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