yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
tile16_selector_view.cc
Go to the documentation of this file.
2
3#include <string>
4
10#include "util/log.h"
11
12namespace yaze::editor {
13
24
25void Tile16SelectorView::Draw(bool* p_open) {
26 (void)p_open;
27 const auto ctx = CurrentOverworldWindowContext();
28 if (!ctx)
29 return;
30
31 // Log a failure once per distinct message; this runs every frame.
32 static std::string last_error;
33 if (auto status = ctx.editor->DrawTile16Selector(); !status.ok()) {
34 if (status.ToString() != last_error) {
35 last_error = status.ToString();
36 LOG_ERROR("Tile16SelectorView", "Failed to draw: %s", last_error.c_str());
37 }
38 } else {
39 last_error.clear();
40 }
41}
42
44
45} // namespace yaze::editor
Displays the Tile16 palette for painting tiles on the overworld.
float GetPreferredWidth() const override
Get preferred width for this panel (optional)
void Draw(bool *p_open) override
Draw the panel content.
static constexpr float kWindowPadding
static float PreferredViewportWidth(const Config &config, float scrollbar_size)
static float CurrentScrollbarSize()
Current style scrollbar size, or ImGui's default without a context.
#define LOG_ERROR(category, format,...)
Definition log.h:140
Editors are the view controllers for the application.
constexpr float kTile16SelectorScale
constexpr int kTile16SelectorColumns
constexpr float kTile16SelectorDrawOffsetX
OverworldWindowContext CurrentOverworldWindowContext()
#define REGISTER_PANEL(PanelClass)
Auto-registration macro for panels with default constructors.