3#include "absl/strings/str_format.h"
9#include "imgui/imgui.h"
17 "Vanilla ROM Hack",
"ZSCustomOverworld v2",
18 "ZSCustomOverworld v3 (Recommended)",
"Randomizer Compatible"};
21 "Standard ROM editing without custom ASM. Limited to vanilla features.",
22 "Basic overworld expansion: custom BG colors, main palettes, parent "
24 "Full overworld expansion: wide/tall areas, animated GFX, overlays, all "
26 "Compatible with ALttP Randomizer. Minimal custom features."};
53 Open(rom, rom_filename,
false);
57 bool suggest_project_creation) {
83 std::string base_name;
84 if (last_slash != std::string::npos) {
89 if (last_dot != std::string::npos && last_dot > last_slash) {
90 base_name = base_name.substr(0, base_name.find_last_of(
'.'));
120 ImGui::SetNextWindowSize(ImVec2(600, 500), ImGuiCond_FirstUseEver);
121 ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(),
122 ImGuiCond_FirstUseEver, ImVec2(0.5f, 0.5f));
124 ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse;
171 const char* version_name =
174 ImVec4 version_color;
196 "%s This ROM can be upgraded for expanded features",
208 ImGui::Checkbox(
"Upgrade ROM to ZSCustomOverworld",
214 ImGui::Text(
"Target Version:");
227 "v2: BG colors, main palettes, parent system");
229 "v3: + wide/tall areas, animated GFX, overlays");
235 ImGui::Checkbox(
"Enable special world tail (0xA0-0xBF)",
237 if (ImGui::IsItemHovered()) {
239 "Enables access to unused special world map slots.\n"
240 "REQUIRES additional ASM patch for pointer table expansion.\n"
241 "Without the patch, maps will show blank tiles (safe).");
256 ImGui::Checkbox(
"Enable custom overworld features in editor",
259 if (ImGui::IsItemHovered()) {
261 "Enables ZSCustomOverworld-specific UI elements.\n"
262 "Auto-enabled if ASM is detected in ROM.");
271 if (ImGui::BeginCombo(
"##PresetCombo",
280 if (ImGui::IsItemHovered()) {
285 ImGui::SetItemDefaultFocus();
298 :
"Show Advanced Options")) {
308 if (ImGui::TreeNodeEx(
"Overworld", ImGuiTreeNodeFlags_DefaultOpen)) {
317 if (ImGui::TreeNodeEx(
"Dungeon")) {
323 if (ImGui::TreeNodeEx(
"Graphics")) {
339 ImGui::Text(
"Project Name:");
340 ImGui::SetNextItemWidth(-1);
347 "Project file stores settings, labels, and preferences.");
354 const float button_width = 120.0f;
355 const float spacing = 10.0f;
356 float total_width = button_width * 2 + spacing;
359 float avail = ImGui::GetContentRegionAvail().x;
360 ImGui::SetCursorPosX((avail - total_width) * 0.5f + ImGui::GetCursorPosX());
363 if (ImGui::Button(
"Cancel", ImVec2(button_width, 0))) {
368 ImGui::SameLine(0, spacing);
375 gui::StyleColorGuard btn_guard(
376 {{ImGuiCol_Button, accent},
377 {ImGuiCol_ButtonHovered,
378 ImVec4(accent.x * 1.1f, accent.y * 1.1f, accent.z * 1.1f, accent.w)},
379 {ImGuiCol_ButtonActive, ImVec4(accent.x * 0.9f, accent.y * 0.9f,
380 accent.z * 0.9f, accent.w)}});
382 if (ImGui::Button(absl::StrFormat(
"%s Continue",
ICON_MD_CHECK).c_str(),
383 ImVec2(button_width, 0))) {
405 if (preset_name ==
"Vanilla ROM Hack") {
415 }
else if (preset_name ==
"ZSCustomOverworld v2") {
427 }
else if (preset_name ==
"ZSCustomOverworld v3 (Recommended)") {
439 }
else if (preset_name ==
"Randomizer Compatible") {
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
Rom * rom()
Get the current ROM instance.
ImVec4 ConvertColorToImVec4(const Color &color)
ImVec4 GetTextSecondaryVec4()
@ 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