Browse Source

Replace `ButtonList` enum with `MouseButton` (#6334)

Replace `ButtonList` enum with `MouseButton`

Switched `ButtonList` enum to `MouseButton` since `MouseButton` is defined in `InputEventMouse`, while `ButtonList` was undefined in `Godot` namespace.
Rudi 2 years ago
parent
commit
f51c77dd7f
1 changed files with 4 additions and 4 deletions
  1. 4 4
      tutorials/inputs/input_examples.rst

+ 4 - 4
tutorials/inputs/input_examples.rst

@@ -296,12 +296,12 @@ also counts as a button - two buttons, to be precise, with both
     {
     {
         if (inputEvent is InputEventMouseButton mouseEvent && mouseEvent.Pressed)
         if (inputEvent is InputEventMouseButton mouseEvent && mouseEvent.Pressed)
         {
         {
-            switch ((ButtonList)mouseEvent.ButtonIndex)
+            switch (mouseEvent.ButtonIndex)
             {
             {
-                case ButtonList.Left:
-                    GD.Print("Left button was clicked at ", {mouseEvent.Position});
+                case MouseButton.Left:
+                    GD.Print($"Left button was clicked at {mouseEvent.Position}");
                     break;
                     break;
-                case ButtonList.WheelUp:
+                case MouseButton.WheelUp:
                     GD.Print("Wheel up");
                     GD.Print("Wheel up");
                     break;
                     break;
             }
             }