yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
sprite_editor_views.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_SPRITE_PANELS_SPRITE_EDITOR_PANELS_H_
2#define YAZE_APP_EDITOR_SPRITE_PANELS_SPRITE_EDITOR_PANELS_H_
3
4#include <functional>
5#include <string>
6
9
10namespace yaze {
11namespace editor {
12
14 public:
15 explicit SpriteCatalogPanel(std::function<void()> draw)
16 : draw_(std::move(draw)) {}
17 std::string GetId() const override { return "sprite.catalog"; }
18 std::string GetDisplayName() const override { return "Sprite Catalog"; }
19 std::string GetIcon() const override { return ICON_MD_SMART_TOY; }
20 std::string GetEditorCategory() const override { return "Sprite"; }
24 int GetPriority() const override { return 15; }
25 bool IsVisibleByDefault() const override { return false; }
26 float GetPreferredWidth() const override { return 900.0f; }
27 void Draw(bool*) override {
28 if (draw_)
29 draw_();
30 }
31
32 private:
33 std::function<void()> draw_;
34};
35
36// =============================================================================
37// WindowContent wrappers for SpriteEditor panels
38// =============================================================================
39
47 public:
48 using DrawCallback = std::function<void()>;
49
50 explicit VanillaSpriteEditorPanel(DrawCallback draw_callback)
51 : draw_callback_(std::move(draw_callback)) {}
52
53 std::string GetId() const override { return "sprite.vanilla_editor"; }
54 std::string GetDisplayName() const override { return "Vanilla Sprites"; }
55 std::string GetIcon() const override { return ICON_MD_SMART_TOY; }
56 std::string GetEditorCategory() const override { return "Sprite"; }
60 int GetPriority() const override { return 10; }
61 bool IsVisibleByDefault() const override { return true; }
62 float GetPreferredWidth() const override { return 900.0f; }
63
64 void Draw(bool* p_open) override {
65 if (draw_callback_) {
67 }
68 }
69
70 private:
72};
73
81 public:
82 using DrawCallback = std::function<void()>;
83
84 explicit CustomSpriteEditorPanel(DrawCallback draw_callback)
85 : draw_callback_(std::move(draw_callback)) {}
86
87 std::string GetId() const override { return "sprite.custom_editor"; }
88 std::string GetDisplayName() const override { return "Custom Sprites"; }
89 std::string GetIcon() const override { return ICON_MD_ADD_CIRCLE; }
90 std::string GetEditorCategory() const override { return "Sprite"; }
94 int GetPriority() const override { return 20; }
95 float GetPreferredWidth() const override { return 1000.0f; }
96
97 void Draw(bool* p_open) override {
98 if (draw_callback_) {
100 }
101 }
102
103 private:
105};
106
107} // namespace editor
108} // namespace yaze
109
110#endif // YAZE_APP_EDITOR_SPRITE_PANELS_SPRITE_EDITOR_PANELS_H_
WindowContent for Custom Sprite Editor (ZSM format)
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
float GetPreferredWidth() const override
Get preferred width for this panel (optional)
int GetPriority() const override
Get display priority for menu ordering.
std::string GetIcon() const override
Material Design icon for this panel.
WindowPresentationPolicy GetPresentationPolicy() const override
How this content is hosted and advertised by workspace chrome.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
void Draw(bool *p_open) override
Draw the panel content.
std::string GetId() const override
Unique identifier for this panel.
CustomSpriteEditorPanel(DrawCallback draw_callback)
std::string GetId() const override
Unique identifier for this panel.
bool IsVisibleByDefault() const override
Whether this panel should be visible by default.
void Draw(bool *) override
Draw the panel content.
SpriteCatalogPanel(std::function< void()> draw)
int GetPriority() const override
Get display priority for menu ordering.
float GetPreferredWidth() const override
Get preferred width for this panel (optional)
std::string GetEditorCategory() const override
Editor category this panel belongs to.
std::string GetIcon() const override
Material Design icon for this panel.
WindowPresentationPolicy GetPresentationPolicy() const override
How this content is hosted and advertised by workspace chrome.
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
WindowContent for Vanilla Sprite Editor.
VanillaSpriteEditorPanel(DrawCallback draw_callback)
void Draw(bool *p_open) override
Draw the panel content.
WindowPresentationPolicy GetPresentationPolicy() const override
How this content is hosted and advertised by workspace chrome.
std::string GetId() const override
Unique identifier for this panel.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
bool IsVisibleByDefault() const override
Whether this panel should be visible by default.
std::string GetIcon() const override
Material Design icon for this panel.
float GetPreferredWidth() const override
Get preferred width for this panel (optional)
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
int GetPriority() const override
Get display priority for menu ordering.
Base interface for all logical window content components.
#define ICON_MD_ADD_CIRCLE
Definition icons.h:95
#define ICON_MD_SMART_TOY
Definition icons.h:1781
static WindowPresentationPolicy CoreWorkspace()
static WindowPresentationPolicy OptionalPopOut()