mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
Tweak menus a bit, add proper single player menu, made back link have some margin from above links
This commit is contained in:
16
Gemfile.lock
16
Gemfile.lock
@@ -1,8 +1,8 @@
|
|||||||
GIT
|
GIT
|
||||||
remote: https://github.com/cyberarm/cyberarm_engine
|
remote: https://github.com/cyberarm/cyberarm_engine
|
||||||
revision: 20970e5aa9fbcad6d4bf7d9b56cbd06ba5c53275
|
revision: 1b080f9fb99cc4ec696f32f00f28cbf89b40ed04
|
||||||
specs:
|
specs:
|
||||||
cyberarm_engine (0.17.1)
|
cyberarm_engine (0.18.0)
|
||||||
clipboard (~> 1.3.5)
|
clipboard (~> 1.3.5)
|
||||||
excon (~> 0.78.0)
|
excon (~> 0.78.0)
|
||||||
gosu (~> 1.1)
|
gosu (~> 1.1)
|
||||||
@@ -25,18 +25,18 @@ GEM
|
|||||||
concurrent-ruby (1.1.8)
|
concurrent-ruby (1.1.8)
|
||||||
cri (2.1.0)
|
cri (2.1.0)
|
||||||
excon (0.78.1)
|
excon (0.78.1)
|
||||||
gosu (1.1.0)
|
gosu (1.2.0)
|
||||||
gosu_more_drawables (0.3.1)
|
gosu_more_drawables (0.3.1)
|
||||||
i18n (1.8.8)
|
i18n (1.8.10)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
mini_portile2 (2.5.1)
|
mini_portile2 (2.5.3)
|
||||||
nokogiri (1.11.4)
|
nokogiri (1.11.6)
|
||||||
mini_portile2 (~> 2.5.0)
|
mini_portile2 (~> 2.5.0)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.11.4-x64-mingw32)
|
nokogiri (1.11.6-x64-mingw32)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
ocra (1.3.11)
|
ocra (1.3.11)
|
||||||
opengl-bindings (1.6.10)
|
opengl-bindings (1.6.11)
|
||||||
racc (1.5.2)
|
racc (1.5.2)
|
||||||
rake (13.0.3)
|
rake (13.0.3)
|
||||||
rubyzip (2.3.0)
|
rubyzip (2.3.0)
|
||||||
|
|||||||
@@ -88,11 +88,7 @@ class IMICFPS
|
|||||||
def button_down(id)
|
def button_down(id)
|
||||||
super
|
super
|
||||||
|
|
||||||
if (id == Gosu::KbEscape) ||
|
push_state(MainMenu)
|
||||||
((id >= Gosu::GP_LEFT) && (id >= Gosu::GP_BUTTON_15)) ||
|
|
||||||
(id == Gosu::MsLeft)
|
|
||||||
push_state(MainMenu)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -25,11 +25,7 @@ class IMICFPS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def insert_leaf(leaf)
|
def insert_leaf(leaf)
|
||||||
@root = if @root
|
@root = @root ? @root.insert_subtree(leaf) : leaf
|
||||||
@root.insert_subtree(leaf)
|
|
||||||
else
|
|
||||||
leaf
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def update(object, bounding_box)
|
def update(object, bounding_box)
|
||||||
|
|||||||
@@ -66,7 +66,10 @@ class IMICFPS
|
|||||||
},
|
},
|
||||||
active: {
|
active: {
|
||||||
color: Gosu::Color.rgb(64, 128, 255),
|
color: Gosu::Color.rgb(64, 128, 255),
|
||||||
}
|
},
|
||||||
|
disabled: {
|
||||||
|
color: Gosu::Color.rgb(175, 175, 175),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Button:
|
Button:
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class IMICFPS
|
|||||||
push_state(IMICFPS::MapEditorTool::MainMenu)
|
push_state(IMICFPS::MapEditorTool::MainMenu)
|
||||||
end
|
end
|
||||||
|
|
||||||
link I18n.t("menus.back") do
|
link I18n.t("menus.back"), margin_top: 25 do
|
||||||
pop_state
|
pop_state
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class IMICFPS
|
|||||||
push_state(SettingsMenu)
|
push_state(SettingsMenu)
|
||||||
end
|
end
|
||||||
|
|
||||||
link I18n.t("menus.leave") do
|
link I18n.t("menus.leave"), margin_top: 25 do
|
||||||
push_state(MainMenu)
|
push_state(MainMenu)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class IMICFPS
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
link I18n.t("menus.back") do
|
link I18n.t("menus.back"), margin_top: 25 do
|
||||||
pop_state
|
pop_state
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class IMICFPS
|
|||||||
title IMICFPS::NAME
|
title IMICFPS::NAME
|
||||||
|
|
||||||
link I18n.t("menus.singleplayer") do
|
link I18n.t("menus.singleplayer") do
|
||||||
push_state(LevelSelectMenu)
|
push_state(SinglePlayerMenu)
|
||||||
end
|
end
|
||||||
|
|
||||||
link I18n.t("menus.multiplayer") do
|
link I18n.t("menus.multiplayer") do
|
||||||
@@ -21,7 +21,7 @@ class IMICFPS
|
|||||||
push_state(ExtrasMenu)
|
push_state(ExtrasMenu)
|
||||||
end
|
end
|
||||||
|
|
||||||
link I18n.t("menus.quit") do
|
link I18n.t("menus.quit"), margin_top: 25 do
|
||||||
window.close
|
window.close
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class IMICFPS
|
|||||||
link "Profile" do
|
link "Profile" do
|
||||||
push_state(MultiplayerProfileMenu)
|
push_state(MultiplayerProfileMenu)
|
||||||
end
|
end
|
||||||
link I18n.t("menus.back") do
|
link I18n.t("menus.back"), margin_top: 25 do
|
||||||
pop_state
|
pop_state
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ class IMICFPS
|
|||||||
title "Profile"
|
title "Profile"
|
||||||
|
|
||||||
flow width: 1.0 do
|
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
|
pop_state
|
||||||
end
|
end
|
||||||
|
|
||||||
button "Edit Profile", width: 0.32
|
button "Edit Profile", width: 0.333
|
||||||
button "Log Out", width: 0.32
|
button "Log Out", width: 0.333
|
||||||
end
|
end
|
||||||
|
|
||||||
flow(width: 1.0, padding: 4) do
|
flow(width: 1.0, padding: 4) do
|
||||||
@@ -42,7 +42,7 @@ class IMICFPS
|
|||||||
end
|
end
|
||||||
|
|
||||||
stack margin_left: 16 do
|
stack margin_left: 16 do
|
||||||
label "0.72"
|
label "0.75"
|
||||||
label "21"
|
label "21"
|
||||||
label "28"
|
label "28"
|
||||||
label "14"
|
label "14"
|
||||||
|
|||||||
@@ -39,12 +39,12 @@ class IMICFPS
|
|||||||
title "Server Browser"
|
title "Server Browser"
|
||||||
|
|
||||||
flow(width: 1.0) do
|
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
|
pop_state
|
||||||
end
|
end
|
||||||
|
|
||||||
button "Host Game", width: 0.32
|
button "Host Game", width: 0.333
|
||||||
button "Direct Connect", width: 0.32
|
button "Direct Connect", width: 0.333
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -55,22 +55,22 @@ class IMICFPS
|
|||||||
background i.even? ? 0x55000000 : 0x55ff5500
|
background i.even? ? 0x55000000 : 0x55ff5500
|
||||||
|
|
||||||
flow width: 0.1 do
|
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
|
end
|
||||||
flow width: 0.3 do
|
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
|
end
|
||||||
flow width: 0.3 do
|
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
|
end
|
||||||
flow width: 0.1 do
|
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
|
end
|
||||||
flow width: 0.1 do
|
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
|
end
|
||||||
flow width: 0.1 do
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class IMICFPS
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
check_box "Fullscreen", padding_top: 25, padding_bottom: 25
|
check_box "Fullscreen", margin_top: 25, margin_bottom: 25
|
||||||
|
|
||||||
stack do
|
stack do
|
||||||
longest_string = "Gamma Correction"
|
longest_string = "Gamma Correction"
|
||||||
|
|||||||
21
lib/ui/menus/single_player_menu.rb
Normal file
21
lib/ui/menus/single_player_menu.rb
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user