Gamepad Control tokens + Remap some Buttons

Y button doesn't work so sometimes Y and X get swapped and the one that would be Y gets mapped to Select
This commit is contained in:
JappaWakka 2025-02-15 15:49:06 +01:00
parent 1fd932d43f
commit 742c43ac4d
9 changed files with 31 additions and 31 deletions

View File

@ -60,11 +60,11 @@
If GamePad.GetState(PlayerIndex.One).IsConnected = True And Core.GameOptions.GamePadEnabled = True And BV2Screen.IsCurrentScreen() = True Then If GamePad.GetState(PlayerIndex.One).IsConnected = True And Core.GameOptions.GamePadEnabled = True And BV2Screen.IsCurrentScreen() = True Then
Dim d As New Dictionary(Of Buttons, String) Dim d As New Dictionary(Of Buttons, String)
d.Add(Buttons.A, "OK") d.Add(Buttons.A, Localization.GetString("global_ok", "OK"))
BV2Screen.DrawGamePadControls(d, New Vector2(rec.X + rec.Width - 100, rec.Y + rec.Height - 40)) BV2Screen.DrawGamePadControls(d, New Vector2(rec.X + rec.Width - 100, rec.Y + rec.Height - 40))
Else Else
If TextReady = True Then If TextReady = True Then
Core.SpriteBatch.DrawString(FontManager.InGameFont, "OK", New Vector2(rec.X + rec.Width - FontManager.InGameFont.MeasureString("OK").X - 20, rec.Y + rec.Height - FontManager.InGameFont.MeasureString("OK").Y - 5), Color.White) Core.SpriteBatch.DrawString(FontManager.InGameFont, Localization.GetString("global_ok", "OK"), New Vector2(rec.X + rec.Width - FontManager.InGameFont.MeasureString(Localization.GetString("global_ok", "OK")).X - 20, rec.Y + rec.Height - FontManager.InGameFont.MeasureString(Localization.GetString("global_ok", "OK")).Y - 5), Color.White)
End If End If
End If End If
End Sub End Sub

View File

@ -80,11 +80,11 @@
If GamePad.GetState(PlayerIndex.One).IsConnected = True And Core.GameOptions.GamePadEnabled = True And BV2Screen.IsCurrentScreen() = True Then If GamePad.GetState(PlayerIndex.One).IsConnected = True And Core.GameOptions.GamePadEnabled = True And BV2Screen.IsCurrentScreen() = True Then
Dim d As New Dictionary(Of Buttons, String) Dim d As New Dictionary(Of Buttons, String)
d.Add(Buttons.A, "OK") d.Add(Buttons.A, Localization.GetString("global_ok", "OK"))
BV2Screen.DrawGamePadControls(d, New Vector2(rec.X + rec.Width - 100, rec.Y + rec.Height - 40)) BV2Screen.DrawGamePadControls(d, New Vector2(rec.X + rec.Width - 100, rec.Y + rec.Height - 40))
Else Else
If TextReady = True Then If TextReady = True Then
Core.SpriteBatch.DrawString(FontManager.TextFont, "OK", New Vector2(rec.X + rec.Width - (FontManager.TextFont.MeasureString("OK").X * 2.0F) - 20, rec.Y + rec.Height - (FontManager.TextFont.MeasureString("OK").Y * 2.0F) - 5), Color.White, 0.0F, Vector2.Zero, 2.0F, SpriteEffects.None, 0.0F) Core.SpriteBatch.DrawString(FontManager.TextFont, Localization.GetString("global_ok", "OK"), New Vector2(rec.X + rec.Width - (FontManager.TextFont.MeasureString(Localization.GetString("global_ok", "OK")).X * 2.0F) - 20, rec.Y + rec.Height - (FontManager.TextFont.MeasureString(Localization.GetString("global_ok", "OK")).Y * 2.0F) - 5), Color.White, 0.0F, Vector2.Zero, 2.0F, SpriteEffects.None, 0.0F)
End If End If
End If End If
End Sub End Sub

View File

