7#include "imgui/imgui.h"
17 return "Dungeon Room";
19 return "Dungeon Object";
21 return "Dungeon Sprite";
23 return "Dungeon Entrance";
25 return "Overworld Map";
27 return "Overworld Tile";
29 return "Overworld Sprite";
31 return "Overworld Entrance";
33 return "Overworld Exit";
35 return "Overworld Item";
37 return "Graphics Sheet";
110 ImGui::PopStyleColor();
114 "Click on an object in the editor to view and edit its properties.");
121 ImGui::TextDisabled(
"Selectable Items:");
122 ImGui::BulletText(
"Dungeon: Rooms, Objects, Sprites");
123 ImGui::BulletText(
"Overworld: Maps, Tiles, Entities");
124 ImGui::BulletText(
"Graphics: Sheets, Palettes");
130 ImGui::Text(
"%s", icon);
131 ImGui::PopStyleColor();
133 ImGui::Text(
"%s", title);
142 ImGui::TextDisabled(
"(Read Only)");
152 bool changed =
false;
153 ImGui::PushID(label);
155 ImGui::Text(
"%s", label);
156 ImGui::PushItemWidth(80);
160 if (ImGui::InputInt(
"##X", x, 1, 8)) {
161 *x = std::clamp(*x, min_val, max_val);
168 if (ImGui::InputInt(
"##Y", y, 1, 8)) {
169 *y = std::clamp(*y, min_val, max_val);
173 ImGui::PopItemWidth();
181 bool changed =
false;
182 ImGui::PushID(label);
184 ImGui::Text(
"%s", label);
185 ImGui::PushItemWidth(80);
189 if (ImGui::InputInt(
"##W", width, 1, 8)) {
190 *width = std::max(1, *width);
197 if (ImGui::InputInt(
"##H", height, 1, 8)) {
198 *height = std::max(1, *height);
202 ImGui::PopItemWidth();
210 const char* tooltip) {
211 bool changed =
false;
214 ImGui::PushItemWidth(80);
215 if (ImGui::InputInt(label, &val, 1, 16)) {
216 *value =
static_cast<uint8_t
>(std::clamp(val, 0, 255));
219 ImGui::PopItemWidth();
221 if (tooltip && ImGui::IsItemHovered()) {
222 ImGui::SetTooltip(
"%s", tooltip);
230 const char* tooltip) {
231 bool changed =
false;
234 ImGui::PushItemWidth(100);
235 if (ImGui::InputInt(label, &val, 1, 256)) {
236 *value =
static_cast<uint16_t
>(std::clamp(val, 0, 65535));
239 ImGui::PopItemWidth();
241 if (tooltip && ImGui::IsItemHovered()) {
242 ImGui::SetTooltip(
"%s", tooltip);
250 const char*
const items[],
252 return ImGui::Combo(label, current_item, items, items_count);
257 const char*
const flag_names[],
259 bool changed =
false;
261 if (ImGui::TreeNode(label)) {
262 for (
int i = 0; i < flag_count && i < 8; ++i) {
263 bool bit_set = (*flags >> i) & 1;
264 if (ImGui::Checkbox(flag_names[i], &bit_set)) {
281 ImGui::Text(
"%s:", label);
283 ImGui::TextDisabled(
"%s", value);
287 uint32_t value,
int digits) {
288 ImGui::Text(
"%s:", label);
291 snprintf(fmt,
sizeof(fmt),
"0x%%0%dX", digits);
292 ImGui::TextDisabled(fmt, value);
308 if (ImGui::CollapsingHeader(
"Identity", ImGuiTreeNodeFlags_DefaultOpen)) {
313 if (ImGui::CollapsingHeader(
"Layout", ImGuiTreeNodeFlags_DefaultOpen)) {
315 ImGui::TextDisabled(
"Layout properties would appear here");
316 ImGui::BulletText(
"Floor 1 tileset");
317 ImGui::BulletText(
"Floor 2 tileset");
318 ImGui::BulletText(
"Sprite graphics");
319 ImGui::BulletText(
"Room palette");
323 ImGui::CollapsingHeader(
"Advanced", ImGuiTreeNodeFlags_None)) {
324 ImGui::TextDisabled(
"Advanced room settings");
325 ImGui::BulletText(
"Room effects");
326 ImGui::BulletText(
"Message ID");
327 ImGui::BulletText(
"Tag 1 / Tag 2");
334 if (ImGui::CollapsingHeader(
"Transform", ImGuiTreeNodeFlags_DefaultOpen)) {
347 if (ImGui::CollapsingHeader(
"Object Type", ImGuiTreeNodeFlags_DefaultOpen)) {
348 ImGui::TextDisabled(
"Object ID: --");
349 ImGui::TextDisabled(
"Subtype: --");
350 ImGui::TextDisabled(
"Layer: --");
354 ImGui::CollapsingHeader(
"Raw Data", ImGuiTreeNodeFlags_None)) {
355 ImGui::TextDisabled(
"Byte 1: 0x00");
356 ImGui::TextDisabled(
"Byte 2: 0x00");
357 ImGui::TextDisabled(
"Byte 3: 0x00");
364 if (ImGui::CollapsingHeader(
"Position", ImGuiTreeNodeFlags_DefaultOpen)) {
371 if (ImGui::CollapsingHeader(
"Sprite Data", ImGuiTreeNodeFlags_DefaultOpen)) {
372 ImGui::TextDisabled(
"Sprite ID: --");
373 ImGui::TextDisabled(
"Subtype: --");
374 ImGui::TextDisabled(
"Overlord: No");
381 if (ImGui::CollapsingHeader(
"Target", ImGuiTreeNodeFlags_DefaultOpen)) {
382 ImGui::TextDisabled(
"Target Room: --");
383 ImGui::TextDisabled(
"Entry Position: --");
386 if (ImGui::CollapsingHeader(
"Properties", ImGuiTreeNodeFlags_DefaultOpen)) {
387 ImGui::TextDisabled(
"Door Type: --");
388 ImGui::TextDisabled(
"Direction: --");
395 if (ImGui::CollapsingHeader(
"Identity", ImGuiTreeNodeFlags_DefaultOpen)) {
400 if (ImGui::CollapsingHeader(
"Graphics", ImGuiTreeNodeFlags_DefaultOpen)) {
401 ImGui::TextDisabled(
"GFX Set: --");
402 ImGui::TextDisabled(
"Palette: --");
403 ImGui::TextDisabled(
"Sprite GFX: --");
404 ImGui::TextDisabled(
"Sprite Palette: --");
407 if (ImGui::CollapsingHeader(
"Properties", ImGuiTreeNodeFlags_DefaultOpen)) {
408 ImGui::TextDisabled(
"Large Map: No");
409 ImGui::TextDisabled(
"Area Size: 1x1");
410 ImGui::TextDisabled(
"Parent ID: --");
417 if (ImGui::CollapsingHeader(
"Tile Info", ImGuiTreeNodeFlags_DefaultOpen)) {
419 ImGui::TextDisabled(
"Position: --");
423 ImGui::CollapsingHeader(
"Tile16 Data", ImGuiTreeNodeFlags_None)) {
424 ImGui::TextDisabled(
"TL: 0x0000");
425 ImGui::TextDisabled(
"TR: 0x0000");
426 ImGui::TextDisabled(
"BL: 0x0000");
427 ImGui::TextDisabled(
"BR: 0x0000");
434 if (ImGui::CollapsingHeader(
"Position", ImGuiTreeNodeFlags_DefaultOpen)) {
441 if (ImGui::CollapsingHeader(
"Sprite", ImGuiTreeNodeFlags_DefaultOpen)) {
442 ImGui::TextDisabled(
"Sprite ID: --");
443 ImGui::TextDisabled(
"Map ID: --");
450 if (ImGui::CollapsingHeader(
"Position", ImGuiTreeNodeFlags_DefaultOpen)) {
457 if (ImGui::CollapsingHeader(
"Target", ImGuiTreeNodeFlags_DefaultOpen)) {
458 ImGui::TextDisabled(
"Entrance ID: --");
459 ImGui::TextDisabled(
"Target Room: --");
466 if (ImGui::CollapsingHeader(
"Exit Point", ImGuiTreeNodeFlags_DefaultOpen)) {
467 ImGui::TextDisabled(
"Exit ID: --");
474 if (ImGui::CollapsingHeader(
"Target Map", ImGuiTreeNodeFlags_DefaultOpen)) {
475 ImGui::TextDisabled(
"Room ID: --");
476 ImGui::TextDisabled(
"Target Map: --");
483 if (ImGui::CollapsingHeader(
"Position", ImGuiTreeNodeFlags_DefaultOpen)) {
490 if (ImGui::CollapsingHeader(
"Item Data", ImGuiTreeNodeFlags_DefaultOpen)) {
491 ImGui::TextDisabled(
"Item ID: --");
492 ImGui::TextDisabled(
"Map ID: --");
499 if (ImGui::CollapsingHeader(
"Sheet Info", ImGuiTreeNodeFlags_DefaultOpen)) {
501 ImGui::TextDisabled(
"Size: 128x32");
502 ImGui::TextDisabled(
"BPP: 4");
506 ImGui::CollapsingHeader(
"ROM Location", ImGuiTreeNodeFlags_None)) {
507 ImGui::TextDisabled(
"Address: --");
508 ImGui::TextDisabled(
"Compressed: Yes");
509 ImGui::TextDisabled(
"Original Size: --");
516 if (ImGui::CollapsingHeader(
"Palette Info", ImGuiTreeNodeFlags_DefaultOpen)) {
518 ImGui::TextDisabled(
"Colors: 16");
521 if (ImGui::CollapsingHeader(
"Colors", ImGuiTreeNodeFlags_DefaultOpen)) {
523 ImGui::TextDisabled(
"Color editing not yet implemented");
void DrawGraphicsSheetProperties()
void DrawDungeonEntranceProperties()
bool DrawByteProperty(const char *label, uint8_t *value, const char *tooltip=nullptr)
ChangeCallback on_change_
void DrawDungeonRoomProperties()
bool DrawFlagsProperty(const char *label, uint8_t *flags, const char *const flag_names[], int flag_count)
void DrawOverworldExitProperties()
void DrawOverworldItemProperties()
void DrawOverworldMapProperties()
bool DrawPositionEditor(const char *label, int *x, int *y, int min_val=0, int max_val=512)
void DrawOverworldTileProperties()
SelectionContext selection_
void DrawReadOnlyText(const char *label, const char *value)
void DrawOverworldSpriteProperties()
bool DrawSizeEditor(const char *label, int *width, int *height)
bool DrawWordProperty(const char *label, uint16_t *value, const char *tooltip=nullptr)
void DrawDungeonObjectProperties()
void DrawDungeonSpriteProperties()
void DrawPaletteProperties()
bool DrawComboProperty(const char *label, int *current_item, const char *const items[], int items_count)
void DrawOverworldEntranceProperties()
void ClearSelection()
Clear the current selection.
void Draw()
Draw the properties panel content.
void DrawReadOnlyHex(const char *label, uint32_t value, int digits=4)
void DrawPropertyHeader(const char *icon, const char *title)
void SetSelection(const SelectionContext &context)
Set the current selection to display/edit.
const Theme & GetCurrentTheme() const
static ThemeManager & Get()
#define ICON_MD_GRID_VIEW
#define ICON_MD_EXIT_TO_APP
#define ICON_MD_DOOR_FRONT
#define ICON_MD_PEST_CONTROL
#define ICON_MD_TOUCH_APP
const char * GetSelectionTypeName(SelectionType type)
Get a human-readable name for a selection type.
SelectionType
Types of entities that can be selected and edited.
ImVec4 GetTextDisabledVec4()
Holds information about the current selection.