Fixed Some Bugs

* Skin genders in the new game intro now grab the correct localization string
* Badges rotate around the center of their texture's width and height, which fixes the bug where the badges would rotate off-center when the texture resolution was different.
* The selected button background color in the GameMode selection screen is now light and the unselected buttons are dark instead of the other way around.
This commit is contained in:
JappaWakka 2022-02-14 19:28:21 +01:00
parent e162f84e78
commit bbfc4acdd8
7 changed files with 12 additions and 14 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 B

After

Width:  |  Height:  |  Size: 723 B

View File

@ -34,7 +34,9 @@
If GameModeManager.GameModeCount > 0 Then
Dim GameModeLocalizationPath As String = GameModeManager.ActiveGameMode.LocalizationsPath
LoadTokenFile(GameModeLocalizationPath, True)
If GameModeLocalizationPath <> GameMode.DefaultLocalizationsPath Then
LoadTokenFile(GameModeLocalizationPath, True)
End If
End If
Logger.Debug("---Reloaded GameMode Tokens---")

View File

@ -12,7 +12,7 @@
Select Case Line.CountSplits("|")
Case 2 'ResolutionChange
Dim TextureName As String = Line.GetSplit(0, "|")
Dim Resolution As Single = CInt(Line.GetSplit(1, "|"))
Dim Resolution As Single = CSng(Line.GetSplit(1, "|").Replace(".", GameController.DecSeparator))
If TextureResolutions.ContainsKey(TextureName) = False Then
TextureResolutions.Add(TextureName, Resolution)

View File

@ -317,7 +317,7 @@
Next
SpriteBatch.DrawString(FontManager.MainFont, _names(_index), New Vector2(CInt(windowSize.Width / 2.0F - FontManager.MainFont.MeasureString(_names(_index)).X), CInt(windowSize.Height / 2.0F + 200)), New Color(255, 255, 255, CInt(255 * _fadeIn)), 0F, Vector2.Zero, 2.0F, SpriteEffects.None, 0F)
SpriteBatch.DrawString(FontManager.MainFont, Localization.GetString("global_" & _genders(_index), _genders(_index)), New Vector2(CInt(windowSize.Width / 2.0F - FontManager.MainFont.MeasureString(Localization.GetString("global_" & _genders(_index), _genders(_index))).X / 2.0F), CInt(windowSize.Height / 2.0F + 300)), New Color(255, 255, 255, CInt(255 * _fadeIn)), 0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0F)
SpriteBatch.DrawString(FontManager.MainFont, Localization.GetString("global_" & _genders(_index).ToLower(), _genders(_index)), New Vector2(CInt(windowSize.Width / 2.0F - FontManager.MainFont.MeasureString(Localization.GetString("global_" & _genders(_index).ToLower(), _genders(_index))).X / 2.0F), CInt(windowSize.Height / 2.0F + 300)), New Color(255, 255, 255, CInt(255 * _fadeIn)), 0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0F)
End Sub
End Class

View File

@ -1518,7 +1518,7 @@ Public Class GameModeSelectionScreen
Dim halfWidth = CInt(WIDTH / 2)
Dim ButtonColor = New Rectangle(0, 0, 16, 16)
Dim ButtonAccent = Screens.UI.ColorProvider.AccentColor(False, CInt(255))
If i = _index Then
If i <> _index Then
ButtonColor = New Rectangle(40, 48, 16, 16)
ButtonAccent = New Color(84, 198, 216)
End If
@ -1534,8 +1534,8 @@ Public Class GameModeSelectionScreen
Dim textSize = FontManager.InGameFont.MeasureString(displayText)
GetFontRenderer().DrawString(FontManager.InGameFont, displayText, New Vector2(center - halfWidth + 50 + 2, CType(ButtonY + HEIGHT / 2 - (textSize.Y / 2) + 2, Integer)), Color.Black, 0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0F)
GetFontRenderer().DrawString(FontManager.InGameFont, displayText, New Vector2(center - halfWidth + 50, CType(ButtonY + HEIGHT / 2 - (textSize.Y / 2), Integer)), Color.White, 0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0F)
GetFontRenderer().DrawString(FontManager.InGameFont, displayText, New Vector2(center - halfWidth + 32 + 2, CType(ButtonY + HEIGHT / 2 - (textSize.Y / 2) + 2, Integer)), Color.Black, 0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0F)
GetFontRenderer().DrawString(FontManager.InGameFont, displayText, New Vector2(center - halfWidth + 32, CType(ButtonY + HEIGHT / 2 - (textSize.Y / 2), Integer)), Color.White, 0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0F)
Next
'Draw GameMode description box
@ -1562,7 +1562,7 @@ Public Class GameModeSelectionScreen
For x = 0 To displayWidth
For y = 0 To displayHeight
SpriteBatch.Draw(_menuTexture, New Rectangle(CInt(x * 16 + displayRect.X), CInt(y * 16) + displayRect.Y - 8, 16, 16), New Rectangle(40, 48, 16, 16), Color.White)
SpriteBatch.Draw(_menuTexture, New Rectangle(CInt(x * 16 + displayRect.X), CInt(y * 16) + displayRect.Y - 8, 16, 16), New Rectangle(0, 0, 16, 16), Color.White)
Next
Next
Canvas.DrawRectangle(New Rectangle(displayRect.X, displayRect.Y - 8, displayWidth * 16 + 16, 3), New Color(84, 198, 216))

