Tramway SDK
debug.h
Go to the documentation of this file.
1// TRAMWAY DRIFT AND DUNGEON EXPLORATION SIMULATOR 2022
2// All rights reserved.
3
4#ifndef TRAM_SDK_EXTENSIONS_MENU_DEBUG_H
5#define TRAM_SDK_EXTENSIONS_MENU_DEBUG_H
6
8
9#include <functional>
10
11namespace tram {
12 class WorldCell;
13}
14
15namespace tram::Ext::Menu {
16
17void InitCallbacks();
18void UpdateCallbacks();
19
20class InterceptMenu;
21class StatisticsMenu;
22
23class DebugMenu : public Menu {
24public:
25 void Display();
26 uint32_t Layer() { return 0; }
27 ~DebugMenu() = default;
28protected:
29 static bool intercept_enabled;
30 static bool statistics_enabled;
33};
34
35class EntityProperties : public Menu {
36public:
37 void SetPicked(id_t entity);
38 uint32_t Layer() { return 1; }
39 void Display();
40 ~EntityProperties() = default;
41protected:
43};
44
45class EntityPicker : public Menu {
46public:
47 EntityPicker(std::function<void(id_t)> callback);
48 uint32_t Layer() { return 1; }
49 void Display();
50 ~EntityPicker() = default;
51protected:
52 std::function<void(id_t)> callback;
53};
54
55class ListSelection : public Menu {
56public:
57 ListSelection(std::function<void(uint32_t)> callback, std::vector<std::string> list);
58 uint32_t Layer() { return 2; }
59 void Display();
60 ~ListSelection() = default;
61protected:
62 std::function<void(uint32_t)> callback;
63 std::vector<std::string> list;
64};
65
66class MessageSend : public Menu {
67public:
68 void SetEntity(id_t entity);
69 void SetMessageType(uint32_t type);
70 uint32_t Layer() { return 1; }
71 void Display();
72 ~MessageSend() = default;
73protected:
74 uint32_t parameter_type = 0;
76 uint32_t message_type = 0;
77 char parameter_string[32] = "";
78};
79
80class InterceptMenu : public Menu {
81public:
82 void Display();
83 uint32_t Layer() { return 0; }
84 inline void SetOffset(uint32_t offset) { this->offset = offset; }
85 ~InterceptMenu() = default;
86protected:
87 uint32_t offset = 0;
88};
89
90class WorldCellProperties : public Menu {
91public:
93 uint32_t Layer() { return 1; }
94 void Display();
96protected:
97 WorldCell* cell = nullptr;
98};
99
100class StatisticsMenu : public Menu {
101public:
102 void Display();
103 uint32_t Layer() { return 0; }
104 ~StatisticsMenu() = default;
105};
106
107class EventEmit : public Menu {
108public:
109 void SetEventType(uint32_t type) { event_type = type; }
110 uint32_t Layer() { return 1; }
111 void Display();
112 ~EventEmit() = default;
113protected:
114 uint16_t subtype = 0;
115 uint32_t parameter_type = 0;
116 uint32_t event_type = 0;
117 char subtype_string[8] = "0";
118 char parameter_string[32] = "";
119};
120
121class SignalMenu : public Menu {
122public:
123 void SetEntity(id_t entity) { entity_id = entity; }
124 void Display();
125 uint32_t Layer() { return 2; }
126 ~SignalMenu() = default;
127protected:
129};
130
131}
132
133#endif
Definition: debug.h:23
static StatisticsMenu * statistics_menu
Definition: debug.h:32
void Display()
Definition: debug.cpp:242
static InterceptMenu * intercept_menu
Definition: debug.h:31
static bool intercept_enabled
Definition: debug.h:29
uint32_t Layer()
Definition: debug.h:26
static bool statistics_enabled
Definition: debug.h:30
Definition: debug.h:45
uint32_t Layer()
Definition: debug.h:48
std::function< void(id_t)> callback
Definition: debug.h:52
EntityPicker(std::function< void(id_t)> callback)
Definition: debug.cpp:360
void Display()
Definition: debug.cpp:364
Definition: debug.h:35
void SetPicked(id_t entity)
Definition: debug.cpp:309
uint32_t Layer()
Definition: debug.h:38
id_t entity
Definition: debug.h:42
void Display()
Definition: debug.cpp:313
Definition: debug.h:107
char parameter_string[32]
Definition: debug.h:118
uint32_t event_type
Definition: debug.h:116
uint32_t Layer()
Definition: debug.h:110
void Display()
Definition: debug.cpp:677
char subtype_string[8]
Definition: debug.h:117
void SetEventType(uint32_t type)
Definition: debug.h:109
uint32_t parameter_type
Definition: debug.h:115
uint16_t subtype
Definition: debug.h:114
Definition: debug.h:80
uint32_t offset
Definition: debug.h:87
uint32_t Layer()
Definition: debug.h:83
void SetOffset(uint32_t offset)
Definition: debug.h:84
void Display()
Definition: debug.cpp:513
Definition: debug.h:55
std::vector< std::string > list
Definition: debug.h:63
uint32_t Layer()
Definition: debug.h:58
ListSelection(std::function< void(uint32_t)> callback, std::vector< std::string > list)
Definition: debug.cpp:416
std::function< void(uint32_t)> callback
Definition: debug.h:62
void Display()
Definition: debug.cpp:421
Definition: menu.h:20
Definition: debug.h:66
void SetEntity(id_t entity)
Definition: debug.cpp:448
uint32_t Layer()
Definition: debug.h:70
void SetMessageType(uint32_t type)
Definition: debug.cpp:452
id_t entity_id
Definition: debug.h:75
void Display()
Definition: debug.cpp:456
uint32_t parameter_type
Definition: debug.h:74
char parameter_string[32]
Definition: debug.h:77
uint32_t message_type
Definition: debug.h:76
Definition: debug.h:121
uint32_t Layer()
Definition: debug.h:125
id_t entity_id
Definition: debug.h:128
void Display()
Definition: debug.cpp:734
void SetEntity(id_t entity)
Definition: debug.h:123
Definition: debug.h:100
uint32_t Layer()
Definition: debug.h:103
void Display()
Definition: debug.cpp:627
void Display()
Definition: debug.cpp:540
uint32_t Layer()
Definition: debug.h:93
void SetPicked(WorldCell *cell)
Definition: debug.cpp:536
WorldCell * cell
Definition: debug.h:97
Definition: worldcell.h:18
Definition: debug.cpp:14
void UpdateCallbacks()
Definition: debug.cpp:185
void InitCallbacks()
Definition: debug.cpp:135
Definition: api.h:9
uint32_t id_t
Definition: core.h:11