yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
scratch_space_panel.cc
Go to the documentation of this file.
2
3#include <string>
4
7
8#include "util/log.h"
9
10namespace yaze::editor {
11
12void ScratchSpacePanel::Draw(bool* p_open) {
13 (void)p_open;
14 auto* ow_editor = CurrentOverworldEditor();
15 if (!ow_editor)
16 return;
17
18 // Call the existing DrawScratchSpace implementation
19 // Log a failure once per distinct message; this runs every frame.
20 static std::string last_error;
21 if (auto status = ow_editor->DrawScratchSpace(); !status.ok()) {
22 if (status.ToString() != last_error) {
23 last_error = status.ToString();
24 LOG_ERROR("ScratchSpacePanel", "Failed to draw: %s", last_error.c_str());
25 }
26 } else {
27 last_error.clear();
28 }
29}
30
32
33} // namespace yaze::editor
Provides a scratch workspace for layout planning and clipboard operations.
void Draw(bool *p_open) override
Draw the panel content.
#define LOG_ERROR(category, format,...)
Definition log.h:140
Editors are the view controllers for the application.
OverworldEditor * CurrentOverworldEditor()
#define REGISTER_PANEL(PanelClass)
Auto-registration macro for panels with default constructors.