4#include "absl/strings/str_format.h"
10#include "imgui/imgui.h"
18 "Vanilla ROM Hack",
"ZSCustomOverworld v2",
19 "ZSCustomOverworld v3 (Recommended)",
"Randomizer Compatible"};
22 "Standard ROM editing without custom ASM. Limited to vanilla features.",
23 "Basic overworld expansion: custom BG colors, main palettes, parent "
25 "Full overworld expansion: wide/tall areas, animated GFX, overlays, all "
27 "Compatible with ALttP Randomizer. Minimal custom features."};
54 Open(rom, rom_filename,
false);
58 bool suggest_project_creation) {
84 std::string base_name;
85 if (last_slash != std::string::npos) {
90 if (last_dot != std::string::npos && last_dot > last_slash) {
91 base_name = base_name.substr(0, base_name.find_last_of(
'.'));
121 ImGui::SetNextWindowSize(ImVec2(600, 500), ImGuiCond_FirstUseEver);
122 ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(),
123 ImGuiCond_FirstUseEver, ImVec2(0.5f, 0.5f));
125 ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse;
172 const char* version_name =
175 ImVec4 version_color;
197 tr(
"%s This ROM can be upgraded for expanded features"),
209 ImGui::Checkbox(tr(
"Upgrade ROM to ZSCustomOverworld"),
215 ImGui::Text(tr(
"Target Version:"));
218 if (ImGui::RadioButton(tr(
"v2 (Basic)"),
223 if (ImGui::RadioButton(tr(
"v3 (Full)"),
230 tr(
"v2: BG colors, main palettes, parent system"));
232 tr(
"v3: + wide/tall areas, animated GFX, overlays"));
238 ImGui::Checkbox(tr(
"Enable special world tail (0xA0-0xBF)"),
240 if (ImGui::IsItemHovered()) {
242 tr(
"Enables access to unused special world map slots.\n"
243 "REQUIRES additional ASM patch for pointer table expansion.\n"
244 "Without the patch, maps will show blank tiles (safe)."));
259 ImGui::Checkbox(tr(
"Enable custom overworld features in editor"),
262 if (ImGui::IsItemHovered()) {
264 tr(
"Enables ZSCustomOverworld-specific UI elements.\n"
265 "Auto-enabled if ASM is detected in ROM."));
274 if (ImGui::BeginCombo(
"##PresetCombo",
283 if (ImGui::IsItemHovered()) {
288 ImGui::SetItemDefaultFocus();
301 :
"Show Advanced Options")) {
311 if (ImGui::TreeNodeEx(
"Overworld", ImGuiTreeNodeFlags_DefaultOpen)) {
320 if (ImGui::TreeNodeEx(
"Dungeon")) {
326 if (ImGui::TreeNodeEx(
"Graphics")) {
337 ImGui::Checkbox(tr(
"Create associated project file"),
343 ImGui::Text(tr(
"Project Name:"));
344 ImGui::SetNextItemWidth(-1);
351 tr(
"Project file stores settings, labels, and preferences."));
358 const float button_width = 120.0f;
359 const float spacing = 10.0f;
360 float total_width = button_width * 2 + spacing;
363 float avail = ImGui::GetContentRegionAvail().x;
364 ImGui::SetCursorPosX((avail - total_width) * 0.5f + ImGui::GetCursorPosX());
367 if (ImGui::Button(tr(
"Cancel"), ImVec2(button_width, 0))) {
372 ImGui::SameLine(0, spacing);
380 {{ImGuiCol_Button, accent},
381 {ImGuiCol_ButtonHovered,
382 ImVec4(accent.x * 1.1f, accent.y * 1.1f, accent.z * 1.1f, accent.w)},
383 {ImGuiCol_ButtonActive, ImVec4(accent.x * 0.9f, accent.y * 0.9f,
384 accent.z * 0.9f, accent.w)}});
386 if (ImGui::Button(absl::StrFormat(
"%s Continue",
ICON_MD_CHECK).c_str(),
387 ImVec2(button_width, 0))) {
409 if (preset_name ==
"Vanilla ROM Hack") {
419 }
else if (preset_name ==
"ZSCustomOverworld v2") {
431 }
else if (preset_name ==
"ZSCustomOverworld v3 (Recommended)") {
443 }
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)
RAII guard for ImGui style colors.
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)
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