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
24 // Zoom level as a percentage (100 = 1x)
25 int zoom_percent = 100;
26
27 // Whether the current room has unsaved changes
28 bool room_dirty = false;
29
30 // Cursor position in tile coordinates (-1 = not hovering)
31 int cursor_tile_x = -1;
32 int cursor_tile_y = -1;
33
34 // Current room ID for display
35 int room_id = -1;
36
37 // Undo/Redo state
38 bool can_undo = false;
39 bool can_redo = false;
40 const char* undo_desc = nullptr; // Description of undo action
41 const char* redo_desc = nullptr; // Description of redo action
42 int undo_depth = 0; // Number of undo actions available
43
44 // Callbacks for undo/redo buttons (set by the host panel)
45 std::function<void()> on_undo;
46 std::function<void()> on_redo;
47};
48
49// Thin persistent bar drawn at the bottom of the dungeon editor canvas area.
50// Displays tool mode, selection summary, zoom level, dirty indicator, and
51// cursor coordinates at a 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.