View File

@ -50,8 +50,6 @@
BattleSystem.GameModeAttackLoader.Load()
Localization.ReloadGameModeTokens()
If GameModeManager.ActiveGameMode.IsDefaultGamemode = False Then
'MusicManager.LoadMusic(True)
'SoundManager.LoadSounds(True)
@ -241,10 +239,8 @@
Core.SpriteBatch.DrawString(FontManager.MainFont, Localization.GetString("new_game_name_too_short"), New Vector2(TextboxPosition.X, TextboxPosition.Y + 48), Color.DarkRed)
End If
Case 4
Canvas.DrawRectangle(New Rectangle(CInt(TextboxPosition.X - 5), CInt(TextboxPosition.Y - 24), 138, 42), New Color(0, 0, 0, 80))
Core.SpriteBatch.DrawString(FontManager.MainFont, Localization.GetString("new_game_choose_skin") & ":" & Environment.NewLine & skinNames(SkinIndex) & Environment.NewLine & skinGenders(SkinIndex), New Vector2(TextboxPosition.X + 2, TextboxPosition.Y - 24 + 2), Color.White)
Core.SpriteBatch.DrawString(FontManager.MainFont, Localization.GetString("new_game_choose_skin") & ":" & Environment.NewLine & skinNames(SkinIndex) & Environment.NewLine & skinGenders(SkinIndex), New Vector2(TextboxPosition.X, TextboxPosition.Y - 24), Color.White)
Core.SpriteBatch.DrawString(FontManager.MainFont, Localization.GetString("new_game_select_skin") & ":" & Environment.NewLine & skinNames(SkinIndex) & Environment.NewLine & Localization.GetString("global_" & skinGenders(SkinIndex).ToLower(), skinGenders(SkinIndex)), New Vector2(TextboxPosition.X + 2, TextboxPosition.Y - 24 + 2), Color.Black)
Core.SpriteBatch.DrawString(FontManager.MainFont, Localization.GetString("new_game_select_skin") & ":" & Environment.NewLine & skinNames(SkinIndex) & Environment.NewLine & Localization.GetString("global_" & skinGenders(SkinIndex).ToLower(), skinGenders(SkinIndex)), New Vector2(TextboxPosition.X, TextboxPosition.Y - 24), Color.White)
Canvas.DrawScrollBar(New Vector2(TextboxPosition.X, TextboxPosition.Y + 48), skinFiles.Count, 1, SkinIndex, New Size(128, 4), True, TextureManager.GetTexture(TextureManager.GetTexture("GUI\Menus\Menu"), New Rectangle(112, 12, 1, 1)), TextureManager.GetTexture(TextureManager.GetTexture("GUI\Menus\Menu"), New Rectangle(113, 12, 1, 1)))
End Select

View File

@ -178,7 +178,7 @@
badgeName = t
shake = _badgeAnimation._shakeV
End If
_spriteBatch.Draw(Badge.GetBadgeTexture(badgeID), New Rectangle(16 + (i + 1) * 64, 412, 50, 50), Nothing, c, shake, New Vector2(25, 25), SpriteEffects.None, 0F)
_spriteBatch.Draw(Badge.GetBadgeTexture(badgeID), New Rectangle(16 + (i + 1) * 64, 412, 50, 50), Nothing, c, shake, New Vector2(CInt(Badge.GetBadgeTexture(badgeID).Width / 2), CInt(Badge.GetBadgeTexture(badgeID).Height / 2)), SpriteEffects.None, 0F)
Next
_textBatch.DrawString(FontManager.MiniFont, badgeName, New Vector2(555 - FontManager.MiniFont.MeasureString(badgeName).X.ToInteger(), 360), Color.Black)