Make attack descriptions localizable

This commit is contained in:
JappaWakka 2023-09-22 12:23:04 +02:00
parent 25bda8826a
commit 6bb8d2107f
2 changed files with 16 additions and 1 deletions

View File

@ -163,6 +163,18 @@
Me._name = value
End Set
End Property
Public Property Description() As String
Get
If Localization.TokenExists("move_desc_" & Me.ID.ToString) = True Then
Return Localization.GetString("move_desc_" & Me.ID.ToString)
Else
Return Me._description
End If
End Get
Set(value As String)
Me._description = value
End Set
End Property
Private _ID As Integer = 1
Public OriginalID As Integer = 1 'Original MoveID, remove when not needed anymore. This stores the original move ID when the move isn't programmed yet.
@ -179,7 +191,7 @@
Public OriginalPP As Integer = 35
Public Category As Categories = Categories.Physical
Public ContestCategory As ContestCategories = ContestCategories.Tough
Public Description As String = "Pounds with forelegs or tail."
Public _description As String = "Pounds with forelegs or tail."
Public CriticalChance As Integer = 1
Public IsHMMove As Boolean = False
Public Target As Targets = Targets.OneAdjacentTarget

View File

@ -195,6 +195,9 @@
If move.ID >= 1000 Then
Dim testMove As Attack = Attack.GetAttackByID(move.ID)
If testMove.IsDefaultMove = True Then
If Localization.TokenExists("move_name_" & move.ID.ToString) = True Then
move.Name = Localization.GetString("move_name_" & move.ID.ToString)
End If
LoadedMoves.Add(move) 'Add the move.
Else
Logger.Log(Logger.LogTypes.ErrorMessage, "GameModeAttackLoader.vb: User defined moves are not allowed to have an ID of an already existing move or an ID below 1000. The ID for the move loaded from """ & file & """ has the ID " & move.ID.ToString() & ", which is the ID of an already existing move (" & testMove.Name & ").")