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 // Attempt to run the dungeon room draw routine when opening a room.
34
35 // Save dungeon map edits to the Rom.
36 bool kSaveDungeonMaps = false;
37
38 // Save graphics sheet to the Rom.
39 bool kSaveGraphicsSheet = false;
40
41 // Log to the console.
42 bool kLogToConsole = false;
43
44 // Overworld flags
45 struct Overworld {
46 // Load and render overworld sprites to the screen. Unstable.
48
49 // Save overworld map edits to the Rom.
50 bool kSaveOverworldMaps = true;
51
52 // Save overworld entrances to the Rom.
54
55 // Save overworld exits to the Rom.
57
58 // Save overworld items to the Rom.
60
61 // Save overworld properties to the Rom.
63
64 // Load custom overworld data from the ROM and enable UI.
67 };
68
69 static Flags &get() {
70 static Flags instance;
71 return instance;
72 }
73
74 std::string Serialize() const {
75 std::string result;
76 result +=
77 "kLogInstructions: " + std::to_string(get().kLogInstructions) + "\n";
78 result +=
79 "kSaveAllPalettes: " + std::to_string(get().kSaveAllPalettes) + "\n";
80 result += "kSaveGfxGroups: " + std::to_string(get().kSaveGfxGroups) + "\n";
81 result +=
82 "kSaveWithChangeQueue: " + std::to_string(get().kSaveWithChangeQueue) +
83 "\n";
84 result += "kDrawDungeonRoomGraphics: " +
85 std::to_string(get().kDrawDungeonRoomGraphics) + "\n";
86 result +=
87 "kSaveDungeonMaps: " + std::to_string(get().kSaveDungeonMaps) + "\n";
88 result += "kLogToConsole: " + std::to_string(get().kLogToConsole) + "\n";
89 result += "kDrawOverworldSprites: " +
90 std::to_string(get().overworld.kDrawOverworldSprites) + "\n";
91 result += "kSaveOverworldMaps: " +
92 std::to_string(get().overworld.kSaveOverworldMaps) + "\n";
93 result += "kSaveOverworldEntrances: " +
94 std::to_string(get().overworld.kSaveOverworldEntrances) + "\n";
95 result += "kSaveOverworldExits: " +
96 std::to_string(get().overworld.kSaveOverworldExits) + "\n";
97 result += "kSaveOverworldItems: " +
98 std::to_string(get().overworld.kSaveOverworldItems) + "\n";
99 result += "kSaveOverworldProperties: " +
100 std::to_string(get().overworld.kSaveOverworldProperties) + "\n";
101 return result;
102 }
103};
104
105using ImGui::BeginMenu;
106using ImGui::Checkbox;
107using ImGui::EndMenu;
108using ImGui::MenuItem;
109using ImGui::Separator;
110
111struct FlagsMenu {
113 Checkbox("Enable Overworld Sprites",
114 &FeatureFlags::get().overworld.kDrawOverworldSprites);
115 Separator();
116 Checkbox("Save Overworld Maps",
117 &FeatureFlags::get().overworld.kSaveOverworldMaps);
118 Checkbox("Save Overworld Entrances",
119 &FeatureFlags::get().overworld.kSaveOverworldEntrances);
120 Checkbox("Save Overworld Exits",
121 &FeatureFlags::get().overworld.kSaveOverworldExits);
122 Checkbox("Save Overworld Items",
123 &FeatureFlags::get().overworld.kSaveOverworldItems);
124 Checkbox("Save Overworld Properties",
125 &FeatureFlags::get().overworld.kSaveOverworldProperties);
126 Checkbox("Load Custom Overworld",
127 &FeatureFlags::get().overworld.kLoadCustomOverworld);
128 }
129
131 Checkbox("Draw Dungeon Room Graphics",
132 &FeatureFlags::get().kDrawDungeonRoomGraphics);
133 Separator();
134 Checkbox("Save Dungeon Maps", &FeatureFlags::get().kSaveDungeonMaps);
135 }
136
138 Checkbox("Save All Palettes", &FeatureFlags::get().kSaveAllPalettes);
139 Checkbox("Save Gfx Groups", &FeatureFlags::get().kSaveGfxGroups);
140 Checkbox("Save Graphics Sheets", &FeatureFlags::get().kSaveGraphicsSheet);
141 }
142
144 Checkbox("Enable Console Logging", &FeatureFlags::get().kLogToConsole);
145 Checkbox("Log Instructions to Emulator Debugger",
146 &FeatureFlags::get().kLogInstructions);
147 }
148};
149
150} // namespace core
151} // namespace yaze
152
153#endif // YAZE_APP_CORE_FEATURES_H
A class to manage experimental feature flags.
Definition features.h:15
std::string Serialize() const
Definition features.h:74
static Flags & get()
Definition features.h:69
Main namespace for the application.
Definition controller.cc:18
struct yaze::core::FeatureFlags::Flags::Overworld overworld