Utility functions for palette operations across editors. More...
Functions | |
bool | DrawPaletteJumpButton (const char *label, const std::string &group_name, int palette_index, PaletteEditor *editor) |
Draw a palette selector button that opens palette editor. | |
bool | DrawInlineColorEdit (const char *label, gfx::SnesColor *color, const std::string &group_name, int palette_index, int color_index, PaletteEditor *editor) |
Draw inline color edit with jump to palette. | |
bool | DrawPaletteIdSelector (const char *label, int *palette_id, const std::string &group_name, PaletteEditor *editor) |
Draw a compact palette ID selector with preview. | |
void | DrawColorInfoTooltip (const gfx::SnesColor &color) |
Draw color info tooltip on hover. | |
void | DrawPalettePreview (const std::string &group_name, int palette_index, class Rom *rom) |
Draw a small palette preview (8 colors in a row) | |
Utility functions for palette operations across editors.
bool yaze::editor::palette_utility::DrawPaletteJumpButton | ( | const char * | label, |
const std::string & | group_name, | ||
int | palette_index, | ||
PaletteEditor * | editor | ||
) |
Draw a palette selector button that opens palette editor.
label | Button label |
group_name | The palette group name |
palette_index | The palette index within the group |
editor | Pointer to palette editor (can be null) |
Definition at line 14 of file palette_utility.cc.
References ICON_MD_PALETTE, and yaze::editor::PaletteEditor::JumpToPalette().
Referenced by DrawPaletteIdSelector().
bool yaze::editor::palette_utility::DrawInlineColorEdit | ( | const char * | label, |
gfx::SnesColor * | color, | ||
const std::string & | group_name, | ||
int | palette_index, | ||
int | color_index, | ||
PaletteEditor * | editor | ||
) |
Draw inline color edit with jump to palette.
label | Label for the color widget |
color | Color to edit |
group_name | Palette group this color belongs to |
palette_index | Palette index within group |
color_index | Color index within palette |
editor | Pointer to palette editor (can be null) |
Definition at line 31 of file palette_utility.cc.
References yaze::gui::ConvertImVec4ToSnesColor(), yaze::gui::ConvertSnesColorToImVec4(), DrawColorInfoTooltip(), ICON_MD_OPEN_IN_NEW, and yaze::editor::PaletteEditor::JumpToPalette().
bool yaze::editor::palette_utility::DrawPaletteIdSelector | ( | const char * | label, |
int * | palette_id, | ||
const std::string & | group_name, | ||
PaletteEditor * | editor | ||
) |
Draw a compact palette ID selector with preview.
label | Label for the widget |
palette_id | Current palette ID (in/out) |
group_name | The palette group name |
editor | Pointer to palette editor (can be null) |
Definition at line 69 of file palette_utility.cc.
References DrawPaletteJumpButton().
void yaze::editor::palette_utility::DrawColorInfoTooltip | ( | const gfx::SnesColor & | color | ) |
Draw color info tooltip on hover.
color | The color to show info for |
Definition at line 91 of file palette_utility.cc.
References yaze::gfx::SnesColor::rgb(), and yaze::gfx::SnesColor::snes().
Referenced by DrawInlineColorEdit(), and DrawPalettePreview().
void yaze::editor::palette_utility::DrawPalettePreview | ( | const std::string & | group_name, |
int | palette_index, | ||
class Rom * | rom | ||
) |
Draw a small palette preview (8 colors in a row)
group_name | Palette group name |
palette_index | Palette index |
rom | ROM instance to read palette from |
Definition at line 105 of file palette_utility.cc.
References yaze::gui::ConvertSnesColorToImVec4(), DrawColorInfoTooltip(), yaze::Rom::is_loaded(), and yaze::Rom::mutable_palette_group().