Added icons for settings menu, refreshed menus to unify layouts

This commit is contained in:
2021-05-27 02:39:32 +00:00
parent 51363d2e3d
commit 3570a80d67
16 changed files with 680 additions and 65 deletions

View File

@@ -17,17 +17,19 @@ class IMICFPS
@manifests.sort_by! { |m| m.name.downcase }
label IMICFPS::NAME.to_s, text_size: 100, color: Gosu::Color::BLACK
label "Asset Viewer", text_size: 50
flow(width: 1.0, height: 1.0) do
stack(width: 0.25, height: 1.0) do
button "Back", width: 1.0 do
pop_state
end
end
stack(width: 0.5, height: 1.0) do
label "Asset Viewer", text_size: 100, font: BOLD_SANS_FONT, width: 1.0, text_align: :center
link I18n.t("menus.back"), width: 1.0 do
pop_state
end
flow(width: 1.0, height: 1.0) do
@manifests.each do |manifest|
button manifest.name do

View File

@@ -6,9 +6,6 @@ class IMICFPS
def setup
window.needs_cursor = true
label IMICFPS::NAME.to_s, text_size: 50
label "Map Editor", text_size: 28
@maps = []
Dir.glob("#{GAME_ROOT_PATH}/maps/*.json").each do |map|
begin
@@ -22,15 +19,20 @@ class IMICFPS
flow(width: 1.0, height: 1.0) do
stack(width: 0.25, height: 1.0) do
button "New Map", width: 1.0
button "Back", margin_top: 64, width: 1.0 do
pop_state
end
end
stack(width: 0.5, height: 1.0) do
label "Edit Map"
label "Map Editor", text_size: 100, font: BOLD_SANS_FONT, width: 1.0, text_align: :center
flow width: 1.0 do
link I18n.t("menus.back"), width: 0.32 do
pop_state
end
button "New Map", width: 1.0, width: 0.64
end
label "Edit Map", width: 1.0, text_align: :center, text_size: 50
flow(width: 1.0, height: 1.0) do
@maps.each do |map|
button map.metadata.name do

View File

@@ -3,17 +3,22 @@
class IMICFPS
class MultiplayerProfileMenu < Menu
def setup
label "Profile", text_size: 100, color: Gosu::Color::BLACK
flow(width: 1.0, height: 1.0) do
stack(width: 0.25, height: 1.0) do
button "Edit Profile", width: 1.0
button "Log Out", width: 1.0
button I18n.t("menus.back"), width: 1.0, margin_top: 64 do
pop_state
end
end
stack(width: 0.5, height: 1.0) do
label "Profile", text_size: 100, color: Gosu::Color::BLACK, width: 1.0, text_align: :center
flow width: 1.0 do
link I18n.t("menus.back"), width: 0.32 do
pop_state
end
button "Edit Profile", width: 0.32
button "Log Out", width: 0.32
end
flow(width: 1.0, padding: 4) do
background 0x88_222222
@@ -25,7 +30,7 @@ class IMICFPS
end
end
flow(margin_top: 4, margin_right: 4) do
flow(margin_top: 4) do
stack do
label "Kiil/Death Ratio"
label "Kills"
@@ -36,7 +41,7 @@ class IMICFPS
label "Repair Points"
end
stack do
stack margin_left: 16 do
label "0.72"
label "21"
label "28"

View File

@@ -30,19 +30,25 @@ class IMICFPS
}
]
label "Server Browser", text_size: 100
flow width: 1.0, height: 1.0 do
flow(width: 1.0, height: 1.0) do
stack width: 0.25 do
button "Host Game", width: 1.0
button "Direct Connect", width: 1.0
button I18n.t("menus.back"), width: 1.0, margin_top: 64 do
pop_state
end
end
stack width: 0.5, height: 1.0 do
stack width: 1.0, height: 0.75, border_color: 0xffffffff, border_thickness: 1 do
stack width: 1.0, height: 0.25 do
label "Server Browser", text_size: 100, text_align: :center, width: 1.0
flow(width: 1.0) do
link I18n.t("menus.back"), width: 0.32 do
pop_state
end
button "Host Game", width: 0.32
button "Direct Connect", width: 0.32
end
end
stack width: 1.0, height: 0.5, border_color: 0xffffffff, border_thickness: 1 do
@sample_games.each_with_index do |game, i|
text_size = 18
flow width: 1.0 do

