yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
door_editor_content.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_DUNGEON_INSPECTORS_DOOR_EDITOR_CONTENT_H_
2#define YAZE_APP_EDITOR_DUNGEON_INSPECTORS_DOOR_EDITOR_CONTENT_H_
3
4#include <functional>
5#include <string>
6
10#include "app/gui/core/icons.h"
12
13namespace yaze::editor {
14
16 public:
17 std::string GetId() const override { return "dungeon.door_editor"; }
18 std::string GetDisplayName() const override { return "Door Editor"; }
19 std::string GetIcon() const override { return ICON_MD_DOOR_FRONT; }
20 std::string GetEditorCategory() const override { return "Dungeon"; }
21 int GetPriority() const override { return 68; }
22 std::string GetWorkflowGroup() const override { return "Editors"; }
23 float GetPreferredWidth() const override { return 420.0f; }
24
25 void Draw(bool* p_open) override;
26 void OnClose() override;
27
28 void SetCurrentRoom(int room_id) { current_room_id_ = room_id; }
29 void SetCanvasViewerProvider(std::function<DungeonCanvasViewer*()> provider) {
30 canvas_viewer_provider_ = std::move(provider);
31 }
33 void SetRooms(DungeonRoomStore* rooms) { rooms_ = rooms; }
34 void SetOpenSelectionInspectorCallback(std::function<void()> callback) {
35 open_selection_inspector_callback_ = std::move(callback);
36 }
37
38 // Callback fired by the "Jump to Reciprocal" button. Takes the neighbor
39 // room id and the index of the paired door in that room.
41 std::function<void(int neighbor_room_id, size_t reciprocal_door_index)>
42 callback) {
43 on_jump_to_reciprocal_door_ = std::move(callback);
44 }
45
46 private:
48 void CancelPlacement();
49
56 std::function<void(int, size_t)> on_jump_to_reciprocal_door_;
58};
59
60} // namespace yaze::editor
61
62#endif // YAZE_APP_EDITOR_DUNGEON_INSPECTORS_DOOR_EDITOR_CONTENT_H_
void SetOpenSelectionInspectorCallback(std::function< void()> callback)
void SetJumpToReciprocalDoorCallback(std::function< void(int neighbor_room_id, size_t reciprocal_door_index)> callback)
std::string GetId() const override
Unique identifier for this panel.
int GetPriority() const override
Get display priority for menu ordering.
DungeonCanvasViewer * ResolveCanvasViewer()
float GetPreferredWidth() const override
Get preferred width for this panel (optional)
std::string GetEditorCategory() const override
Editor category this panel belongs to.
std::function< DungeonCanvasViewer *()> canvas_viewer_provider_
void OnClose() override
Called when panel is hidden.
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
void SetCanvasViewerProvider(std::function< DungeonCanvasViewer *()> provider)
void Draw(bool *p_open) override
Draw the panel content.
void SetRooms(DungeonRoomStore *rooms)
std::function< void()> open_selection_inspector_callback_
std::function< void(int, size_t)> on_jump_to_reciprocal_door_
void SetCanvasViewer(DungeonCanvasViewer *viewer)
std::string GetWorkflowGroup() const override
Optional workflow group for hack-centric actions.
std::string GetIcon() const override
Material Design icon for this panel.
Base interface for all logical window content components.
#define ICON_MD_DOOR_FRONT
Definition icons.h:613
Editors are the view controllers for the application.
DoorType
Door types from ALTTP.
Definition door_types.h:33
@ NormalDoor
Normal door (upper layer)