| 1 | |
| 2 | /** |
| 3 | * |
| 4 | * @file menu.h |
| 5 | * |
| 6 | * Part of the OpenJazz project |
| 7 | * |
| 8 | * @par History: |
| 9 | * - 23rd August 2005: Created OpenJazz.h |
| 10 | * - 3rd February 2009: Created menu.h from parts of OpenJazz.h |
| 11 | * - 21st July 2013: Created setup.h from parts of menu.h |
| 12 | * |
| 13 | * @par Licence: |
| 14 | * Copyright (c) 2005-2017 AJ Thomson |
| 15 | * Copyright (c) 2015-2026 Carsten Teibes |
| 16 | * |
| 17 | * OpenJazz is distributed under the terms of |
| 18 | * the GNU General Public License, version 2.0 |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | |
| 23 | #ifndef _MENU_H |
| 24 | #define _MENU_Hcxx . . $ `src/menu/menu.h:24:9`! |
| 25 | |
| 26 | |
| 27 | #include "game/gamemode.h"cxx . . $ `<file>/src/game/gamemode.h`/ |
| 28 | |
| 29 | #include "OpenJazz.h"cxx . . $ `<file>/src/OpenJazz.h`/ |
| 30 | |
| 31 | #ifdef OJ_SDL3 |
| 32 | #include <SDL3/SDL.h> |
| 33 | #else |
| 34 | #include <SDL.h> |
| 35 | #endif |
| 36 | |
| 37 | // Constants |
| 38 | |
| 39 | #define ESCAPE_STRINGcxx . . $ `src/menu/menu.h:39:9`! "(esc) quits" |
| 40 | |
| 41 | #define MAX_EPISODEScxx . . $ `src/menu/menu.h:41:9`! 11 |
| 42 | |
| 43 | // Demo timeout |
| 44 | #define T_DEMOcxx . . $ `src/menu/menu.h:44:9`! 20000 |
| 45 | |
| 46 | |
| 47 | // Classes |
| 48 | |
| 49 | class Filecxx . . $ File#; |
| 50 | |
| 51 | /// Menu base class, providing generic menu screens |
| 52 | class Menucxx . . $ Menu# { |
| 53 | |
| 54 | protected: |
| 55 | void showEscStringcxx . . $ Menu#showEscString(b45ddcbc8423892c). (bool alignLeft = true); |
| 56 | int messagecxx . . $ Menu#message(5c4306d8553b3696). (const char* text); |
| 57 | int genericcxx . . $ Menu#generic(9f6ec59569c98226). (const char* title, const char** optionNames, int options, int& chosen); |
| 58 | int textInputcxx . . $ Menu#textInput(bc30cf002e76fcd0). (const char* request, char*& text, bool ip = false); |
| 59 | |
| 60 | }; |
| 61 | |
| 62 | /// Saving and loading menu |
| 63 | class FileMenucxx . . $ FileMenu# : public Menucxx . . $ Menu# { |
| 64 | |
| 65 | public: |
| 66 | int maincxx . . $ FileMenu#main(9f1afb2e1f195c72). (bool forSaving, bool showCustom); |
| 67 | |
| 68 | }; |
| 69 | |
| 70 | /// New game menus |
| 71 | class GameMenucxx . . $ GameMenu# : public Menucxx . . $ Menu# { |
| 72 | |
| 73 | private: |
| 74 | SDL_Surface* episodeScreenscxx . . $ GameMenu#episodeScreens.[MAX_EPISODEScxx . . $ `src/menu/menu.h:41:9`!]; ///< Episode images |
| 75 | SDL_Surface* difficultyScreencxx . . $ GameMenu#difficultyScreen.; ///< 4 difficulty images |
| 76 | SDL_Color palettecxx . . $ GameMenu#palette.[MAX_PALETTE_COLORScxx . . $ `src/OpenJazz.h:71:9`!]; ///< Episode selection palette |
| 77 | SDL_Color greyPalettecxx . . $ GameMenu#greyPalette.[MAX_PALETTE_COLORScxx . . $ `src/OpenJazz.h:71:9`!]; ///< Greyed-out episode selection palette |
| 78 | int episodescxx . . $ GameMenu#episodes.; ///< Number of episodes |
| 79 | difficultyTypecxx . . $ difficultyType# difficultycxx . . $ GameMenu#difficulty.; ///< Difficulty setting (easy, medium, hard, turbo (hard in JJ2 levels)) |
| 80 | FileMenucxx . . $ FileMenu#* fileMenucxx . . $ GameMenu#fileMenu.; ///< Load menu |
| 81 | |
| 82 | int playNewGamecxx . . $ GameMenu#playNewGame(8cd152da69128d1a). (GameModeTypecxx . . $ GameModeType# mode, char* firstLevel); |
| 83 | int newGameDifficultycxx . . $ GameMenu#newGameDifficulty(8cd152da69128d1a). (GameModeTypecxx . . $ GameModeType# mode, char* firstLevel); |
| 84 | int newGameDifficultycxx . . $ GameMenu#newGameDifficulty(274cbed7efcd7c9d). (GameModeTypecxx . . $ GameModeType# mode, int levelNum, int worldNum); |
| 85 | int newGameLevelcxx . . $ GameMenu#newGameLevel(eac196c7edaa1201). (GameModeTypecxx . . $ GameModeType# mode); |
| 86 | int selectEpisodecxx . . $ GameMenu#selectEpisode(47ff60b9b94a3aa1). (GameModeTypecxx . . $ GameModeType# mode, int episode); |
| 87 | int newGameEpisodecxx . . $ GameMenu#newGameEpisode(eac196c7edaa1201). (GameModeTypecxx . . $ GameModeType# mode); |
| 88 | int joinGamecxx . . $ GameMenu#joinGame(b126dc7c1de90089). (); |
| 89 | int loadGameCustomcxx . . $ GameMenu#loadGameCustom(b126dc7c1de90089). (); |
| 90 | |
| 91 | public: |
| 92 | explicit GameMenucxx . . $ GameMenu#GameMenu(cbcd11eaff6dd399).(Filecxx . . $ File#* file); |
| 93 | ~cxx . . $ GameMenu#`~GameMenu`(49f6e7a06ebc5aa8).GameMenucxx . . $ GameMenu#(); |
| 94 | |
| 95 | int newGamecxx . . $ GameMenu#newGame(b126dc7c1de90089). (); |
| 96 | int loadGamecxx . . $ GameMenu#loadGame(b126dc7c1de90089). (); |
| 97 | int loadGamecxx . . $ GameMenu#loadGame(9b79fb6aee4c0440). (int levelNum, int worldNum); |
| 98 | |
| 99 | }; |
| 100 | |
| 101 | /// Setup menus |
| 102 | class SetupMenucxx . . $ SetupMenu# : public Menucxx . . $ Menu# { |
| 103 | |
| 104 | private: |
| 105 | #ifndef NO_KEYBOARD_CFG |
| 106 | int setupKeyboardcxx . . $ SetupMenu#setupKeyboard(b126dc7c1de90089). (); |
| 107 | #endif |
| 108 | #ifndef NO_CONTROLLER_CFG |
| 109 | int setupJoystickcxx . . $ SetupMenu#setupJoystick(b126dc7c1de90089). (); |
| 110 | #endif |
| 111 | #if !defined(NO_RESIZE) || defined(SCALEcxx . . $ `<built-in>:466:9`!) |
| 112 | int setupVideocxx . . $ SetupMenu#setupVideo(b126dc7c1de90089). (); |
| 113 | #endif |
| 114 | int setupAudiocxx . . $ SetupMenu#setupAudio(b126dc7c1de90089). (); |
| 115 | |
| 116 | public: |
| 117 | int setupMaincxx . . $ SetupMenu#setupMain(b126dc7c1de90089). (); |
| 118 | |
| 119 | }; |
| 120 | |
| 121 | /// Main menu |
| 122 | class MainMenucxx . . $ MainMenu# : public Menucxx . . $ Menu# { |
| 123 | |
| 124 | private: |
| 125 | SDL_Surface* backgroundcxx . . $ MainMenu#background.; ///< Menu image |
| 126 | SDL_Surface* highlightcxx . . $ MainMenu#highlight.; ///< Menu image with highlighted text |
| 127 | SDL_Surface* logocxx . . $ MainMenu#logo.; ///< OJ logo image |
| 128 | GameMenucxx . . $ GameMenu#* gameMenucxx . . $ MainMenu#gameMenu.; ///< New game menu |
| 129 | SDL_Color palettecxx . . $ MainMenu#palette.[MAX_PALETTE_COLORScxx . . $ `src/OpenJazz.h:71:9`!]; ///< Menu palette |
| 130 | |
| 131 | MainMenucxx . . $ MainMenu#MainMenu(b7e86e363e4de61e).(const MainMenucxx . . $ MainMenu#&); // non construction-copyable |
| 132 | MainMenucxx . . $ MainMenu#& operatorcxx . . $ MainMenu#`operator=`(3bf9b686c45c761e).=(const MainMenucxx . . $ MainMenu#&); // non copyable |
| 133 | int selectcxx . . $ MainMenu#select(7864480464b09eea). (int option); |
| 134 | |
| 135 | public: |
| 136 | MainMenucxx . . $ MainMenu#MainMenu(49f6e7a06ebc5aa8). (); |
| 137 | ~cxx . . $ MainMenu#`~MainMenu`(49f6e7a06ebc5aa8).MainMenucxx . . $ MainMenu# (); |
| 138 | |
| 139 | int maincxx . . $ MainMenu#main(b126dc7c1de90089). (); |
| 140 | int skipcxx . . $ MainMenu#skip(9b79fb6aee4c0440). (int levelNum, int worldNum); |
| 141 | |
| 142 | }; |
| 143 | |
| 144 | |
| 145 | // Variables |
| 146 | |
| 147 | EXTERNcxx . . $ `src/OpenJazz.h:38:10`! SDL_Color menuPalettecxx . . $ menuPalette.[MAX_PALETTE_COLORScxx . . $ `src/OpenJazz.h:71:9`!]; /// Palette used by most menu screens |
| 148 | |
| 149 | #endif |
| 150 |