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 // Number of selected objects and which layer they're on
18 int selection_layer = -1; // -1 = mixed/none
19
20 // Zoom level as a percentage (100 = 1x)
21 int zoom_percent = 100;
22
23 // Whether the current room has unsaved changes
24 bool room_dirty = false;
25
26 // Cursor position in tile coordinates (-1 = not hovering)
27 int cursor_tile_x = -1;
28 int cursor_tile_y = -1;
29
30 // Current room ID for display
31 int room_id = -1;
32
33 // Undo/Redo state
34 bool can_undo = false;
35 bool can_redo = false;
36 const char* undo_desc = nullptr; // Description of undo action
37 const char* redo_desc = nullptr; // Description of redo action
38 int undo_depth = 0; // Number of undo actions available
39
40 // Callbacks for undo/redo buttons (set by the host panel)
41 std::function<void()> on_undo;
42 std::function<void()> on_redo;
43};
44
45// Thin persistent bar drawn at the bottom of the dungeon editor canvas area.
46// Displays tool mode, selection summary, zoom level, dirty indicator, and
47// cursor coordinates at a glance.
49 public:
50 // Draws the status bar using the provided state. Should be called once per
51 // frame, below the canvas area.
52 static void Draw(const DungeonStatusBarState& state);
53
54 // Helper: populate state from a DungeonCanvasViewer's current frame data.
56 const char* tool_mode,
57 bool room_dirty);
58};
59
60} // namespace yaze::editor
61
62#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.