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