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 // Cursor position in tile coordinates (-1 = not hovering)
32 int cursor_tile_x = -1;
33 int cursor_tile_y = -1;
34
35 // Current room ID for display
36 int room_id = -1;
37
38 // Undo/Redo state
39 bool can_undo = false;
40 bool can_redo = false;
41 const char* undo_desc = nullptr; // Description of undo action
42 const char* redo_desc = nullptr; // Description of redo action
43 int undo_depth = 0; // Number of undo actions available
44
45 // Callbacks for undo/redo buttons (set by the host panel)
46 std::function<void()> on_undo;
47 std::function<void()> on_redo;
48};
49
50// Thin persistent bar drawn at the bottom of the dungeon editor canvas area.
51// Displays tool mode, selection summary, zoom level, dirty indicator, and
52// cursor coordinates at a glance.
54 public:
55 // Draws the status bar using the provided state. Should be called once per
56 // frame, below the canvas area.
57 static void Draw(const DungeonStatusBarState& state);
58
59 // Helper: populate state from a DungeonCanvasViewer's current frame data.
61 const char* tool_mode,
62 bool room_dirty);
63};
64
65} // namespace yaze::editor
66
67#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.