diff --git a/lib/tools/asset_viewer/lib/main_menu.rb b/lib/tools/asset_viewer/lib/main_menu.rb index 60fc210..28f6db7 100644 --- a/lib/tools/asset_viewer/lib/main_menu.rb +++ b/lib/tools/asset_viewer/lib/main_menu.rb @@ -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 diff --git a/lib/tools/map_editor/lib/main_menu.rb b/lib/tools/map_editor/lib/main_menu.rb index ec01f35..55817cd 100644 --- a/lib/tools/map_editor/lib/main_menu.rb +++ b/lib/tools/map_editor/lib/main_menu.rb @@ -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 diff --git a/lib/ui/menus/multiplayer_profile_menu.rb b/lib/ui/menus/multiplayer_profile_menu.rb index b65a281..4f8c32f 100644 --- a/lib/ui/menus/multiplayer_profile_menu.rb +++ b/lib/ui/menus/multiplayer_profile_menu.rb @@ -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" diff --git a/lib/ui/menus/multiplayer_server_browser_menu.rb b/lib/ui/menus/multiplayer_server_browser_menu.rb index 2503d10..e6d70ce 100644 --- a/lib/ui/menus/multiplayer_server_browser_menu.rb +++ b/lib/ui/menus/multiplayer_server_browser_menu.rb @@ -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 diff --git a/lib/ui/menus/settings_menu.rb b/lib/ui/menus/settings_menu.rb index 39feb14..13e33e3 100644 --- a/lib/ui/menus/settings_menu.rb +++ b/lib/ui/menus/settings_menu.rb @@ -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 diff --git a/locales/en.yml b/locales/en.yml index 317ed67..293dbc4 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -10,4 +10,10 @@ en: back: Back leave: Leave paused: Paused - resume: Resume \ No newline at end of file + resume: Resume + settings: + display: Display + graphics: Graphics + audio: Audio + controls: Controls + multiplayer: Multiplayer \ No newline at end of file diff --git a/static/icons/settings_audio.png b/static/icons/settings_audio.png new file mode 100644 index 0000000..469eb50 Binary files /dev/null and b/static/icons/settings_audio.png differ diff --git a/static/icons/settings_controls.png b/static/icons/settings_controls.png new file mode 100644 index 0000000..ae420d2 Binary files /dev/null and b/static/icons/settings_controls.png differ diff --git a/static/icons/settings_display.png b/static/icons/settings_display.png new file mode 100644 index 0000000..f263a7c Binary files /dev/null and b/static/icons/settings_display.png differ diff --git a/static/icons/settings_graphics.png b/static/icons/settings_graphics.png new file mode 100644 index 0000000..791db36 Binary files /dev/null and b/static/icons/settings_graphics.png differ diff --git a/static/icons/settings_multiplayer.png b/static/icons/settings_multiplayer.png new file mode 100644 index 0000000..91be79b Binary files /dev/null and b/static/icons/settings_multiplayer.png differ diff --git a/svg/icons/settings_audio.svg b/svg/icons/settings_audio.svg new file mode 100644 index 0000000..7ee9315 --- /dev/null +++ b/svg/icons/settings_audio.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/svg/icons/settings_controls.svg b/svg/icons/settings_controls.svg new file mode 100644 index 0000000..0653638 --- /dev/null +++ b/svg/icons/settings_controls.svg @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/svg/icons/settings_display.svg b/svg/icons/settings_display.svg new file mode 100644 index 0000000..77e2b93 --- /dev/null +++ b/svg/icons/settings_display.svg @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/svg/icons/settings_graphics.svg b/svg/icons/settings_graphics.svg new file mode 100644 index 0000000..f5057a0 --- /dev/null +++ b/svg/icons/settings_graphics.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/svg/icons/settings_multiplayer.svg b/svg/icons/settings_multiplayer.svg new file mode 100644 index 0000000..7db8463 --- /dev/null +++ b/svg/icons/settings_multiplayer.svg @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + +