10using ImGui::BeginTable;
11using ImGui::TableNextColumn;
17 bool scratch_has_data,
Rom* rom,
19 if (!overworld || !overworld->
is_loaded() || !panel_manager)
return;
22 if (BeginTable(
"CanvasToolbar", 8,
23 ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit,
25 ImGui::TableSetupColumn(
"World", ImGuiTableColumnFlags_WidthFixed,
27 ImGui::TableSetupColumn(
"Map", ImGuiTableColumnFlags_WidthFixed,
29 ImGui::TableSetupColumn(
"Area Size", ImGuiTableColumnFlags_WidthFixed,
31 ImGui::TableSetupColumn(
"Lock", ImGuiTableColumnFlags_WidthFixed,
33 ImGui::TableSetupColumn(
"Mode", ImGuiTableColumnFlags_WidthFixed,
35 ImGui::TableSetupColumn(
"Entity",
36 ImGuiTableColumnFlags_WidthStretch);
37 ImGui::TableSetupColumn(
"Panels", ImGuiTableColumnFlags_WidthFixed, 320.0f);
38 ImGui::TableSetupColumn(
"Sidebar", ImGuiTableColumnFlags_WidthFixed, 50.0f);
42 ImGui::Combo(
"##world", ¤t_world,
kWorldNames, 3);
45 ImGui::Text(
"%d (0x%02X)", current_map, current_map);
52 int current_area_size =
53 static_cast<int>(overworld->
overworld_map(current_map)->area_size());
58 if (ImGui::Combo(
"##AreaSize", ¤t_area_size,
kAreaSizeNames, 4)) {
68 const char* limited_names[] = {
"Small (1x1)",
"Large (2x2)"};
69 int limited_size = (current_area_size == 0 || current_area_size == 1)
73 if (ImGui::Combo(
"##AreaSize", &limited_size, limited_names, 2)) {
86 HOVER_HINT(
"Small (1x1) and Large (2x2) maps. Wide/Tall require v3+");
93 current_map_lock = !current_map_lock;
95 HOVER_HINT(current_map_lock ?
"Unlock Map" :
"Lock Map");
99 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(2, 0));
104 HOVER_HINT(
"Mouse Mode (1)\nNavigate, pan, and manage entities");
111 HOVER_HINT(
"Tile Paint Mode (2)\nDraw tiles on the map");
112 ImGui::PopStyleVar();
117 const char* entity_icon =
"";
118 const char* entity_label =
"";
119 switch (entity_edit_mode) {
122 entity_label =
"Entrances";
126 entity_label =
"Exits";
130 entity_label =
"Items";
134 entity_label =
"Sprites";
138 entity_label =
"Transports";
142 entity_label =
"Music";
147 ImGui::TextColored(ImVec4(0.4f, 0.8f, 1.0f, 1.0f),
"%s %s", entity_icon,
151 const char* version_label =
"Vanilla";
152 ImVec4 version_color = ImVec4(0.6f, 0.6f, 0.6f, 1.0f);
153 bool show_upgrade =
false;
155 switch (rom_version) {
157 version_label =
"Vanilla";
158 version_color = ImVec4(0.7f, 0.7f, 0.5f, 1.0f);
162 version_label =
"ZSCustom v1";
163 version_color = ImVec4(0.5f, 0.7f, 0.9f, 1.0f);
167 version_label =
"ZSCustom v2";
168 version_color = ImVec4(0.5f, 0.9f, 0.7f, 1.0f);
172 version_label =
"ZSCustom v3";
173 version_color = ImVec4(0.3f, 1.0f, 0.5f, 1.0f);
177 ImGui::TextColored(version_color,
ICON_MD_INFO " %s", version_label);
178 HOVER_HINT(
"ROM version determines available overworld features.\n"
179 "v2+: Custom BG colors, main palettes\n"
180 "v3+: Wide/Tall maps, custom tile GFX, animated GFX");
184 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.2f, 0.5f, 0.8f, 1.0f));
188 ImGui::PopStyleColor();
189 HOVER_HINT(
"Upgrade ROM to ZSCustomOverworld v3\n"
190 "Enables all advanced features");
196 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4, 0));
199 bool tile16_editor_visible =
210 bool tile16_selector_visible =
221 bool tile8_selector_visible =
232 bool area_gfx_visible =
243 bool gfx_groups_visible =
254 bool usage_stats_visible =
265 bool scratch_visible =
273 ImGui::PopStyleVar();
277 bool properties_visible =
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Central registry for all editor cards with session awareness and dependency injection.
bool TogglePanel(size_t session_id, const std::string &base_card_id)
bool IsPanelVisible(size_t session_id, const std::string &base_card_id) const
static OverworldVersion GetVersion(const Rom &rom)
Detect ROM version from ASM marker byte.
static bool SupportsAreaEnum(OverworldVersion version)
Check if ROM supports area enum system (v3+ only)
Represents the full Overworld data, light and dark world.
auto overworld_map(int i) const
absl::Status ConfigureMultiAreaMap(int parent_index, AreaSizeEnum size)
Configure a multi-area map structure (Large/Wide/Tall)
#define ICON_MD_GRID_VIEW
#define ICON_MD_LOCK_OPEN
#define ICON_MD_DOOR_BACK
#define ICON_MD_MUSIC_NOTE
#define ICON_MD_DOOR_FRONT
#define ICON_MD_ADD_LOCATION
#define ICON_MD_PEST_CONTROL_RODENT
#define ICON_MD_ANALYTICS
#define HOVER_HINT(string)
Editors are the view controllers for the application.
constexpr const char * kAreaSizeNames[]
constexpr float kPanelToggleButtonWidth
constexpr float kTableColumnWorld
constexpr const char * kWorldNames[]
constexpr float kComboWorldWidth
constexpr float kTableColumnMap
constexpr float kTableColumnAreaSize
constexpr float kIconButtonWidth
constexpr float kComboAreaSizeWidth
constexpr float kTableColumnLock
bool ToggleButton(const char *label, bool active, const ImVec2 &size)
AreaSizeEnum
Area size enumeration for v3+ ROMs.
@ 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.
static constexpr const char * kMapProperties
static constexpr const char * kTile8Selector
static constexpr const char * kAreaGraphics
static constexpr const char * kScratchSpace
static constexpr const char * kTile16Editor
static constexpr const char * kTile16Selector
static constexpr const char * kGfxGroups
static constexpr const char * kUsageStats