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

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