From 9bde9a71ed080752863f364bc43ac8f325125e04 Mon Sep 17 00:00:00 2001 From: JappaWakkaP3D <31563291+JappaWakka@users.noreply.github.com> Date: Fri, 22 Oct 2021 18:13:33 +0200 Subject: [PATCH] Main Menu & Options Menu Fixes and Improvements * Gave enabled Content Packs better feedback by making the text green if it's enabled * Removed the "enabled" suffix from enabled Content Packs * Changed the "enabled:no/yes" text in the Content Pack menu to "Enable" when the selected Pack is disabled and "Disable" when the selected Pack is enabled * Fixed mouse clicks registering in a different location on the Content Packs menu When clicking any button on the row above the options submenu while the options submenu is opened, I made it close the submenu and move to that button. * Added visual keypress feedback when pressing a commandbutton. The key will revert back to it's regular look when the mouse/keyboard/controller button is released. * Fixed the jump when moving the cursor in the options menu from a slider to a button and vice versa. * added an "apply" button to the main menu's option menus * Made the "back" buttons in the main menu's option menus not apply the changes. * Made the language change when you scroll through the languages. Tokens in other languages need to be updated! --- P3D/Content/Localization/Tokens_en.dat | 134 +++++++----- P3D/Screens/MainMenu/PressStartScreen.vb | 53 ++++- P3D/Screens/NewOptionScreen.vb | 262 ++++++++++++++--------- 3 files changed, 283 insertions(+), 166 deletions(-) diff --git a/P3D/Content/Localization/Tokens_en.dat b/P3D/Content/Localization/Tokens_en.dat index bd7bd479e..0e798a2db 100644 --- a/P3D/Content/Localization/Tokens_en.dat +++ b/P3D/Content/Localization/Tokens_en.dat @@ -10,7 +10,6 @@ global_new,New global_add,Add global_edit,Edit global_remove,Remove -global_back,Back global_please_wait,Please wait global_loading,Loading global_game,Game @@ -24,11 +23,15 @@ global_cancel,Cancel global_gamemode,GameMode global_clear,Clear global_save,Save +global_apply,Apply global_close,Close +global_back,Back global_on,On global_off,Off global_enabled,Enabled global_disabled,Disabled +global_enable,Enable +global_disable,Disable global_player_name,Player name global_badges,Badges global_play_time,Play Time @@ -76,7 +79,6 @@ global_pokemon_move_cut,Cut global_pokemon_move_teleport,Teleport global_pokemon_move_dig,Dig global_used,Used -global_apply,Apply global_eggs_cannot_hold,Eggs cannot hold items. --- General: @@ -117,27 +119,7 @@ DeleteScreen: delete_menu_delete_confirm,Do you really want to delete the save delete_menu_delete,Delete delete_menu_cancel,Cancel -LanguageScreen: -language_menu_apply,Apply -language_menu_back,Back -PacksScreen: -pack_menu_up,Move Up -pack_menu_down,Move Down -pack_menu_toggle_on,Enabled -pack_menu_toggle_off,Disabled -pack_menu_information,Information -pack_menu_enabled,Enabled -pack_menu_apply,Apply -pack_menu_back,Back -pack_menu_songs,Songs -pack_menu_sounds,Sounds -pack_menu_textures,Textures -pack_menu_name,Name -pack_menu_version,Version -pack_menu_by,By -pack_menu_content,Content -pack_menu_description,Description ---- + GameModeMenu: gamemode_menu_name,Name gamemode_menu_description,Description @@ -270,46 +252,80 @@ option_screen_title,Options option_screen_warning,Options aren't saved yet, scroll down and choose "Save options." option_screen_backadvice,PRESS E TO GO BACK option_screen_description,Description -option_screen_textspeed,Textspeed -option_screen_textspeed_description,The speed the textbox shows up and~displays the text -option_screen_fov,FOV -option_screen_fov_description,The field of view. The higher the value is,~the more you can see.~Warning: Too large value can cause lags in larger maps. -option_screen_mousespeed,MouseSpeed -option_screen_mousespeed_description,The Mousespeed sets the speed on which the~mouse can rotate the view. -option_screen_volume,Volume -option_screen_volume_description,The volume of the background music.~This settings is for all save states. -option_screen_render_distance,RenderDistance -option_screen_render_distance_tiny,Tiny -option_screen_render_distance_short,Short -option_screen_render_distance_normal,Normal -option_screen_render_distance_far,Far -option_screen_render_distance_extreme,Extreme -option_screen_render_distance_description,The renderdistance determines,~how far you can see.~By turning this down, you can improve your FPS. + +option_screen_game,Game +option_screen_game_textspeed,Text Speed +option_screen_game_textspeed_description,The speed the textbox shows up and~displays the text +option_screen_game_difficulty,Difficulty +option_screen_game_difficulty_description,Difficulty mode~Sets the level of difficulty. +option_screen_game_difficulty_easy,Easy +option_screen_game_difficulty_hard,Hard +option_screen_game_difficulty_superhard,Super Hard +option_screen_game_viewbobbing,View Bobbing +option_screen_game_viewbobbing_description,Turns camera shaking on or off. + option_screen_graphics,Graphics -option_screen_graphics_fancy,Fancy -option_screen_graphics_fast,Fast -option_screen_graphics_description,Affects if some objects are rendered~or not. By turning this down, you can improve your FPS.~This settings is for all save states. -option_screen_offset_map_quality,Offset map quality -option_screen_offset_map_off,Off -option_screen_offset_map_quality_description,Sets the quality of the offset maps.~The details and update frequency of offset maps increase with this value.~Set this value to 0 to prevent the game from loading offset maps. -option_screen_animations_in_battle,Animations in battle -option_screen_animations_in_battle_no,No -option_screen_animations_in_battle_attacks_off,Attacks off -option_screen_animations_in_battle_yes,Yes -option_screen_animations_in_battle_description,Determines if the game shows battle animations. -option_screen_difficulty,Difficulty -option_screen_difficulty_description,Difficulty mode~Sets the level of difficulty. -option_screen_battle_style,BattleStyle -option_screen_battle_style_shift,Shift -option_screen_battle_style_set,Set +option_screen_graphics_fov,Field of View +option_screen_graphics_fov_description,The field of view. The higher the value is,~the more you can see.~Warning: Too large value can cause lags in larger maps. +option_screen_graphics_renderdistance,Render Distance +option_screen_graphics_renderdistance_description,The render distance determines,~how far you can see.~By turning this down, you can improve your FPS. +option_screen_graphics_renderdistance_tiny,Tiny +option_screen_graphics_renderdistance_short,Short +option_screen_graphics_renderdistance_normal,Normal +option_screen_graphics_renderdistance_far,Far +option_screen_graphics_renderdistance_extreme,Extreme +option_screen_graphics_offset_mapquality,Offset Map Quality +option_screen_graphics_offset_mapquality_description,Sets the quality of the offset maps.~The details and update frequency of offset maps increase with this value.~Set this value to 0 to prevent the game from loading offset maps. +option_screen_graphics_offset_mapquality_off,Off +option_screen_graphics_graphics,Graphics +option_screen_graphics_graphics_description,Affects if some objects are rendered~or not. By turning this down, you can improve your FPS.~This settings is for all save states. +option_screen_graphics_graphics_fancy,Fancy +option_screen_graphics_graphics_fast,Fast +option_screen_graphics_multisampling,Multi Sampling + +option_screen_battle,Battle +option_screen_battle_3dmodels,3D Models +option_screen_battle_animations,Animations +option_screen_battle_animations_description,Determines if the game shows battle animations. +option_screen_battle_battlestyle,Battle Style +option_screen_battle_battlestyle_shift,Shift +option_screen_battle_battlestyle_set,Set option_screen_battle_style_description,Battle Style~Set: You are not asked to switch out your Pokémon~Shift: You can switch out your Pokémon after defeating an opponent. -option_screen_view_bobbing,View bobbing -option_screen_view_bobbing_description,Turns camera shaking on or off. -option_screen_reset_options,Reset options. -option_screen_reset_options_description,Resets all options. + +option_screen_controls,Controls +option_screen_controls_xboxgamepad,Xbox Gamepad +option_screen_controls_resetkeybindings,Reset Key Bindings +option_screen_controls_cameraspeed,Camera Speed +option_screen_controls_cameraspeed_description,The camera speed sets the speed on which the~mouse can rotate the view. +option_screen_controls_cameraspeed_slow,...Slow... +option_screen_controls_cameraspeed_medium,Standard +option_screen_controls_cameraspeed_fast,Super fast! +option_screen_controls_cameraspeed_fastest,SPEED OF LIGHT! + +option_screen_audio,Audio +option_screen_audio_volume_music,Music Volume +option_screen_audio_volume_music_description,The volume of the background music. +option_screen_audio_volume_sfx,SoundFX Volume +option_screen_audio_volume_music_description,The volume of the sound effects and jingles. +option_screen_audio_muted,Muted + +option_screen_contentpacks_up,Move Up +option_screen_contentpacks_down,Move Down +option_screen_contentpacks_information,Information +option_screen_contentpacks_songs,Songs +option_screen_contentpacks_sounds,Sounds +option_screen_contentpacks_textures,Textures +option_screen_contentpacks_name,Name +option_screen_contentpacks_version,Version +option_screen_contentpacks_by,By +option_screen_contentpacks_content,Content +option_screen_contentpacks_description,Description + +option_screen_resetoptions,Reset options. +option_screen_resetoptions_description,Resets all options. option_screen_save_options,Save options. option_screen_save_options_description,Save the options and close the menu. -option_screen_close_menu,Close menu. +option_screen_close,Close. option_screen_close_menu_description,Close the menu and do not save~the changes. --- Item Detail Screen: diff --git a/P3D/Screens/MainMenu/PressStartScreen.vb b/P3D/Screens/MainMenu/PressStartScreen.vb index ecebb1e92..8373cdf1f 100644 --- a/P3D/Screens/MainMenu/PressStartScreen.vb +++ b/P3D/Screens/MainMenu/PressStartScreen.vb @@ -414,7 +414,49 @@ Public Class NewMainMenuScreen End If Next End If - Case 2, 3 + Case 2 + For x = 0 To _MainProfiles.Count - 1 + Dim xOffset As Single = _screenOrigin.X + _mainOffset.X + x * 180 + ((x + 1) * 100 * (1 - _fadeInMain)) + If New Rectangle(CInt(xOffset), CInt(_screenOrigin.Y + _screenOffsetTarget.Y), 160, 160).Contains(MouseHandler.MousePosition) Then + _menuIndex = 0 + Dim diff As Integer = CInt(_screenOffset.X + x * 180) - CInt(_optionsOffset.X + _selectedProfile * 180) + _screenOffsetTarget.X -= diff + _selectedProfile = x + _sliderTarget = GetSliderTarget(x) + SoundManager.PlaySound("select") + End If + Next + For x = 0 To _OptionsProfiles.Count - 1 + Dim xOffset As Single = _screenOrigin.X + _optionsOffset.X + x * 180 + ((x + 1) * 100 * (1 - _fadeInMain)) + + If New Rectangle(CInt(xOffset), CInt(_screenOrigin.Y + _optionsOffset.Y), 160, 160).Contains(MouseHandler.MousePosition) Then + If _selectedProfile = x Then + If CurrentScreen.Identification = Identifications.MainMenuScreen Then + ClickedProfile() + SoundManager.PlaySound("select") + End If + Else + If CurrentScreen.Identification = Identifications.MainMenuScreen Then + Dim diff As Integer = x - _selectedProfile + _optionsOffsetTarget.X -= diff * 180 + _selectedProfile = x + End If + Exit For + End If + End If + Next + Case 3 + For x = 0 To _GameJoltProfiles.Count - 1 + Dim xOffset As Single = _screenOrigin.X + _gameJoltOffset.X + x * 180 + ((x + 1) * 100 * (1 - _fadeInMain)) + If New Rectangle(CInt(xOffset), CInt(_screenOrigin.Y + _screenOffsetTarget.Y + -180 + 32), 160, 160).Contains(MouseHandler.MousePosition) Then + Dim diff As Integer = x - _selectedProfile + _gameJoltOffsetTarget.X -= diff * 180 + _menuIndex = 1 + _selectedProfile = x + _sliderTarget = GetSliderTarget(x) + SoundManager.PlaySound("select") + End If + Next For x = 0 To _OptionsProfiles.Count - 1 Dim xOffset As Single = _screenOrigin.X + _optionsOffset.X + x * 180 + ((x + 1) * 100 * (1 - _fadeInMain)) @@ -539,14 +581,17 @@ Public Class NewMainMenuScreen If CurrentScreen.Identification = Identifications.MainMenuScreen Then SetScreen(New PressStartScreen()) End If + SoundManager.PlaySound("select") Case 1, 2 _menuIndex = 0 _selectedProfile = _selectedProfileTemp _sliderTarget = GetSliderTarget(_selectedProfile) + SoundManager.PlaySound("select") Case 3 _menuIndex = 1 _selectedProfile = _selectedProfileTemp _sliderTarget = GetSliderTarget(_selectedProfile) + SoundManager.PlaySound("select") End Select End If If KeyBoardHandler.KeyPressed(KeyBindings.ForwardMoveKey) Or KeyBoardHandler.KeyPressed(KeyBindings.UpKey) Then @@ -555,10 +600,12 @@ Public Class NewMainMenuScreen _menuIndex = 0 _selectedProfile = _selectedProfileTemp _sliderTarget = GetSliderTarget(_selectedProfile) + SoundManager.PlaySound("select") Case 3 _menuIndex = 1 _selectedProfile = _selectedProfileTemp _sliderTarget = GetSliderTarget(_selectedProfile) + SoundManager.PlaySound("select") End Select End If @@ -604,13 +651,13 @@ Public Class NewMainMenuScreen Core.Player.Skin = GameJolt.Emblem.GetPlayerSpriteFile(GameJolt.Emblem.GetPlayerLevel(GameJoltSave.Points), GameJoltSave.GameJoltID, GameJoltSave.Gender) _MainProfiles(_selectedProfile).Sprite = GameJolt.Emblem.GetPlayerSprite(GameJolt.Emblem.GetPlayerLevel(GameJoltSave.Points), GameJoltSave.GameJoltID, GameJoltSave.Gender) End Sub + Private Sub ButtonResetSave() GameJoltSave.ResetSave() _MainProfiles(_selectedProfile).Sprite = GameJolt.Emblem.GetPlayerSprite(GameJolt.Emblem.GetPlayerLevel(GameJoltSave.Points), GameJoltSave.GameJoltID, GameJoltSave.Gender) _MainProfiles(_selectedProfile).SetToDefault() End Sub - Private Sub ClickedProfile() Select Case _menuIndex Case 0 @@ -846,6 +893,8 @@ Public Class NewMainMenuScreen Select Case _menuIndex Case 2, 3 Return CInt(_optionsOffset.X + index * 180 + 80) + Case 1 + Return CInt(_gameJoltOffset.X + index * 180 + 80) Case Else Return CInt(_screenOffset.X + index * 180 + 80) End Select diff --git a/P3D/Screens/NewOptionScreen.vb b/P3D/Screens/NewOptionScreen.vb index 98ede4656..d51a836ef 100644 --- a/P3D/Screens/NewOptionScreen.vb +++ b/P3D/Screens/NewOptionScreen.vb @@ -26,7 +26,8 @@ Private Languages As New List(Of String) Private LanguageNames As New List(Of String) - Private currentLanguage As String = "en" + Private currentLanguage As String = Localization.LanguageSuffix + Private TempLanguage As String = Localization.LanguageSuffix Public Shared languageMenuIndex(3) As Integer Private PackNames As New List(Of String) @@ -218,10 +219,6 @@ Localization.Load(Languages(languageMenuIndex(0))) End If - If KeyBoardHandler.KeyPressed(KeyBindings.EscapeKey) Or KeyBoardHandler.KeyPressed(KeyBindings.BackKey1) Or KeyBoardHandler.KeyPressed(KeyBindings.BackKey2) Or MouseHandler.ButtonPressed(MouseHandler.MouseButtons.RightButton) Or ControllerHandler.ButtonPressed(Buttons.B) Then - Localization.Load(currentLanguage) - End If - End Sub Private Sub GetLanguages() @@ -302,15 +299,19 @@ For i = 0 To x Dim Name As String = PackNames(i + packsMenuIndex(2)) If EnabledPackNames.Contains(Name) = True Then - Name &= " (" & Localization.GetString("pack_menu_enabled") & ")" - textColor = New Color(0, 0, 0, CInt(255 * _interfaceFade * _pageFade)) - End If - - If i + packsMenuIndex(2) = packsMenuIndex(0) Then - SpriteBatch.DrawString(FontManager.InGameFont, Name, New Vector2(CInt(windowSize.Width / 2) - 318, CInt(Core.windowSize.Height / 2 - 120 + i * 50 + 2)), textColor) - SpriteBatch.DrawString(FontManager.InGameFont, Name, New Vector2(CInt(windowSize.Width / 2) - 320, CInt(Core.windowSize.Height / 2 - 120 + i * 50)), New Color(255, 255, 255, CInt(255 * _interfaceFade * _pageFade))) + If i + packsMenuIndex(2) = packsMenuIndex(0) Then + SpriteBatch.DrawString(FontManager.InGameFont, Name, New Vector2(CInt(windowSize.Width / 2) - 320 + 2, CInt(Core.windowSize.Height / 2 - 120 + i * 50 + 2)), New Color(0, 0, 0, CInt(255 * _interfaceFade * _pageFade))) + SpriteBatch.DrawString(FontManager.InGameFont, Name, New Vector2(CInt(windowSize.Width / 2) - 320, CInt(Core.windowSize.Height / 2 - 120 + i * 50)), New Color(181, 255, 82, CInt(255 * _interfaceFade * _pageFade))) + Else + SpriteBatch.DrawString(FontManager.InGameFont, Name, New Vector2(CInt(windowSize.Width / 2) - 320, CInt(Core.windowSize.Height / 2 - 120 + i * 50)), New Color(98, 205, 8, CInt(255 * _interfaceFade * _pageFade))) + End If Else - SpriteBatch.DrawString(FontManager.InGameFont, Name, New Vector2(CInt(windowSize.Width / 2) - 320, CInt(Core.windowSize.Height / 2 - 120 + i * 50)), textColor) + If i + packsMenuIndex(2) = packsMenuIndex(0) Then + SpriteBatch.DrawString(FontManager.InGameFont, Name, New Vector2(CInt(windowSize.Width / 2) - 320 + 2, CInt(Core.windowSize.Height / 2 - 120 + i * 50 + 2)), textColor) + SpriteBatch.DrawString(FontManager.InGameFont, Name, New Vector2(CInt(windowSize.Width / 2) - 320, CInt(Core.windowSize.Height / 2 - 120 + i * 50)), New Color(255, 255, 255, CInt(255 * _interfaceFade * _pageFade))) + Else + SpriteBatch.DrawString(FontManager.InGameFont, Name, New Vector2(CInt(windowSize.Width / 2) - 320, CInt(Core.windowSize.Height / 2 - 120 + i * 50)), textColor) + End If End If Next End If @@ -354,7 +355,7 @@ End If If GameInstance.IsMouseVisible = True Then For i = 0 To 3 - If New Rectangle(CInt(windowSize.Width / 2) - 328, 204 + i * 50, 500, 48).Contains(MouseHandler.MousePosition) = True Then + If New Rectangle(CInt(windowSize.Width / 2) - 328, CInt(Core.windowSize.Height / 2 - 128 + i * 50), 500, 48).Contains(MouseHandler.MousePosition) = True Then If MouseHandler.ButtonPressed(MouseHandler.MouseButtons.LeftButton) = True Then packsMenuIndex(0) = i + packsMenuIndex(2) End If @@ -407,7 +408,7 @@ Next If hasMP3 = True Or hasOGG = True Or hasWMA = True Then - PInfoContent = Localization.GetString("pack_menu_songs") + PInfoContent = Localization.GetString("option_screen_contentpacks_songs") End If End If If IO.Directory.Exists(contentPackPath & "Sounds") = True Then @@ -431,7 +432,7 @@ PInfoContent &= ", " End If - PInfoContent &= Localization.GetString("pack_menu_sounds") + PInfoContent &= Localization.GetString("option_screen_contentpacks_sounds") End If End If @@ -454,7 +455,7 @@ PInfoContent &= ", " End If - PInfoContent &= Localization.GetString("pack_menu_textures") + PInfoContent &= Localization.GetString("option_screen_contentpacks_textures") Exit For End If End If @@ -489,11 +490,11 @@ Dim CanvasTexture As Texture2D = TextureManager.GetTexture("GUI\Menus\Menu", New Rectangle(0, 0, 48, 48), "") Canvas.DrawRectangle(New Rectangle(CInt(windowSize.Width / 2) - 240 + 4, CInt(Core.windowSize.Height / 2 - 144), 480, 64), New Color(77, 147, 198, CInt(255 * _interfaceFade * _pageFade))) - SpriteBatch.DrawString(FontManager.InGameFont, Localization.GetString("pack_menu_name") & ": " & PInfoName, New Vector2(CInt(windowSize.Width / 2) - CInt(FontManager.InGameFont.MeasureString(Localization.GetString("pack_menu_name") & ": " & PInfoName).X / 2) + 2, CInt(Core.windowSize.Height / 2 - 128 + 2)), New Color(0, 0, 0, CInt(255 * _interfaceFade * _pageFade))) - SpriteBatch.DrawString(FontManager.InGameFont, Localization.GetString("pack_menu_name") & ": " & PInfoName, New Vector2(CInt(windowSize.Width / 2) - CInt(FontManager.InGameFont.MeasureString(Localization.GetString("pack_menu_name") & ": " & PInfoName).X / 2), CInt(Core.windowSize.Height / 2 - 128)), New Color(255, 255, 255, CInt(255 * _interfaceFade * _pageFade))) + SpriteBatch.DrawString(FontManager.InGameFont, Localization.GetString("option_screen_contentpacks_name") & ": " & PInfoName, New Vector2(CInt(windowSize.Width / 2) - CInt(FontManager.InGameFont.MeasureString(Localization.GetString("option_screen_contentpacks_name") & ": " & PInfoName).X / 2) + 2, CInt(Core.windowSize.Height / 2 - 128 + 2)), New Color(0, 0, 0, CInt(255 * _interfaceFade * _pageFade))) + SpriteBatch.DrawString(FontManager.InGameFont, Localization.GetString("option_screen_contentpacks_name") & ": " & PInfoName, New Vector2(CInt(windowSize.Width / 2) - CInt(FontManager.InGameFont.MeasureString(Localization.GetString("option_screen_contentpacks_name") & ": " & PInfoName).X / 2), CInt(Core.windowSize.Height / 2 - 128)), New Color(255, 255, 255, CInt(255 * _interfaceFade * _pageFade))) Canvas.DrawRectangle(New Rectangle(CInt(windowSize.Width / 2) - 272 + 4, CInt(Core.windowSize.Height / 2 - 72), 544, 196), New Color(255, 255, 255, CInt(255 * _interfaceFade * _pageFade))) - SpriteBatch.DrawString(FontManager.InGameFont, Localization.GetString("pack_menu_version") & ": " & PInfoVersion & Environment.NewLine & Localization.GetString("pack_menu_by") & ": " & PInfoAuthor & Environment.NewLine & Localization.GetString("pack_menu_content") & ": " & PInfoContent & Environment.NewLine & Localization.GetString("pack_menu_description") & ": " & Environment.NewLine & PInfoDescription.Replace("
", Environment.NewLine), New Vector2(CInt(windowSize.Width / 2) - 272 + 16, CInt(Core.windowSize.Height / 2 - 64)), New Color(0, 0, 0, CInt(255 * _interfaceFade * _pageFade))) + SpriteBatch.DrawString(FontManager.InGameFont, Localization.GetString("option_screen_contentpacks_version") & ": " & PInfoVersion & Environment.NewLine & Localization.GetString("option_screen_contentpacks_by") & ": " & PInfoAuthor & Environment.NewLine & Localization.GetString("option_screen_contentpacks_content") & ": " & PInfoContent & Environment.NewLine & Localization.GetString("option_screen_contentpacks_description") & ": " & Environment.NewLine & PInfoDescription.Replace("
", Environment.NewLine).Replace("~", Environment.NewLine), New Vector2(CInt(windowSize.Width / 2) - 272 + 16, CInt(Core.windowSize.Height / 2 - 64)), New Color(0, 0, 0, CInt(255 * _interfaceFade * _pageFade))) End Sub Private Sub UpdatePackInformationMenu() @@ -593,7 +594,7 @@ SpriteBatch.Draw(_texture, New Rectangle(halfWidth - 140, halfHeight - 232, 16, 16), New Rectangle(80, 0, 16, 16), mainBackgroundColor) SpriteBatch.Draw(_texture, New Rectangle(halfWidth - 124, halfHeight - 216, 16, 16), New Rectangle(80, 0, 16, 16), mainBackgroundColor) - SpriteBatch.DrawString(FontManager.ChatFont, "Options", New Vector2(halfWidth - 390, halfHeight - 228), mainBackgroundColor) + SpriteBatch.DrawString(FontManager.ChatFont, Localization.GetString("option_screen_title", "Options"), New Vector2(halfWidth - 390, halfHeight - 228), mainBackgroundColor) For y = 0 To CInt(_enrollY) Step 16 For x = 0 To 800 Step 16 @@ -609,22 +610,8 @@ End If End Sub Private Sub DrawCursor() - Dim currentControl As Control = Nothing - Dim XOffset As Integer = 0 - - For Each control As Control In ControlList - If control._position = _cursorDestPosition Then - currentControl = control - Exit For - End If - Next - If ControlList.Count > 0 Then - If currentControl.ControlType = "ScrollBar" Then - XOffset = 400 - 68 - End If - End If Dim t As Texture2D = TextureManager.GetTexture("GUI\Menus\General", New Rectangle(0, 0, 16, 16), "") - Core.SpriteBatch.Draw(t, New Rectangle(CInt(_cursorPosition.X) + XOffset + 60, CInt(_cursorPosition.Y) - 28, 48, 48), New Rectangle(0, 0, 16, 16), New Color(255, 255, 255, CInt(255 * Me._interfaceFade)), 0.0F, Vector2.Zero, SpriteEffects.None, 0.0F) + Core.SpriteBatch.Draw(t, New Rectangle(CInt(_cursorPosition.X) + 60, CInt(_cursorPosition.Y) - 28, 48, 48), New Rectangle(0, 0, 16, 16), New Color(255, 255, 255, CInt(255 * Me._interfaceFade)), 0.0F, Vector2.Zero, SpriteEffects.None, 0.0F) End Sub Private Sub DrawCurrentPage() For Each C As Control In ControlList @@ -785,9 +772,22 @@ End If End Sub Private Sub SetCursorPosition(ByVal direction As String) + Dim ScrollControl As Control = Nothing Dim pos = GetButtonPosition(direction) - 'Dim cPosition As Vector2 = New Vector2(pos.X + 180, pos.Y - 42) Dim cPosition As Vector2 = New Vector2(pos.X, pos.Y) + 'Dim cPosition As Vector2 = New Vector2(pos.X + 180, pos.Y - 42) + For Each control As Control In ControlList + If control._position = New Vector2(pos.X, pos.Y) Then + If control.ControlType = "ScrollBar" Then + ScrollControl = control + Exit For + End If + End If + Next + If ScrollControl IsNot Nothing Then + cPosition.X += 332 + End If + _cursorDestPosition = cPosition End Sub @@ -796,9 +796,16 @@ Dim currentControl As Control = Nothing For Each control As Control In ControlList - If control._position = _cursorDestPosition Then - currentControl = control - Exit For + If control.ControlType = "ScrollBar" Then + If control._position.Y = _cursorDestPosition.Y Then + currentControl = control + Exit For + End If + Else + If control._position = _cursorDestPosition Then + currentControl = control + Exit For + End If End If Next @@ -921,104 +928,116 @@ Select Case ScreenIndex Case 0 ' Main Options menu. - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 90, Delta_Y + 80), 1, 64, "Game", AddressOf SwitchToGame, 1)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 310, Delta_Y + 80), 1, 64, "Graphics", AddressOf SwitchToGraphics, 2)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530, Delta_Y + 80), 1, 64, "Battle", AddressOf SwitchToBattle, 3)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 200, Delta_Y + 168), 1, 64, "Controls", AddressOf SwitchToControls, 4)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 420, Delta_Y + 168), 1, 64, "Audio", AddressOf SwitchToAudio, 5)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 90, Delta_Y + 80), 1, 64, Localization.GetString("option_screen_game", "Game"), AddressOf SwitchToGame, 1)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 310, Delta_Y + 80), 1, 64, Localization.GetString("option_screen_graphics", "Graphics"), AddressOf SwitchToGraphics, 2)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530, Delta_Y + 80), 1, 64, Localization.GetString("option_screen_battle", "Battle"), AddressOf SwitchToBattle, 3)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 200, Delta_Y + 168), 1, 64, Localization.GetString("option_screen_controls", "Controls"), AddressOf SwitchToControls, 4)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 420, Delta_Y + 168), 1, 64, Localization.GetString("option_screen_audio", "Audio"), AddressOf SwitchToAudio, 5)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 90 + 24, Delta_Y + 336), 1, 48, "Apply", AddressOf Apply, 6)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 286 + 24, Delta_Y + 336), 2, 48, "Reset Options", AddressOf Reset, 7)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 336), 1, 48, "Close", AddressOf Close, 8)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 90 + 24, Delta_Y + 336), 1, 48, Localization.GetString("global_apply", "Apply"), AddressOf Apply, 6)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 286 + 24, Delta_Y + 336), 2, 48, Localization.GetString("option_screen_resetoptions", "Reset Options"), AddressOf Reset, 7)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 336), 1, 48, Localization.GetString("global_close", "Close"), AddressOf Close, 8)) Case 1 ' "Game" from the Options menu. - Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 60), 400, "Text Speed", Me.TextSpeed, 1, 3, AddressOf ChangeTextspeed, 1)) + Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 60), 400, Localization.GetString("option_screen_game_textspeed", "Text Speed"), Me.TextSpeed, 1, 3, AddressOf ChangeTextspeed, 1)) If CBool(GameModeManager.GetGameRuleValue("LockDifficulty", "0")) = False Then Dim d As New Dictionary(Of Integer, String) - d.Add(0, "Easy") - d.Add(1, "Hard") - d.Add(2, "Super Hard") + d.Add(0, Localization.GetString("option_screen_game_difficulty_easy", "Easy")) + d.Add(1, Localization.GetString("option_screen_game_difficulty_hard", "Hard")) + d.Add(2, Localization.GetString("option_screen_game_difficulty_superhard", "Super Hard")) - Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 120), 400, "Difficulty", Me.Difficulty, 0, 2, AddressOf ChangeDifficulty, d, 2)) + Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 120), 400, Localization.GetString("option_screen_game_difficulty", "Difficulty"), Me.Difficulty, 0, 2, AddressOf ChangeDifficulty, d, 2)) End If - Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100, Delta_Y + 180), 3, 64, "View Bobbing", Me.ViewBobbing, AddressOf ToggleBobbing, {"Off", "On"}.ToList(), 3)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, "Back", AddressOf SwitchToMain, 4)) + Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100, Delta_Y + 180), 3, 64, Localization.GetString("option_screen_game_viewbobbing", "View Bobbing"), Me.ViewBobbing, AddressOf ToggleBobbing, {Localization.GetString("global_off", "Off"), Localization.GetString("global_on", "On")}.ToList(), 3)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, Localization.GetString("global_back", "Back"), AddressOf SwitchToMain, 4)) Case 2 ' "Graphics" from the Options menu. - Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 40), 400, "Field of View", CInt(Me.FOV), 45, 120, AddressOf ChangeFOV, 1)) + Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 40), 400, Localization.GetString("option_screen_graphics_fov", "Field of View"), CInt(Me.FOV), 45, 120, AddressOf ChangeFOV, 1)) Dim d As New Dictionary(Of Integer, String) - d.Add(0, "Tiny") - d.Add(1, "Small") - d.Add(2, "Normal") - d.Add(3, "Far") - d.Add(4, "Extreme") - Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 100), 400, "Render Distance", Me.RenderDistance, 0, 4, AddressOf ChangeRenderDistance, d, 2)) + d.Add(0, Localization.GetString("option_screen_graphics_renderdistance_tiny", "Tiny")) + d.Add(1, Localization.GetString("option_screen_graphics_renderdistance_small", "Small")) + d.Add(2, Localization.GetString("option_screen_graphics_renderdistance_normal", "Normal")) + d.Add(3, Localization.GetString("option_screen_graphics_renderdistance_far","Far")) + d.Add(4, Localization.GetString("option_screen_graphics_renderdistance_extreme", "Extreme")) + Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 100), 400, Localization.GetString("option_screen_graphics_renderdistance", "Render Distance"), Me.RenderDistance, 0, 4, AddressOf ChangeRenderDistance, d, 2)) Dim d1 As New Dictionary(Of Integer, String) d1.Add(0, "Off") - Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 160), 400, "Offset Map Quality", Me.LoadOffsetMaps, 0, 100, AddressOf ChangeOffsetMaps, d1, 3)) + Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 160), 400, Localization.GetString("option_screen_graphics_offset_mapquality", "Offset Map Quality"), Me.LoadOffsetMaps, 0, 100, AddressOf ChangeOffsetMaps, d1, 3)) - Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100, Delta_Y + 220), 3, 64, "Graphics", CBool(Me.GraphicStyle), AddressOf ToggleGraphicsStyle, {"Fast", "Fancy"}.ToList(), 4)) - Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100, Delta_Y + 300), 3, 64, "Multi Sampling", Me.PreferMultiSampling, AddressOf ToggleMultiSampling, {"Off", "On"}.ToList(), 5)) + Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100, Delta_Y + 220), 3, 64, Localization.GetString("option_screen_graphics_graphics", "Graphics"), CBool(Me.GraphicStyle), AddressOf ToggleGraphicsStyle, {Localization.GetString("option_screen_graphics_graphics_fast", "Fast"), Localization.GetString("option_screen_graphics_graphics_fancy", "Fancy")}.ToList(), 4)) + Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100, Delta_Y + 300), 3, 64, Localization.GetString("option_screen_graphics_multisampling", "Multi Sampling"), Me.PreferMultiSampling, AddressOf ToggleMultiSampling, {"Off", "On"}.ToList(), 5)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, "Back", AddressOf SwitchToMain, 6)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, Localization.GetString("global_back", "Back"), AddressOf SwitchToMain, 6)) Case 3 ' "Battle" from the Options menu. - Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100 + 20, Delta_Y + 100), 2, 64, "3D Models", CBool(ShowModels), AddressOf ToggleShowModels, {"Off", "On"}.ToList(), 1)) - Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 400 + 20, Delta_Y + 100), 2, 64, "Animations", CBool(Me.ShowBattleAnimations), AddressOf ToggleAnimations, {"Off", "On"}.ToList(), 2)) - Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100 + 20, Delta_Y + 200), 2, 64, "Battle Style", CBool(Me.BattleStyle), AddressOf ToggleBattleStyle, {"Shift", "Set"}.ToList(), 3)) + Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100 + 20, Delta_Y + 100), 2, 64, Localization.GetString("option_screen_battle_3dmodels", "3D Models"), CBool(ShowModels), AddressOf ToggleShowModels, {Localization.GetString("global_off", "Off"), Localization.GetString("global_on", "On")}.ToList(), 1)) + Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 400 + 20, Delta_Y + 100), 2, 64, Localization.GetString("option_screen_battle_animations", "Animations"), CBool(Me.ShowBattleAnimations), AddressOf ToggleAnimations, {Localization.GetString("global_off", "Off"), Localization.GetString("global_on", "On")}.ToList(), 2)) + Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100 + 20, Delta_Y + 200), 2, 64, Localization.GetString("option_screen_battle_battlestyle", "Battle Style"), CBool(Me.BattleStyle), AddressOf ToggleBattleStyle, {Localization.GetString("option_screen_battle_battlestyle_shift", "Shift"), Localization.GetString("option_screen_battle_battlestyle_set", "Set")}.ToList(), 3)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, "Back", AddressOf SwitchToMain, 4)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, Localization.GetString("global_back", "Back"), AddressOf SwitchToMain, 4)) Case 4 ' "Controls" from the Options menu. If PreScreen.Identification = Identifications.MainMenuScreen Then - Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100, Delta_Y + 100), 5, 64, "Xbox Gamepad", Me.GamePadEnabled, AddressOf ToggleXBOX360Controller, {"Disabled", "Enabled"}.ToList(), 1)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 100, Delta_Y + 200), 3, 64, "Reset Key Bindings", AddressOf ResetKeyBindings, 2)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, "Back", AddressOf ApplyControls, 3)) + Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100, Delta_Y + 100), 5, 64, Localization.GetString("option_screen_controls_xboxgamepad", "Xbox Gamepad"), Me.GamePadEnabled, AddressOf ToggleXBOX360Controller, {"Disabled", "Enabled"}.ToList(), 1)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 100, Delta_Y + 200), 3, 64, Localization.GetString("option_screen_controls_resetkeybindings", "Reset Key Bindings"), AddressOf ResetKeyBindings, 2)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 90 + 24, Delta_Y + 336), 1, 48, Localization.GetString("global_apply", "Apply"), AddressOf ControlsApply, 3)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, Localization.GetString("global_back", "Back"), AddressOf Close, 4)) Else Dim d As New Dictionary(Of Integer, String) - d.Add(1, "...Slow...") - d.Add(12, "Standard") - d.Add(38, "Super fast!") - d.Add(50, "SPEED OF LIGHT!") - Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 60), 400, "Camera Speed", Me.CameraSpeed, 1, 50, AddressOf ChangeCameraSpeed, d, 1)) - Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100, Delta_Y + 120), 5, 64, "Xbox Gamepad", Me.GamePadEnabled, AddressOf ToggleXBOX360Controller, {"Disabled", "Enabled"}.ToList(), 2)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 100, Delta_Y + 200), 3, 64, "Reset Key Bindings", AddressOf ResetKeyBindings, 3)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, "Back", AddressOf SwitchToMain, 4)) + d.Add(1, Localization.GetString("option_screen_controls_cameraspeed_slow", "...Slow...")) + d.Add(12, Localization.GetString("option_screen_controls_cameraspeed_medium", "Standard")) + d.Add(38, Localization.GetString("option_screen_controls_cameraspeed_fast", "Super fast!")) + d.Add(50, Localization.GetString("option_screen_controls_cameraspeed_fastest", "SPEED OF LIGHT!")) + Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 60), 400, Localization.GetString("option_screen_controls_cameraspeed", "Camera Speed"), Me.CameraSpeed, 1, 50, AddressOf ChangeCameraSpeed, d, 1)) + Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100, Delta_Y + 120), 5, 64, Localization.GetString("option_screen_controls_xboxgamepad", "Xbox Gamepad"), Me.GamePadEnabled, AddressOf ToggleXBOX360Controller, {"Disabled", "Enabled"}.ToList(), 2)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 100, Delta_Y + 200), 3, 64, Localization.GetString("option_screen_controls_resetkeybindings", "Reset Key Bindings"), AddressOf ResetKeyBindings, 3)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, Localization.GetString("global_back", "Back"), AddressOf SwitchToMain, 4)) End If Case 5 ' "Audio" from the Options menu. - Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 60), 400, "Music Volume", Me.Music, 0, 100, AddressOf ChangeMusicVolume, 1)) - Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 120), 400, "Sound Volume", Me.Sound, 0, 100, AddressOf ChangeSoundVolume, 2)) - Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100, Delta_Y + 200), 1, 64, "Muted", CBool(Me.Muted), AddressOf ToggleMute, {"No", "Yes"}.ToList(), 3)) + Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 60), 400, Localization.GetString("option_screen_audio_volume_music", "Music Volume"), Me.Music, 0, 100, AddressOf ChangeMusicVolume, 1)) + Me.ControlList.Add(New ScrollBar(New Vector2(Delta_X + 100, Delta_Y + 120), 400, Localization.GetString("option_screen_audio_volume_sfx", "SoundFX Volume"), Me.Sound, 0, 100, AddressOf ChangeSoundVolume, 2)) + Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100, Delta_Y + 200), 1, 64, Localization.GetString("option_screen_audio_muted", "Muted"), CBool(Me.Muted), AddressOf ToggleMute, {"No", "Yes"}.ToList(), 3)) If PreScreen.Identification = Identifications.MainMenuScreen Then - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, "Back", AddressOf AudioApply, 4)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 90 + 24, Delta_Y + 327), 1, 48, Localization.GetString("global_apply", "Apply"), AddressOf AudioApply, 4)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, Localization.GetString("global_back", "Back"), AddressOf Close, 5)) Else - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, "Back", AddressOf SwitchToMain, 4)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, Localization.GetString("global_back", "Back"), AddressOf SwitchToMain, 4)) End If Case 6 ' "Language" from the Options menu. - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 286 + 24, Delta_Y + 336), 1, 48, "Back", AddressOf LanguageApply, 1)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 90 + 24, Delta_Y + 336), 1, 48, Localization.GetString("global_apply", "Apply"), AddressOf LanguageApply, 1)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, Localization.GetString("global_back", "Back"), AddressOf Close, 2)) Case 7 ' "ContentPacks" from the Options menu. - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 604, Delta_Y + 64), 2, 48, Localization.GetString("pack_menu_up"), AddressOf ButtonUp, 1)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 604, Delta_Y + 120), 2, 48, Localization.GetString("pack_menu_down"), AddressOf ButtonDown, 2)) - Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 604, Delta_Y + 176), 2, 48, Localization.GetString("pack_menu_enabled"), isSelectedEnabled, AddressOf PackEnabledToggle, {Localization.GetString("global_no"), Localization.GetString("global_yes")}.ToList(), 3)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 604, Delta_Y + 232), 2, 48, Localization.GetString("pack_menu_information"), AddressOf SwitchToPackInformation, 4)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 604, Delta_Y + 64), 2, 48, Localization.GetString("option_screen_contentpacks_up"), AddressOf ButtonUp, 1)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 604, Delta_Y + 120), 2, 48, Localization.GetString("option_screen_contentpacks_down"), AddressOf ButtonDown, 2)) + Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 604, Delta_Y + 176), 2, 48, "", isSelectedEnabled, AddressOf PackEnabledToggle, {Localization.GetString("global_enable"), Localization.GetString("global_disable")}.ToList(), 3)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 604, Delta_Y + 232), 2, 48, Localization.GetString("option_screen_contentpacks_information"), AddressOf SwitchToPackInformation, 4)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 90 + 24, Delta_Y + 327), 1, 48, "Apply", AddressOf PacksApply, 5)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 310 + 24, Delta_Y + 327), 1, 48, "Back", AddressOf Close, 6)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 90 + 24, Delta_Y + 327), 1, 48, Localization.GetString("global_apply", "Apply"), AddressOf PacksApply, 5)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 310 + 24, Delta_Y + 327), 1, 48, Localization.GetString("global_back", "Back"), AddressOf Close, 6)) Case 8 ' "Information" from the ContentPacks menu. - Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 90 + 24, Delta_Y + 336), 2, 48, Localization.GetString("pack_menu_enabled"), isSelectedEnabled, AddressOf PackEnabledToggle, {Localization.GetString("global_no"), Localization.GetString("global_yes")}.ToList(), 1)) - Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 336), 1, 48, "Back", AddressOf SwitchToContentPacks, 2)) + Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 90 + 24, Delta_Y + 336), 2, 48, Localization.GetString("global_enabled"), isSelectedEnabled, AddressOf PackEnabledToggle, {Localization.GetString("global_no"), Localization.GetString("global_yes")}.ToList(), 1)) + Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 336), 1, 48, Localization.GetString("global_back", "Back"), AddressOf SwitchToContentPacks, 2)) End Select If ScreenIndex <> 7 Then - _cursorDestPosition = ControlList(0)._position + If ControlList(0).ControlType = "ScrollBar" Then + _cursorDestPosition = New Vector2(ControlList(0)._position.X + 332, ControlList(0)._position.Y) + Else + _cursorDestPosition = ControlList(0)._position + End If + Else - _cursorDestPosition = ControlList(4)._position + If ControlList(0).ControlType = "ScrollBar" Then + _cursorDestPosition = New Vector2(ControlList(4)._position.X + 332, ControlList(4)._position.Y) + Else + _cursorDestPosition = ControlList(4)._position + End If End If End Sub @@ -1028,10 +1047,15 @@ End Sub Private Sub Close() + If currentLanguage <> TempLanguage Then + Localization.Load(TempLanguage) + End If _closing = True End Sub - Private Sub ApplyControls() + Private Sub ControlsApply() Core.GameOptions.GamePadEnabled = Me.GamePadEnabled + Core.GameOptions.SaveOptions() + SoundManager.PlaySound("save") _closing = True End Sub @@ -1144,6 +1168,7 @@ GetLanguages() If Languages.Contains(currentLanguage) = True Then languageMenuIndex(0) = Languages.IndexOf(currentLanguage) + TempLanguage = currentLanguage End If languageMenuIndex(1) = 0 languageMenuIndex(2) = 0 @@ -1301,6 +1326,7 @@ MusicManager.Muted = CBool(Me.Muted) SoundManager.Muted = CBool(Me.Muted) Core.GameOptions.SaveOptions() + SoundManager.PlaySound("save") _closing = True End Sub @@ -1310,6 +1336,9 @@ If currentLanguage <> Languages(languageMenuIndex(0)) Then currentLanguage = Languages(languageMenuIndex(0)) End If + Localization.Load(currentLanguage) + Core.GameOptions.SaveOptions() + SoundManager.PlaySound("save") _closing = True End Sub #End Region @@ -1417,17 +1446,20 @@ Dim c As Color = New Color(255, 255, 255, CInt(255 * s._interfaceFade * s._pageFade)) Dim size As Integer = Me.Size - + Dim ToggleDivider As String = ": " + If Me.Text = "" Then + ToggleDivider = "" + End If Dim B As New Vector2 Dim t As String = Me.Text Dim textColor As New Color If Toggled Then - t &= ": " & Settings(1) + t &= ToggleDivider & Settings(1) B.X = 16 B.Y = 32 textColor = (New Color(255, 255, 255, CInt(255 * s._interfaceFade * s._pageFade))) Else - t &= ": " & Settings(0) + t &= ToggleDivider & Settings(0) B.X = 16 B.Y = 16 textColor = (New Color(0, 0, 0, CInt(255 * s._interfaceFade * s._pageFade))) @@ -1481,6 +1513,7 @@ Inherits Control Private _buttonWidth As Integer = 1 Private _text As String = "" + Private TextureY As Integer Public Property Position As Vector2 Get @@ -1526,6 +1559,7 @@ Me._text = Text Me.ID = ID Me.OnClickTrigger = ClickSub + TextureY = 16 End Sub @@ -1535,9 +1569,9 @@ Dim pos As Vector2 = Me.Position Dim c As Color = New Color(255, 255, 255, CInt(255 * s._interfaceFade * s._pageFade)) - Core.SpriteBatch.Draw(s._texture, New Rectangle(CInt(pos.X), CInt(pos.Y), Size, Size), New Rectangle(16, 16, 16, 16), c) - Core.SpriteBatch.Draw(s._texture, New Rectangle(CInt(pos.X) + Size, CInt(pos.Y), Size * ButtonWidth, Size), New Rectangle(32, 16, 16, 16), c) - Core.SpriteBatch.Draw(s._texture, New Rectangle(CInt(pos.X) + Size * (ButtonWidth + 1), CInt(pos.Y), Size, Size), New Rectangle(16, 16, 16, 16), c, 0.0F, Vector2.Zero, SpriteEffects.FlipHorizontally, 0.0F) + Core.SpriteBatch.Draw(s._menuTexture, New Rectangle(CInt(pos.X), CInt(pos.Y), Size, Size), New Rectangle(16, TextureY, 16, 16), c) + Core.SpriteBatch.Draw(s._menuTexture, New Rectangle(CInt(pos.X) + Size, CInt(pos.Y), Size * ButtonWidth, Size), New Rectangle(32, TextureY, 16, 16), c) + Core.SpriteBatch.Draw(s._menuTexture, New Rectangle(CInt(pos.X) + Size * (ButtonWidth + 1), CInt(pos.Y), Size, Size), New Rectangle(16, TextureY, 16, 16), c, 0.0F, Vector2.Zero, SpriteEffects.FlipHorizontally, 0.0F) Dim fontWidth As Integer = CInt(FontManager.MainFont.MeasureString(Text).X * 1.0) Core.SpriteBatch.DrawString(FontManager.MainFont, Text, New Vector2(CInt((pos.X + (Size * (2 + ButtonWidth) - fontWidth) * 0.5F)), CInt(pos.Y) + CInt(16 * Size / 64)), New Color(0, 0, 0, CInt(255 * s._interfaceFade * s._pageFade)), 0.0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0.0F) @@ -1545,20 +1579,38 @@ Public Overrides Sub Update(ByRef s As NewOptionScreen) Dim r As New Rectangle(CInt(_position.X), CInt(_position.Y), (2 + ButtonWidth) * Size, Size) + Dim Click As Boolean = False If s._pageClosing = False And s._pageOpening = False Then If r.Contains(MouseHandler.MousePosition) = True Then If P3D.Controls.Accept(True, False, False) = True Then SoundManager.PlaySound("select") + Click = True OnClickTrigger(Me) End If End If + If Click = True Then + TextureY = 32 + End If + If MouseHandler.ButtonUp(MouseHandler.MouseButtons.LeftButton) Then + TextureY = 16 + Click = False + End If - If Controls.Accept(False, True, True) Then + If Controls.Accept(False, True, True) = True Then If Position = s._cursorDestPosition Then SoundManager.PlaySound("select") OnClickTrigger(Me) End If End If + If KeyBoardHandler.KeyDown(KeyBindings.EnterKey1) = True Or KeyBoardHandler.KeyDown(KeyBindings.EnterKey2) = True Or ControllerHandler.ButtonDown(Buttons.A) = True Then + If Position = s._cursorDestPosition Then + TextureY = 32 + Else + TextureY = 16 + End If + End If + Else + Click = False End If End Sub End Class