81 ImGui::Text(
"ROM not loaded");
85 if (show_room_id_input) {
105 room_filter_.Draw(
"Filter", ImGui::GetContentRegionAvail().x);
115 if (ImGui::IsItemHovered()) {
116 ImGui::SetTooltip(
"Toggle between flat list and dungeon-grouped view");
118 ImGui::SameLine(0, 12);
121 const char* labels[] = {
"All",
"Sprites",
"Items",
"Objects"};
124 for (
int idx = 0; idx < 4; ++idx) {
129 ImGui::PushStyleColor(ImGuiCol_Button,
130 ImGui::GetStyleColorVec4(ImGuiCol_ButtonActive));
132 if (ImGui::SmallButton(labels[idx])) {
136 ImGui::PopStyleColor();
150 std::optional<gui::StyleVarGuard> touch_pad_guard;
152 float touch_pad = std::max(
155 touch_pad_guard.emplace(ImGuiStyleVar_CellPadding,
156 ImVec2(ImGui::GetStyle().CellPadding.x, touch_pad));
166 if (ImGui::BeginTable(
"RoomList", 2,
167 ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders |
168 ImGuiTableFlags_RowBg |
169 ImGuiTableFlags_Resizable)) {
170 ImGui::TableSetupColumn(
"ID", ImGuiTableColumnFlags_WidthFixed, 40.0f);
171 ImGui::TableSetupColumn(
"Name");
172 ImGui::TableHeadersRow();
175 ImGuiListClipper clipper;
178 while (clipper.Step()) {
179 for (
int row = clipper.DisplayStart; row < clipper.DisplayEnd; ++row) {
183 ImGui::TableNextRow();
184 ImGui::TableNextColumn();
187 snprintf(label,
sizeof(label),
"%03X", room_id);
189 ImGuiSelectableFlags_SpanAllColumns |
190 ImGuiSelectableFlags_AllowDoubleClick)) {
199 if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) {
216 if (ImGui::BeginPopupContextItem()) {
217 if (ImGui::MenuItem(
"Open in Workbench")) {
226 if (ImGui::MenuItem(
"Open as Panel")) {
237 snprintf(id_buf,
sizeof(id_buf),
"0x%03X", room_id);
238 if (ImGui::MenuItem(
"Copy Room ID")) {
239 ImGui::SetClipboardText(id_buf);
245 if (ImGui::IsItemHovered()) {
246 ImGui::BeginTooltip();
247 ImGui::Text(
"%s", display_name.c_str());
250 if (loaded_room !=
nullptr) {
251 ImGui::TextDisabled(
"Blockset: %d | Palette: %d",
252 loaded_room->blockset(),
253 loaded_room->palette());
254 auto& room = *loaded_room;
257 auto& bmp = room.GetCompositeBitmap(layer_mgr);
258 if (bmp.is_active() && bmp.texture() != 0) {
259 ImGui::Image((ImTextureID)(intptr_t)bmp.texture(),
267 ImGui::TableNextColumn();
268 ImGui::TextUnformatted(display_name.c_str());
322 ImGui::Text(
"ROM not loaded");
327 ImGui::Text(
"Entrances not loaded");
331 if (show_properties) {
335 if (ImGui::BeginTable(
"EntranceProps", 4, ImGuiTableFlags_Borders)) {
336 ImGui::TableSetupColumn(
"Core", ImGuiTableColumnFlags_WidthStretch);
337 ImGui::TableSetupColumn(
"Position", ImGuiTableColumnFlags_WidthStretch);
338 ImGui::TableSetupColumn(
"Camera", ImGuiTableColumnFlags_WidthStretch);
339 ImGui::TableSetupColumn(
"Scroll", ImGuiTableColumnFlags_WidthStretch);
340 ImGui::TableHeadersRow();
342 ImGui::TableNextRow();
343 ImGui::TableNextColumn();
349 ImGui::TableNextColumn();
355 ImGui::TableNextColumn();
360 ImGui::TableNextColumn();
368 if (ImGui::CollapsingHeader(
"Camera Boundaries")) {
369 ImGui::Text(
" North East South West");
370 ImGui::Text(
"Quadrant ");
380 ImGui::Text(
"Full Room ");
403 constexpr int kNumSpawnPoints = 7;
405 if (ImGui::BeginTable(
"EntranceList", 3,
406 ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders |
407 ImGuiTableFlags_RowBg |
408 ImGuiTableFlags_Resizable)) {
409 ImGui::TableSetupColumn(
"ID", ImGuiTableColumnFlags_WidthFixed, 40.0f);
410 ImGui::TableSetupColumn(
"Room", ImGuiTableColumnFlags_WidthFixed, 50.0f);
411 ImGui::TableSetupColumn(
"Name");
412 ImGui::TableHeadersRow();
415 ImGuiListClipper clipper;
418 while (clipper.Step()) {
419 for (
int row = clipper.DisplayStart; row < clipper.DisplayEnd; ++row) {
421 std::string display_name;
423 if (i < kNumSpawnPoints) {
424 display_name = absl::StrFormat(
"Spawn Point %d", i);
426 int entrance_id = i - kNumSpawnPoints;
430 int room_id = (i < static_cast<int>(
entrances_->size()))
434 ImGui::TableNextRow();
435 ImGui::TableNextColumn();
438 snprintf(label,
sizeof(label),
"%02X", i);
440 ImGuiSelectableFlags_SpanAllColumns)) {
442 if (i <
static_cast<int>(
entrances_->size())) {
458 ImGui::TableNextColumn();
459 ImGui::Text(
"%03X", room_id);
461 ImGui::TableNextColumn();
462 ImGui::TextUnformatted(display_name.c_str());
542 std::vector<int> room_ids;
544 std::map<int, GroupInfo> groups;
548 const char* group_name =
"Unloaded";
551 key = loaded_room->blockset();
555 auto& g = groups[key];
557 g.room_ids.push_back(room_id);
561 if (ImGui::BeginChild(
"##GroupedRoomList", ImVec2(0, 0),
false,
562 ImGuiWindowFlags_None)) {
563 for (
auto& [key, group] : groups) {
565 snprintf(header,
sizeof(header),
"%s (%zu rooms)##grp%d", group.name,
566 group.room_ids.size(), key);
570 std::find(group.room_ids.begin(), group.room_ids.end(),
573 ImGui::SetNextItemOpen(
true, ImGuiCond_Once);
576 if (ImGui::CollapsingHeader(header)) {
577 for (
int room_id : group.room_ids) {
580 snprintf(label,
sizeof(label),
"%03X %s##r%d", room_id,
581 display_name.c_str(), room_id);
584 ImGuiSelectableFlags_AllowDoubleClick)) {
592 if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) {
609 if (ImGui::IsItemHovered() &&
rooms_) {
611 if (loaded_room !=
nullptr) {
612 ImGui::BeginTooltip();
613 ImGui::Text(
"%s", display_name.c_str());
614 ImGui::TextDisabled(
"Blockset: %d | Palette: %d",
615 loaded_room->blockset(),
616 loaded_room->palette());
617 auto& room = *loaded_room;
620 auto& bmp = room.GetCompositeBitmap(layer_mgr);
621 if (bmp.is_active() && bmp.texture() != 0) {
622 ImGui::Image((ImTextureID)(intptr_t)bmp.texture(),
::yaze::EventBus * event_bus()
Get the current EventBus instance.