yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dungeon_status_bar.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_DUNGEON_WIDGETS_DUNGEON_STATUS_BAR_H
2#define YAZE_APP_EDITOR_DUNGEON_WIDGETS_DUNGEON_STATUS_BAR_H
3
4#include <functional>
5#include <string>
6
7namespace yaze::editor {
8
9class DungeonCanvasViewer;
10
11// Data source for the status bar — caller populates fields each frame.
13 // Current placement/edit mode label (e.g., "Object", "Sprite", "Select")
14 const char* tool_mode = "Select";
15
16 // Workflow badge (e.g., "Workbench", "Standalone")
17 const char* workflow_mode = nullptr;
18 bool workflow_primary = false;
19
20 // Number of selected objects and which layer they're on
22 int selection_layer = -1; // -1 = mixed/none
23 std::string selection_summary = "No selection";
24
25 // Zoom level as a percentage (100 = 1x)
26 int zoom_percent = 100;
27
28 // Whether the current room has unsaved changes
29 bool room_dirty = false;
30
31 // Current room ID for display
32 int room_id = -1;
33
34 // Undo/Redo state
35 bool can_undo = false;
36 bool can_redo = false;
37 const char* undo_desc = nullptr; // Description of undo action
38 const char* redo_desc = nullptr; // Description of redo action
39 int undo_depth = 0; // Number of undo actions available
40
41 // Callbacks for stable status-bar actions (set by the host panel).
42 // Selection opens the detailed inspector without adding transient canvas
43 // chrome above the drawing surface.
44 std::function<void()> on_undo;
45 std::function<void()> on_redo;
46 std::function<void()> on_selection;
47};
48
49// Thin persistent bar drawn at the bottom of the dungeon editor canvas area.
50// Displays tool mode, selection summary, zoom level, and dirty state at a
51// glance.
53 public:
54 // Draws the status bar using the provided state. Should be called once per
55 // frame, below the canvas area.
56 static void Draw(const DungeonStatusBarState& state);
57
58 // Helper: populate state from a DungeonCanvasViewer's current frame data.
60 const char* tool_mode,
61 bool room_dirty);
62};
63
64} // namespace yaze::editor
65
66#endif // YAZE_APP_EDITOR_DUNGEON_WIDGETS_DUNGEON_STATUS_BAR_H
static void Draw(const DungeonStatusBarState &state)
static DungeonStatusBarState BuildState(const DungeonCanvasViewer &viewer, const char *tool_mode, bool room_dirty)
Editors are the view controllers for the application.