Quellcode durchsuchen

refactor debugState props

lairaalmas vor 1 Jahr
Ursprung
Commit
8f9258d467

+ 0 - 1
src/js/games/circleOne.js

@@ -430,7 +430,6 @@ const circleOne = {
       // Restart if
       // Does not have at least one fraction of type 1/difficulty
       if (!hasBaseDifficulty) {
-        alert('restart no base difficulty');
         restart = true;
       }
 

+ 7 - 7
src/js/globals/globals_debug.js

@@ -1,17 +1,17 @@
 const isDebugMode = true;
 
 const debugState = {
-  lang: { status: true, lang: 'pt_BR' },
-  name: { status: true, name: 'Username' },
-  menu: { status: true, id: 1 },
+  lang: { skip: true, lang: 'pt_BR' },
+  name: { skip: true, name: 'Username' },
+  menu: { skip: true, id: 1 },
   customMenu: {
-    status: true,
+    skip: true,
     getData: () => {
-      return { mode: 'b', operation: 'plus', difficulty: 2, label: true };
+      return { mode: 'b', operation: 'minus', difficulty: 2, label: true };
     },
   },
-  map: { status: false },
-  end: { status: false, stop: false },
+  map: { skip: true },
+  end: { skip: false, stop: false },
 };
 
 const debugFunctions = {

+ 1 - 1
src/js/menus/menu_custom.js

@@ -71,7 +71,7 @@ const customMenuState = {
       game.event.add('click', this.onInputDown);
       game.event.add('mousemove', this.onInputOver);
 
-      if (isDebugMode && debugState.customMenu.status) {
+      if (isDebugMode && debugState.customMenu.skip) {
         // programmatically customize a game
         const { mode, operation, difficulty, label } =
           debugState.customMenu.getData();

+ 1 - 1
src/js/menus/menu_main.js

@@ -90,7 +90,7 @@ const menuState = {
       game.event.add('click', this.onInputDown);
       game.event.add('mousemove', this.onInputOver);
 
-      if (isDebugMode && debugState.menu.status) {
+      if (isDebugMode && debugState.menu.skip) {
         // programmatically select a game
         const id = debugState.menu.id;
         gameId = id;

+ 1 - 1
src/js/menus/preMenu_lang.js

@@ -53,7 +53,7 @@ const langState = {
     game.event.add('click', this.onInputDown);
     game.event.add('mousemove', this.onInputOver);
 
-    if (isDebugMode && debugState.lang.status) {
+    if (isDebugMode && debugState.lang.skip) {
       // programmatically select a language
       this.setLang(debugState.lang.lang || 'pt_BR');
     }

+ 1 - 1
src/js/menus/preMenu_name.js

@@ -66,7 +66,7 @@ const nameState = {
     game.event.add('click', this.onInputDown);
     game.event.add('mousemove', this.onInputOver);
 
-    if (isDebugMode && debugState.name.status) {
+    if (isDebugMode && debugState.name.skip) {
       // programmatically select a user name
       document.querySelector('.ifr-input').value =
         debugState.name.name || 'My User Name';

+ 1 - 1
src/js/screens/end.js

@@ -116,7 +116,7 @@ const endState = {
    * Game loop
    */
   update: function () {
-    if (isDebugMode && debugState.end.status) {
+    if (isDebugMode && debugState.end.skip) {
       if (debugState.end.stop) {
         self.animate = false;
       }

+ 2 - 2
src/js/screens/map.js

@@ -194,11 +194,11 @@ const mapState = {
   update: function () {
     self.moveCounter++;
 
-    if (isDebugMode && debugState.end.status) {
+    if (isDebugMode && debugState.end.skip) {
       curMapPosition = 4;
     }
 
-    if (isDebugMode && debugState.map.status) {
+    if (isDebugMode && debugState.map.skip) {
       // programmatically skip map
       curMapPosition++;
       self.loadGame();