@ -89,11 +89,11 @@ Public Class ChatScreen
Me.UpdateTabCompletion() Me.UpdateTabCompletion()
End If End If
If ControllerHandler.ButtonPressed(Buttons.X) = True Then If ControllerHandler.ButtonPressed(Buttons.Back) = True Then
Me.currentText = "" Me.currentText = ""
End If End If
If ControllerHandler.ButtonPressed(Buttons.Y) = True Then If ControllerHandler.ButtonPressed(Buttons.X) = True Then
Dim t As String = Me.currentText Dim t As String = Me.currentText
While t.Length > 38 While t.Length > 38
t = t.Remove(t.Length - 1, 1) t = t.Remove(t.Length - 1, 1)
@ -640,10 +640,10 @@ Public Class ChatScreen
End If End If
Dim d As New Dictionary(Of Buttons, String) Dim d As New Dictionary(Of Buttons, String)
d.Add(Input.Buttons.A, "Enter") d.Add(Input.Buttons.A, Localization.GetString("game_interaction_enter", "Enter"))
d.Add(Input.Buttons.B, "Back") d.Add(Input.Buttons.B, Localization.GetString("game_interaction_back", "Back"))
d.Add(Input.Buttons.Y, "Edit") d.Add(Input.Buttons.X, Localization.GetString("game_interaction_edit", "Edit"))
d.Add(Input.Buttons.X, "Clear") d.Add(Input.Buttons.Back, Localization.GetString("game_interaction_clear", "Clear"))
Me.DrawGamePadControls(d) Me.DrawGamePadControls(d)
End Sub End Sub

View File

@ -128,7 +128,7 @@
If Me.IsGameOver = True Or Me.ready = True Then If Me.IsGameOver = True Or Me.ready = True Then
Dim d As New Dictionary(Of Buttons, String) Dim d As New Dictionary(Of Buttons, String)
d.Add(Buttons.A, "Accept") d.Add(Buttons.A, Localization.GetString("game_interaction_accept", "Accept"))
DrawGamePadControls(d) DrawGamePadControls(d)
End If End If
End Sub End Sub

View File

@ -180,10 +180,10 @@
Core.SpriteBatch.DrawString(FontManager.MainFont, "Chars left: " & (MaxChars - Me.CurrentText.Length).ToString(), New Vector2(CInt((Core.windowSize.Width / 2) + 180), 477), Color.Gray) Core.SpriteBatch.DrawString(FontManager.MainFont, "Chars left: " & (MaxChars - Me.CurrentText.Length).ToString(), New Vector2(CInt((Core.windowSize.Width / 2) + 180), 477), Color.Gray)
Dim d As New Dictionary(Of Buttons, String) Dim d As New Dictionary(Of Buttons, String)
d.Add(Input.Buttons.A, "Enter") d.Add(Input.Buttons.A, Localization.GetString("game_interaction_enter", "Enter"))
d.Add(Input.Buttons.B, "Delete") d.Add(Input.Buttons.B, Localization.GetString("game_interaction_delete", "Delete"))
d.Add(Input.Buttons.Y, "Confirm") d.Add(Input.Buttons.X, Localization.GetString("game_interaction_confirm", "Confirm"))
d.Add(Input.Buttons.X, "Clear") d.Add(Input.Buttons.Back, Localization.GetString("game_interaction_clear", "Clear"))
Me.DrawGamePadControls(d) Me.DrawGamePadControls(d)
End Sub End Sub
@ -247,11 +247,11 @@
End If End If
End If End If
If ControllerHandler.ButtonPressed(Input.Buttons.X) = True Then If ControllerHandler.ButtonPressed(Input.Buttons.Back) = True Then
Me.CurrentText = "" Me.CurrentText = ""
End If End If
If ControllerHandler.ButtonPressed(Input.Buttons.Y) = True Then If ControllerHandler.ButtonPressed(Input.Buttons.X) = True Then
If Me.ButtonSelector = New Vector2(6, 4) Then If Me.ButtonSelector = New Vector2(6, 4) Then
Me.Confirm() Me.Confirm()
Else Else

View File

