Tweak menus a bit, add proper single player menu, made back link have some margin from above links

This commit is contained in:
2021-06-03 00:59:08 +00:00
parent 58b2f8b890
commit 3986b1b0af
13 changed files with 55 additions and 39 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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)

View File

@@ -66,7 +66,10 @@ class IMICFPS
},
active: {
color: Gosu::Color.rgb(64, 128, 255),
}
},
disabled: {
color: Gosu::Color.rgb(175, 175, 175),
},
},
Button:
{

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View 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