yaze
0.3.2
Link to the Past ROM Editor
Loading...
Searching...
No Matches
dungeon_emulator_preview_panel.h
Go to the documentation of this file.
1
#ifndef YAZE_APP_EDITOR_DUNGEON_PANELS_DUNGEON_EMULATOR_PREVIEW_PANEL_H_
2
#define YAZE_APP_EDITOR_DUNGEON_PANELS_DUNGEON_EMULATOR_PREVIEW_PANEL_H_
3
4
#include <string>
5
6
#include "
app/editor/system/workspace/editor_panel.h
"
7
#include "
app/gui/core/icons.h
"
8
#include "
app/gui/widgets/dungeon_object_emulator_preview.h
"
9
10
namespace
yaze
{
11
namespace
editor {
12
23
class
DungeonEmulatorPreviewPanel
:
public
WindowContent
{
24
public
:
25
explicit
DungeonEmulatorPreviewPanel
(
26
gui::DungeonObjectEmulatorPreview
*
preview
)
27
:
preview_
(
preview
) {}
28
29
// ==========================================================================
30
// WindowContent Identity
31
// ==========================================================================
32
33
std::string
GetId
()
const override
{
return
"dungeon.emulator_preview"
; }
34
std::string
GetDisplayName
()
const override
{
return
"SNES Object Preview"
; }
35
std::string
GetIcon
()
const override
{
return
ICON_MD_MONITOR
; }
36
std::string
GetEditorCategory
()
const override
{
return
"Dungeon"
; }
37
int
GetPriority
()
const override
{
return
65; }
38
39
// ==========================================================================
40
// WindowContent Drawing
41
// ==========================================================================
42
43
void
Draw
(
bool
* p_open)
override
{
44
if
(!
preview_
)
return
;
45
46
preview_
->
set_visible
(
true
);
47
preview_
->
Render
();
48
49
// Sync visibility back if user closed via X button
50
if
(!
preview_
->
is_visible
() && p_open) {
51
*p_open =
false
;
52
}
53
}
54
55
void
OnClose
()
override
{
56
if
(
preview_
) {
57
preview_
->
set_visible
(
false
);
58
}
59
}
60
61
// ==========================================================================
62
// Panel-Specific Methods
63
// ==========================================================================
64
65
gui::DungeonObjectEmulatorPreview
*
preview
()
const
{
return
preview_
; }
66
67
private
:
68
gui::DungeonObjectEmulatorPreview
*
preview_
=
nullptr
;
69
};
70
71
}
// namespace editor
72
}
// namespace yaze
73
74
#endif
// YAZE_APP_EDITOR_DUNGEON_PANELS_DUNGEON_EMULATOR_PREVIEW_PANEL_H_
yaze::editor::DungeonEmulatorPreviewPanel
WindowContent wrapper for DungeonObjectEmulatorPreview.
Definition
dungeon_emulator_preview_panel.h:23
yaze::editor::DungeonEmulatorPreviewPanel::GetDisplayName
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
Definition
dungeon_emulator_preview_panel.h:34
yaze::editor::DungeonEmulatorPreviewPanel::GetEditorCategory
std::string GetEditorCategory() const override
Editor category this panel belongs to.
Definition
dungeon_emulator_preview_panel.h:36
yaze::editor::DungeonEmulatorPreviewPanel::preview
gui::DungeonObjectEmulatorPreview * preview() const
Definition
dungeon_emulator_preview_panel.h:65
yaze::editor::DungeonEmulatorPreviewPanel::GetId
std::string GetId() const override
Unique identifier for this panel.
Definition
dungeon_emulator_preview_panel.h:33
yaze::editor::DungeonEmulatorPreviewPanel::OnClose
void OnClose() override
Called when panel is hidden.
Definition
dungeon_emulator_preview_panel.h:55
yaze::editor::DungeonEmulatorPreviewPanel::DungeonEmulatorPreviewPanel
DungeonEmulatorPreviewPanel(gui::DungeonObjectEmulatorPreview *preview)
Definition
dungeon_emulator_preview_panel.h:25
yaze::editor::DungeonEmulatorPreviewPanel::GetPriority
int GetPriority() const override
Get display priority for menu ordering.
Definition
dungeon_emulator_preview_panel.h:37
yaze::editor::DungeonEmulatorPreviewPanel::preview_
gui::DungeonObjectEmulatorPreview * preview_
Definition
dungeon_emulator_preview_panel.h:68
yaze::editor::DungeonEmulatorPreviewPanel::Draw
void Draw(bool *p_open) override
Draw the panel content.
Definition
dungeon_emulator_preview_panel.h:43
yaze::editor::DungeonEmulatorPreviewPanel::GetIcon
std::string GetIcon() const override
Material Design icon for this panel.
Definition
dungeon_emulator_preview_panel.h:35
yaze::editor::WindowContent
Base interface for all logical window content components.
Definition
editor_panel.h:89
yaze::gui::DungeonObjectEmulatorPreview
Definition
dungeon_object_emulator_preview.h:27
yaze::gui::DungeonObjectEmulatorPreview::Render
void Render()
Definition
dungeon_object_emulator_preview.cc:123
yaze::gui::DungeonObjectEmulatorPreview::set_visible
void set_visible(bool visible)
Definition
dungeon_object_emulator_preview.h:40
yaze::gui::DungeonObjectEmulatorPreview::is_visible
bool is_visible() const
Definition
dungeon_object_emulator_preview.h:41
dungeon_object_emulator_preview.h
icons.h
ICON_MD_MONITOR
#define ICON_MD_MONITOR
Definition
icons.h:1233
yaze
Definition
patch_export_usage.cc:8
editor_panel.h
src
app
editor
dungeon
ui
window
dungeon_emulator_preview_panel.h
Generated by
1.10.0