diff --git a/Gemfile.lock b/Gemfile.lock index 00a91c3..dd85ef1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ GIT remote: https://github.com/cyberarm/cyberarm_engine - revision: 20970e5aa9fbcad6d4bf7d9b56cbd06ba5c53275 + revision: 1b080f9fb99cc4ec696f32f00f28cbf89b40ed04 specs: - cyberarm_engine (0.17.1) + cyberarm_engine (0.18.0) clipboard (~> 1.3.5) excon (~> 0.78.0) gosu (~> 1.1) @@ -25,18 +25,18 @@ GEM concurrent-ruby (1.1.8) cri (2.1.0) excon (0.78.1) - gosu (1.1.0) + gosu (1.2.0) gosu_more_drawables (0.3.1) - i18n (1.8.8) + i18n (1.8.10) concurrent-ruby (~> 1.0) - mini_portile2 (2.5.1) - nokogiri (1.11.4) + mini_portile2 (2.5.3) + nokogiri (1.11.6) mini_portile2 (~> 2.5.0) racc (~> 1.4) - nokogiri (1.11.4-x64-mingw32) + nokogiri (1.11.6-x64-mingw32) racc (~> 1.4) ocra (1.3.11) - opengl-bindings (1.6.10) + opengl-bindings (1.6.11) racc (1.5.2) rake (13.0.3) rubyzip (2.3.0) diff --git a/lib/states/game_states/boot.rb b/lib/states/game_states/boot.rb index 7e35314..0cdfa34 100644 --- a/lib/states/game_states/boot.rb +++ b/lib/states/game_states/boot.rb @@ -88,11 +88,7 @@ class IMICFPS def button_down(id) super - if (id == Gosu::KbEscape) || - ((id >= Gosu::GP_LEFT) && (id >= Gosu::GP_BUTTON_15)) || - (id == Gosu::MsLeft) - push_state(MainMenu) - end + push_state(MainMenu) end end end diff --git a/lib/trees/aabb_tree.rb b/lib/trees/aabb_tree.rb index 0a753b4..b4f21a3 100644 --- a/lib/trees/aabb_tree.rb +++ b/lib/trees/aabb_tree.rb @@ -25,11 +25,7 @@ class IMICFPS end def insert_leaf(leaf) - @root = if @root - @root.insert_subtree(leaf) - else - leaf - end + @root = @root ? @root.insert_subtree(leaf) : leaf end def update(object, bounding_box) diff --git a/lib/ui/menu.rb b/lib/ui/menu.rb index 756b6ee..20e5e60 100644 --- a/lib/ui/menu.rb +++ b/lib/ui/menu.rb @@ -66,7 +66,10 @@ class IMICFPS }, active: { color: Gosu::Color.rgb(64, 128, 255), - } + }, + disabled: { + color: Gosu::Color.rgb(175, 175, 175), + }, }, Button: { diff --git a/lib/ui/menus/extras_menu.rb b/lib/ui/menus/extras_menu.rb index 6697cc5..074d667 100644 --- a/lib/ui/menus/extras_menu.rb +++ b/lib/ui/menus/extras_menu.rb @@ -13,7 +13,7 @@ class IMICFPS push_state(IMICFPS::MapEditorTool::MainMenu) end - link I18n.t("menus.back") do + link I18n.t("menus.back"), margin_top: 25 do pop_state end end diff --git a/lib/ui/menus/game_pause_menu.rb b/lib/ui/menus/game_pause_menu.rb index ac1748b..fa31185 100644 --- a/lib/ui/menus/game_pause_menu.rb +++ b/lib/ui/menus/game_pause_menu.rb @@ -14,7 +14,7 @@ class IMICFPS push_state(SettingsMenu) end - link I18n.t("menus.leave") do + link I18n.t("menus.leave"), margin_top: 25 do push_state(MainMenu) end end diff --git a/lib/ui/menus/level_select_menu.rb b/lib/ui/menus/level_select_menu.rb index 61f816f..d3456fc 100644 --- a/lib/ui/menus/level_select_menu.rb +++ b/lib/ui/menus/level_select_menu.rb @@ -16,7 +16,7 @@ class IMICFPS end end - link I18n.t("menus.back") do + link I18n.t("menus.back"), margin_top: 25 do pop_state end end diff --git a/lib/ui/menus/main_menu.rb b/lib/ui/menus/main_menu.rb index 7690670..9d5f02a 100644 --- a/lib/ui/menus/main_menu.rb +++ b/lib/ui/menus/main_menu.rb @@ -6,7 +6,7 @@ class IMICFPS title IMICFPS::NAME link I18n.t("menus.singleplayer") do - push_state(LevelSelectMenu) + push_state(SinglePlayerMenu) end link I18n.t("menus.multiplayer") do @@ -21,7 +21,7 @@ class IMICFPS push_state(ExtrasMenu) end - link I18n.t("menus.quit") do + link I18n.t("menus.quit"), margin_top: 25 do window.close end diff --git a/lib/ui/menus/multiplayer_menu.rb b/lib/ui/menus/multiplayer_menu.rb index 51400c2..43145a9 100644 --- a/lib/ui/menus/multiplayer_menu.rb +++ b/lib/ui/menus/multiplayer_menu.rb @@ -12,7 +12,7 @@ class IMICFPS link "Profile" do push_state(MultiplayerProfileMenu) end - link I18n.t("menus.back") do + link I18n.t("menus.back"), margin_top: 25 do pop_state end end diff --git a/lib/ui/menus/multiplayer_profile_menu.rb b/lib/ui/menus/multiplayer_profile_menu.rb index 52e0563..2848608 100644 --- a/lib/ui/menus/multiplayer_profile_menu.rb +++ b/lib/ui/menus/multiplayer_profile_menu.rb @@ -11,12 +11,12 @@ class IMICFPS title "Profile" flow width: 1.0 do - link I18n.t("menus.back"), width: 0.32 do + link I18n.t("menus.back"), width: 0.333 do pop_state end - button "Edit Profile", width: 0.32 - button "Log Out", width: 0.32 + button "Edit Profile", width: 0.333 + button "Log Out", width: 0.333 end flow(width: 1.0, padding: 4) do @@ -42,7 +42,7 @@ class IMICFPS end stack margin_left: 16 do - label "0.72" + label "0.75" label "21" label "28" label "14" diff --git a/lib/ui/menus/multiplayer_server_browser_menu.rb b/lib/ui/menus/multiplayer_server_browser_menu.rb index 57d00ef..83a757a 100644 --- a/lib/ui/menus/multiplayer_server_browser_menu.rb +++ b/lib/ui/menus/multiplayer_server_browser_menu.rb @@ -39,12 +39,12 @@ class IMICFPS title "Server Browser" flow(width: 1.0) do - link I18n.t("menus.back"), width: 0.32 do + link I18n.t("menus.back"), width: 0.333 do pop_state end - button "Host Game", width: 0.32 - button "Direct Connect", width: 0.32 + button "Host Game", width: 0.333 + button "Direct Connect", width: 0.333 end end @@ -55,22 +55,22 @@ class IMICFPS background i.even? ? 0x55000000 : 0x55ff5500 flow width: 0.1 do - label game[:game_type], text_size: text_size + label game[:game_type], text_size: text_size, text_wrap: :none, font: i.zero? ? BOLD_SANS_FONT : SANS_FONT end flow width: 0.3 do - label game[:host], text_size: text_size + label game[:host], text_size: text_size, text_wrap: :none, font: i.zero? ? BOLD_SANS_FONT : SANS_FONT end flow width: 0.3 do - label game[:map], text_size: text_size + label game[:map], text_size: text_size, text_wrap: :none, font: i.zero? ? BOLD_SANS_FONT : SANS_FONT end flow width: 0.1 do - label game[:players], text_size: text_size + label game[:players], text_size: text_size, text_wrap: :none, font: i.zero? ? BOLD_SANS_FONT : SANS_FONT end flow width: 0.1 do - label game[:ping], text_size: text_size + label game[:ping], text_size: text_size, text_wrap: :none, font: i.zero? ? BOLD_SANS_FONT : SANS_FONT end flow width: 0.1 do - label game[:source], text_size: text_size + label game[:source], text_size: text_size, text_wrap: :none, font: i.zero? ? BOLD_SANS_FONT : SANS_FONT end end end diff --git a/lib/ui/menus/settings_menu.rb b/lib/ui/menus/settings_menu.rb index 96c4452..8502cc8 100644 --- a/lib/ui/menus/settings_menu.rb +++ b/lib/ui/menus/settings_menu.rb @@ -94,7 +94,7 @@ class IMICFPS end end - check_box "Fullscreen", padding_top: 25, padding_bottom: 25 + check_box "Fullscreen", margin_top: 25, margin_bottom: 25 stack do longest_string = "Gamma Correction" diff --git a/lib/ui/menus/single_player_menu.rb b/lib/ui/menus/single_player_menu.rb new file mode 100644 index 0000000..a631002 --- /dev/null +++ b/lib/ui/menus/single_player_menu.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class IMICFPS + class SinglePlayerMenu < Menu + def setup + title I18n.t("menus.singleplayer") + + link "Tutorial", enabled: false, tip: "No tutorial implemented, yet..." + + link "Campaign", enabled: false, tip: "No campaign, yet..." + + link "Multiplayer Practice" do + push_state(LevelSelectMenu) + end + + link I18n.t("menus.back"), margin_top: 25 do + pop_state + end + end + end +end