Fix incorrect character list in rename screen
Also added space and a failsafe for if the name ends with a space
This commit is contained in:
parent
b27136d6bf
commit
72d653f65f
|
@ -8,6 +8,7 @@
|
||||||
Text = 0
|
Text = 0
|
||||||
Numbers = 1
|
Numbers = 1
|
||||||
Name = 2
|
Name = 2
|
||||||
|
Pokemon = 3
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
Dim DefaultName As String = ""
|
Dim DefaultName As String = ""
|
||||||
|
@ -63,7 +64,7 @@
|
||||||
Select Case Me.InputMode
|
Select Case Me.InputMode
|
||||||
Case InputModes.Text
|
Case InputModes.Text
|
||||||
Me.InitializeText()
|
Me.InitializeText()
|
||||||
Case InputModes.Name
|
Case InputModes.Name, InputModes.Pokemon
|
||||||
Me.InitializeName()
|
Me.InitializeName()
|
||||||
Case InputModes.Numbers
|
Case InputModes.Numbers
|
||||||
Me.InitializeNumbers()
|
Me.InitializeNumbers()
|
||||||
|
@ -101,7 +102,13 @@
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub InitializeName()
|
Private Sub InitializeName()
|
||||||
Dim chars() As String = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", " ", " ", " ", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", " ", "'", "-", "u", "v", "w", "x", "y", "z", " ", " ", " ", " ", "!", "?", "_"}
|
Dim chars() As String
|
||||||
|
If InputMode = InputModes.Name Then
|
||||||
|
chars = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", " ", ".", ",", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", " ", "'", "-", "u", "v", "w", "x", "y", "z", " ", " ", " ", " ", "!", "?", "_"}
|
||||||
|
Else
|
||||||
|
chars = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", " ", " ", " ", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", " ", " ", " ", "u", "v", "w", "x", "y", "z", " ", " ", " ", " ", " ", " ", " "}
|
||||||
|
End If
|
||||||
|
|
||||||
Dim x As Integer = 0
|
Dim x As Integer = 0
|
||||||
Dim y As Integer = 0
|
Dim y As Integer = 0
|
||||||
|
|
||||||
|
|
|
@ -243,9 +243,17 @@ Public Class NameObjectScreen
|
||||||
If _currentText <> "" Then
|
If _currentText <> "" Then
|
||||||
If _renamePokemon = True Then
|
If _renamePokemon = True Then
|
||||||
If _pokemon.GetName() <> _currentText Then
|
If _pokemon.GetName() <> _currentText Then
|
||||||
|
' Remove spaces at the end
|
||||||
|
While _currentText.EndsWith(" ")
|
||||||
|
_currentText = _currentText.Remove(_currentText.Length - 1, 1)
|
||||||
|
End While
|
||||||
_pokemon.NickName = _currentText
|
_pokemon.NickName = _currentText
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
' Remove spaces at the end
|
||||||
|
While _currentText.EndsWith(" ")
|
||||||
|
_currentText = _currentText.Remove(_currentText.Length - 1, 1)
|
||||||
|
End While
|
||||||
Me._acceptName(_currentText)
|
Me._acceptName(_currentText)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
@ -255,9 +263,13 @@ Public Class NameObjectScreen
|
||||||
Else
|
Else
|
||||||
Me._askedRename = True
|
Me._askedRename = True
|
||||||
If ControllerHandler.IsConnected() = True Then
|
If ControllerHandler.IsConnected() = True Then
|
||||||
|
If _pokemon IsNot Nothing Then
|
||||||
|
Core.SetScreen(New InputScreen(Me, Me._defaultName, InputScreen.InputModes.Pokemon, Me._defaultName, 14, New List(Of Texture2D), AddressOf Me.GetControllerInput))
|
||||||
|
Else
|
||||||
Core.SetScreen(New InputScreen(Me, Me._defaultName, InputScreen.InputModes.Name, Me._defaultName, 14, New List(Of Texture2D), AddressOf Me.GetControllerInput))
|
Core.SetScreen(New InputScreen(Me, Me._defaultName, InputScreen.InputModes.Name, Me._defaultName, 14, New List(Of Texture2D), AddressOf Me.GetControllerInput))
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ClickNo()
|
Private Sub ClickNo()
|
||||||
|
@ -270,7 +282,7 @@ Public Class NameObjectScreen
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub GetControllerInput(ByVal input As String)
|
Public Sub GetControllerInput(ByVal input As String)
|
||||||
Me._currentText = input
|
Me._currentText = ReplaceInvalidChars(input)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
Loading…
Reference in New Issue