@ -121,10 +121,10 @@
End If End If
Dim d As New Dictionary(Of Buttons, String) Dim d As New Dictionary(Of Buttons, String)
d.Add(Input.Buttons.A, "Accept") d.Add(Input.Buttons.A, Localization.GetString("game_interaction_accept", "Accept"))
d.Add(Input.Buttons.B, "Back") d.Add(Input.Buttons.B, Localization.GetString("game_interaction_back", "Back"))
d.Add(Input.Buttons.Y, "Edit") d.Add(Input.Buttons.X, Localization.GetString("game_interaction_edit", "Edit"))
d.Add(Input.Buttons.X, "Clear") d.Add(Input.Buttons.Back, Localization.GetString("game_interaction_clear", "Clear"))
Me.DrawGamePadControls(d) Me.DrawGamePadControls(d)
End Sub End Sub
@ -182,18 +182,18 @@
Select Case Index Select Case Index
Case 0 Case 0
KeyBindings.GetInput(Me.IdentifyName, 30, True, True) KeyBindings.GetInput(Me.IdentifyName, 30, True, True)
If ControllerHandler.ButtonPressed(Buttons.Y) = True Then If ControllerHandler.ButtonPressed(Buttons.X) = True Then
Core.SetScreen(New InputScreen(Me, "Pokemon3D server", InputScreen.InputModes.Text, Me.IdentifyName, 30, New List(Of Texture2D), AddressOf Me.AcceptName)) Core.SetScreen(New InputScreen(Me, "Pokemon3D server", InputScreen.InputModes.Text, Me.IdentifyName, 30, New List(Of Texture2D), AddressOf Me.AcceptName))
End If End If
If ControllerHandler.ButtonPressed(Buttons.X) = True Then If ControllerHandler.ButtonPressed(Buttons.Back) = True Then
Me.IdentifyName = "" Me.IdentifyName = ""
End If End If
Case 1 Case 1
KeyBindings.GetInput(Me.Address, 30, True, True) KeyBindings.GetInput(Me.Address, 30, True, True)
If ControllerHandler.ButtonPressed(Buttons.Y) = True Then If ControllerHandler.ButtonPressed(Buttons.X) = True Then
Core.SetScreen(New InputScreen(Me, "127.0.0.1", InputScreen.InputModes.Text, Me.Address, 30, New List(Of Texture2D), AddressOf Me.AcceptAddress)) Core.SetScreen(New InputScreen(Me, "127.0.0.1", InputScreen.InputModes.Text, Me.Address, 30, New List(Of Texture2D), AddressOf Me.AcceptAddress))
End If End If
If ControllerHandler.ButtonPressed(Buttons.X) = True Then If ControllerHandler.ButtonPressed(Buttons.Back) = True Then
Me.Address = "" Me.Address = ""
End If End If
End Select End Select

View File

@ -30,8 +30,8 @@
Core.SpriteBatch.DrawString(FontManager.MainFont, t, New Vector2(CSng(Core.windowSize.Width / 2 - 310) + 50, 240), Color.White) Core.SpriteBatch.DrawString(FontManager.MainFont, t, New Vector2(CSng(Core.windowSize.Width / 2 - 310) + 50, 240), Color.White)
Dim d As New Dictionary(Of Buttons, String) Dim d As New Dictionary(Of Buttons, String)
d.Add(Buttons.A, "Accept") d.Add(Buttons.A, Localization.GetString("game_interaction_accept", "Accept"))
d.Add(Buttons.B, "Dismiss") d.Add(Buttons.B, Localization.GetString("game_interaction_dismiss", "Dismiss"))
DrawGamePadControls(d, New Vector2(CSng(Core.windowSize.Width / 2) - 140, 420)) DrawGamePadControls(d, New Vector2(CSng(Core.windowSize.Width / 2) - 140, 420))
End Sub End Sub

View File

@ -72,8 +72,8 @@
End If End If
Dim d As New Dictionary(Of Buttons, String) Dim d As New Dictionary(Of Buttons, String)
d.Add(Buttons.A, "Accept") d.Add(Buttons.A, Localization.GetString("game_interaction_accept", "Accept"))
d.Add(Buttons.B, "Go back") d.Add(Buttons.B, Localization.GetString("game_interaction_go_back", "Go Back"))
DrawGamePadControls(d) DrawGamePadControls(d)
End Sub End Sub

View File

@ -141,8 +141,8 @@
End If End If
Dim d As New Dictionary(Of Buttons, String) Dim d As New Dictionary(Of Buttons, String)
d.Add(Buttons.A, "Learn") d.Add(Buttons.A, Localization.GetString("game_interaction_learn", "Learn"))
d.Add(Buttons.B, "Close") d.Add(Buttons.B, Localization.GetString("game_interaction_close", "Close"))
DrawGamePadControls(d) DrawGamePadControls(d)
End Sub End Sub