yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
screen_editor_views.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_GRAPHICS_SCREEN_SCREEN_EDITOR_VIEWS_H_
2#define YAZE_APP_EDITOR_GRAPHICS_SCREEN_SCREEN_EDITOR_VIEWS_H_
3
4#include <functional>
5#include <string>
6
9
10namespace yaze {
11namespace editor {
12
13// =============================================================================
14// WindowContent views for the ScreenEditor workspace
15// =============================================================================
16
18 public:
19 using DrawCallback = std::function<void()>;
20 using EnabledCallback = std::function<bool()>;
21
23 EnabledCallback enabled_callback,
24 std::string shortcut_hint)
25 : draw_callback_(std::move(draw_callback)),
26 enabled_callback_(std::move(enabled_callback)),
27 shortcut_hint_(std::move(shortcut_hint)) {}
28
29 bool IsEnabled() const override {
30 return enabled_callback_ ? enabled_callback_() : true;
31 }
32
33 std::string GetDisabledTooltip() const override { return "Load a ROM first"; }
34 std::string GetShortcutHint() const override { return shortcut_hint_; }
35
36 void Draw(bool* p_open) override {
37 if (draw_callback_) {
39 }
40 }
41
42 private:
45 std::string shortcut_hint_;
46};
47
52 public:
53 DungeonMapsView(DrawCallback draw_callback, EnabledCallback enabled_callback,
54 std::string shortcut_hint)
55 : ScreenWorkspaceView(std::move(draw_callback),
56 std::move(enabled_callback),
57 std::move(shortcut_hint)) {}
58
59 std::string GetId() const override { return "screen.dungeon_maps"; }
60 std::string GetDisplayName() const override { return "Dungeon Maps"; }
61 std::string GetIcon() const override { return ICON_MD_MAP; }
62 std::string GetEditorCategory() const override { return "Screen"; }
63 int GetPriority() const override { return 10; }
64};
65
70 public:
72 EnabledCallback enabled_callback, std::string shortcut_hint)
73 : ScreenWorkspaceView(std::move(draw_callback),
74 std::move(enabled_callback),
75 std::move(shortcut_hint)) {}
76
77 std::string GetId() const override { return "screen.inventory_menu"; }
78 std::string GetDisplayName() const override { return "Inventory Menu"; }
79 std::string GetIcon() const override { return ICON_MD_INVENTORY; }
80 std::string GetEditorCategory() const override { return "Screen"; }
81 int GetPriority() const override { return 20; }
82};
83
88 public:
90 EnabledCallback enabled_callback,
91 std::string shortcut_hint)
92 : ScreenWorkspaceView(std::move(draw_callback),
93 std::move(enabled_callback),
94 std::move(shortcut_hint)) {}
95
96 std::string GetId() const override { return "screen.overworld_map"; }
97 std::string GetDisplayName() const override { return "Overworld Map"; }
98 std::string GetIcon() const override { return ICON_MD_PUBLIC; }
99 std::string GetEditorCategory() const override { return "Screen"; }
100 int GetPriority() const override { return 30; }
101};
102
107 public:
108 TitleScreenView(DrawCallback draw_callback, EnabledCallback enabled_callback,
109 std::string shortcut_hint)
110 : ScreenWorkspaceView(std::move(draw_callback),
111 std::move(enabled_callback),
112 std::move(shortcut_hint)) {}
113
114 std::string GetId() const override { return "screen.title_screen"; }
115 std::string GetDisplayName() const override { return "Title Screen"; }
116 std::string GetIcon() const override { return ICON_MD_TITLE; }
117 std::string GetEditorCategory() const override { return "Screen"; }
118 int GetPriority() const override { return 40; }
119};
120
125 public:
126 NamingScreenView(DrawCallback draw_callback, EnabledCallback enabled_callback,
127 std::string shortcut_hint)
128 : ScreenWorkspaceView(std::move(draw_callback),
129 std::move(enabled_callback),
130 std::move(shortcut_hint)) {}
131
132 std::string GetId() const override { return "screen.naming_screen"; }
133 std::string GetDisplayName() const override { return "Naming Screen"; }
134 std::string GetIcon() const override { return ICON_MD_EDIT; }
135 std::string GetEditorCategory() const override { return "Screen"; }
136 int GetPriority() const override { return 50; }
137};
138
139} // namespace editor
140} // namespace yaze
141
142#endif // YAZE_APP_EDITOR_GRAPHICS_SCREEN_SCREEN_EDITOR_VIEWS_H_
Dungeon map editing view.
DungeonMapsView(DrawCallback draw_callback, EnabledCallback enabled_callback, std::string shortcut_hint)
std::string GetIcon() const override
Material Design icon for this panel.
std::string GetId() const override
Unique identifier for this panel.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
int GetPriority() const override
Get display priority for menu ordering.
Inventory menu editing view.
std::string GetId() const override
Unique identifier for this panel.
int GetPriority() const override
Get display priority for menu ordering.
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
std::string GetIcon() const override
Material Design icon for this panel.
InventoryMenuView(DrawCallback draw_callback, EnabledCallback enabled_callback, std::string shortcut_hint)
Naming screen editing view.
NamingScreenView(DrawCallback draw_callback, EnabledCallback enabled_callback, std::string shortcut_hint)
std::string GetEditorCategory() const override
Editor category this panel belongs to.
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
int GetPriority() const override
Get display priority for menu ordering.
std::string GetIcon() const override
Material Design icon for this panel.
std::string GetId() const override
Unique identifier for this panel.
std::string GetIcon() const override
Material Design icon for this panel.
std::string GetId() const override
Unique identifier for this panel.
int GetPriority() const override
Get display priority for menu ordering.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
OverworldMapScreenView(DrawCallback draw_callback, EnabledCallback enabled_callback, std::string shortcut_hint)
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
bool IsEnabled() const override
Check if this panel is currently enabled.
void Draw(bool *p_open) override
Draw the panel content.
std::string GetDisabledTooltip() const override
Get tooltip text when panel is disabled.
ScreenWorkspaceView(DrawCallback draw_callback, EnabledCallback enabled_callback, std::string shortcut_hint)
std::string GetShortcutHint() const override
Get keyboard shortcut hint for display.
Title screen editing view.
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
std::string GetId() const override
Unique identifier for this panel.
int GetPriority() const override
Get display priority for menu ordering.
std::string GetIcon() const override
Material Design icon for this panel.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
TitleScreenView(DrawCallback draw_callback, EnabledCallback enabled_callback, std::string shortcut_hint)
Base interface for all logical window content components.
#define ICON_MD_TITLE
Definition icons.h:1990
#define ICON_MD_MAP
Definition icons.h:1173
#define ICON_MD_EDIT
Definition icons.h:645
#define ICON_MD_PUBLIC
Definition icons.h:1524
#define ICON_MD_INVENTORY
Definition icons.h:1011