ui improvements to games list icons and login page

This commit is contained in:
2021-11-11 09:49:51 -06:00
parent e0dec01e75
commit e8e2cd302c
2 changed files with 34 additions and 16 deletions

View File

@@ -29,8 +29,11 @@ class W3DHub
game_button = stack(width: 1.0, border_thickness_left: 4, border_color_left: selected ? 0xff_00acff : 0x00_000000, hover: { background: 0xff_444444 }) do
background game.background_color if selected
image game.icon, height: 48
inscription game.name
flow(width: 1.0, height: 48) do
stack(width: 0.3)
image game.icon, height: 48
end
inscription game.name, width: 1.0, text_align: :center
end
def game_button.hit_element?(x, y)
@@ -106,7 +109,6 @@ class W3DHub
end
end
# FIXME: Do actual gui update on main thread
def fetch_game_news(game)
feed_uri = Excon.get(
game.news_feed,

View File

@@ -3,24 +3,40 @@ class W3DHub
class Login < Page
def setup
body.clear do
stack(width: 1.0, height: 1.0, padding: 32) do
flow(width: 1.0, height: 1.0, padding: 32) do
background 0xff_252535
para "Login using your W3D Hub forum account"
stack(width: 0.28)
flow(width: 1.0) do
tagline "Username", width: 0.25, text_align: :right, focus: true
edit_line ""
end
stack(width: 0.48) do
flow(width: 1.0) do
stack(width: 0.4)
image "#{GAME_ROOT_PATH}/media/icons/w3dhub.png", width: 0.20
end
para "Login using your W3D Hub forum account", width: 1.0, text_align: :center
flow(width: 1.0) do
tagline "Password", width: 0.25, text_align: :right
edit_line "", type: :password
end
flow(width: 1.0) do
tagline "Username", width: 0.25, text_align: :right
@username = edit_line "", width: 0.75, focus: true
end
flow(width: 1.0) do
tagline "", width: 0.25
button "Log In"
flow(width: 1.0) do
tagline "Password", width: 0.25, text_align: :right
@password = edit_line "", width: 0.75, type: :password
end
flow(width: 1.0) do
tagline "", width: 0.25
button "Log In" do |btn|
@username.enabled = false
@password.enabled = false
btn.enabled = false
# Todo lock whole UI until response or timeout
# Do network stuff
end
end
end
end
end