added a comment

This commit is contained in:
2023-02-10 19:22:38 +01:00
parent eee3897b85
commit f3e4300332

View File

@@ -16,6 +16,9 @@ public partial class essential : Node
public override void _Process(double delta) public override void _Process(double delta)
{ {
//CHANGE INPUT FOR NINTENDO CONTROLLER //CHANGE INPUT FOR NINTENDO CONTROLLER
/*TODO: shouldnt hard change the controlls everytime and only switch
the current input methods when the controller changes to make
custom controlls possible*/
InputEventJoypadButton JoyButtonA = new InputEventJoypadButton() { ButtonIndex = JoyButton.A }; InputEventJoypadButton JoyButtonA = new InputEventJoypadButton() { ButtonIndex = JoyButton.A };
InputEventJoypadButton JoyButtonB = new InputEventJoypadButton() { ButtonIndex = JoyButton.B }; InputEventJoypadButton JoyButtonB = new InputEventJoypadButton() { ButtonIndex = JoyButton.B };
if (currentController.StartsWith("Nintendo")) if (currentController.StartsWith("Nintendo"))
@@ -24,7 +27,8 @@ public partial class essential : Node
InputMap.ActionEraseEvent("ui_cancel", JoyButtonB); InputMap.ActionEraseEvent("ui_cancel", JoyButtonB);
InputMap.ActionAddEvent("ui_accept", JoyButtonB); InputMap.ActionAddEvent("ui_accept", JoyButtonB);
InputMap.ActionAddEvent("ui_cancel", JoyButtonA); InputMap.ActionAddEvent("ui_cancel", JoyButtonA);
} else }
else
{ {
InputMap.ActionEraseEvent("ui_accept", JoyButtonB); InputMap.ActionEraseEvent("ui_accept", JoyButtonB);
InputMap.ActionEraseEvent("ui_cancel", JoyButtonA); InputMap.ActionEraseEvent("ui_cancel", JoyButtonA);
@@ -36,8 +40,8 @@ public partial class essential : Node
if (Input.IsActionJustPressed("hotkey_fullscreen")) if (Input.IsActionJustPressed("hotkey_fullscreen"))
{ {
if (DisplayServer.WindowGetMode() == DisplayServer.WindowMode.Fullscreen) if (DisplayServer.WindowGetMode() == DisplayServer.WindowMode.Fullscreen)
DisplayServer.WindowSetMode(DisplayServer.WindowMode.Windowed); DisplayServer.WindowSetMode(DisplayServer.WindowMode.Windowed);
else DisplayServer.WindowSetMode(DisplayServer.WindowMode.Fullscreen); else DisplayServer.WindowSetMode(DisplayServer.WindowMode.Fullscreen);
} }
} }
} }