Blamite Game Engine - blam!
00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
debug_menu.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <string>
4
#include <vector>
5
6
#define MENU_ITEM_TYPE_UNKNOWN BlamDebugMenuItemType::Unknown
7
#define MENU_ITEM_TYPE_EXEC BlamDebugMenuItemType::Command
8
#define MENU_ITEM_TYPE_CATEGORY BlamDebugMenuItemType::Submenu
9
#define MENU_ITEM_TYPE_GLOBAL BlamDebugMenuItemType::Global
10
#define MENU_ITEM_TYPE_MULTIEXEC BlamDebugMenuItemType::CommandSequence
11
12
#define DEBUG_MENU_FILE "debug_menu_init"
13
14
#ifndef BLAM
15
#define BLAM
16
#endif
17
18
namespace
InternalUI
19
{
20
BLAM
void
CreateFPSCounter
();
21
BLAM
void
UpdateFPSCounter
();
22
}
23
27
enum class
BlamDebugMenuItemType
28
{
29
Command
,
30
38
CommandSequence
,
39
Global
,
40
Submenu
,
41
Unknown
42
};
43
47
class
BlamDebugMenuItem
48
{
49
public
:
50
BlamDebugMenuItemType
item_type
;
51
std::string
title
;
52
53
// Properties specific to #BlamDebugMenuItemType::Command
54
55
std::string
exec_line
=
""
;
56
57
// Properties specific to #BlamDebugMenuItemType::CommandSequence
58
59
std::vector<std::string>
exec_sequence
;
60
int
current_exec_index
= 0;
61
62
// Properties specific to #BlamDebugMenuItemType::Global
63
64
std::string
global_id
=
""
;
65
bool
use_bounds
=
false
;
66
double
inc
= 1;
67
double
min
= 0;
68
double
max
= 0;
69
70
// Properties specific to #BlamDebugMenuItemType::Submenu
71
std::vector<BlamDebugMenuItem>
items
;
72
76
BlamDebugMenuItem
();
77
81
void
HandleKeyEnter
();
82
86
void
HandleKeyLeft
();
87
91
void
HandleKeyRight
();
92
};
93
97
struct
BlamDebugMenu
98
{
99
std::string
title
;
100
std::vector<BlamDebugMenuItem>
items
;
101
};
102
106
namespace
Blam::Resources::DebugMenu
107
{
111
BLAM
void
InitializeDebugMenu
();
112
116
BLAM
void
ReloadDebugMenu
();
117
123
BLAM
BlamDebugMenu
GetDebugMenu
();
124
}
BlamDebugMenuItem::title
std::string title
The title of the debug menu item as shown in the menu.
Definition:
debug_menu.h:51
BlamDebugMenuItem::exec_line
std::string exec_line
The command to run upon activation for an Executor menu item type.
Definition:
debug_menu.h:55
BlamDebugMenuItem::inc
double inc
How much to add or remove from the value at a time upon activation.
Definition:
debug_menu.h:66
BlamDebugMenuItem::exec_sequence
std::vector< std::string > exec_sequence
The command sequence to run upon activation for an ExecSequence menu item type.
Definition:
debug_menu.h:59
BlamDebugMenuItem::BlamDebugMenuItem
BlamDebugMenuItem()
Creates a new debug menu item.
Definition:
BlamDebugMenuItem.cpp:6
BlamDebugMenuItem::current_exec_index
int current_exec_index
The index of the next item to run within the execution sequence.
Definition:
debug_menu.h:60
BlamDebugMenuItem::HandleKeyLeft
void HandleKeyLeft()
Called when the menu item is active and the left arrow key is pressed.
Definition:
BlamDebugMenuItem.cpp:41
BlamDebugMenuItemType::Submenu
@ Submenu
Enters into a submenu/subscreen upon activation.
BlamDebugMenuItem::items
std::vector< BlamDebugMenuItem > items
The contents of the submenu to show upon activation.
Definition:
debug_menu.h:71
BlamCommandType::Global
@ Global
A command that is used to modify a global.
Blam::Resources::DebugMenu::InitializeDebugMenu
BLAM void InitializeDebugMenu()
Load debug menu content from debug_menu_init.xml.
Definition:
debug_menu.cpp:331
Blam::Resources::DebugMenu
Namespace containing data for the engine's debug menu.
Definition:
debug_menu.h:106
BlamDebugMenuItemType
BlamDebugMenuItemType
Menu item type enumerator.
Definition:
debug_menu.h:27
InternalUI::CreateFPSCounter
BLAM void CreateFPSCounter()
BlamDebugMenuItem::HandleKeyRight
void HandleKeyRight()
Called when the menu item is active and the right arrow key is pressed.
Definition:
BlamDebugMenuItem.cpp:168
BlamDebugMenuItem::item_type
BlamDebugMenuItemType item_type
The type of menu item. See BlamDebugMenuItemType for details.
Definition:
debug_menu.h:50
BlamDebugMenuItem
Class used to store data and functions relating to an item within the engine's debug menu.
Definition:
debug_menu.h:47
BlamDebugMenu::items
std::vector< BlamDebugMenuItem > items
The list of items within the debug menu.
Definition:
debug_menu.h:100
BlamDebugMenuItem::global_id
std::string global_id
The ID of the engine global to modify upon activation.
Definition:
debug_menu.h:64
BlamDebugMenuItemType::Unknown
@ Unknown
Fallback in the event that debug_menu_init contained an invalid option.
Blam::Resources::DebugMenu::ReloadDebugMenu
BLAM void ReloadDebugMenu()
Reloads debug menu content from debug_menu_init.xml.
Definition:
debug_menu.cpp:355
BlamDebugMenuItem::HandleKeyEnter
void HandleKeyEnter()
Called when the menu item is active and the enter key is pressed.
Definition:
BlamDebugMenuItem.cpp:11
BlamDebugMenuItem::max
double max
The maximum value specified in debug_menu_init.
Definition:
debug_menu.h:68
BlamDebugMenuItem::use_bounds
bool use_bounds
Whether or not arbitrary bounds are specified in debug_menu_init.
Definition:
debug_menu.h:65
BlamDebugMenu::title
std::string title
The title of the main page of the debug menu. Defaults to Main.
Definition:
debug_menu.h:99
InternalUI
Namespace containing things for the engine's "internal UI", which is powered through ImGUI.
Definition:
debug_menu.h:18
BLAM
#define BLAM
Definition:
debug_menu.h:15
BlamDebugMenuItemType::CommandSequence
@ CommandSequence
Runs a sequence of console commands upon activation.
BlamDebugMenuItemType::Command
@ Command
Runs a console command upon activation.
BlamDebugMenu
Structure containing data for the root of the debug menu.
Definition:
debug_menu.h:97
InternalUI::UpdateFPSCounter
BLAM void UpdateFPSCounter()
BlamDebugMenuItem::min
double min
The minimum value specified in debug_menu_init.
Definition:
debug_menu.h:67
Blam::Resources::DebugMenu::GetDebugMenu
BLAM BlamDebugMenu GetDebugMenu()
Retrieves the debug menu data.
Definition:
debug_menu.cpp:25
blam
components
resources
debug_menu
debug_menu.h
Generated on Tue Jan 12 2021 01:11:27 for Blamite Game Engine - blam! by
1.8.17