mirror of
https://github.com/cyberarm/i-mic-rts.git
synced 2025-12-16 00:02:33 +00:00
Tweaked ui a bit, updated Credits, stubbed load menu, fixed crash when stopping helicopter, Stop order is now only emitted if player has entities selected.
This commit is contained in:
@@ -34,7 +34,7 @@ class IMICRTS
|
||||
|
||||
@debug_info = CyberarmEngine::Text.new("", y: 10, z: Float::INFINITY, shadow_color: Gosu::Color.rgba(0, 0, 0, 200))
|
||||
|
||||
@sidebar = stack(width: 350, height: 1.0) do
|
||||
@sidebar = stack(width: IMICRTS::MENU_WIDTH, height: 1.0, padding: IMICRTS::MENU_PADDING) do
|
||||
background [0x55555555, 0x55666666]
|
||||
|
||||
label "SIDEBAR", text_size: 78, margin_bottom: 20
|
||||
|
||||
@@ -3,14 +3,29 @@ class IMICRTS
|
||||
def setup
|
||||
background [0xff7b6ead, 0xff7a0d71, 0xff7a0d71, 0xff7b6ead]
|
||||
|
||||
stack(width: 600, height: 1.0) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
flow(width: 1.0, height: 1.0) do
|
||||
stack(width: IMICRTS::MENU_WIDTH, height: 1.0, padding: IMICRTS::MENU_PADDING) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
|
||||
label "About I-MIC-RTS", text_size: 78, margin: 20
|
||||
label "Words go here. More words also go here. Thank you and have a nice day.", text_wrap: :word_wrap
|
||||
label "Credits", text_size: 78, margin: 20
|
||||
|
||||
button("Back", width: 1.0, margin_top: 20) do
|
||||
push_state(MainMenu)
|
||||
licenses = Gosu::LICENSES.lines
|
||||
preamble = licenses.shift
|
||||
licenses.shift # remove blank line
|
||||
|
||||
label preamble, text_wrap: :word_wrap
|
||||
|
||||
licenses.each do |l|
|
||||
name, website, license, license_website = l.strip.split(",")
|
||||
flow(width: 1.0) do
|
||||
label name.strip, width: 0.49
|
||||
label license.strip, width: 0.49
|
||||
end
|
||||
end
|
||||
|
||||
button("Back", width: 1.0, margin_top: 20) do
|
||||
push_state(MainMenu)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
32
lib/states/menus/load_menu.rb
Normal file
32
lib/states/menus/load_menu.rb
Normal file
@@ -0,0 +1,32 @@
|
||||
class IMICRTS
|
||||
class LoadMenu < CyberarmEngine::GuiState
|
||||
def setup
|
||||
self.show_cursor = true
|
||||
|
||||
background [0xff7b6ead, 0xff7a0d71, 0xff7a0d71, 0xff7b6ead]
|
||||
|
||||
stack(width: IMICRTS::MENU_WIDTH, height: 1.0, padding: IMICRTS::MENU_PADDING) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
label "Load", text_size: 78, margin: 20
|
||||
|
||||
label "Replays"
|
||||
stack(width: 1.0, height: 0.30) do
|
||||
["2020-01-31_16-31-45.replay"].each do |item|
|
||||
button item, width: 1.0
|
||||
end
|
||||
end
|
||||
|
||||
label "Saves"
|
||||
stack(width: 1.0, height: 0.30) do
|
||||
["2020-01-31_16-31-45.save"].each do |item|
|
||||
button item, width: 1.0
|
||||
end
|
||||
end
|
||||
|
||||
button("Back", width: 1.0, margin_top: 20) do
|
||||
pop_state
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -5,10 +5,11 @@ class IMICRTS
|
||||
|
||||
background [0xff7b6ead, 0xff7a0d71, 0xff7a0d71, 0xff7b6ead]
|
||||
|
||||
stack(width: 350, height: 1.0) do
|
||||
stack(width: IMICRTS::MENU_WIDTH, height: 1.0, padding: IMICRTS::MENU_PADDING) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
label "I-MIC-RTS", text_size: 78, margin: 20
|
||||
button("Campaign", width: 1.0) do
|
||||
label IMICRTS::NAME, text_size: 78, margin: 20
|
||||
button("Campaign", width: 1.0, enabled: false) do
|
||||
push_state(CampaignMenu)
|
||||
end
|
||||
|
||||
button("Skirmish", width: 1.0) do
|
||||
@@ -20,7 +21,11 @@ class IMICRTS
|
||||
push_state(MultiplayerMenu)
|
||||
end
|
||||
|
||||
button("Settings", width: 1.0, margin_top: 20) do
|
||||
button("Load", width: 1.0, margin_top: 20) do
|
||||
push_state(LoadMenu)
|
||||
end
|
||||
|
||||
button("Settings", width: 1.0) do
|
||||
push_state(SettingsMenu)
|
||||
end
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ class IMICRTS
|
||||
def setup
|
||||
background [0xff7b6ead, 0xff7a0d71, 0xff7a0d71, 0xff7b6ead]
|
||||
|
||||
stack(height: 1.0) do
|
||||
stack(width: IMICRTS::MENU_WIDTH, height: 1.0, padding: IMICRTS::MENU_PADDING) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
|
||||
label "Multiplayer", text_size: 78, margin: 20
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
class IMICRTS
|
||||
class PauseMenu < CyberarmEngine::GuiState
|
||||
def setup
|
||||
stack(width: 350) do
|
||||
stack(width: IMICRTS::MENU_WIDTH, height: 1.0, padding: IMICRTS::MENU_PADDING) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
label "Paused", text_size: 78, margin: 20
|
||||
|
||||
button "Resume", width: 1.0 do
|
||||
pop_state
|
||||
end
|
||||
|
||||
button "Settings", width: 1.0 do
|
||||
push_state(SettingsMenu)
|
||||
end
|
||||
button "Quit", width: 1.0 do
|
||||
|
||||
button "Quit", width: 1.0, margin_top: 20 do
|
||||
# TODO: Confirm
|
||||
|
||||
previous_state.director.finalize
|
||||
@@ -25,7 +30,7 @@ class IMICRTS
|
||||
def draw
|
||||
previous_state&.draw
|
||||
|
||||
# Gosu.flush
|
||||
Gosu.flush
|
||||
|
||||
super
|
||||
end
|
||||
|
||||
@@ -3,22 +3,18 @@ class IMICRTS
|
||||
def setup
|
||||
background [0xff7b6ead, 0xff7a0d71, 0xff7a0d71, 0xff7b6ead]
|
||||
|
||||
stack(width: 350, height: 1.0) do
|
||||
stack(width: IMICRTS::MENU_WIDTH, height: 1.0, padding: IMICRTS::MENU_PADDING) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
|
||||
label "Settings", text_size: 78, margin: 20
|
||||
|
||||
@skip_intro = check_box "Skip Intro", checked: Setting.enabled?(:skip_intro)
|
||||
|
||||
stack(width: 1.0) do
|
||||
background 0xff030303
|
||||
|
||||
label "Debug Settings"
|
||||
@debug_mode = check_box "Debug Mode", checked: Setting.enabled?(:debug_mode)
|
||||
@debug_info_bar = check_box "Show Debug Info Bar", checked: Setting.enabled?(:debug_info_bar)
|
||||
@debug_pathfinding = check_box "Debug Pathfinding", checked: Setting.enabled?(:debug_pathfinding)
|
||||
@debug_pathfinding_allow_diagonal = check_box "Allow Diagonal Paths", checked: Setting.enabled?(:debug_pathfinding_allow_diagonal)
|
||||
end
|
||||
label "Debug Settings", background: 0xff030303, width: 1.0, margin_top: 20
|
||||
@debug_mode = check_box "Debug Mode", checked: Setting.enabled?(:debug_mode)
|
||||
@debug_info_bar = check_box "Show Debug Info Bar", checked: Setting.enabled?(:debug_info_bar)
|
||||
@debug_pathfinding = check_box "Debug Pathfinding", checked: Setting.enabled?(:debug_pathfinding)
|
||||
@debug_pathfinding_allow_diagonal = check_box "Allow Diagonal Paths", checked: Setting.enabled?(:debug_pathfinding_allow_diagonal)
|
||||
|
||||
button("Save and Close", width: 1.0, margin_top: 20) do
|
||||
if valid_options?
|
||||
|
||||
@@ -3,7 +3,7 @@ class IMICRTS
|
||||
def setup
|
||||
background [0xff7b6ead, 0xff7a0d71, 0xff7a0d71, 0xff7b6ead]
|
||||
|
||||
stack(width: 0.5, min_width: 720, height: 1.0) do
|
||||
stack(width: 0.5, min_width: 720, height: 1.0, padding: IMICRTS::MENU_PADDING) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
|
||||
label "Lobby", text_size: 78, margin: 20
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
class IMICRTS
|
||||
class SoloPlayMenu < CyberarmEngine::GuiState
|
||||
def setup
|
||||
background [0xff7b6ead, 0xff7a0d71, 0xff7a0d71, 0xff7b6ead]
|
||||
|
||||
stack(height: 1.0) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
|
||||
label "Solo Play", text_size: 78, margin: 20
|
||||
label "Words go here.\nMore words also go here. Thank you and have a nice day."
|
||||
|
||||
button("Campaign", width: 1.0) do
|
||||
end
|
||||
|
||||
button("Skirmish", width: 1.0) do
|
||||
push_state(SoloLobbyMenu)
|
||||
end
|
||||
|
||||
button("Back", width: 1.0, margin_top: 20) do
|
||||
push_state(MainMenu)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user