yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
sprite_editor_panel.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_DUNGEON_PANELS_SPRITE_EDITOR_PANEL_H_
2#define YAZE_APP_EDITOR_DUNGEON_PANELS_SPRITE_EDITOR_PANEL_H_
3
4#include <functional>
5#include <string>
6
8
9namespace yaze {
10namespace zelda3 {
11class Sprite;
12} // namespace zelda3
13namespace editor {
14
15class DungeonCanvasViewer;
16class DungeonRoomStore;
17
26 public:
27 SpriteEditorPanel(int* current_room_id, DungeonRoomStore* rooms,
28 DungeonCanvasViewer* canvas_viewer = nullptr);
29
30 std::string GetId() const override;
31 std::string GetDisplayName() const override;
32 std::string GetIcon() const override;
33 std::string GetEditorCategory() const override;
34 int GetPriority() const override;
35 std::string GetWorkflowGroup() const override;
36
37 void Draw(bool* p_open) override;
38 void DrawInWorkbench();
39
42 std::function<void(const zelda3::Sprite&)> callback);
43 void SetOpenSelectionInspectorCallback(std::function<void()> callback);
44
45 private:
46 void DrawContent(bool show_room_sprites);
48 void DrawSpriteSelector(bool show_room_sprites);
49 void DrawRoomSprites();
50
51 std::string SpriteName(int sprite_id) const;
52 bool MatchesFilter(int sprite_id) const;
53
54 int* current_room_id_ = nullptr;
57
58 // Selection state
60 char search_filter_[64] = {0};
61
62 std::function<void(const zelda3::Sprite&)> sprite_placed_callback_;
64};
65
66} // namespace editor
67} // namespace yaze
68
69#endif // YAZE_APP_EDITOR_DUNGEON_PANELS_SPRITE_EDITOR_PANEL_H_
WindowContent for placing and managing dungeon sprites.
std::function< void(const zelda3::Sprite &) sprite_placed_callback_)
std::string SpriteName(int sprite_id) const
void SetOpenSelectionInspectorCallback(std::function< void()> callback)
void DrawContent(bool show_room_sprites)
void SetCanvasViewer(DungeonCanvasViewer *viewer)
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.
void Draw(bool *p_open) override
Draw the panel content.
std::string GetWorkflowGroup() const override
Optional workflow group for hack-centric actions.
bool MatchesFilter(int sprite_id) const
std::function< void()> open_selection_inspector_callback_
void DrawSpriteSelector(bool show_room_sprites)
void SetSpritePlacedCallback(std::function< void(const zelda3::Sprite &)> callback)
std::string GetId() const override
Unique identifier for this panel.
int GetPriority() const override
Get display priority for menu ordering.
SpriteEditorPanel(int *current_room_id, DungeonRoomStore *rooms, DungeonCanvasViewer *canvas_viewer=nullptr)
std::string GetIcon() const override
Material Design icon for this panel.
Base interface for all logical window content components.
A class for managing sprites in the overworld and underworld.
Definition sprite.h:39