1#ifndef YAZE_APP_EDITOR_DUNGEON_PANELS_DUNGEON_ROOM_PANEL_H_
2#define YAZE_APP_EDITOR_DUNGEON_PANELS_DUNGEON_ROOM_PANEL_H_
7#include "absl/strings/str_format.h"
12#include "imgui/imgui.h"
66 return absl::StrFormat(
"[%03X] %s",
room_id_,
78 void Draw(
bool* p_open)
override {
80 ImGui::TextColored(ImVec4(1, 0, 0, 1),
"Room data unavailable");
88 ImGui::TextColored(ImVec4(1, 0, 0, 1),
"Failed to load room: %s",
89 status.message().data());
96 bool needs_render =
false;
109 if (needs_render || !bg1_bitmap.is_active() || bg1_bitmap.width() == 0) {
116 ImGui::TextColored(ImVec4(0.4f, 1.0f, 0.4f, 1.0f),
119 ImGui::TextColored(ImVec4(1.0f, 0.4f, 0.4f, 1.0f),
126 if (ImGui::CollapsingHeader(
"Room Controls")) {
127 if (ImGui::Button(
ICON_MD_REFRESH " Reload Graphics & Objects", ImVec2(-FLT_MIN, 0))) {
134 ImVec2(-FLT_MIN, 0))) {
139 ImGui::Text(
"Floor Graphics Override:");
143 static uint8_t floor_min = 0;
144 static uint8_t floor_max = 15;
146 bool changed =
false;
147 if (ImGui::SliderScalar(
"Floor1", ImGuiDataType_U8, &floor1, &floor_min,
152 if (ImGui::SliderScalar(
"Floor2", ImGuiDataType_U8, &floor2, &floor_min,
void DrawDungeonCanvas(int room_id)
Manages loading and saving of dungeon room data.
absl::Status LoadRoom(int room_id, zelda3::Room &room)
ResourcePanel for editing individual dungeon rooms.
std::string GetIcon() const override
Material Design icon for this panel.
std::string GetResourceName() const override
Human-readable resource name.
DungeonRoomLoader * room_loader_
int GetResourceId() const override
The numeric ID of the resource.
std::string GetResourceType() const override
The resource type name.
DungeonRoomPanel(size_t session_id, int room_id, zelda3::Room *room, DungeonCanvasViewer *canvas_viewer, DungeonRoomLoader *room_loader)
Construct a room panel.
DungeonCanvasViewer * canvas_viewer_
void OnResourceModified() override
Called when resource data changes externally.
int GetPriority() const override
Get display priority for menu ordering.
zelda3::Room * room() const
std::string GetEditorCategory() const override
Editor category this panel belongs to.
void Draw(bool *p_open) override
Draw the panel content.
Base class for panels that edit specific ROM resources.
size_t session_id_
Session ID for multi-ROM editing (0 = single session)
void LoadRoomGraphics(uint8_t entrance_blockset=0xFF)
void set_floor2(uint8_t value)
void set_floor1(uint8_t value)
void RenderRoomGraphics()
const std::vector< RoomObject > & GetTileObjects() const
#define ICON_MD_CLEANING_SERVICES
std::string GetRoomLabel(int id)
Convenience function to get a room label.