3#include "absl/strings/str_format.h"
8#include "imgui/imgui.h"
16 "ZSCustomOverworld v2",
17 "ZSCustomOverworld v3 (Recommended)",
18 "Randomizer Compatible"
22 "Standard ROM editing without custom ASM. Limited to vanilla features.",
23 "Basic overworld expansion: custom BG colors, main palettes, parent system.",
24 "Full overworld expansion: wide/tall areas, animated GFX, overlays, all features.",
25 "Compatible with ALttP Randomizer. Minimal custom features."
62 std::string base_name;
63 if (last_slash != std::string::npos) {
68 if (last_dot != std::string::npos && last_dot > last_slash) {
69 base_name = base_name.substr(0, base_name.find_last_of(
'.'));
97 ImGui::SetNextWindowSize(ImVec2(600, 500), ImGuiCond_FirstUseEver);
98 ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(),
99 ImGuiCond_FirstUseEver, ImVec2(0.5f, 0.5f));
101 ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse;
148 const char* version_name =
151 ImVec4 version_color;
154 version_color = ImVec4(0.8f, 0.8f, 0.2f, 1.0f);
158 version_color = ImVec4(0.2f, 0.6f, 0.8f, 1.0f);
161 version_color = ImVec4(0.2f, 0.8f, 0.4f, 1.0f);
164 version_color = ImVec4(0.5f, 0.5f, 0.5f, 1.0f);
172 ImGui::TextColored(ImVec4(1.0f, 0.6f, 0.2f, 1.0f),
173 "%s This ROM can be upgraded for expanded features",
185 ImGui::Checkbox(
"Upgrade ROM to ZSCustomOverworld",
191 ImGui::Text(
"Target Version:");
203 ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1.0f),
204 "v2: BG colors, main palettes, parent system");
205 ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1.0f),
206 "v3: + wide/tall areas, animated GFX, overlays");
211 ImGui::TextColored(ImVec4(1.0f, 0.8f, 0.2f, 1.0f),
"Experimental:");
212 ImGui::Checkbox(
"Enable special world tail (0xA0-0xBF)",
214 if (ImGui::IsItemHovered()) {
216 "Enables access to unused special world map slots.\n"
217 "REQUIRES additional ASM patch for pointer table expansion.\n"
218 "Without the patch, maps will show blank tiles (safe).");
225 ImGui::TextColored(ImVec4(0.5f, 0.8f, 0.5f, 1.0f),
226 "%s ROM already has ZSCustomOverworld %s",
234 ImGui::Checkbox(
"Enable custom overworld features in editor",
237 if (ImGui::IsItemHovered()) {
239 "Enables ZSCustomOverworld-specific UI elements.\n"
240 "Auto-enabled if ASM is detected in ROM.");
257 if (ImGui::IsItemHovered()) {
262 ImGui::SetItemDefaultFocus();
269 ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1.0f),
"%s",
275 :
"Show Advanced Options")) {
285 if (ImGui::TreeNodeEx(
"Overworld", ImGuiTreeNodeFlags_DefaultOpen)) {
294 if (ImGui::TreeNodeEx(
"Dungeon")) {
300 if (ImGui::TreeNodeEx(
"Graphics")) {
316 ImGui::Text(
"Project Name:");
317 ImGui::SetNextItemWidth(-1);
322 ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1.0f),
323 "Project file stores settings, labels, and preferences.");
330 const float button_width = 120.0f;
331 const float spacing = 10.0f;
332 float total_width = button_width * 2 + spacing;
335 float avail = ImGui::GetContentRegionAvail().x;
336 ImGui::SetCursorPosX((avail - total_width) * 0.5f + ImGui::GetCursorPosX());
339 if (ImGui::Button(
"Cancel", ImVec2(button_width, 0))) {
344 ImGui::SameLine(0, spacing);
350 ImGui::PushStyleColor(ImGuiCol_Button, accent);
351 ImGui::PushStyleColor(ImGuiCol_ButtonHovered,
352 ImVec4(accent.x * 1.1f, accent.y * 1.1f,
353 accent.z * 1.1f, accent.w));
354 ImGui::PushStyleColor(ImGuiCol_ButtonActive,
355 ImVec4(accent.x * 0.9f, accent.y * 0.9f,
356 accent.z * 0.9f, accent.w));
358 if (ImGui::Button(absl::StrFormat(
"%s Continue",
ICON_MD_CHECK).c_str(),
359 ImVec2(button_width, 0))) {
378 ImGui::PopStyleColor(3);
382 if (preset_name ==
"Vanilla ROM Hack") {
392 }
else if (preset_name ==
"ZSCustomOverworld v2") {
404 }
else if (preset_name ==
"ZSCustomOverworld v3 (Recommended)") {
416 }
else if (preset_name ==
"Randomizer Compatible") {
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
std::function< void(const LoadOptions &) confirm_callback_)
void ApplyPreset(const std::string &preset_name)
void Open(Rom *rom, const std::string &rom_filename)
Open the dialog after ROM detection.
int selected_preset_index_
static const char * kPresetNames[kNumPresets]
zelda3::OverworldVersion detected_version_
char project_name_buffer_[256]
std::function< absl::Status(int version)> upgrade_callback_
void DrawFeatureFlagDetails()
bool Show(bool *p_open)
Show the dialog.
void DrawUpgradeOptions()
void DrawFeatureFlagPresets()
void DrawProjectOptions()
static const char * kPresetDescriptions[kNumPresets]
std::string rom_filename_
static constexpr int kNumPresets
bool ShouldPromptUpgrade() const
Check if ROM needs upgrade prompt.
void ApplyOptionsToFeatureFlags()
void Draw(bool *p_open)
Draw the dialog (wrapper around Show)
const Theme & GetCurrentTheme() const
static ThemeManager & Get()
static OverworldVersion GetVersion(const Rom &rom)
Detect ROM version from ASM marker byte.
static const char * GetVersionName(OverworldVersion version)
Get human-readable version name for display/logging.
#define ICON_MD_AUTO_FIX_HIGH
#define ICON_MD_CHECK_CIRCLE
ImVec4 ConvertColorToImVec4(const Color &color)
@ kZSCustomV2
Parent system, BG colors, main palettes.
@ kZSCustomV1
Basic features, expanded pointers.
@ kVanilla
0xFF in ROM, no ZScream ASM applied
@ kZSCustomV3
Area enum, wide/tall areas, all features.
bool enable_tail_expansion
bool save_overworld_items
std::string selected_preset
bool save_overworld_exits
bool enable_custom_overworld
bool save_overworld_entrances