17#include "absl/status/status.h"
18#include "absl/strings/str_cat.h"
19#include "absl/strings/str_format.h"
20#include "absl/time/clock.h"
21#include "absl/time/time.h"
28#include "imgui/imgui.h"
52 "Captured room screenshot to %s";
56 "Copied report to clipboard and saved issue report to %s";
58 "Copied diagnostics and saved issue report to %s";
65 const int layer_value =
object.GetLayerValue();
67 if (layer_value == 0) {
68 return "Upper layer (BG1)";
70 return layer_value == 1 ?
"Lower layer (BG2)" :
"Invalid selector";
72 switch (layer_value) {
85 static const char* kGroupNames[] = {
86 "HC/Sewers",
"Eastern",
"Desert",
"Hera",
"A-Tower",
"PoD",
"Swamp",
87 "Skull",
"Thieves",
"Ice",
"Misery",
"Turtle",
"GT",
89 constexpr size_t kCount =
sizeof(kGroupNames) /
sizeof(kGroupNames[0]);
90 return blockset < kCount ? kGroupNames[blockset] :
"Custom";
94 return absl::FormatTime(
"%Y%m%d-%H%M%S", absl::Now(), absl::LocalTimeZone());
98 return absl::FormatTime(
"%Y-%m-%d %H:%M:%S %Z", absl::Now(),
99 absl::LocalTimeZone());
103 const auto blocks = room.
blocks();
104 if (blocks.size() < 8) {
105 return "BG sheets: unavailable";
107 return absl::StrFormat(
108 "BG sheets: [%02X %02X %02X %02X %02X %02X %02X %02X]",
109 static_cast<int>(blocks[0]),
static_cast<int>(blocks[1]),
110 static_cast<int>(blocks[2]),
static_cast<int>(blocks[3]),
111 static_cast<int>(blocks[4]),
static_cast<int>(blocks[5]),
112 static_cast<int>(blocks[6]),
static_cast<int>(blocks[7]));
118 return absl::StrFormat(
119 "storage=special-table selector=%d (%s) routine=%d "
120 "legacy_both_bgs=%s "
123 semantics.draws_to_both_bgs ?
"yes" :
"no",
126 return absl::StrFormat(
127 "stream=%s draw_layer=%d effective_bg=%s routine=%d "
128 "legacy_both_bgs=%s "
134 semantics.routine_id, semantics.draws_to_both_bgs ?
"yes" :
"no",
151 size_t max_count, std::string_view prefix) {
152 std::string out = absl::StrFormat(
"%s count=%zu", std::string(prefix).c_str(),
154 const size_t preview_count = std::min<size_t>(tiles.size(), max_count);
155 for (
size_t i = 0; i < preview_count; ++i) {
156 const auto& tile = tiles[i];
157 out += absl::StrFormat(
" [%zu]=0x%03X/p%d/pr%d/h%d/v%d", i, tile.id_,
158 static_cast<int>(tile.palette_), tile.over_ ? 1 : 0,
159 tile.horizontal_mirror_ ? 1 : 0,
160 tile.vertical_mirror_ ? 1 : 0);
162 if (tiles.size() > preview_count) {
163 out += absl::StrFormat(
" ... %zu more", tiles.size() - preview_count);
170 std::vector<zelda3::ObjectDrawer::TileTrace>
writes;
176 if (rom ==
nullptr || !rom->
is_loaded()) {
177 return {.
summary =
"\nDrawer trace: unavailable (ROM not loaded)"};
183 std::vector<zelda3::ObjectDrawer::TileTrace> trace;
185 const auto status = drawer.
DrawObject(obj, bg1, bg2, palette_group);
188 return {.summary = absl::StrFormat(
"\nDrawer trace: unavailable (%s)",
189 std::string(status.message()).c_str())};
193 return {.summary =
"\nDrawer trace: status=ok writes=0"};
196 int min_x = std::numeric_limits<int>::max();
197 int min_y = std::numeric_limits<int>::max();
198 int max_x = std::numeric_limits<int>::min();
199 int max_y = std::numeric_limits<int>::min();
200 std::array<int, 3> layer_counts = {0, 0, 0};
201 std::set<std::tuple<int, int, uint8_t>> unique_cells;
202 for (
const auto& write : trace) {
203 min_x = std::min<int>(min_x, write.x_tile);
204 min_y = std::min<int>(min_y, write.y_tile);
205 max_x = std::max<int>(max_x, write.x_tile);
206 max_y = std::max<int>(max_y, write.y_tile);
207 if (write.layer < layer_counts.size()) {
208 ++layer_counts[write.layer];
210 unique_cells.insert({write.x_tile, write.y_tile, write.layer});
213 std::string out = absl::StrFormat(
214 "\nDrawer trace: status=ok writes=%zu unique_cells=%zu "
215 "bounds_tiles=(%d,%d)..(%d,%d) layer_counts BG1=%d BG2=%d BG3=%d",
216 trace.size(), unique_cells.size(), min_x, min_y, max_x, max_y,
221 const size_t preview_count = std::min<size_t>(trace.size(), 12);
222 for (
size_t i = 0; i < preview_count; ++i) {
223 const auto& write = trace[i];
224 const int palette = (write.flags >> 3) & 0x7;
225 out += absl::StrFormat(
226 "\n write[%zu] %s tile=(%d,%d) id=0x%03X pal=%d pri=%d h=%d v=%d", i,
227 TraceLayerLabel(write.layer), write.x_tile, write.y_tile, write.tile_id,
228 palette, (write.flags & 0x4) ? 1 : 0, (write.flags & 0x1) ? 1 : 0,
229 (write.flags & 0x2) ? 1 : 0);
231 if (trace.size() > preview_count) {
232 out += absl::StrFormat(
"\n ... %zu more write(s)",
233 trace.size() - preview_count);
235 return {.summary = std::move(out), .writes = std::move(trace)};
245 uint8_t trace_flags) {
246 if ((palette_index & 0x0F) == 0) {
249 const uint8_t trace_palette =
static_cast<uint8_t
>((trace_flags >> 3) & 0x7);
250 return static_cast<uint8_t
>((palette_index >> 4) & 0x7) == trace_palette;
254 std::span<const zelda3::ObjectDrawer::TileTrace> trace,
256 constexpr std::array<std::pair<int, int>, 6> kPreferredOffsets = {
257 std::pair{4, 4}, std::pair{3, 3}, std::pair{0, 0},
258 std::pair{7, 7}, std::pair{0, 7}, std::pair{7, 0},
261 for (
size_t i = 0; i < trace.size(); ++i) {
262 const auto& write = trace[i];
263 const int tile_origin_x = write.x_tile * 8;
264 const int tile_origin_y = write.y_tile * 8;
265 const auto label = absl::StrFormat(
266 "object-trace[%zu] tile=(%d,%d) pal=%d", i, write.x_tile, write.y_tile,
267 static_cast<int>((write.flags >> 3) & 0x7));
269 for (
const auto& [dx, dy] : kPreferredOffsets) {
270 const int sample_x = tile_origin_x + dx;
271 const int sample_y = tile_origin_y + dy;
272 const auto comp = palette_debugger.
SamplePixelAt(sample_x, sample_y);
278 for (
int dy = 0; dy < 8; ++dy) {
279 for (
int dx = 0; dx < 8; ++dx) {
280 const int sample_x = tile_origin_x + dx;
281 const int sample_y = tile_origin_y + dy;
282 const auto comp = palette_debugger.
SamplePixelAt(sample_x, sample_y);
285 .
label = label, .x = sample_x, .y = sample_y};
291 if (!trace.empty()) {
292 const auto& write = trace.front();
294 .
label = absl::StrFormat(
"object-trace[0] tile=(%d,%d) pal=%d fallback",
295 write.x_tile, write.y_tile,
296 static_cast<int>((write.flags >> 3) & 0x7)),
297 .x = write.x_tile * 8 + 4,
298 .y = write.y_tile * 8 + 4};
305 std::span<const zelda3::ObjectDrawer::TileTrace> trace,
int selection_x_px,
306 int selection_y_px,
int selection_w_px,
int selection_h_px) {
308 return "trace: writes=0";
311 int min_x = std::numeric_limits<int>::max();
312 int min_y = std::numeric_limits<int>::max();
313 int max_x = std::numeric_limits<int>::min();
314 int max_y = std::numeric_limits<int>::min();
315 std::set<std::tuple<int, int, uint8_t>> unique_cells;
316 for (
const auto& write : trace) {
317 min_x = std::min<int>(min_x, write.x_tile);
318 min_y = std::min<int>(min_y, write.y_tile);
319 max_x = std::max<int>(max_x, write.x_tile);
320 max_y = std::max<int>(max_y, write.y_tile);
321 unique_cells.insert({write.x_tile, write.y_tile, write.layer});
324 const int trace_x_px = min_x * 8;
325 const int trace_y_px = min_y * 8;
326 const int trace_w_px = (max_x - min_x + 1) * 8;
327 const int trace_h_px = (max_y - min_y + 1) * 8;
328 return absl::StrFormat(
329 "trace: writes=%zu unique_cells=%zu bounds_px=(%d,%d,%d,%d) "
330 "delta_vs_selection_px=(%+d,%+d,%+d,%+d)",
331 trace.size(), unique_cells.size(), trace_x_px, trace_y_px, trace_w_px,
332 trace_h_px, trace_x_px - selection_x_px, trace_y_px - selection_y_px,
333 trace_w_px - selection_w_px, trace_h_px - selection_h_px);
337 std::string_view label) {
342 const auto [bounds_x, bounds_y, bounds_w, bounds_h] = door.
GetBounds();
343 const auto [editor_x, editor_y, editor_w, editor_h] = door.
GetEditorBounds();
344 const auto [encoded_b1, encoded_b2] = door.
EncodeBytes();
346 return absl::StrFormat(
348 "- type=%s (0x%02X)\n"
349 "- direction=%s (%d)\n"
351 "- tile_coords=(%d,%d) pixel_coords=(%d,%d)\n"
352 "- dims_tiles=(%d,%d) editor_dims_tiles=(%d,%d)\n"
353 "- bounds_px=(%d,%d,%d,%d) editor_bounds_px=(%d,%d,%d,%d)\n"
354 "- encoded=(0x%02X,0x%02X) original=(0x%02X,0x%02X)",
355 std::string(label).c_str(), index,
357 static_cast<int>(door.
type),
360 tile_y, pixel_x, pixel_y, dims.width_tiles, dims.height_tiles,
361 editor_dims.width_tiles, editor_dims.height_tiles, bounds_x, bounds_y,
362 bounds_w, bounds_h, editor_x, editor_y, editor_w, editor_h, encoded_b1,
371 return std::filesystem::path(rom.
filename()).filename().string();
373 const std::string title = rom.
title();
374 return title.empty() ?
"in-memory ROM" : title;
381 const std::string rom_path =
383 ? std::string(
"in-memory")
385 summary += absl::StrFormat(
390 summary +=
"ROM: unavailable";
394 summary += absl::StrFormat(
406 return absl::StrFormat(
"- [%s] palette=%d colors=%d %s",
411 return absl::StrFormat(
"- [%s] palette=%d %s", event.
location.c_str(),
415 return absl::StrFormat(
"- [%s] colors=%d %s", event.
location.c_str(),
418 return absl::StrFormat(
"- [%s] %s", event.
location.c_str(),
430 std::string entrance_context =
"Entrance:none";
432 const std::string entrance_id_text =
436 const std::string entrance_blockset_text =
437 entrance_blockset != 0xFF
438 ? absl::StrFormat(
"%02X",
static_cast<int>(entrance_blockset))
441 absl::StrFormat(
"Entrance:%s EB:%s", entrance_id_text.c_str(),
442 entrance_blockset_text.c_str());
445 std::string summary = absl::StrFormat(
446 "Room 0x%03X [%s] | B:%02X P:%02X->%02X L:%02X S:%02X | %s | Group:%s | "
447 "Floor:%d Effect:%d Tag1:%d Tag2:%d\n%s\n%s",
450 entrance_context, GetBlocksetGroupName(room.
blockset()), room.
floor1(),
453 BuildEffectiveBlockListSummary(room).c_str());
460 const auto link_diagnostics =
462 if (!link_diagnostics.links.empty() ||
463 !link_diagnostics.staircase_issues.empty()) {
464 summary +=
"\nConnectivity:";
465 for (
const auto& link : link_diagnostics.links) {
469 for (
const auto& issue : link_diagnostics.staircase_issues) {
480 std::string report =
"Dungeon Draw Issue Report\n";
482 report += absl::StrFormat(
483 "\nResolved palette group: 0x%02X\nInteraction mode: %s\nView: BG1=%s "
484 "BG2=%s Grid=%s Bounds=%s Sprites=%s Pots=%s Collision=%s Camera=%s",
496 if (!selected.empty()) {
497 report += absl::StrFormat(
"\nSelected objects: %zu", selected.size());
498 if (selected.size() == 1) {
500 const size_t index = selected.front();
501 if (index < objects.size()) {
502 const auto& obj = objects[index];
503 report += absl::StrFormat(
504 "\nObject: id=0x%03X name=%s pos=(%d,%d) size=0x%02X %s", obj.id_,
505 GetObjectName(obj.id_).c_str(), obj.x_, obj.y_, obj.size_,
506 BuildSelectedObjectSemanticsSummary(obj).c_str());
507 if (
auto tiles = obj.GetTiles(); tiles.ok()) {
509 report += FormatObjectTileSample(*tiles, 16,
"Object tiles:");
512 auto [bounds_x, bounds_y, bounds_w, bounds_h] =
514 bounds_w = std::max(bounds_w, 8);
515 bounds_h = std::max(bounds_h, 8);
516 const int origin_x = obj.x_ * 8;
517 const int origin_y = obj.y_ * 8;
518 const int center_x = bounds_x + std::max(0, (bounds_w / 2) - 1);
519 const int center_y = bounds_y + std::max(0, (bounds_h / 2) - 1);
520 report += absl::StrFormat(
521 "\nObject geometry: selection_bounds_px=(%d,%d,%d,%d) "
522 "object_origin_px=(%d,%d) center_px=(%d,%d)",
523 bounds_x, bounds_y, bounds_w, bounds_h, origin_x, origin_y,
525 const auto trace_report =
527 report += trace_report.summary;
530 auto append_sample = [&](std::string_view label,
int sample_x,
532 const auto comp = palette_debugger.SamplePixelAt(sample_x, sample_y);
533 palette_debugger.AddComparison(comp);
534 const std::string label_text(label);
535 report += absl::StrFormat(
536 "\nPalette sample %s (%d,%d): idx=%d expected=(%d,%d,%d) "
537 "actual=(%d,%d,%d) match=%s",
538 label_text.c_str(), sample_x, sample_y,
539 static_cast<int>(comp.palette_index),
540 static_cast<int>(comp.expected_r),
541 static_cast<int>(comp.expected_g),
542 static_cast<int>(comp.expected_b),
543 static_cast<int>(comp.actual_r),
static_cast<int>(comp.actual_g),
544 static_cast<int>(comp.actual_b), comp.matches ?
"yes" :
"no");
547 if (
auto trace_sample = ChooseObjectTracePaletteSample(
548 trace_report.writes, palette_debugger)) {
549 append_sample(trace_sample->label, trace_sample->x, trace_sample->y);
551 append_sample(
"selection-origin", bounds_x, bounds_y);
552 if (center_x != bounds_x || center_y != bounds_y) {
553 append_sample(
"selection-center", center_x, center_y);
557 report += absl::StrFormat(
558 "\nSelected object index %zu is stale; room currently has %zu "
559 "object(s). Reselect the object and report again if this issue "
561 index, objects.size());
568 switch (selected_entity.type) {
570 const auto& doors = room.
GetDoors();
571 if (selected_entity.index < doors.size()) {
572 const auto& door = doors[selected_entity.index];
573 report += BuildDoorIssueSummary(door, selected_entity.index,
580 if (selected_entity.index < sprites.size()) {
581 const auto& sprite = sprites[selected_entity.index];
582 report += absl::StrFormat(
583 "\nSelected entity: sprite id=0x%02X name=%s pos=(%d,%d) "
586 sprite.y(), sprite.layer());
592 if (selected_entity.index < items.size()) {
593 const auto& item = items[selected_entity.index];
595 absl::StrFormat(
"\nSelected entity: pot item=0x%02X pos=(%d,%d)",
596 item.item, item.GetPixelX(), item.GetPixelY());
606 if (!palette_events.empty()) {
608 absl::StrFormat(
"\nPalette debug events: %zu", palette_events.size());
609 const size_t preview_count = std::min<size_t>(palette_events.size(), 4);
610 const size_t start = palette_events.size() - preview_count;
611 for (
size_t i = start; i < palette_events.size(); ++i) {
612 const auto&
event = palette_events[i];
614 report += FormatPaletteDebugEventForReport(event);
623 std::string report =
"Dungeon Selection Issue Report\n";
626 absl::StrFormat(
"\nInteraction mode: %s\nResolved palette group: 0x%02X",
631 if (!selected_objects.empty()) {
633 absl::StrFormat(
"\nSelected objects: %zu", selected_objects.size());
635 const size_t preview_count = std::min<size_t>(selected_objects.size(), 4);
636 for (
size_t i = 0; i < preview_count; ++i) {
637 const size_t index = selected_objects[i];
638 if (index >= objects.size()) {
639 report += absl::StrFormat(
640 "\n- object[%zu] unavailable; room currently has %zu object(s) "
641 "(selection is stale)",
642 index, objects.size());
645 const auto& obj = objects[index];
646 report += absl::StrFormat(
647 "\n- object[%zu] id=0x%03X name=%s pos=(%d,%d) size=0x%02X %s", index,
648 obj.id_, GetObjectName(obj.id_).c_str(), obj.x_, obj.y_, obj.size_,
649 BuildSelectedObjectSemanticsSummary(obj).c_str());
650 auto [bounds_x, bounds_y, bounds_w, bounds_h] =
652 bounds_w = std::max(bounds_w, 8);
653 bounds_h = std::max(bounds_h, 8);
654 report += absl::StrFormat(
655 "\n geometry: selection_bounds_px=(%d,%d,%d,%d) "
656 "object_origin_px=(%d,%d)",
657 bounds_x, bounds_y, bounds_w, bounds_h, obj.x_ * 8, obj.y_ * 8);
658 if (
auto tiles = obj.GetTiles(); tiles.ok() && !tiles->empty()) {
660 report += FormatObjectTileSample(*tiles, 10,
"tiles:");
662 const auto trace_report =
665 report += BuildObjectTraceBoundsSummary(trace_report.writes, bounds_x,
666 bounds_y, bounds_w, bounds_h);
668 if (selected_objects.size() > preview_count) {
669 report += absl::StrFormat(
"\n- ... %zu more object(s)",
670 selected_objects.size() - preview_count);
677 switch (selected_entity.type) {
679 const auto& doors = room.
GetDoors();
680 if (selected_entity.index < doors.size()) {
681 const auto& door = doors[selected_entity.index];
682 report += BuildDoorIssueSummary(door, selected_entity.index,
690 if (selected_entity.index < sprites.size()) {
691 const auto& sprite = sprites[selected_entity.index];
692 report += absl::StrFormat(
693 "\nSelected sprite[%zu]:\n"
698 selected_entity.index, sprite.id(),
707 if (selected_entity.index < items.size()) {
708 const auto& item = items[selected_entity.index];
709 report += absl::StrFormat(
710 "\nSelected pot item[%zu]:\n"
712 "- pixel_pos=(%d,%d)",
713 selected_entity.index, item.item, item.GetPixelX(),
724 report +=
"\nNo active object or entity selection.";
733 if (!paths_or.ok()) {
764 ImGui::TextWrapped(tr(
"Log target: %s"),
769 ImGui::TextWrapped(tr(
"Screenshot dir: %s"),
773 ImGui::TextWrapped(tr(
"Screenshot: %s"),
777 ImGui::TextWrapped(tr(
"Issue log: %s"),
794 const std::string& title,
const std::string& summary,
795 const std::string& kind_label,
const std::string& diagnostics,
int room_id,
796 int default_category_index) {
802 std::clamp(default_category_index, 0,
813 if (initial_persist_status.ok()) {
815 absl::StrFormat(kIssueReportStatusStartedLog,
822 return initial_persist_status;
826 const std::string& summary,
827 const std::string& kind_label,
828 const std::string& diagnostics,
830 int default_category_index) {
832 room_id, default_category_index);
835 ImGuiWindowFlags_AlwaysAutoResize)) {
844 const char* category_preview =
846 if (ImGui::BeginCombo(tr(
"Category"), category_preview)) {
848 const bool selected =
855 ImGui::SetItemDefaultFocus();
861 ImGui::SetNextItemWidth(kIssueReportDialogWidth);
862 if (ImGui::InputTextWithHint(
"Summary", kIssueReportSummaryHint,
867 if (ImGui::InputTextMultiline(
870 ImVec2(kIssueReportDialogWidth, kIssueReportNotesHeight))) {
877 tr(
"Reports auto-save on open, screenshot capture, copy, or close."));
879 if (ImGui::CollapsingHeader(kIssueReportSectionDiagnostics,
880 ImGuiTreeNodeFlags_DefaultOpen)) {
881 ImGui::InputTextMultiline(
882 kIssueReportPopupIdDiagnostics,
885 ImVec2(kIssueReportDialogWidth, kIssueReportDiagnosticsHeight),
886 ImGuiInputTextFlags_ReadOnly);
891 ? kIssueReportCaptureButtonLabel
892 : kIssueReportRecaptureButtonLabel;
893 if (ImGui::Button(capture_label)) {
898 if (persist_status.ok()) {
900 absl::StrFormat(kIssueReportStatusSavedScreenshot,
917 absl::StrFormat(kIssueReportStatusSavedLog,
927 ImGui::SetClipboardText(report.c_str());
931 absl::StrFormat(kIssueReportStatusCopiedReport,
944 absl::StrFormat(kIssueReportStatusCopiedDiagnostics,
960 ImGui::CloseCurrentPopup();
977 report += absl::StrFormat(
983 report += absl::StrFormat(
"Screenshot: %s\n",
989 report +=
"\nDiagnostics:\n";
998 return absl::FailedPreconditionError(
999 "Room canvas region is not available for screenshot capture");
1002 const std::string timestamp = BuildIssueTimestampSlug();
1006 if (!screenshot_path_or.ok()) {
1007 return screenshot_path_or.status();
1010 yaze::test::CaptureRegion region;
1016 auto artifact_or = yaze::test::CaptureHarnessScreenshotRegion(
1017 std::optional<yaze::test::CaptureRegion>(region),
1018 screenshot_path_or->string(),
1020 if (!artifact_or.ok()) {
1021 return artifact_or.status();
1026 return absl::OkStatus();
1028 return absl::UnimplementedError(
1029 "Screenshot capture is unavailable without YAZE_WITH_GRPC");
1046 if (!log_path_or.ok()) {
1047 return log_path_or.status();
1052 return absl::OkStatus();
1058 return absl::OkStatus();
1063 return absl::OkStatus();
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
bool issue_report_popup_status_is_error_
std::string issue_report_popup_screenshot_dir_
int issue_report_category_index_
bool has_canvas_capture_region_
void MarkIssueReportDirty()
bool show_camera_quadrant_overlay_
std::string issue_report_popup_status_message_
bool IsBG1Visible(int room_id) const
std::string issue_report_popup_id_
std::string issue_report_popup_kind_
void RefreshIssueReportOutputTargets()
std::string BuildIssueReportClipboardText() const
std::string issue_report_popup_screenshot_path_
int issue_report_popup_room_id_
void SetIssueReportPopupStatus(std::string message, bool is_error)
char issue_report_summary_[256]
bool show_custom_collision_overlay_
DungeonObjectInteraction object_interaction_
void OpenIssueReportPopup(const std::string &title, const std::string &summary, const std::string &kind_label, const std::string &diagnostics, int room_id, int default_category_index)
absl::Status AppendIssueReportToLog()
std::string BuildRoomMetadataSummary(const zelda3::Room &room, int room_id) const
void DrawIssueReportStatusMessage() const
const project::YazeProject * project_
void DrawIssueReportStorageSummary() const
absl::Status EnsureIssueReportPersisted()
int canvas_capture_height_
std::string issue_report_popup_diagnostics_
gfx::PaletteGroup current_palette_group_
std::string BuildDrawIssueReport(const zelda3::Room &room, int room_id) const
absl::Status PrepareIssueReportPopup(const std::string &title, const std::string &summary, const std::string &kind_label, const std::string &diagnostics, int room_id, int default_category_index)
bool issue_report_popup_persisted_
EntityVisibility entity_visibility_
bool IsBG2Visible(int room_id) const
absl::Status CaptureIssueReportScreenshot()
char issue_report_notes_[2048]
std::string issue_report_popup_last_log_path_
std::string issue_report_popup_log_target_path_
int canvas_capture_width_
std::string issue_report_popup_title_
std::string BuildSelectionIssueReport(const zelda3::Room &room, int room_id) const
SelectedEntity GetSelectedEntity() const
std::vector< size_t > GetSelectedObjectIndices() const
InteractionModeManager & mode_manager()
bool HasEntitySelection() const
const char * GetModeName() const
Get mode name for debugging/UI.
void ClosePersistentPopup(const std::string &popup_id)
void OpenPersistentPopup(const std::string &popup_id, std::function< void()> render_callback)
static DimensionService & Get()
std::tuple< int, int, int, int > GetSelectionBoundsPixels(const RoomObject &obj) const
Draws dungeon objects to background buffers using game patterns.
void ClearTraceCollector()
absl::Status DrawObject(const RoomObject &object, gfx::BackgroundBuffer &bg1, gfx::BackgroundBuffer &bg2, const gfx::PaletteGroup &palette_group, const DungeonState *state=nullptr, gfx::BackgroundBuffer *layout_bg1=nullptr)
Draw a room object to background buffers.
void SetTraceCollector(std::vector< TileTrace > *collector, bool trace_only=false)
static PaletteDebugger & Get()
const std::vector< PaletteDebugEvent > & GetEvents() const
ColorComparison SamplePixelAt(int x, int y) const
uint8_t GetLayerValue() const
const std::vector< Door > & GetDoors() const
uint8_t spriteset() const
const std::vector< zelda3::Sprite > & GetSprites() const
const std::vector< RoomObject > & GetTileObjects() const
int ResolveDungeonPaletteId() const
uint8_t render_entrance_blockset() const
uint8_t layout_id() const
const std::vector< PotItem > & GetPotItems() const
#define ICON_MD_ADD_A_PHOTO
#define ICON_MD_ASSIGNMENT
#define ICON_MD_CONTENT_COPY
#define ICON_MD_PHOTO_CAMERA
std::string BuildEffectiveBlockListSummary(const zelda3::Room &room)
constexpr char kIssueReportSummaryHint[]
std::string BuildDoorIssueSummary(const zelda3::Room::Door &door, size_t index, std::string_view label)
bool PaletteIndexMatchesTracePalette(uint8_t palette_index, uint8_t trace_flags)
constexpr char kIssueReportStatusStartedLog[]
std::string BuildIssueTimestampSlug()
std::string BuildObjectTraceBoundsSummary(std::span< const zelda3::ObjectDrawer::TileTrace > trace, int selection_x_px, int selection_y_px, int selection_w_px, int selection_h_px)
constexpr char kIssueReportCaptureButtonLabel[]
std::optional< PaletteSamplePoint > ChooseObjectTracePaletteSample(std::span< const zelda3::ObjectDrawer::TileTrace > trace, const zelda3::PaletteDebugger &palette_debugger)
constexpr float kIssueReportDialogWidth
constexpr char kIssueReportStatusCopiedDiagnostics[]
constexpr char kIssueReportPopupIdDiagnostics[]
std::string BuildRomDisplayName(const Rom &rom)
std::string BuildSelectedObjectSemanticsSummary(const zelda3::RoomObject &obj)
std::string BuildIssueTimestampDisplay()
constexpr char kIssueReportStatusSavedLog[]
std::string FormatPaletteDebugEventForReport(const zelda3::PaletteDebugEvent &event)
constexpr char kIssueReportSectionPaths[]
constexpr char kIssueReportRecaptureButtonLabel[]
constexpr char kIssueReportStatusCopiedReport[]
std::string BuildReportSessionSummary(const Rom *rom, const project::YazeProject *project)
ObjectTraceReport BuildObjectTraceReport(Rom *rom, int room_id, const zelda3::RoomObject &obj, const gfx::PaletteGroup &palette_group)
constexpr char kIssueReportStatusSavedScreenshot[]
constexpr float kIssueReportDiagnosticsHeight
std::string FormatObjectTileSample(std::span< const gfx::TileInfo > tiles, size_t max_count, std::string_view prefix)
constexpr char kIssueReportSectionDiagnostics[]
const char * TraceLayerLabel(uint8_t layer)
const char * GetBlocksetGroupName(uint8_t blockset)
const char * GetStoredPlacementLabel(const zelda3::RoomObject &object)
constexpr float kIssueReportNotesHeight
Editors are the view controllers for the application.
std::string FormatDungeonConnectedLinkDescription(const DungeonConnectedRoomLink &link)
DungeonConnectedRoomLinkDiagnostics CollectDungeonConnectedRoomLinkDiagnostics(int room_id, const zelda3::Room &room, const std::function< bool(int, zelda3::DoorDirection)> &has_reciprocal_door)
const char * GetIssueCategoryLabel(int index)
constexpr std::array< const char *, 6 > kDungeonIssueCategoryLabels
absl::StatusOr< std::filesystem::path > AppendDungeonIssueLogEntry(const DungeonIssueLogEntry &entry)
absl::StatusOr< std::filesystem::path > BuildDungeonIssueScreenshotPath(int room_id, const std::string &category_label, const std::string ×tamp_slug)
absl::StatusOr< DungeonIssueReportPaths > ResolveDungeonIssueReportPaths()
std::string FormatDungeonStaircaseIssueDescription(const DungeonStaircaseIssue &issue)
void SeparatorText(const char *label)
std::string ComputeRomHash(const uint8_t *data, size_t size)
ObjectLayerSemantics GetObjectLayerSemantics(const RoomObject &object)
std::string GetRoomLabel(int id)
Convenience function to get a room label.
RoomObject::LayerType MapRoomObjectListIndexToDrawLayer(uint8_t list_index)
const char * ObjectRenderRoutingToken(ObjectRenderRouting routing)
constexpr std::string_view GetDoorDirectionName(DoorDirection dir)
Get human-readable name for door direction.
bool UsesRoomObjectStream(const RoomObject &object)
std::string GetObjectName(int object_id)
constexpr std::string_view GetDoorTypeName(DoorType type)
Get human-readable name for door type.
const char * EffectiveBgLayerLabel(EffectiveBgLayer layer)
const char * ResolveSpriteName(uint16_t id)
#define RETURN_IF_ERROR(expr)
std::string observed_issue
std::string screenshot_path
std::string timestamp_display
std::string category_label
std::vector< zelda3::ObjectDrawer::TileTrace > writes
Represents a group of palettes.
Modern project structure with comprehensive settings consolidation.
bool project_opened() const
std::string GetDisplayName() const
Represents a door in a dungeon room.
std::tuple< int, int, int, int > GetEditorBounds() const
Get editor interaction bounds (x, y, width, height in pixels)
std::tuple< int, int, int, int > GetBounds() const
Get bounding rectangle (x, y, width, height in pixels)
uint8_t byte1
Original ROM byte 1 (position data)
DoorDimensions GetDimensions() const
Get door dimensions in tiles.
DoorType type
Door type (determines appearance/behavior)
std::pair< uint8_t, uint8_t > EncodeBytes() const
Encode door data for ROM storage.
DoorDirection direction
Which wall the door is on.
DoorDimensions GetEditorDimensions() const
Get editor interaction dimensions in tiles.
uint8_t position
Encoded position (5-bit, 0-31)
std::pair< int, int > GetPixelCoords() const
Get pixel coordinates for this door.
uint8_t byte2
Original ROM byte 2 (type + direction)
std::pair< int, int > GetTileCoords() const
Get tile coordinates for this door.