Debian Codegraph @

Descent3/menu.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/main/menu.h $
21 * $Revision: 5 $
22 * $Date: 4/17/99 6:15p $
23 * $Author: Samir $
24 *
25 * menu header
26 *
27 * $Log: /DescentIII/main/menu.h $
28 *
29 * 5 4/17/99 6:15p Samir
30 * replaced gr.h with grdefs.h and fixed resulting compile bugs.
31 *
32 * 4 12/15/98 4:28p Jeff
33 * added mission data information to the pilot files to save what the
34 * highest level they achieved on a mission is. Added level select dialog
35 * (not hooked up) and level warp cheat.
36 *
37 * 3 5/24/98 2:58a Jeff
38 * Options menu changes. MenuOptions now takes a parameter, whether its
39 * being called from the game or not
40 *
41 * 2 3/02/98 5:53p Samir
42 * Added MenuOptions prototype.
43 *
44 * 3 4/29/97 5:29p Samir
45 * New game calls mission functions.
46 *
47 * 2 2/10/97 11:49a Jason
48 * checked in for samir
49 *
50 * 1 2/04/97 2:50p Samir
51 *
52 * $NoKeywords: $
53 */
54
55 #ifndef MENU_H
56 #define MENU_H
57
58 #include "pstypes.h"
59 #include "grdefs.h"
60
61 #define MAX_MENUS 5
62
63 #define MAX_MENU_ITEMS 50
64 #define MENU_STRING_LEN 70
65
66 #define MF_NORMAL_ANIMATED 1
67 #define MF_SELECT_ANIMATED 2
68
69 #define MAX_MENU_TYPES 5
70
71 enum menu_type {
72 MENU_TYPE_BUTTON,
73 MENU_TYPE_TEXT,
74 MENU_TYPE_RADIOBUTTON,
75 MENU_TYPE_CHECKBOX,
76 MENU_TYPE_TEXTBOX
77 };
78
79 struct menu_item {
80 menu_type mtype;
81 char name[MENU_STRING_LEN];
82
83 int normal_handle; // The anim/bitmap associated with this unhighlighted item
84 int select_handle; // The anim/bitmap associated with the selected menu
85
86 int flags; // see MF types above
87
88 int x, y;
89
90 ddgr_color normal_color, selected_color;
91
92 };
93
94 struct menu {
95 int num_items;
96
97 menu_item items[MAX_MENU_ITEMS];
98 uint8_t used;
99 };
100
101 // returns whether we decided to quit the game or not
102 // this displays the main menu options and runs the menu system
103 int MainMenu();
104
105 // opens options menu.
106 // ingame = true (if calling while playing the game)
107 void MenuOptions(bool ingame);
108
109 // DisplayLevelWarpDlg
110 // pass in the max level allowed to be chosen, if -1, than all levels are allowed (a.k.a level warp cheat)
111 int DisplayLevelWarpDlg(int max_level);
112
113 #endif