mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
UI tweaks
This commit is contained in:
@@ -26,7 +26,9 @@ class W3DHub
|
|||||||
W3DHub::Game.games.each do |game|
|
W3DHub::Game.games.each do |game|
|
||||||
selected = game == @focused_game
|
selected = game == @focused_game
|
||||||
|
|
||||||
game_button = stack(width: 1.0, border_thickness_left: 4, border_color_left: selected ? 0xff_00acff : 0x00_000000, hover: { background: 0xff_444444 }) do
|
game_button = stack(width: 1.0, border_thickness_left: 4,
|
||||||
|
border_color_left: selected ? 0xff_00acff : 0x00_000000, hover: { background: 0xff_444444 },
|
||||||
|
padding_top: 4, padding_bottom: 4) do
|
||||||
background game.background_color if selected
|
background game.background_color if selected
|
||||||
|
|
||||||
flow(width: 1.0, height: 48) do
|
flow(width: 1.0, height: 48) do
|
||||||
@@ -134,7 +136,7 @@ class W3DHub
|
|||||||
flow(width: 0.5, height: 128, margin: 4) do
|
flow(width: 0.5, height: 128, margin: 4) do
|
||||||
# background 0x88_000000
|
# background 0x88_000000
|
||||||
|
|
||||||
image game.icon, width: 0.4
|
image game.icon, width: 0.4, padding: 4
|
||||||
|
|
||||||
stack(width: 0.6, height: 1.0) do
|
stack(width: 0.6, height: 1.0) do
|
||||||
stack(width: 1.0, height: 112) do
|
stack(width: 1.0, height: 112) do
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ class W3DHub
|
|||||||
# Todo lock whole UI until response or timeout
|
# Todo lock whole UI until response or timeout
|
||||||
|
|
||||||
# Do network stuff
|
# Do network stuff
|
||||||
|
|
||||||
|
Thread.new do
|
||||||
|
sleep 0.2
|
||||||
|
|
||||||
|
main_thread_queue << proc { populate_account_info; page(W3DHub::Pages::Games) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -42,5 +47,36 @@ class W3DHub
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def populate_account_info
|
||||||
|
@host.instance_variable_get(:"@account_container").clear do
|
||||||
|
stack(width: 0.7, height: 1.0) do
|
||||||
|
# background 0xff_222222
|
||||||
|
tagline "<b>#{@username.value}</b>"
|
||||||
|
|
||||||
|
flow(width: 1.0) do
|
||||||
|
link("Logout", text_size: 16) { depopulate_account_info }
|
||||||
|
link "Profile", text_size: 16
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
image "#{GAME_ROOT_PATH}/media/ui_icons/singleplayer.png", height: 1.0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def depopulate_account_info
|
||||||
|
@host.instance_variable_get(:"@account_container").clear do
|
||||||
|
stack(width: 0.7, height: 1.0) do
|
||||||
|
# background 0xff_222222
|
||||||
|
tagline "<b>Not Logged In</b>", text_wrap: :none
|
||||||
|
|
||||||
|
flow(width: 1.0) do
|
||||||
|
link("Log in", text_size: 16) { page(W3DHub::Pages::Login) }
|
||||||
|
link "Register", text_size: 16
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class W3DHub
|
|||||||
text_shadow: false,
|
text_shadow: false,
|
||||||
},
|
},
|
||||||
TextBlock: {
|
TextBlock: {
|
||||||
|
# font: "Inconsolata",
|
||||||
text_border: false,
|
text_border: false,
|
||||||
text_shadow: true,
|
text_shadow: true,
|
||||||
text_shadow_size: 1,
|
text_shadow_size: 1,
|
||||||
@@ -68,7 +69,7 @@ class W3DHub
|
|||||||
@app_info_container = flow(width: 1.0, height: 0.65) do
|
@app_info_container = flow(width: 1.0, height: 0.65) do
|
||||||
# background 0xff_8855ff
|
# background 0xff_8855ff
|
||||||
|
|
||||||
stack(width: 0.75, height: 1.0) do
|
stack(width: 0.6749, height: 1.0) do
|
||||||
title "<b>W3D Hub Launcher</b>", height: 0.5
|
title "<b>W3D Hub Launcher</b>", height: 0.5
|
||||||
flow(width: 1.0, height: 0.5) do
|
flow(width: 1.0, height: 0.5) do
|
||||||
button(
|
button(
|
||||||
@@ -102,19 +103,48 @@ class W3DHub
|
|||||||
end
|
end
|
||||||
|
|
||||||
@account_container = flow(width: 0.25, height: 1.0) do
|
@account_container = flow(width: 0.25, height: 1.0) do
|
||||||
# background 0xff_22ff00
|
|
||||||
|
|
||||||
stack(width: 0.7, height: 1.0) do
|
stack(width: 0.7, height: 1.0) do
|
||||||
# background 0xff_222222
|
# background 0xff_222222
|
||||||
tagline "<b>Cyberarm</b>"
|
tagline "<b>Not Logged In</b>", text_wrap: :none
|
||||||
|
|
||||||
flow(width: 1.0) do
|
flow(width: 1.0) do
|
||||||
link("Logout", text_size: 14) { page(W3DHub::Pages::Login) }
|
link("Log in", text_size: 16) { page(W3DHub::Pages::Login) }
|
||||||
link "Profile", text_size: 14
|
link "Register", text_size: 16
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
image BLACK_IMAGE, height: 1.0
|
flow(width: 0.075, height: 1.0) do
|
||||||
|
button(
|
||||||
|
get_image("#{GAME_ROOT_PATH}/media/ui_icons/minus.png"),
|
||||||
|
image_width: 16,
|
||||||
|
padding_left: 4,
|
||||||
|
padding_top: 4,
|
||||||
|
padding_right: 4,
|
||||||
|
padding_bottom: 4,
|
||||||
|
margin_left: 4
|
||||||
|
) do
|
||||||
|
# window.minimize
|
||||||
|
end
|
||||||
|
|
||||||
|
button(
|
||||||
|
get_image("#{GAME_ROOT_PATH}/media/ui_icons/cross.png"),
|
||||||
|
image_width: 16,
|
||||||
|
padding_left: 4,
|
||||||
|
padding_top: 4,
|
||||||
|
padding_right: 4,
|
||||||
|
padding_bottom: 4,
|
||||||
|
margin_left: 4,
|
||||||
|
background: 0xff_800000,
|
||||||
|
hover: {
|
||||||
|
background: 0xff_a00000
|
||||||
|
},
|
||||||
|
active: {
|
||||||
|
background: 0xff_600000
|
||||||
|
}
|
||||||
|
) do
|
||||||
|
window.close
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,11 @@ class W3DHub
|
|||||||
|
|
||||||
push_state(W3DHub::States::Boot)
|
push_state(W3DHub::States::Boot)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def button_down(id)
|
||||||
|
super
|
||||||
|
|
||||||
|
self.borderless = !self.borderless? if id == Gosu::KB_F7
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
BIN
media/ui_icons/cross.png
Normal file
BIN
media/ui_icons/cross.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
media/ui_icons/minus.png
Normal file
BIN
media/ui_icons/minus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Reference in New Issue
Block a user