Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed FATFileSystem
Diff: Menu/Menu.h
- Revision:
- 3:a8960004d261
- Parent:
- 2:81cfa8310f55
- Child:
- 4:035448357749
--- a/Menu/Menu.h Wed Mar 20 18:23:22 2019 +0000
+++ b/Menu/Menu.h Fri Mar 29 18:45:40 2019 +0000
@@ -13,7 +13,7 @@
};
/** Menu Class
-* @brief Library for controlling menu options
+* @brief Library for navigating menu options
* @author Ellis Blackford Stroud
* @date May, 2018
*/
@@ -28,29 +28,43 @@
/** Destructor */
~Menu();
+ void init();
+
/** Prints opening message */
void print_welcome(N5110 &lcd);
/** Prints menu screen */
void print_menu(N5110 &lcd);
+ /** Prints start screen */
+ bool check_start(N5110 &lcd, Gamepad &pad);
+
/** Prints highscore screen */
void print_highscores(N5110 &lcd);
/** Prints settings screen */
void print_settings(N5110 &lcd);
- /** Prints start screen */
- void print_start(N5110 &lcd);
+ /** Changes screen to menu choice and returns start game message
+ * @returns a bool: true to start game, false to stay in menu
+ */
+ bool menu_change(N5110 &lcd, Gamepad &pad);
+
+ /** Returns to menu screen */
+ void menu_return(N5110 &lcd, Gamepad &pad);
+
+ /** Updates cursor and returns menu choice
+ * @returns an enum: START, HIGHSCORES, SETTINGS
+ */
+ void menu_select(Gamepad &pad, N5110 &lcd);
- /** Updates and returns menu choice
- * @returns an enum: START, HIGHSCORES, SETTINGS
- */
- MenuChoices menu_choice(MenuChoices menu, Gamepad &pad, N5110 &lcd);
+private:
-private:
+ void draw_cursor(N5110 &lcd);
+
+ MenuChoices _cursor_pos;
};