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
7
namespace
yaze::editor
{
8
9
class
DungeonCanvasViewer;
10
11
// Data source for the status bar — caller populates fields each frame.
12
struct
DungeonStatusBarState
{
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
17
int
selection_count
= 0;
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.
48
class
DungeonStatusBar
{
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.
55
static
DungeonStatusBarState
BuildState
(
const
DungeonCanvasViewer
& viewer,
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
yaze::editor::DungeonCanvasViewer
Definition
dungeon_canvas_viewer.h:40
yaze::editor::DungeonStatusBar
Definition
dungeon_status_bar.h:48
yaze::editor::DungeonStatusBar::Draw
static void Draw(const DungeonStatusBarState &state)
Definition
dungeon_status_bar.cc:17
yaze::editor::DungeonStatusBar::BuildState
static DungeonStatusBarState BuildState(const DungeonCanvasViewer &viewer, const char *tool_mode, bool room_dirty)
Definition
dungeon_status_bar.cc:162
yaze::editor
Editors are the view controllers for the application.
Definition
patch_export_usage.cc:9
yaze::editor::DungeonStatusBarState
Definition
dungeon_status_bar.h:12
yaze::editor::DungeonStatusBarState::undo_desc
const char * undo_desc
Definition
dungeon_status_bar.h:36
yaze::editor::DungeonStatusBarState::room_dirty
bool room_dirty
Definition
dungeon_status_bar.h:24
yaze::editor::DungeonStatusBarState::redo_desc
const char * redo_desc
Definition
dungeon_status_bar.h:37
yaze::editor::DungeonStatusBarState::selection_count
int selection_count
Definition
dungeon_status_bar.h:17
yaze::editor::DungeonStatusBarState::cursor_tile_y
int cursor_tile_y
Definition
dungeon_status_bar.h:28
yaze::editor::DungeonStatusBarState::can_undo
bool can_undo
Definition
dungeon_status_bar.h:34
yaze::editor::DungeonStatusBarState::can_redo
bool can_redo
Definition
dungeon_status_bar.h:35
yaze::editor::DungeonStatusBarState::tool_mode
const char * tool_mode
Definition
dungeon_status_bar.h:14
yaze::editor::DungeonStatusBarState::selection_layer
int selection_layer
Definition
dungeon_status_bar.h:18
yaze::editor::DungeonStatusBarState::undo_depth
int undo_depth
Definition
dungeon_status_bar.h:38
yaze::editor::DungeonStatusBarState::on_undo
std::function< void()> on_undo
Definition
dungeon_status_bar.h:41
yaze::editor::DungeonStatusBarState::cursor_tile_x
int cursor_tile_x
Definition
dungeon_status_bar.h:27
yaze::editor::DungeonStatusBarState::zoom_percent
int zoom_percent
Definition
dungeon_status_bar.h:21
yaze::editor::DungeonStatusBarState::on_redo
std::function< void()> on_redo
Definition
dungeon_status_bar.h:42
yaze::editor::DungeonStatusBarState::room_id
int room_id
Definition
dungeon_status_bar.h:31
src
app
editor
dungeon
widgets
dungeon_status_bar.h
Generated by
1.10.0