6#include "absl/strings/str_format.h"
11#include "imgui/imgui.h"
19using ImGui::Separator;
24 : overworld_(overworld),
26 map_properties_system_(map_properties_system) {}
29 bool& current_map_lock,
int& game_state,
30 bool& show_custom_bg_color_editor,
31 bool& show_overlay_editor) {
37 if (ImGui::BeginChild(
"OverworldSidebar", ImVec2(0, 0),
false,
38 ImGuiWindowFlags_None)) {
39 ImGui::PushID(
"OverworldSidebar");
46 ImGui::TextDisabled(tr(
"Current map selection is invalid."));
48 tr(
"Hover or jump to a valid overworld map to continue."));
59 if (ImGui::CollapsingHeader(tr(
"General Settings"),
60 ImGuiTreeNodeFlags_DefaultOpen)) {
62 show_custom_bg_color_editor, show_overlay_editor);
65 if (ImGui::CollapsingHeader(tr(
"Graphics"),
66 ImGuiTreeNodeFlags_DefaultOpen)) {
70 if (ImGui::CollapsingHeader(tr(
"Sprites"))) {
74 if (ImGui::CollapsingHeader(tr(
"Music"))) {
83 bool& show_custom_bg_color_editor,
84 bool& show_overlay_editor) {
117 uint8_t sprite_palette =
132 for (
int i = 0; i < 4; ++i) {
134 const std::string label = absl::StrFormat(
"Music Byte %d", i + 1);
143 bool& current_map_lock) {
146 const int clamped_world = std::clamp(current_world, 0, 2);
147 ImGui::TextDisabled(tr(
"World: %s"),
kWorldNames[clamped_world]);
150 ImGui::Text(tr(
"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");
165 uint8_t area_graphics =
173 uint8_t sprite_graphics =
184 uint8_t animated_gfx =
195 if (ImGui::TreeNode(
"Custom Tile Graphics")) {
196 if (ImGui::BeginTable(
"CustomTileGraphics", 2,
197 ImGuiTableFlags_SizingFixedFit)) {
198 for (
int i = 0; i < 8; i++) {
199 ImGui::TableNextColumn();
200 std::string label = absl::StrFormat(
"Sheet %d", i);
201 uint8_t custom_tileset =
209 if (ImGui::IsItemHovered()) {
210 ImGui::SetTooltip(tr(
"Custom graphics sheet %d (0x00-0xFF)"), i);
221 bool& show_custom_bg_color_editor) {
234 uint8_t main_palette =
243 uint8_t sprite_palette =
254 show_custom_bg_color_editor = !show_custom_bg_color_editor;
260 bool& show_overlay_editor) {
261 if (ImGui::BeginTable(
"ConfigTable", 2, ImGuiTableFlags_SizingFixedFit)) {
262 ImGui::TableSetupColumn(
"Label", ImGuiTableColumnFlags_WidthFixed, 100.0f);
263 ImGui::TableSetupColumn(
"Control", ImGuiTableColumnFlags_WidthStretch);
266 ImGui::TableNextColumn();
268 ImGui::TableNextColumn();
269 ImGui::SetNextItemWidth(-1);
276 ImGui::TableNextColumn();
278 ImGui::TableNextColumn();
281 int current_area_size =
284 ImGui::SetNextItemWidth(-1);
286 if (ImGui::Combo(
"##AreaSize", ¤t_area_size,
kAreaSizeNames, 4)) {
292 const char* limited_names[] = {
"Small (1x1)",
"Large (2x2)"};
293 int limited_size = (current_area_size == 0 || current_area_size == 1)
296 if (ImGui::Combo(
"##AreaSize", &limited_size, limited_names, 2)) {
301 static_cast<int>(size)});
306 ImGui::TableNextColumn();
308 ImGui::TableNextColumn();
309 ImGui::SetNextItemWidth(-1);
322 if (ImGui::Button(
ICON_MD_LAYERS " Visual Effects", ImVec2(-1, 0))) {
323 show_overlay_editor = !show_overlay_editor;
333 std::array<bool, 4> mosaic_expanded = current_map_ptr->mosaic_expanded();
334 const char* direction_names[] = {
"North",
"South",
"East",
"West"};
336 if (ImGui::BeginTable(
"MosaicTable", 2)) {
337 for (
int i = 0; i < 4; i++) {
338 ImGui::TableNextColumn();
339 if (ImGui::Checkbox(direction_names[i], &mosaic_expanded[i])) {
342 mosaic_expanded[i] ? 1 : 0});
350 if (ImGui::Checkbox(tr(
"Mosaic Effect"), &mosaic)) {
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
absl::Status ApplyPropertyEdit(const OverworldPropertyEdit &edit)
void RefreshMapProperties()
void RefreshOverworldMap()
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)
#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)
@ kVanilla
0xFF in ROM, no ZScream ASM applied