View File

@@ -17,53 +17,69 @@ class IMICFPS
end
def setup
@categories = %w[
Display
Graphics
Audio
Controls
Multiplayer
]
@pages = {}
@current_page = nil
label "Settings", text_size: 100, color: Gosu::Color::BLACK
flow(width: 1.0, height: 1.0) do
stack(width: 0.25, height: 1.0) do
@categories.each do |category|
button category, width: 1.0 do
show_page(:"#{category}".downcase)
end
stack(width: 0.5, height: 1.0) do
stack(width: 1.0, height: 0.25) do
label "Settings", color: Gosu::Color::BLACK, text_size: 100, text_align: :center, width: 1.0
flow(width: 1.0) do
link I18n.t("menus.back"), width: nil do
pop_state
end
button get_image("#{GAME_ROOT_PATH}/static/icons/settings_display.png"), image_width: 64, tip: I18n.t("settings.display") do
show_page(:display)
end
button get_image("#{GAME_ROOT_PATH}/static/icons/settings_graphics.png"), image_width: 64, tip: I18n.t("settings.graphics") do
show_page(:graphics)
end
button get_image("#{GAME_ROOT_PATH}/static/icons/settings_audio.png"), image_width: 64, tip: I18n.t("settings.audio") do
show_page(:audio)
end
button get_image("#{GAME_ROOT_PATH}/static/icons/settings_controls.png"), image_width: 64, tip: I18n.t("settings.controls") do
show_page(:controls)
end
button get_image("#{GAME_ROOT_PATH}/static/icons/settings_multiplayer.png"), image_width: 64, tip: I18n.t("settings.multiplayer") do
show_page(:multiplayer)
end
end
end
button I18n.t("menus.back"), width: 1.0, margin_top: 64 do
pop_state
end
end
@categories.each do |category|
stack(width: 0.5, height: 1.0) do |element|
@pages[:"#{category}".downcase] = element
element.hide
send(:"create_page_#{category}".downcase) if respond_to?(:"create_page_#{category}".downcase)
@page_container = stack(width: 1.0, height: 0.75, scroll: true) do
end
end
end
# @categories.each do |category|
# stack(width: 0.5, height: 1.0) do |element|
# @pages[:"#{category}".downcase] = element
# element.hide
# send(:"create_page_#{category}".downcase) if respond_to?(:"create_page_#{category}".downcase)
# end
# end
# end
show_page(:display)
end
def show_page(page)
if element = @pages[page]
@current_page&.hide
@current_page = element
element.show
@page_container.clear do
send(:"page_#{page}")
end
end
def create_page_display
def page_display
label "Display", text_size: 50
label "Resolution"
@@ -109,7 +125,7 @@ class IMICFPS
end
end
def create_page_audio
def page_audio
label "Audio", text_size: 50
longest_string = "Dialogue".length
volumes = %i[sound music dialogue]
@@ -131,7 +147,7 @@ class IMICFPS
end
end
def create_page_controls
def page_controls
label "Controls", text_size: 50
InputMapper.keymap.each do |key, values|
@@ -150,7 +166,7 @@ class IMICFPS
end
end
def create_page_graphics
def page_graphics
label "Graphics", text_size: 50
longest_string = "Surface Effect Detail"
@@ -218,7 +234,7 @@ class IMICFPS
end
end
def create_page_multiplayer
def page_multiplayer
label "Multiplayer", text_size: 50
flow do