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 float GetPreferredWidth() const override { return 420.0f; }
23
24 void Draw(bool* p_open) override;
25 void OnClose() override;
26
27 void SetCurrentRoom(int room_id) { current_room_id_ = room_id; }
28 void SetCanvasViewerProvider(std::function<DungeonCanvasViewer*()> provider) {
29 canvas_viewer_provider_ = std::move(provider);
30 }
32 void SetRooms(DungeonRoomStore* rooms) { rooms_ = rooms; }
33 void SetOpenSelectionInspectorCallback(std::function<void()> callback) {
34 open_selection_inspector_callback_ = std::move(callback);
35 }
36
37 // Callback fired by the "Jump to Reciprocal" button. Takes the neighbor
38 // room id and the index of the paired door in that room.
40 std::function<void(int neighbor_room_id, size_t reciprocal_door_index)>
41 callback) {
42 on_jump_to_reciprocal_door_ = std::move(callback);
43 }
44
45 private:
47 void CancelPlacement();
48
55 std::function<void(int, size_t)> on_jump_to_reciprocal_door_;
57};
58
59} // namespace yaze::editor
60
61#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 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)