yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
feature_flags_menu.h
Go to the documentation of this file.
1#ifndef YAZE_APP_GUI_FEATURE_FLAGS_MENU_H
2#define YAZE_APP_GUI_FEATURE_FLAGS_MENU_H
3
4#include "core/features.h"
6#include "imgui/imgui.h"
9
10namespace yaze {
11
12class Rom; // Forward declaration
13
14namespace gui {
15
16using ImGui::BeginMenu;
17using ImGui::Checkbox;
18using ImGui::EndMenu;
19using ImGui::MenuItem;
20using ImGui::Separator;
21
22struct FlagsMenu {
24 const auto& theme = ThemeManager::Get().GetCurrentTheme();
25 Checkbox("Enable Overworld Sprites",
26 &core::FeatureFlags::get().overworld.kDrawOverworldSprites);
27 Separator();
28 Checkbox("Save Overworld Maps",
29 &core::FeatureFlags::get().overworld.kSaveOverworldMaps);
30 Checkbox("Save Overworld Entrances",
31 &core::FeatureFlags::get().overworld.kSaveOverworldEntrances);
32 Checkbox("Save Overworld Exits",
33 &core::FeatureFlags::get().overworld.kSaveOverworldExits);
34 Checkbox("Save Overworld Items",
35 &core::FeatureFlags::get().overworld.kSaveOverworldItems);
36 Checkbox("Save Overworld Properties",
37 &core::FeatureFlags::get().overworld.kSaveOverworldProperties);
38 Checkbox("Enable Custom Overworld Features",
39 &core::FeatureFlags::get().overworld.kLoadCustomOverworld);
40 ImGui::SameLine();
41 if (ImGui::Button("?")) {
42 ImGui::OpenPopup("CustomOverworldHelp");
43 }
44 if (ImGui::BeginPopup("CustomOverworldHelp")) {
45 ImGui::Text("This flag enables ZSCustomOverworld features.");
46 ImGui::Text("If ZSCustomOverworld ASM is already applied to the ROM,");
47 ImGui::Text("features are auto-enabled regardless of this flag.");
48 ImGui::Text("For vanilla ROMs, enable this to use custom features.");
49 ImGui::EndPopup();
50 }
51 Checkbox("Apply ZSCustomOverworld ASM",
52 &core::FeatureFlags::get().overworld.kApplyZSCustomOverworldASM);
53
54 Separator();
55 ImGui::TextColored(ConvertColorToImVec4(theme.warning), "Experimental");
56
57 Checkbox("Enable Special World Tail (0xA0-0xBF)",
58 &core::FeatureFlags::get().overworld.kEnableSpecialWorldExpansion);
59 ImGui::SameLine();
60 if (ImGui::Button("?##TailHelp")) {
61 ImGui::OpenPopup("TailExpansionHelp");
62 }
63 if (ImGui::BeginPopup("TailExpansionHelp")) {
64 ImGui::TextColored(ConvertColorToImVec4(theme.warning),
65 "EXPERIMENTAL FEATURE");
66 ImGui::Separator();
67 ImGui::Text("Enables access to special world tail maps (0xA0-0xBF).");
68 ImGui::Text("These are unused map slots that can be made editable.");
69 ImGui::Spacing();
70 ImGui::TextColored(ConvertColorToImVec4(theme.error), "REQUIRES:");
71 ImGui::BulletText("ZSCustomOverworld v3 ASM");
72 ImGui::BulletText("Pointer table expansion ASM patch");
73 ImGui::Spacing();
74 ImGui::Text("Without proper ASM patches, tail maps will show");
75 ImGui::Text("blank tiles (safe fallback behavior).");
76 ImGui::EndPopup();
77 }
78 }
79
81 const auto& theme = ThemeManager::Get().GetCurrentTheme();
82 Checkbox("Save Dungeon Maps", &core::FeatureFlags::get().kSaveDungeonMaps);
83 ImGui::Separator();
84 ImGui::TextColored(ConvertColorToImVec4(theme.text_secondary),
85 "Dungeon Save Controls");
86 Checkbox("Save Objects", &core::FeatureFlags::get().dungeon.kSaveObjects);
87 Checkbox("Save Sprites", &core::FeatureFlags::get().dungeon.kSaveSprites);
88 Checkbox("Save Room Headers",
89 &core::FeatureFlags::get().dungeon.kSaveRoomHeaders);
90 Checkbox("Save Torches", &core::FeatureFlags::get().dungeon.kSaveTorches);
91 Checkbox("Save Pits", &core::FeatureFlags::get().dungeon.kSavePits);
92 Checkbox("Save Blocks", &core::FeatureFlags::get().dungeon.kSaveBlocks);
93 Checkbox("Save Collision",
94 &core::FeatureFlags::get().dungeon.kSaveCollision);
95 Checkbox("Save Chests", &core::FeatureFlags::get().dungeon.kSaveChests);
96 Checkbox("Save Pot Items",
97 &core::FeatureFlags::get().dungeon.kSavePotItems);
98 Checkbox("Save Palettes",
99 &core::FeatureFlags::get().dungeon.kSavePalettes);
100 ImGui::Separator();
101 Checkbox("Enable Custom Objects", &core::FeatureFlags::get().kEnableCustomObjects);
102 ImGui::SameLine();
103 if (ImGui::Button("?##CustomObjHelp")) {
104 ImGui::OpenPopup("CustomObjectsHelp");
105 }
106 if (ImGui::BeginPopup("CustomObjectsHelp")) {
107 ImGui::Text("Enables custom dungeon object support:");
108 ImGui::BulletText("Minecart track editor panel");
109 ImGui::BulletText("Custom object graphics (0x31, 0x32)");
110 ImGui::Spacing();
111 ImGui::TextColored(ConvertColorToImVec4(theme.warning), "REQUIRES:");
112 ImGui::BulletText("custom_objects_folder set in project file");
113 ImGui::BulletText("Custom object .bin files in that folder");
114 ImGui::EndPopup();
115 }
116 }
117
119 Checkbox("Save All Palettes", &core::FeatureFlags::get().kSaveAllPalettes);
120 Checkbox("Save Gfx Groups", &core::FeatureFlags::get().kSaveGfxGroups);
121 Checkbox("Save Graphics Sheets",
122 &core::FeatureFlags::get().kSaveGraphicsSheet);
123 Checkbox("Save Messages", &core::FeatureFlags::get().kSaveMessages);
124 }
125
127 Checkbox("Enable Console Logging",
128 &core::FeatureFlags::get().kLogToConsole);
129 Checkbox("Enable Performance Monitoring",
130 &core::FeatureFlags::get().kEnablePerformanceMonitoring);
131 Checkbox("Enable Tiered GFX Architecture",
132 &core::FeatureFlags::get().kEnableTieredGfxArchitecture);
133 // REMOVED: "Log Instructions" - DisassemblyViewer is always active
134 // Use the viewer's UI controls to enable/disable recording if needed
135 Checkbox("Use Native File Dialog (NFD)",
136 &core::FeatureFlags::get().kUseNativeFileDialog);
137 }
138
139 // ZSCustomOverworld ROM-level enable flags (requires loaded ROM)
141 if (!rom || !rom->is_loaded()) {
142 ImGui::TextDisabled("Load a ROM to configure ZSCustomOverworld flags");
143 return;
144 }
145
146 auto rom_version = zelda3::OverworldVersionHelper::GetVersion(*rom);
148 ImGui::TextDisabled("ROM does not support ZSCustomOverworld (v2+ required)");
149 return;
150 }
151
152 ImGui::TextWrapped(
153 "These flags globally enable/disable ZSCustomOverworld features. "
154 "When disabled, the game uses vanilla behavior.");
155 ImGui::Spacing();
156
157 // Area-Specific Background Color
158 bool bg_enabled =
160 if (Checkbox("Area Background Colors", &bg_enabled)) {
162 bg_enabled ? 0x01 : 0x00;
163 }
164 if (ImGui::IsItemHovered()) {
165 ImGui::SetTooltip("Enable per-area custom background color (v2+)");
166 }
167
168 // Main Palette
169 bool main_pal_enabled =
171 if (Checkbox("Custom Main Palette", &main_pal_enabled)) {
173 main_pal_enabled ? 0x01 : 0x00;
174 }
175 if (ImGui::IsItemHovered()) {
176 ImGui::SetTooltip("Enable per-area custom main palette (v2+)");
177 }
178
179 // Mosaic
180 bool mosaic_enabled =
182 if (Checkbox("Custom Mosaic Effects", &mosaic_enabled)) {
184 mosaic_enabled ? 0x01 : 0x00;
185 }
186 if (ImGui::IsItemHovered()) {
187 ImGui::SetTooltip("Enable per-area mosaic effect control (v2+)");
188 }
189
190 // Animated GFX
191 bool anim_enabled =
193 if (Checkbox("Custom Animated GFX", &anim_enabled)) {
195 anim_enabled ? 0x01 : 0x00;
196 }
197 if (ImGui::IsItemHovered()) {
198 ImGui::SetTooltip("Enable per-area animated tile graphics (v3+)");
199 }
200
201 // Subscreen Overlay
202 bool overlay_enabled =
204 if (Checkbox("Custom Subscreen Overlay", &overlay_enabled)) {
206 overlay_enabled ? 0x01 : 0x00;
207 }
208 if (ImGui::IsItemHovered()) {
209 ImGui::SetTooltip("Enable per-area visual effect overlays (v3+)");
210 }
211
212 // Tile GFX Groups
213 bool tile_gfx_enabled =
215 if (Checkbox("Custom Tile GFX Groups", &tile_gfx_enabled)) {
217 tile_gfx_enabled ? 0x01 : 0x00;
218 }
219 if (ImGui::IsItemHovered()) {
220 ImGui::SetTooltip("Enable per-area custom tile graphics groups (v3+)");
221 }
222 }
223};
224
225} // namespace gui
226} // namespace yaze
227
228#endif // YAZE_APP_GUI_FEATURE_FLAGS_MENU_H
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:28
bool is_loaded() const
Definition rom.h:132
static Flags & get()
Definition features.h:118
const Theme & GetCurrentTheme() const
static ThemeManager & Get()
static bool SupportsCustomBGColors(OverworldVersion version)
Check if ROM supports custom background colors per area (v2+)
static OverworldVersion GetVersion(const Rom &rom)
Detect ROM version from ASM marker byte.
ImVec4 ConvertColorToImVec4(const Color &color)
Definition color.h:134
constexpr int OverworldCustomTileGFXGroupEnabled
constexpr int OverworldCustomAreaSpecificBGEnabled
constexpr int OverworldCustomAnimatedGFXEnabled
constexpr int OverworldCustomMainPaletteEnabled
constexpr int OverworldCustomMosaicEnabled
constexpr int OverworldCustomSubscreenOverlayEnabled
void DrawZSCustomOverworldFlags(Rom *rom)