68 ImGui::Text(
"ROM not loaded");
90 room_filter_.Draw(
"Filter", ImGui::GetContentRegionAvail().x);
100 if (ImGui::IsItemHovered()) {
101 ImGui::SetTooltip(
"Toggle between flat list and dungeon-grouped view");
103 ImGui::SameLine(0, 12);
106 const char* labels[] = {
"All",
"Sprites",
"Items",
"Objects"};
109 for (
int idx = 0; idx < 4; ++idx) {
114 ImGui::PushStyleColor(ImGuiCol_Button,
115 ImGui::GetStyleColorVec4(ImGuiCol_ButtonActive));
117 if (ImGui::SmallButton(labels[idx])) {
121 ImGui::PopStyleColor();
135 std::optional<gui::StyleVarGuard> touch_pad_guard;
137 float touch_pad = std::max(
140 touch_pad_guard.emplace(ImGuiStyleVar_CellPadding,
141 ImVec2(ImGui::GetStyle().CellPadding.x, touch_pad));
151 if (ImGui::BeginTable(
"RoomList", 2,
152 ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders |
153 ImGuiTableFlags_RowBg |
154 ImGuiTableFlags_Resizable)) {
155 ImGui::TableSetupColumn(
"ID", ImGuiTableColumnFlags_WidthFixed, 40.0f);
156 ImGui::TableSetupColumn(
"Name");
157 ImGui::TableHeadersRow();
160 ImGuiListClipper clipper;
163 while (clipper.Step()) {
164 for (
int row = clipper.DisplayStart; row < clipper.DisplayEnd; ++row) {
168 ImGui::TableNextRow();
169 ImGui::TableNextColumn();
172 snprintf(label,
sizeof(label),
"%03X", room_id);
174 ImGuiSelectableFlags_SpanAllColumns |
175 ImGuiSelectableFlags_AllowDoubleClick)) {
184 if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) {
201 if (ImGui::BeginPopupContextItem()) {
202 if (ImGui::MenuItem(
"Open in Workbench")) {
211 if (ImGui::MenuItem(
"Open as Panel")) {
222 snprintf(id_buf,
sizeof(id_buf),
"0x%03X", room_id);
223 if (ImGui::MenuItem(
"Copy Room ID")) {
224 ImGui::SetClipboardText(id_buf);
230 if (ImGui::IsItemHovered()) {
231 ImGui::BeginTooltip();
232 ImGui::Text(
"%s", display_name.c_str());
234 ImGui::TextDisabled(
"Blockset: %d | Palette: %d",
235 (*
rooms_)[room_id].blockset(),
236 (*
rooms_)[room_id].palette());
237 auto& room = (*rooms_)[room_id];
240 auto& bmp = room.GetCompositeBitmap(layer_mgr);
241 if (bmp.is_active() && bmp.texture() != 0) {
242 ImGui::Image((ImTextureID)(intptr_t)bmp.texture(),
249 ImGui::TableNextColumn();
250 ImGui::TextUnformatted(display_name.c_str());
296 ImGui::Text(
"ROM not loaded");
301 ImGui::Text(
"Entrances not loaded");
308 if (ImGui::BeginTable(
"EntranceProps", 4, ImGuiTableFlags_Borders)) {
309 ImGui::TableSetupColumn(
"Core", ImGuiTableColumnFlags_WidthStretch);
310 ImGui::TableSetupColumn(
"Position", ImGuiTableColumnFlags_WidthStretch);
311 ImGui::TableSetupColumn(
"Camera", ImGuiTableColumnFlags_WidthStretch);
312 ImGui::TableSetupColumn(
"Scroll", ImGuiTableColumnFlags_WidthStretch);
313 ImGui::TableHeadersRow();
315 ImGui::TableNextRow();
316 ImGui::TableNextColumn();
322 ImGui::TableNextColumn();
328 ImGui::TableNextColumn();
333 ImGui::TableNextColumn();
341 if (ImGui::CollapsingHeader(
"Camera Boundaries")) {
342 ImGui::Text(
" North East South West");
343 ImGui::Text(
"Quadrant ");
353 ImGui::Text(
"Full Room ");
375 constexpr int kNumSpawnPoints = 7;
377 if (ImGui::BeginTable(
"EntranceList", 3,
378 ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders |
379 ImGuiTableFlags_RowBg |
380 ImGuiTableFlags_Resizable)) {
381 ImGui::TableSetupColumn(
"ID", ImGuiTableColumnFlags_WidthFixed, 40.0f);
382 ImGui::TableSetupColumn(
"Room", ImGuiTableColumnFlags_WidthFixed, 50.0f);
383 ImGui::TableSetupColumn(
"Name");
384 ImGui::TableHeadersRow();
387 ImGuiListClipper clipper;
390 while (clipper.Step()) {
391 for (
int row = clipper.DisplayStart; row < clipper.DisplayEnd; ++row) {
393 std::string display_name;
395 if (i < kNumSpawnPoints) {
396 display_name = absl::StrFormat(
"Spawn Point %d", i);
398 int entrance_id = i - kNumSpawnPoints;
402 int room_id = (i < static_cast<int>(
entrances_->size()))
406 ImGui::TableNextRow();
407 ImGui::TableNextColumn();
410 snprintf(label,
sizeof(label),
"%02X", i);
412 ImGuiSelectableFlags_SpanAllColumns)) {
414 if (i <
static_cast<int>(
entrances_->size())) {
430 ImGui::TableNextColumn();
431 ImGui::Text(
"%03X", room_id);
433 ImGui::TableNextColumn();
434 ImGui::TextUnformatted(display_name.c_str());
514 std::vector<int> room_ids;
516 std::map<int, GroupInfo> groups;
520 const char* group_name =
"Unloaded";
521 if (
rooms_ && room_id >= 0 && room_id <
static_cast<int>(
rooms_->size()) &&
522 (*rooms_)[room_id].IsLoaded()) {
523 key = (*rooms_)[room_id].blockset();
526 auto& g = groups[key];
528 g.room_ids.push_back(room_id);
532 if (ImGui::BeginChild(
"##GroupedRoomList", ImVec2(0, 0),
false,
533 ImGuiWindowFlags_None)) {
534 for (
auto& [key, group] : groups) {
536 snprintf(header,
sizeof(header),
"%s (%zu rooms)##grp%d", group.name,
537 group.room_ids.size(), key);
541 std::find(group.room_ids.begin(), group.room_ids.end(),
544 ImGui::SetNextItemOpen(
true, ImGuiCond_Once);
547 if (ImGui::CollapsingHeader(header)) {
548 for (
int room_id : group.room_ids) {
551 snprintf(label,
sizeof(label),
"%03X %s##r%d", room_id,
552 display_name.c_str(), room_id);
555 ImGuiSelectableFlags_AllowDoubleClick)) {
563 if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) {
580 if (ImGui::IsItemHovered() &&
rooms_ &&
581 (*
rooms_)[room_id].IsLoaded()) {
582 ImGui::BeginTooltip();
583 ImGui::Text(
"%s", display_name.c_str());
584 ImGui::TextDisabled(
"Blockset: %d | Palette: %d",
585 (*
rooms_)[room_id].blockset(),
586 (*
rooms_)[room_id].palette());
587 auto& room = (*rooms_)[room_id];
590 auto& bmp = room.GetCompositeBitmap(layer_mgr);
591 if (bmp.is_active() && bmp.texture() != 0) {
592 ImGui::Image((ImTextureID)(intptr_t)bmp.texture(),
::yaze::EventBus * event_bus()
Get the current EventBus instance.