7#include "imgui/imgui.h"
14using ImGui::Separator;
19 : overworld_(overworld),
21 map_properties_system_(map_properties_system) {}
24 bool& current_map_lock,
int& game_state,
25 bool& show_custom_bg_color_editor,
26 bool& show_overlay_editor) {
32 if (ImGui::BeginChild(
"OverworldSidebar", ImVec2(0, 0),
false,
33 ImGuiWindowFlags_None)) {
41 if (ImGui::CollapsingHeader(
"General Settings",
42 ImGuiTreeNodeFlags_DefaultOpen)) {
44 show_custom_bg_color_editor,
48 if (ImGui::CollapsingHeader(
"Graphics", ImGuiTreeNodeFlags_DefaultOpen)) {
52 if (ImGui::CollapsingHeader(
"Sprites")) {
56 if (ImGui::CollapsingHeader(
"Music")) {
64 bool& show_custom_bg_color_editor,
65 bool& show_overlay_editor) {
91 ->mutable_sprite_graphics(game_state),
101 ->mutable_sprite_palette(game_state),
114 uint8_t* music_byte =
143 bool& current_map_lock) {
146 ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
147 ImGui::Combo(
"##world", ¤t_world,
kWorldNames, 3);
150 ImGui::Text(
"ID: %02X", current_map);
153 current_map_lock = !current_map_lock;
155 if (ImGui::IsItemHovered()) {
156 ImGui::SetTooltip(current_map_lock ?
"Unlock Map" :
"Lock Map");
168 ->mutable_area_graphics(),
180 ->mutable_sprite_graphics(game_state),
192 ->mutable_animated_gfx(),
203 if (ImGui::TreeNode(
"Custom Tile Graphics")) {
204 if (ImGui::BeginTable(
"CustomTileGraphics", 2, ImGuiTableFlags_SizingFixedFit)) {
205 for (
int i = 0; i < 8; i++) {
206 ImGui::TableNextColumn();
207 std::string label = absl::StrFormat(
"Sheet %d", i);
210 ->mutable_custom_tileset(i),
217 if (ImGui::IsItemHovered()) {
218 ImGui::SetTooltip(
"Custom graphics sheet %d (0x00-0xFF)", i);
229 bool& show_custom_bg_color_editor) {
235 ->mutable_area_palette(),
247 ->mutable_main_palette(),
258 ->mutable_sprite_palette(game_state),
267 show_custom_bg_color_editor = !show_custom_bg_color_editor;
273 bool& show_overlay_editor) {
274 if (ImGui::BeginTable(
"ConfigTable", 2, ImGuiTableFlags_SizingFixedFit)) {
275 ImGui::TableSetupColumn(
"Label", ImGuiTableColumnFlags_WidthFixed, 100.0f);
276 ImGui::TableSetupColumn(
"Control", ImGuiTableColumnFlags_WidthStretch);
279 ImGui::TableNextColumn();
281 ImGui::TableNextColumn();
282 ImGui::SetNextItemWidth(-1);
289 ImGui::TableNextColumn();
291 ImGui::TableNextColumn();
294 int current_area_size =
297 ImGui::SetNextItemWidth(-1);
299 if (ImGui::Combo(
"##AreaSize", ¤t_area_size,
kAreaSizeNames, 4)) {
308 const char* limited_names[] = {
"Small (1x1)",
"Large (2x2)"};
309 int limited_size = (current_area_size == 0 || current_area_size == 1)
312 if (ImGui::Combo(
"##AreaSize", &limited_size, limited_names, 2)) {
324 ImGui::TableNextColumn();
326 ImGui::TableNextColumn();
327 ImGui::SetNextItemWidth(-1);
330 ->mutable_message_id(),
342 if (ImGui::Button(
ICON_MD_LAYERS " Visual Effects", ImVec2(-1, 0))) {
343 show_overlay_editor = !show_overlay_editor;
353 std::array<bool, 4> mosaic_expanded = current_map_ptr->mosaic_expanded();
354 const char* direction_names[] = {
"North",
"South",
"East",
"West"};
356 if (ImGui::BeginTable(
"MosaicTable", 2)) {
357 for (
int i = 0; i < 4; i++) {
358 ImGui::TableNextColumn();
359 if (ImGui::Checkbox(direction_names[i], &mosaic_expanded[i])) {
360 current_map_ptr->set_mosaic_expanded(i, mosaic_expanded[i]);
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
void RefreshMapProperties()
void RefreshOverworldMap()
absl::Status RefreshTile16Blockset()
void ForceRefreshGraphics(int map_index)
void RefreshSiblingMapGraphics(int map_index, bool include_self=false)
absl::Status RefreshMapPalette()
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.
static bool SupportsAreaEnum(OverworldVersion version)
Check if ROM supports area enum system (v3+ only)
static bool SupportsAnimatedGFX(OverworldVersion version)
Check if ROM supports animated GFX selection (v3+)
static bool SupportsExpandedSpace(OverworldVersion version)
Check if ROM uses expanded ROM space for overworld data.
Represents the full Overworld data, light and dark world.
auto overworld_map(int i) const
auto mutable_overworld_map(int i)
absl::Status ConfigureMultiAreaMap(int parent_index, AreaSizeEnum size)
Configure a multi-area map structure (Large/Wide/Tall)
#define ICON_MD_LOCK_OPEN
#define ICON_MD_PHOTO_SIZE_SELECT_LARGE
#define ICON_MD_FORMAT_COLOR_FILL
#define ICON_MD_MUSIC_NOTE
#define ICON_MD_PEST_CONTROL_RODENT
constexpr const char * kAreaSizeNames[]
constexpr const char * kWorldNames[]
constexpr float kHexByteInputWidth
constexpr const char * kGameStateNames[]
constexpr float kHexWordInputWidth
bool InputHexWordCustom(const char *label, uint16_t *data, float input_width)
bool InputHexByte(const char *label, uint8_t *data, float input_width, bool no_step)
AreaSizeEnum
Area size enumeration for v3+ ROMs.
@ kVanilla
0xFF in ROM, no ZScream ASM applied