From 9131b11944aecd467ddba995997693ddf5f2a240 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 15 Jun 2019 16:57:20 -0500 Subject: [PATCH] Games in Info menu, if enabled --- Marlin/src/lcd/menu/menu_info.cpp | 19 +++++++++++++++++++ Marlin/src/lcd/menu/menu_main.cpp | 19 +++++-------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp index eb58b3a56b..b5318d266b 100644 --- a/Marlin/src/lcd/menu/menu_info.cpp +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -28,6 +28,10 @@ #if HAS_LCD_MENU && ENABLED(LCD_INFO_MENU) +#if HAS_GAMES + #include "game/game.h" +#endif + #include "menu.h" // #include "../../module/motion.h" // #include "../../module/planner.h" @@ -220,6 +224,21 @@ void menu_info() { #if ENABLED(PRINTCOUNTER) MENU_ITEM(submenu, MSG_INFO_STATS_MENU, menu_info_stats); // Printer Stats > #endif + #if HAS_GAMES + MENU_ITEM(submenu, "Game", ( + #if HAS_GAME_MENU + menu_game + #elif ENABLED(MARLIN_BRICKOUT) + brickout.enter_game + #elif ENABLED(MARLIN_INVADERS) + invaders.enter_game + #elif ENABLED(MARLIN_SNAKE) + snake.enter_game + #elif ENABLED(MARLIN_MAZE) + maze.enter_game + #endif + )); + #endif END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index b84000fe90..b1887a9bb6 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -35,6 +35,10 @@ #include "../../module/stepper.h" #include "../../sd/cardreader.h" +#if HAS_GAMES && DISABLED(LCD_INFO_MENU) + #include "game/game.h" +#endif + #define MACHINE_CAN_STOP (EITHER(SDSUPPORT, HOST_PROMPT_SUPPORT) || defined(ACTION_ON_CANCEL)) #define MACHINE_CAN_PAUSE (ANY(SDSUPPORT, HOST_PROMPT_SUPPORT, PARK_HEAD_ON_PAUSE) || defined(ACTION_ON_PAUSE)) @@ -86,19 +90,6 @@ void menu_configuration(); #endif #endif -#if HAS_GAMES - #include "game/game.h" - #if HAS_GAME_MENU - void menu_game(); - #elif ENABLED(MARLIN_BRICKOUT) - void lcd_goto_brickout(); - #elif ENABLED(MARLIN_INVADERS) - void lcd_goto_invaders(); - #elif ENABLED(MARLIN_SNAKE) - void lcd_goto_snake(); - #endif -#endif - void menu_main() { START_MENU(); MENU_BACK(MSG_WATCH); @@ -249,7 +240,7 @@ void menu_main() { #endif #endif - #if ANY(MARLIN_BRICKOUT, MARLIN_INVADERS, MARLIN_SNAKE, MARLIN_MAZE) + #if HAS_GAMES && DISABLED(LCD_INFO_MENU) MENU_ITEM(submenu, "Game", ( #if HAS_GAME_MENU menu_game