feat: Introduce Layout Override Feature in DungeonCanvasViewer

- Added a new "Layout Override" section in the DungeonCanvasViewer, allowing users to enable or disable layout overrides for dungeon rooms.
- Implemented a checkbox to toggle the override and a slider to select the layout ID when enabled.
- Removed the previously disabled room layout drawing code to streamline the rendering process.
- Updated the layout management to ensure proper handling of layout IDs and visibility settings.
- Enhanced the overall user interface for better control over dungeon layout visualization.
This commit is contained in:
scawful
2025-10-10 10:14:50 -04:00
parent db517abbb3
commit b64ef74b10
17 changed files with 258 additions and 1980 deletions

View File

@@ -481,7 +481,6 @@ absl::Status HandleDungeonDescribeRoomCommand(
room.LoadObjects();
room.LoadSprites();
auto dimensions = room.GetLayout().GetDimensions();
const auto& sprites = room.GetSprites();
const auto& chests = room.GetChests();
const auto& stairs = room.GetStairs();
@@ -537,8 +536,6 @@ absl::Status HandleDungeonDescribeRoomCommand(
std::cout << absl::StrFormat(" \"name\": \"%s\",\n", room_name);
std::cout << absl::StrFormat(" \"light\": %s,\n",
room.IsLight() ? "true" : "false");
std::cout << absl::StrFormat(" \"layout\": {\"width\": %d, \"height\": %d},\n",
dimensions.first, dimensions.second);
std::cout << absl::StrFormat(
" \"counts\": {\"sprites\": %zu, \"chests\": %zu, \"stairs\": %zu, \"tile_objects\": %zu},\n",
sprite_count, chest_count, stair_count, object_count);
@@ -609,10 +606,6 @@ absl::Status HandleDungeonDescribeRoomCommand(
std::cout << "}\n";
} else {
std::cout << absl::StrFormat("🏰 Room 0x%03X — %s\n", room_id, room_name);
std::cout << absl::StrFormat(
" Layout: %d×%d tiles | Lighting: %s\n",
dimensions.first, dimensions.second,
room.IsLight() ? "light" : "dark");
std::cout << absl::StrFormat(
" Sprites: %zu Chests: %zu Stairs: %zu Tile Objects: %zu\n",
sprite_count, chest_count, stair_count, object_count);