Browse Source

Games in Info menu, if enabled

Scott Lahteine 6 years ago
parent
commit
9131b11944
2 changed files with 24 additions and 14 deletions
  1. 19
    0
      Marlin/src/lcd/menu/menu_info.cpp
  2. 5
    14
      Marlin/src/lcd/menu/menu_main.cpp

+ 19
- 0
Marlin/src/lcd/menu/menu_info.cpp View File

@@ -28,6 +28,10 @@
28 28
 
29 29
 #if HAS_LCD_MENU && ENABLED(LCD_INFO_MENU)
30 30
 
31
+#if HAS_GAMES
32
+  #include "game/game.h"
33
+#endif
34
+
31 35
 #include "menu.h"
32 36
 // #include "../../module/motion.h"
33 37
 // #include "../../module/planner.h"
@@ -220,6 +224,21 @@ void menu_info() {
220 224
   #if ENABLED(PRINTCOUNTER)
221 225
     MENU_ITEM(submenu, MSG_INFO_STATS_MENU, menu_info_stats);          // Printer Stats >
222 226
   #endif
227
+  #if HAS_GAMES
228
+    MENU_ITEM(submenu, "Game", (
229
+      #if HAS_GAME_MENU
230
+        menu_game
231
+      #elif ENABLED(MARLIN_BRICKOUT)
232
+        brickout.enter_game
233
+      #elif ENABLED(MARLIN_INVADERS)
234
+        invaders.enter_game
235
+      #elif ENABLED(MARLIN_SNAKE)
236
+        snake.enter_game
237
+      #elif ENABLED(MARLIN_MAZE)
238
+        maze.enter_game
239
+      #endif
240
+    ));
241
+  #endif
223 242
   END_MENU();
224 243
 }
225 244
 

+ 5
- 14
Marlin/src/lcd/menu/menu_main.cpp View File

@@ -35,6 +35,10 @@
35 35
 #include "../../module/stepper.h"
36 36
 #include "../../sd/cardreader.h"
37 37
 
38
+#if HAS_GAMES && DISABLED(LCD_INFO_MENU)
39
+  #include "game/game.h"
40
+#endif
41
+
38 42
 #define MACHINE_CAN_STOP (EITHER(SDSUPPORT, HOST_PROMPT_SUPPORT) || defined(ACTION_ON_CANCEL))
39 43
 #define MACHINE_CAN_PAUSE (ANY(SDSUPPORT, HOST_PROMPT_SUPPORT, PARK_HEAD_ON_PAUSE) || defined(ACTION_ON_PAUSE))
40 44
 
@@ -86,19 +90,6 @@ void menu_configuration();
86 90
   #endif
87 91
 #endif
88 92
 
89
-#if HAS_GAMES
90
-  #include "game/game.h"
91
-  #if HAS_GAME_MENU
92
-    void menu_game();
93
-  #elif ENABLED(MARLIN_BRICKOUT)
94
-    void lcd_goto_brickout();
95
-  #elif ENABLED(MARLIN_INVADERS)
96
-    void lcd_goto_invaders();
97
-  #elif ENABLED(MARLIN_SNAKE)
98
-    void lcd_goto_snake();
99
-  #endif
100
-#endif
101
-
102 93
 void menu_main() {
103 94
   START_MENU();
104 95
   MENU_BACK(MSG_WATCH);
@@ -249,7 +240,7 @@ void menu_main() {
249 240
     #endif
250 241
   #endif
251 242
 
252
-  #if ANY(MARLIN_BRICKOUT, MARLIN_INVADERS, MARLIN_SNAKE, MARLIN_MAZE)
243
+  #if HAS_GAMES && DISABLED(LCD_INFO_MENU)
253 244
     MENU_ITEM(submenu, "Game", (
254 245
       #if HAS_GAME_MENU
255 246
         menu_game

Loading…
Cancel
Save