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"
5#include "imgui/imgui.h"
8
9namespace yaze {
10
11class Rom; // Forward declaration
12
13namespace gui {
14
15using ImGui::BeginMenu;
16using ImGui::Checkbox;
17using ImGui::EndMenu;
18using ImGui::MenuItem;
19using ImGui::Separator;
20
21struct FlagsMenu {
23 Checkbox("Enable Overworld Sprites",
24 &core::FeatureFlags::get().overworld.kDrawOverworldSprites);
25 Separator();
26 Checkbox("Save Overworld Maps",
27 &core::FeatureFlags::get().overworld.kSaveOverworldMaps);
28 Checkbox("Save Overworld Entrances",
29 &core::FeatureFlags::get().overworld.kSaveOverworldEntrances);
30 Checkbox("Save Overworld Exits",
31 &core::FeatureFlags::get().overworld.kSaveOverworldExits);
32 Checkbox("Save Overworld Items",
33 &core::FeatureFlags::get().overworld.kSaveOverworldItems);
34 Checkbox("Save Overworld Properties",
35 &core::FeatureFlags::get().overworld.kSaveOverworldProperties);
36 Checkbox("Enable Custom Overworld Features",
37 &core::FeatureFlags::get().overworld.kLoadCustomOverworld);
38 ImGui::SameLine();
39 if (ImGui::Button("?")) {
40 ImGui::OpenPopup("CustomOverworldHelp");
41 }
42 if (ImGui::BeginPopup("CustomOverworldHelp")) {
43 ImGui::Text("This flag enables ZSCustomOverworld features.");
44 ImGui::Text("If ZSCustomOverworld ASM is already applied to the ROM,");
45 ImGui::Text("features are auto-enabled regardless of this flag.");
46 ImGui::Text("For vanilla ROMs, enable this to use custom features.");
47 ImGui::EndPopup();
48 }
49 Checkbox("Apply ZSCustomOverworld ASM",
50 &core::FeatureFlags::get().overworld.kApplyZSCustomOverworldASM);
51
52 Separator();
53 ImGui::TextColored(ImVec4(1.0f, 0.8f, 0.2f, 1.0f), "Experimental");
54
55 Checkbox("Enable Special World Tail (0xA0-0xBF)",
56 &core::FeatureFlags::get().overworld.kEnableSpecialWorldExpansion);
57 ImGui::SameLine();
58 if (ImGui::Button("?##TailHelp")) {
59 ImGui::OpenPopup("TailExpansionHelp");
60 }
61 if (ImGui::BeginPopup("TailExpansionHelp")) {
62 ImGui::TextColored(ImVec4(1.0f, 0.5f, 0.0f, 1.0f), "EXPERIMENTAL FEATURE");
63 ImGui::Separator();
64 ImGui::Text("Enables access to special world tail maps (0xA0-0xBF).");
65 ImGui::Text("These are unused map slots that can be made editable.");
66 ImGui::Spacing();
67 ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), "REQUIRES:");
68 ImGui::BulletText("ZSCustomOverworld v3 ASM");
69 ImGui::BulletText("Pointer table expansion ASM patch");
70 ImGui::Spacing();
71 ImGui::Text("Without proper ASM patches, tail maps will show");
72 ImGui::Text("blank tiles (safe fallback behavior).");
73 ImGui::EndPopup();
74 }
75 }
76
78 Checkbox("Save Dungeon Maps", &core::FeatureFlags::get().kSaveDungeonMaps);
79 Checkbox("Enable Custom Objects", &core::FeatureFlags::get().kEnableCustomObjects);
80 ImGui::SameLine();
81 if (ImGui::Button("?##CustomObjHelp")) {
82 ImGui::OpenPopup("CustomObjectsHelp");
83 }
84 if (ImGui::BeginPopup("CustomObjectsHelp")) {
85 ImGui::Text("Enables custom dungeon object support:");
86 ImGui::BulletText("Minecart track editor panel");
87 ImGui::BulletText("Custom object graphics (0x31, 0x32)");
88 ImGui::Spacing();
89 ImGui::TextColored(ImVec4(1.0f, 0.8f, 0.2f, 1.0f), "REQUIRES:");
90 ImGui::BulletText("custom_objects_folder set in project file");
91 ImGui::BulletText("Custom object .bin files in that folder");
92 ImGui::EndPopup();
93 }
94 }
95
97 Checkbox("Save All Palettes", &core::FeatureFlags::get().kSaveAllPalettes);
98 Checkbox("Save Gfx Groups", &core::FeatureFlags::get().kSaveGfxGroups);
99 Checkbox("Save Graphics Sheets",
100 &core::FeatureFlags::get().kSaveGraphicsSheet);
101 }
102
104 Checkbox("Enable Console Logging",
105 &core::FeatureFlags::get().kLogToConsole);
106 Checkbox("Enable Performance Monitoring",
107 &core::FeatureFlags::get().kEnablePerformanceMonitoring);
108 Checkbox("Enable Tiered GFX Architecture",
109 &core::FeatureFlags::get().kEnableTieredGfxArchitecture);
110 // REMOVED: "Log Instructions" - DisassemblyViewer is always active
111 // Use the viewer's UI controls to enable/disable recording if needed
112 Checkbox("Use Native File Dialog (NFD)",
113 &core::FeatureFlags::get().kUseNativeFileDialog);
114 }
115
116 // ZSCustomOverworld ROM-level enable flags (requires loaded ROM)
118 if (!rom || !rom->is_loaded()) {
119 ImGui::TextDisabled("Load a ROM to configure ZSCustomOverworld flags");
120 return;
121 }
122
123 auto rom_version = zelda3::OverworldVersionHelper::GetVersion(*rom);
125 ImGui::TextDisabled("ROM does not support ZSCustomOverworld (v2+ required)");
126 return;
127 }
128
129 ImGui::TextWrapped(
130 "These flags globally enable/disable ZSCustomOverworld features. "
131 "When disabled, the game uses vanilla behavior.");
132 ImGui::Spacing();
133
134 // Area-Specific Background Color
135 bool bg_enabled =
137 if (Checkbox("Area Background Colors", &bg_enabled)) {
139 bg_enabled ? 0x01 : 0x00;
140 }
141 if (ImGui::IsItemHovered()) {
142 ImGui::SetTooltip("Enable per-area custom background color (v2+)");
143 }
144
145 // Main Palette
146 bool main_pal_enabled =
148 if (Checkbox("Custom Main Palette", &main_pal_enabled)) {
150 main_pal_enabled ? 0x01 : 0x00;
151 }
152 if (ImGui::IsItemHovered()) {
153 ImGui::SetTooltip("Enable per-area custom main palette (v2+)");
154 }
155
156 // Mosaic
157 bool mosaic_enabled =
159 if (Checkbox("Custom Mosaic Effects", &mosaic_enabled)) {
161 mosaic_enabled ? 0x01 : 0x00;
162 }
163 if (ImGui::IsItemHovered()) {
164 ImGui::SetTooltip("Enable per-area mosaic effect control (v2+)");
165 }
166
167 // Animated GFX
168 bool anim_enabled =
170 if (Checkbox("Custom Animated GFX", &anim_enabled)) {
172 anim_enabled ? 0x01 : 0x00;
173 }
174 if (ImGui::IsItemHovered()) {
175 ImGui::SetTooltip("Enable per-area animated tile graphics (v3+)");
176 }
177
178 // Subscreen Overlay
179 bool overlay_enabled =
181 if (Checkbox("Custom Subscreen Overlay", &overlay_enabled)) {
183 overlay_enabled ? 0x01 : 0x00;
184 }
185 if (ImGui::IsItemHovered()) {
186 ImGui::SetTooltip("Enable per-area visual effect overlays (v3+)");
187 }
188
189 // Tile GFX Groups
190 bool tile_gfx_enabled =
192 if (Checkbox("Custom Tile GFX Groups", &tile_gfx_enabled)) {
194 tile_gfx_enabled ? 0x01 : 0x00;
195 }
196 if (ImGui::IsItemHovered()) {
197 ImGui::SetTooltip("Enable per-area custom tile graphics groups (v3+)");
198 }
199 }
200};
201
202} // namespace gui
203} // namespace yaze
204
205#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:24
bool is_loaded() const
Definition rom.h:128
static Flags & get()
Definition features.h:92
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.
constexpr int OverworldCustomTileGFXGroupEnabled
constexpr int OverworldCustomAreaSpecificBGEnabled
constexpr int OverworldCustomAnimatedGFXEnabled
constexpr int OverworldCustomMainPaletteEnabled
constexpr int OverworldCustomMosaicEnabled
constexpr int OverworldCustomSubscreenOverlayEnabled
void DrawZSCustomOverworldFlags(Rom *rom)