yaze 0.2.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
features.h
Go to the documentation of this file.
1#ifndef YAZE_APP_CORE_FEATURES_H
2#define YAZE_APP_CORE_FEATURES_H
3
4#include <string>
5
6#include "imgui/imgui.h"
7
8namespace yaze {
9namespace core {
10
16 public:
17 struct Flags {
18 // Log instructions to the GUI debugger.
19 bool kLogInstructions = true;
20
21 // Flag to enable the saving of all palettes to the Rom.
22 bool kSaveAllPalettes = false;
23
24 // Flag to enable the saving of gfx groups to the rom.
25 bool kSaveGfxGroups = false;
26
27 // Flag to enable the change queue, which could have any anonymous
28 // save routine for the Rom. In practice, just the overworld tilemap
29 // and tile32 save.
31
32 // Save dungeon map edits to the Rom.
33 bool kSaveDungeonMaps = false;
34
35 // Save graphics sheet to the Rom.
36 bool kSaveGraphicsSheet = false;
37
38 // Log to the console.
39 bool kLogToConsole = false;
40
41 // Overworld flags
42 struct Overworld {
43 // Load and render overworld sprites to the screen. Unstable.
45
46 // Save overworld map edits to the Rom.
47 bool kSaveOverworldMaps = true;
48
49 // Save overworld entrances to the Rom.
51
52 // Save overworld exits to the Rom.
54
55 // Save overworld items to the Rom.
57
58 // Save overworld properties to the Rom.
60
61 // Load custom overworld data from the ROM and enable UI.
64 };
65
66 static Flags &get() {
67 static Flags instance;
68 return instance;
69 }
70
71 std::string Serialize() const {
72 std::string result;
73 result +=
74 "kLogInstructions: " + std::to_string(get().kLogInstructions) + "\n";
75 result +=
76 "kSaveAllPalettes: " + std::to_string(get().kSaveAllPalettes) + "\n";
77 result += "kSaveGfxGroups: " + std::to_string(get().kSaveGfxGroups) + "\n";
78 result +=
79 "kSaveWithChangeQueue: " + std::to_string(get().kSaveWithChangeQueue) +
80 "\n";
81 result +=
82 "kSaveDungeonMaps: " + std::to_string(get().kSaveDungeonMaps) + "\n";
83 result += "kLogToConsole: " + std::to_string(get().kLogToConsole) + "\n";
84 result += "kDrawOverworldSprites: " +
85 std::to_string(get().overworld.kDrawOverworldSprites) + "\n";
86 result += "kSaveOverworldMaps: " +
87 std::to_string(get().overworld.kSaveOverworldMaps) + "\n";
88 result += "kSaveOverworldEntrances: " +
89 std::to_string(get().overworld.kSaveOverworldEntrances) + "\n";
90 result += "kSaveOverworldExits: " +
91 std::to_string(get().overworld.kSaveOverworldExits) + "\n";
92 result += "kSaveOverworldItems: " +
93 std::to_string(get().overworld.kSaveOverworldItems) + "\n";
94 result += "kSaveOverworldProperties: " +
95 std::to_string(get().overworld.kSaveOverworldProperties) + "\n";
96 return result;
97 }
98};
99
100using ImGui::BeginMenu;
101using ImGui::Checkbox;
102using ImGui::EndMenu;
103using ImGui::MenuItem;
104using ImGui::Separator;
105
106struct FlagsMenu {
108 Checkbox("Enable Overworld Sprites",
109 &FeatureFlags::get().overworld.kDrawOverworldSprites);
110 Separator();
111 Checkbox("Save Overworld Maps",
112 &FeatureFlags::get().overworld.kSaveOverworldMaps);
113 Checkbox("Save Overworld Entrances",
114 &FeatureFlags::get().overworld.kSaveOverworldEntrances);
115 Checkbox("Save Overworld Exits",
116 &FeatureFlags::get().overworld.kSaveOverworldExits);
117 Checkbox("Save Overworld Items",
118 &FeatureFlags::get().overworld.kSaveOverworldItems);
119 Checkbox("Save Overworld Properties",
120 &FeatureFlags::get().overworld.kSaveOverworldProperties);
121 Checkbox("Load Custom Overworld",
122 &FeatureFlags::get().overworld.kLoadCustomOverworld);
123 }
124
126 Checkbox("Save Dungeon Maps", &FeatureFlags::get().kSaveDungeonMaps);
127 }
128
130 Checkbox("Save All Palettes", &FeatureFlags::get().kSaveAllPalettes);
131 Checkbox("Save Gfx Groups", &FeatureFlags::get().kSaveGfxGroups);
132 Checkbox("Save Graphics Sheets", &FeatureFlags::get().kSaveGraphicsSheet);
133 }
134
136 Checkbox("Enable Console Logging", &FeatureFlags::get().kLogToConsole);
137 Checkbox("Log Instructions to Emulator Debugger",
138 &FeatureFlags::get().kLogInstructions);
139 }
140};
141
142} // namespace core
143} // namespace yaze
144
145#endif // YAZE_APP_CORE_FEATURES_H
A class to manage experimental feature flags.
Definition features.h:15
std::string Serialize() const
Definition features.h:71
static Flags & get()
Definition features.h:66
Main namespace for the application.
Definition controller.cc:18
struct yaze::core::FeatureFlags::Flags::Overworld overworld