1#ifndef YAZE_APP_EDITOR_DUNGEON_PANELS_DUNGEON_ROOM_PANEL_H_
2#define YAZE_APP_EDITOR_DUNGEON_PANELS_DUNGEON_ROOM_PANEL_H_
8#include "absl/strings/str_format.h"
13#include "imgui/imgui.h"
67 return absl::StrFormat(
"[%03X] %s",
room_id_,
79 void Draw(
bool* p_open)
override {
81 ImGui::TextColored(ImVec4(1, 0, 0, 1), tr(
"Room data unavailable"));
89 ImGui::TextColored(ImVec4(1, 0, 0, 1), tr(
"Failed to load room: %s"),
90 status.message().data());
97 bool needs_render =
false;
110 if (needs_render || !bg1_bitmap.is_active() || bg1_bitmap.width() == 0) {
117 ImGui::TextColored(ImVec4(0.4f, 1.0f, 0.4f, 1.0f),
120 ImGui::TextColored(ImVec4(1.0f, 0.4f, 0.4f, 1.0f),
127 if (ImGui::CollapsingHeader(tr(
"Room Controls"))) {
129 ImVec2(-FLT_MIN, 0))) {
134 ImVec2(-FLT_MIN, 0))) {
139 ImGui::Text(tr(
"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)
ResourceWindowContent 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 windows that edit specific ROM resources.
size_t session_id_
Session ID for multi-ROM editing (0 = single session)
void set_floor2(uint8_t value)
void set_floor1(uint8_t value)
void ReloadGraphics(std::optional< uint8_t > entrance_blockset=std::nullopt)
void RenderRoomGraphics()
void LoadRoomGraphics(std::optional< uint8_t > entrance_blockset=std::nullopt)
const std::vector< RoomObject > & GetTileObjects() const
bool AreObjectsLoaded() const
#define ICON_MD_CLEANING_SERVICES
std::string GetRoomLabel(int id)
Convenience function to get a room label.