mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
Moved theme into its own file, added message dialog state to show error messages, game install button is disabled when clicked and if there is an installer task pending or running
This commit is contained in:
@@ -2,6 +2,8 @@ class W3DHub
|
||||
class States
|
||||
class Boot < CyberarmEngine::GuiState
|
||||
def setup
|
||||
theme(W3DHub::THEME)
|
||||
|
||||
background 0xff_252525
|
||||
|
||||
@fraction = 0.0
|
||||
@@ -18,7 +20,7 @@ class W3DHub
|
||||
stack(width: 1.0, height: 0.925) do
|
||||
end
|
||||
|
||||
@progressbar = progress height: 0.025, width: 1.0, fraction_background: 0xff_00acff, border_thickness: 0
|
||||
@progressbar = progress height: 0.025, width: 1.0
|
||||
|
||||
flow(width: 1.0, height: 0.05, padding_left: 16, padding_right: 16, padding_bottom: 8, padding_top: 8) do
|
||||
@status_label = caption "Starting #{NAME}...", width: 0.5
|
||||
|
||||
@@ -15,62 +15,7 @@ class W3DHub
|
||||
|
||||
@main_thread_queue = []
|
||||
|
||||
theme({
|
||||
ToolTip: {
|
||||
background: 0xff_dedede,
|
||||
color: 0xaa_000000,
|
||||
text_size: 18,
|
||||
text_border: false,
|
||||
text_shadow: false,
|
||||
},
|
||||
TextBlock: {
|
||||
# font: "Inconsolata",
|
||||
text_border: false,
|
||||
text_shadow: true,
|
||||
text_shadow_size: 1,
|
||||
text_shadow_color: 0x88_000000,
|
||||
},
|
||||
EditLine: {
|
||||
border_thickness: 2,
|
||||
border_color: Gosu::Color::WHITE,
|
||||
hover: { color: Gosu::Color::WHITE }
|
||||
},
|
||||
Link: {
|
||||
color: 0xff_cdcdcd,
|
||||
hover: {
|
||||
color: Gosu::Color::WHITE
|
||||
},
|
||||
active: {
|
||||
color: 0xff_eeeeee
|
||||
}
|
||||
},
|
||||
Button: {
|
||||
text_size: 18,
|
||||
padding_top: 8,
|
||||
padding_left: 32,
|
||||
padding_right: 32,
|
||||
padding_bottom: 8,
|
||||
border_color: Gosu::Color::NONE,
|
||||
background: 0xff_00acff,
|
||||
hover: {
|
||||
background: 0xff_bee6fd
|
||||
},
|
||||
active: {
|
||||
background: 0xff_add5ec
|
||||
}
|
||||
},
|
||||
ToggleButton: {
|
||||
padding_left: 8,
|
||||
padding_right: 8,
|
||||
width: 18,
|
||||
image_width: 18,
|
||||
checkmark_image: "#{GAME_ROOT_PATH}/media/ui_icons/checkmark.png"
|
||||
},
|
||||
Progress: {
|
||||
fraction_background: 0xff_00acff,
|
||||
border_thickness: 0
|
||||
}
|
||||
})
|
||||
theme(W3DHub::THEME)
|
||||
|
||||
stack(width: 1.0, height: 1.0, border_thickness: 1, border_color: 0xff_aaaaaa) do
|
||||
background 0xff_252525
|
||||
@@ -227,6 +172,10 @@ class W3DHub
|
||||
@page.focus
|
||||
end
|
||||
|
||||
def update_application_manager_status
|
||||
@page.update_application_manager_status
|
||||
end
|
||||
|
||||
def show_application_taskbar
|
||||
@application_taskbar_container.show
|
||||
end
|
||||
|
||||
35
lib/states/message_dialog.rb
Normal file
35
lib/states/message_dialog.rb
Normal file
@@ -0,0 +1,35 @@
|
||||
class W3DHub
|
||||
class States
|
||||
class MessageDialog < CyberarmEngine::GuiState
|
||||
def setup
|
||||
window.show_cursor = true
|
||||
|
||||
theme(W3DHub::THEME)
|
||||
|
||||
background 0xee_444444
|
||||
|
||||
stack(width: 1.0, height: 1.0, margin: 128, padding: 8, background: 0xee_222222) do
|
||||
flow(width: 1.0, height: 0.06) do
|
||||
image "#{GAME_ROOT_PATH}/media/ui_icons/warning.png", width: 0.04, align: :center, color: 0xff_ff8800
|
||||
|
||||
tagline "<b>#{@options[:title]}</b>", width: 0.9, text_align: :center
|
||||
end
|
||||
|
||||
para @options[:message], width: 1.0, height: 0.7, padding: 8
|
||||
|
||||
button "Okay", width: 1.0, margin_top: 64 do
|
||||
pop_state
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def draw
|
||||
previous_state&.draw
|
||||
|
||||
Gosu.flush
|
||||
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user