mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2026-05-06 09:28:18 +00:00
Tweak layout so that player account info is always in the top right but the 'battleview/friends' container can be hidden
This commit is contained in:
@@ -7,9 +7,9 @@ module W3DHubLauncher
|
|||||||
# root container - background image
|
# root container - background image
|
||||||
stack(width: 1.0, height: 1.0, background_image: safe_get_image("/run/media/cyberarm/Storage/W3DHub/Launcher/package-cache/games/apb/background.png.package"), background_image_mode: :fill) do
|
stack(width: 1.0, height: 1.0, background_image: safe_get_image("/run/media/cyberarm/Storage/W3DHub/Launcher/package-cache/games/apb/background.png.package"), background_image_mode: :fill) do
|
||||||
# root container - background image tint
|
# root container - background image tint
|
||||||
flow(width: 1.0, height: 1.0, background: ALPHA_BLACK) do
|
stack(width: 1.0, height: 1.0, background: ALPHA_BLACK) do
|
||||||
# content container
|
# content container
|
||||||
stack(fill: true, height: 1.0, margin: PADDING, margin_right: LARGE_PADDING) do
|
stack(width: 1.0, fill: true, margin: PADDING) do
|
||||||
# header bar container
|
# header bar container
|
||||||
flow(width: 1.0, height: 80, margin_bottom: PADDING) do |c|
|
flow(width: 1.0, height: 80, margin_bottom: PADDING) do |c|
|
||||||
# logo + menu button
|
# logo + menu button
|
||||||
@@ -36,73 +36,76 @@ module W3DHubLauncher
|
|||||||
end
|
end
|
||||||
stack(fill: true)
|
stack(fill: true)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# page content container
|
# self account container
|
||||||
@page_host = stack(width: 1.0, fill: true) do
|
flow(width: 300, height: 80, margin_left: LARGE_PADDING) do
|
||||||
end
|
# self avatar container
|
||||||
end
|
stack(width: 80, height: 1.0, background_image: rounded_avatar(safe_get_image("#{ROOT_PATH}/media/default.png"))) do
|
||||||
|
# self online state container
|
||||||
# battleview/friends container
|
stack(width: 20, height: 20, v_align: :bottom, h_align: :right, background_image: safe_get_image("#{ROOT_PATH}/media/ui/circle_small.png"), background_image_color: 0xff_26a269)
|
||||||
stack(width: 300, height: 1.0, margin: PADDING, margin_left: 0) do
|
end
|
||||||
# self account container
|
|
||||||
flow(width: 1.0, height: 80) do
|
stack(fill: true, height: 1.0, margin_left: HALF_PADDING) do
|
||||||
# self avatar container
|
flow(fill: true)
|
||||||
stack(width: 80, height: 1.0, background_image: rounded_avatar(safe_get_image("#{ROOT_PATH}/media/default.png"))) do
|
# self name
|
||||||
# self online state container
|
caption "cyberarm", font: FONT_BLACK, text_wrap: :none
|
||||||
stack(width: 20, height: 20, v_align: :bottom, h_align: :right, background_image: safe_get_image("#{ROOT_PATH}/media/ui/circle_small.png"), background_image_color: 0xff_26a269)
|
# self set online state
|
||||||
end
|
link "Online ▼", text_size: 18 do |l|
|
||||||
|
menu(parent: l) do
|
||||||
stack(fill: true, height: 1.0, margin_left: HALF_PADDING) do
|
menu_item("Online")
|
||||||
flow(fill: true)
|
menu_item("Do Not Disturb")
|
||||||
# self name
|
menu_item("Away")
|
||||||
caption "cyberarm", font: FONT_BLACK, text_wrap: :none
|
menu_item("Invisible")
|
||||||
# self set online state
|
menu_item("Sign Out")
|
||||||
link "Online ▼", text_size: 18 do |l|
|
end.show
|
||||||
menu(parent: l) do
|
end
|
||||||
menu_item("Online")
|
flow(fill: true)
|
||||||
menu_item("Do Not Disturb")
|
|
||||||
menu_item("Away")
|
|
||||||
menu_item("Invisible")
|
|
||||||
menu_item("Sign Out")
|
|
||||||
end.show
|
|
||||||
end
|
end
|
||||||
flow(fill: true)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# friend management container
|
# layout container
|
||||||
flow(width: 1.0, height: 60, margin_top: PADDING) do
|
flow(width: 1.0, fill: true) do
|
||||||
flow(width: 1.0, v_align: :center) do
|
# page host container
|
||||||
button safe_get_image("#{ROOT_PATH}/media/icons/singleplayer.png"), image_height: 1.0
|
@page_host = stack(fill: true, height: 1.0) do
|
||||||
button safe_get_image("#{ROOT_PATH}/media/icons/gear.png"), image_height: 1.0, margin_left: HALF_PADDING
|
|
||||||
edit_line "", margin_left: HALF_PADDING, fill: true, height: 1.0
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# friends/clanmates list container
|
# battleview/friends container
|
||||||
stack(width: 1.0, fill: true, margin_top: LARGE_PADDING, scroll: true) do
|
@battleview_container = stack(width: 300, height: 1.0, margin_left: LARGE_PADDING, visible: true) do
|
||||||
50.times do |i|
|
# friend management container
|
||||||
# friend container
|
flow(width: 1.0, height: 60) do
|
||||||
widget(width: 1.0, height: 48, padding_top: HALF_PADDING, padding_bottom: HALF_PADDING, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: 0, hover: { background_nine_slice_color: ALPHA_GRAY }, active: { background_nine_slice_color: ALPHA_BLACK }) do |w|
|
flow(width: 1.0, v_align: :center) do
|
||||||
w.subscribe(:clicked_left_mouse_button) do
|
button safe_get_image("#{ROOT_PATH}/media/icons/singleplayer.png"), image_height: 1.0
|
||||||
puts "HELLO THERE"
|
button safe_get_image("#{ROOT_PATH}/media/icons/gear.png"), image_height: 1.0, margin_left: HALF_PADDING
|
||||||
|
edit_line "", margin_left: HALF_PADDING, fill: true, height: 1.0
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# friends/clanmates list container
|
||||||
|
stack(width: 1.0, fill: true, margin_top: LARGE_PADDING, scroll: true) do
|
||||||
|
50.times do |i|
|
||||||
|
# friend container
|
||||||
|
widget(width: 1.0, height: 48, padding_top: HALF_PADDING, padding_bottom: HALF_PADDING, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: 0, hover: { background_nine_slice_color: ALPHA_GRAY }, active: { background_nine_slice_color: ALPHA_BLACK }) do |w|
|
||||||
|
w.subscribe(:clicked_left_mouse_button) do
|
||||||
|
puts "HELLO THERE"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
# friend avatar container
|
# friend avatar container
|
||||||
stack(width: 48, height: 1.0, margin_left: HALF_PADDING, background_image: rounded_avatar(safe_get_image("#{ROOT_PATH}/media/default.png"))) do
|
stack(width: 48, height: 1.0, margin_left: HALF_PADDING, background_image: rounded_avatar(safe_get_image("#{ROOT_PATH}/media/default.png"))) do
|
||||||
stack(width: 12, height: 12, v_align: :bottom, h_align: :right, background_image: safe_get_image("#{ROOT_PATH}/media/ui/circle_small.png"), background_image_color: 0xff_26a269)
|
stack(width: 12, height: 12, v_align: :bottom, h_align: :right, background_image: safe_get_image("#{ROOT_PATH}/media/ui/circle_small.png"), background_image_color: 0xff_26a269)
|
||||||
end
|
end
|
||||||
# friend name and status container
|
# friend name and status container
|
||||||
stack(fill: true, height: 1.0, margin_left: HALF_PADDING, margin_right: HALF_PADDING) do
|
stack(fill: true, height: 1.0, margin_left: HALF_PADDING, margin_right: HALF_PADDING) do
|
||||||
stack(v_align: :center) do
|
stack(v_align: :center) do
|
||||||
caption ["Silverlight", "PXD2000", "Alstar", "SteelGhost", "FRAYDO"].sample, text_wrap: :none
|
caption ["Silverlight", "PXD2000", "Alstar", "SteelGhost", "FRAYDO"].sample, text_wrap: :none
|
||||||
inscription "RA_Under • 13:52", text_wrap: :none, margin_top: -HALF_PADDING
|
inscription "RA_Under • 13:52", text_wrap: :none, margin_top: -HALF_PADDING
|
||||||
|
end
|
||||||
|
end
|
||||||
|
# friend active application container
|
||||||
|
stack(width: 48, height: 1.0, margin_right: HALF_PADDING, background_image: safe_get_image("#{ROOT_PATH}/media/logo.png"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# friend active application container
|
|
||||||
stack(width: 48, height: 1.0, margin_right: HALF_PADDING, background_image: safe_get_image("#{ROOT_PATH}/media/logo.png"))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -112,6 +115,12 @@ module W3DHubLauncher
|
|||||||
|
|
||||||
page(Page::Games)
|
page(Page::Games)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def button_up(id)
|
||||||
|
super
|
||||||
|
|
||||||
|
@battleview_container.toggle if id == Gosu::KB_F8
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user