yaze
0.3.2
Link to the Past ROM Editor
Loading...
Searching...
No Matches
palette_editor_widget.h
Go to the documentation of this file.
1
#ifndef YAZE_APP_GUI_WIDGETS_PALETTE_EDITOR_WIDGET_H
2
#define YAZE_APP_GUI_WIDGETS_PALETTE_EDITOR_WIDGET_H
3
4
#include <functional>
5
#include <vector>
6
7
#include "
app/gfx/snes_palette.h
"
8
#include "
app/rom.h
"
9
#include "imgui/imgui.h"
10
11
namespace
yaze
{
12
namespace
gui {
13
20
class
PaletteEditorWidget
{
21
public
:
22
PaletteEditorWidget
() =
default
;
23
24
void
Initialize
(
Rom
* rom);
25
void
Draw
();
26
27
// Callback when palette is modified
28
void
SetOnPaletteChanged
(std::function<
void
(
int
palette_id)> callback) {
29
on_palette_changed_
= callback;
30
}
31
32
// Get/Set current editing palette
33
int
current_palette_id
()
const
{
return
current_palette_id_
; }
34
void
set_current_palette_id
(
int
id
) {
current_palette_id_
= id; }
35
36
private
:
37
void
DrawPaletteSelector
();
38
void
DrawColorGrid
();
39
void
DrawColorPicker
();
40
41
Rom
*
rom_
=
nullptr
;
42
int
current_palette_id_
= 0;
43
int
selected_color_index_
= -1;
44
45
// Callback for palette changes
46
std::function<void(
int
palette_id)>
on_palette_changed_
;
47
48
// Temp color for editing (RGB 0-1 range for ImGui)
49
ImVec4
editing_color_
{0, 0, 0, 1};
50
};
51
52
}
// namespace gui
53
}
// namespace yaze
54
55
#endif
// YAZE_APP_GUI_WIDGETS_PALETTE_EDITOR_WIDGET_H
56
yaze::Rom
The Rom class is used to load, save, and modify Rom data.
Definition
rom.h:71
yaze::gui::PaletteEditorWidget
Simple visual palette editor with color picker.
Definition
palette_editor_widget.h:20
yaze::gui::PaletteEditorWidget::editing_color_
ImVec4 editing_color_
Definition
palette_editor_widget.h:49
yaze::gui::PaletteEditorWidget::on_palette_changed_
std::function< void(int palette_id)> on_palette_changed_
Definition
palette_editor_widget.h:46
yaze::gui::PaletteEditorWidget::current_palette_id
int current_palette_id() const
Definition
palette_editor_widget.h:33
yaze::gui::PaletteEditorWidget::current_palette_id_
int current_palette_id_
Definition
palette_editor_widget.h:42
yaze::gui::PaletteEditorWidget::DrawColorPicker
void DrawColorPicker()
Definition
palette_editor_widget.cc:128
yaze::gui::PaletteEditorWidget::PaletteEditorWidget
PaletteEditorWidget()=default
yaze::gui::PaletteEditorWidget::set_current_palette_id
void set_current_palette_id(int id)
Definition
palette_editor_widget.h:34
yaze::gui::PaletteEditorWidget::Draw
void Draw()
Definition
palette_editor_widget.cc:15
yaze::gui::PaletteEditorWidget::rom_
Rom * rom_
Definition
palette_editor_widget.h:41
yaze::gui::PaletteEditorWidget::Initialize
void Initialize(Rom *rom)
Definition
palette_editor_widget.cc:9
yaze::gui::PaletteEditorWidget::SetOnPaletteChanged
void SetOnPaletteChanged(std::function< void(int palette_id)> callback)
Definition
palette_editor_widget.h:28
yaze::gui::PaletteEditorWidget::DrawColorGrid
void DrawColorGrid()
Definition
palette_editor_widget.cc:66
yaze::gui::PaletteEditorWidget::selected_color_index_
int selected_color_index_
Definition
palette_editor_widget.h:43
yaze::gui::PaletteEditorWidget::DrawPaletteSelector
void DrawPaletteSelector()
Definition
palette_editor_widget.cc:43
yaze
Main namespace for the application.
Definition
asar_wrapper.cc:14
rom.h
snes_palette.h
src
app
gui
widgets
palette_editor_widget.h
Generated by
1.9.8