yaze
0.3.2
Link to the Past ROM Editor
Loading...
Searching...
No Matches
dungeon_entrance_list_panel.h
Go to the documentation of this file.
1
#ifndef YAZE_APP_EDITOR_DUNGEON_PANELS_DUNGEON_ENTRANCE_LIST_PANEL_H_
2
#define YAZE_APP_EDITOR_DUNGEON_PANELS_DUNGEON_ENTRANCE_LIST_PANEL_H_
3
4
#include <functional>
5
#include <string>
6
7
#include "
app/editor/dungeon/dungeon_room_selector.h
"
8
#include "
app/editor/system/workspace/editor_panel.h
"
9
#include "
app/gui/core/icons.h
"
10
11
namespace
yaze
{
12
namespace
editor {
13
29
class
DungeonEntranceListPanel
:
public
WindowContent
{
30
public
:
36
explicit
DungeonEntranceListPanel
(
37
DungeonRoomSelector
*
selector
,
38
std::function<
void
(
int
)> on_entrance_selected =
nullptr
)
39
:
selector_
(
selector
),
40
on_entrance_selected_
(std::move(on_entrance_selected)) {
41
// Wire up the callback directly to the selector
42
if
(
selector_
&&
on_entrance_selected_
) {
43
selector_
->
SetEntranceSelectedCallback
(
on_entrance_selected_
);
44
}
45
}
46
47
// ==========================================================================
48
// WindowContent Identity
49
// ==========================================================================
50
51
std::string
GetId
()
const override
{
return
"dungeon.entrance_list"
; }
52
std::string
GetDisplayName
()
const override
{
return
"Entrance List"
; }
53
std::string
GetIcon
()
const override
{
return
ICON_MD_DOOR_FRONT
; }
54
std::string
GetEditorCategory
()
const override
{
return
"Dungeon"
; }
55
int
GetPriority
()
const override
{
return
25; }
56
57
// ==========================================================================
58
// WindowContent Drawing
59
// ==========================================================================
60
61
void
Draw
(
bool
* p_open)
override
{
62
if
(!
selector_
)
return
;
63
64
// Draw just the entrance selector (no tabs)
65
selector_
->
DrawEntranceSelector
();
66
}
67
68
// ==========================================================================
69
// Panel-Specific Methods
70
// ==========================================================================
71
76
void
SetEntranceSelectedCallback
(std::function<
void
(
int
)> callback) {
77
on_entrance_selected_
= std::move(callback);
78
if
(
selector_
) {
79
selector_
->
SetEntranceSelectedCallback
(
on_entrance_selected_
);
80
}
81
}
82
87
DungeonRoomSelector
*
selector
()
const
{
return
selector_
; }
88
89
private
:
90
DungeonRoomSelector
*
selector_
=
nullptr
;
91
std::function<void(
int
)>
on_entrance_selected_
;
92
};
93
94
}
// namespace editor
95
}
// namespace yaze
96
97
#endif
// YAZE_APP_EDITOR_DUNGEON_PANELS_DUNGEON_ENTRANCE_LIST_PANEL_H_
98
yaze::editor::DungeonEntranceListPanel
WindowContent for entrance list selection.
Definition
dungeon_entrance_list_panel.h:29
yaze::editor::DungeonEntranceListPanel::GetId
std::string GetId() const override
Unique identifier for this panel.
Definition
dungeon_entrance_list_panel.h:51
yaze::editor::DungeonEntranceListPanel::selector_
DungeonRoomSelector * selector_
Definition
dungeon_entrance_list_panel.h:90
yaze::editor::DungeonEntranceListPanel::on_entrance_selected_
std::function< void(int)> on_entrance_selected_
Definition
dungeon_entrance_list_panel.h:91
yaze::editor::DungeonEntranceListPanel::GetPriority
int GetPriority() const override
Get display priority for menu ordering.
Definition
dungeon_entrance_list_panel.h:55
yaze::editor::DungeonEntranceListPanel::selector
DungeonRoomSelector * selector() const
Get the underlying selector component.
Definition
dungeon_entrance_list_panel.h:87
yaze::editor::DungeonEntranceListPanel::GetIcon
std::string GetIcon() const override
Material Design icon for this panel.
Definition
dungeon_entrance_list_panel.h:53
yaze::editor::DungeonEntranceListPanel::Draw
void Draw(bool *p_open) override
Draw the panel content.
Definition
dungeon_entrance_list_panel.h:61
yaze::editor::DungeonEntranceListPanel::DungeonEntranceListPanel
DungeonEntranceListPanel(DungeonRoomSelector *selector, std::function< void(int)> on_entrance_selected=nullptr)
Construct a new panel wrapping a DungeonRoomSelector.
Definition
dungeon_entrance_list_panel.h:36
yaze::editor::DungeonEntranceListPanel::SetEntranceSelectedCallback
void SetEntranceSelectedCallback(std::function< void(int)> callback)
Set the callback for entrance selection events.
Definition
dungeon_entrance_list_panel.h:76
yaze::editor::DungeonEntranceListPanel::GetDisplayName
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
Definition
dungeon_entrance_list_panel.h:52
yaze::editor::DungeonEntranceListPanel::GetEditorCategory
std::string GetEditorCategory() const override
Editor category this panel belongs to.
Definition
dungeon_entrance_list_panel.h:54
yaze::editor::DungeonRoomSelector
Handles room and entrance selection UI.
Definition
dungeon_room_selector.h:31
yaze::editor::DungeonRoomSelector::SetEntranceSelectedCallback
void SetEntranceSelectedCallback(std::function< void(int)> callback)
Definition
dungeon_room_selector.h:92
yaze::editor::DungeonRoomSelector::DrawEntranceSelector
void DrawEntranceSelector()
Definition
dungeon_room_selector.cc:312
yaze::editor::WindowContent
Base interface for all logical window content components.
Definition
editor_panel.h:89
dungeon_room_selector.h
icons.h
ICON_MD_DOOR_FRONT
#define ICON_MD_DOOR_FRONT
Definition
icons.h:613
yaze
Definition
patch_export_usage.cc:8
editor_panel.h
src
app
editor
dungeon
ui
window
dungeon_entrance_list_panel.h
Generated by
1.10.0