Browse code

avoid moving invisible cursor

devnewton authored on 09/03/2018 17:01:28
Showing 1 changed files
... ...
@@ -66,8 +66,11 @@ export class MenuCursor extends Phaser.Text {
66 66
 
67 67
     moveToButton(direction: number) {
68 68
         if (this.parent.visible && this.buttons.children.length > 0) {
69
-            this.visible = true;
70
-            this.currentButton += direction;
69
+            if (!this.visible) {
70
+                this.visible = true;
71
+            } else {
72
+                this.currentButton += direction;
73
+            }
71 74
             if (this.currentButton >= this.buttons.length) {
72 75
                 this.currentButton = 0;
73 76
             }