Simple visual palette editor with color picker. More...
#include <palette_editor_widget.h>
Public Member Functions | |
PaletteEditorWidget ()=default | |
void | Initialize (Rom *rom) |
void | Draw () |
void | SetOnPaletteChanged (std::function< void(int palette_id)> callback) |
int | current_palette_id () const |
void | set_current_palette_id (int id) |
Private Member Functions | |
void | DrawPaletteSelector () |
void | DrawColorGrid () |
void | DrawColorPicker () |
Private Attributes | |
Rom * | rom_ = nullptr |
int | current_palette_id_ = 0 |
int | selected_color_index_ = -1 |
std::function< void(int palette_id)> | on_palette_changed_ |
ImVec4 | editing_color_ {0, 0, 0, 1} |
Simple visual palette editor with color picker.
Displays dungeon palettes in a grid, allows editing colors, and notifies when palettes change so rooms can re-render.
Definition at line 20 of file palette_editor_widget.h.
|
default |
void yaze::gui::PaletteEditorWidget::Initialize | ( | Rom * | rom | ) |
Definition at line 9 of file palette_editor_widget.cc.
References current_palette_id_, rom_, and selected_color_index_.
Referenced by yaze::editor::DungeonEditorV2::Load().
void yaze::gui::PaletteEditorWidget::Draw | ( | ) |
Definition at line 15 of file palette_editor_widget.cc.
References DrawColorGrid(), DrawColorPicker(), DrawPaletteSelector(), yaze::Rom::is_loaded(), rom_, and selected_color_index_.
Referenced by yaze::editor::DungeonEditorV2::DrawLayout().
|
inline |
Definition at line 28 of file palette_editor_widget.h.
References on_palette_changed_.
Referenced by yaze::editor::DungeonEditorV2::Load().
|
inline |
Definition at line 33 of file palette_editor_widget.h.
References current_palette_id_.
|
inline |
Definition at line 34 of file palette_editor_widget.h.
References current_palette_id_.
|
private |
Definition at line 43 of file palette_editor_widget.cc.
References current_palette_id_, yaze::Rom::mutable_palette_group(), rom_, and selected_color_index_.
Referenced by Draw().
|
private |
Definition at line 66 of file palette_editor_widget.cc.
References current_palette_id_, editing_color_, yaze::Rom::mutable_palette_group(), rom_, and selected_color_index_.
Referenced by Draw().
|
private |
Definition at line 128 of file palette_editor_widget.cc.
References current_palette_id_, editing_color_, yaze::Rom::mutable_palette_group(), on_palette_changed_, rom_, and selected_color_index_.
Referenced by Draw().
|
private |
Definition at line 41 of file palette_editor_widget.h.
Referenced by Draw(), DrawColorGrid(), DrawColorPicker(), DrawPaletteSelector(), and Initialize().
|
private |
Definition at line 42 of file palette_editor_widget.h.
Referenced by current_palette_id(), DrawColorGrid(), DrawColorPicker(), DrawPaletteSelector(), Initialize(), and set_current_palette_id().
|
private |
Definition at line 43 of file palette_editor_widget.h.
Referenced by Draw(), DrawColorGrid(), DrawColorPicker(), DrawPaletteSelector(), and Initialize().
|
private |
Definition at line 46 of file palette_editor_widget.h.
Referenced by DrawColorPicker(), and SetOnPaletteChanged().
|
private |
Definition at line 49 of file palette_editor_widget.h.
Referenced by DrawColorGrid(), and DrawColorPicker().