yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
object_coverage_panel.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_DUNGEON_UI_WINDOW_OBJECT_COVERAGE_PANEL_H_
2#define YAZE_APP_EDITOR_DUNGEON_UI_WINDOW_OBJECT_COVERAGE_PANEL_H_
3
4#include <cstddef>
5#include <filesystem>
6#include <functional>
7#include <map>
8#include <optional>
9#include <string>
10#include <vector>
11
15#include "app/gui/core/icons.h"
16#include "core/project.h"
17
18namespace yaze {
19namespace editor {
20
36 public:
37 // Opens `room_id` and selects the placed object at `object_index`, which
38 // should have ID `object_id`.
40 std::function<void(int room_id, size_t object_index, int object_id)>;
41
43
44 std::string GetId() const override { return "dungeon.object_coverage"; }
45 std::string GetDisplayName() const override { return "Object Coverage"; }
46 std::string GetIcon() const override { return ICON_MD_FACT_CHECK; }
47 std::string GetEditorCategory() const override { return "Dungeon"; }
48 int GetPriority() const override { return 46; }
49 std::string GetWorkflowGroup() const override { return "Editors"; }
50
51 void Draw(bool* p_open) override;
52
53 void SetProject(project::YazeProject* project);
54 void SetRooms(DungeonRoomStore* rooms);
56 navigate_ = std::move(callback);
57 }
58 // Selects `object_id` and remembers `room_id` as where it was seen, so a
59 // verdict set next is recorded against that room.
60 void FocusObject(int object_id, int room_id);
61 // Rooms changed on disk or a different ROM was loaded.
62 void MarkRoomsDirty() { index_dirty_ = true; }
63
64 private:
66
67 void RebuildIndex();
69 void SetVerdict(int object_id, ObjectEvidenceState state);
70 void SaveEvidence();
71 void GoToOccurrence(int object_id, const ObjectOccurrence& occurrence);
72 void GoToNextObject();
73
74 // Automatic check against game tilemap captures (see
75 // scripts/agents/capture-game-room-tilemaps.py).
76 void DrawAutomaticCheck();
78 void SetCaptureDir(const std::string& dir);
79 void ReloadManifest();
81 void StepAutomaticCheck();
82 void CheckRoomAgainstGame(int room_id);
84
85 void DrawSummary();
86 void DrawFilters();
87 void DrawObjectTable(float height);
88 void DrawDetails();
89 void DrawVerdictEditor(int object_id);
90 void DrawObjectOccurrences(int object_id);
91
92 bool PassesFilters(int object_id) const;
93 std::string EvidenceContextName() const;
94
98
99 // Rebuilt by RebuildIndex().
101 // Objects whose draw code the loaded ROM hack changed.
102 std::map<int, ObjectCustomDrawCode> custom_code_;
103 std::vector<int> review_order_;
104 std::string rom_sha1_;
105 bool index_dirty_ = true;
106
108 std::filesystem::path evidence_path_;
109 std::string loaded_context_;
110 std::string status_message_;
111 bool status_is_error_ = false;
112
113 std::optional<int> selected_object_;
115 // Last room opened for each object, recorded with its verdict.
116 std::map<int, int> last_room_for_object_;
117 char note_buffer_[512] = {};
118 std::optional<int> note_buffer_object_;
119
120 std::optional<GameCaptureManifest> manifest_;
121 std::string manifest_error_;
122 std::string manifest_dir_;
124 std::vector<int> auto_queue_;
125 size_t auto_next_ = 0;
126 bool auto_running_ = false;
127 std::vector<std::string> auto_room_errors_;
129
130 char filter_text_[64] = {};
131 int state_filter_ = -1; // -1 = all, else ObjectEvidenceState value.
132 bool only_placed_ = true;
133 bool only_focus_ = false;
134};
135
136} // namespace editor
137} // namespace yaze
138
139#endif // YAZE_APP_EDITOR_DUNGEON_UI_WINDOW_OBJECT_COVERAGE_PANEL_H_
Checklist for proving each dungeon object draws like the game.
std::string GetId() const override
Unique identifier for this panel.
std::optional< GameCaptureManifest > manifest_
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
void SetRooms(DungeonRoomStore *rooms)
void FocusObject(int object_id, int room_id)
std::function< void(int room_id, size_t object_index, int object_id)> NavigateCallback
void SetNavigateCallback(NavigateCallback callback)
void SetVerdict(int object_id, ObjectEvidenceState state)
std::string GetEditorCategory() const override
Editor category this panel belongs to.
void Draw(bool *p_open) override
Draw the panel content.
std::map< int, ObjectCustomDrawCode > custom_code_
void ApplyAutomaticVerdicts(ObjectEvidenceState state)
std::string GetWorkflowGroup() const override
Optional workflow group for hack-centric actions.
void GoToOccurrence(int object_id, const ObjectOccurrence &occurrence)
std::string GetIcon() const override
Material Design icon for this panel.
void SetCaptureDir(const std::string &dir)
std::vector< std::string > auto_room_errors_
void SetProject(project::YazeProject *project)
int GetPriority() const override
Get display priority for menu ordering.
Base interface for all logical window content components.
#define ICON_MD_FACT_CHECK
Definition icons.h:721
Modern project structure with comprehensive settings consolidation.
Definition project.h:287