yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::palette_utility Namespace Reference

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)
 

Detailed Description

Utility functions for palette operations across editors.

Function Documentation

◆ DrawPaletteJumpButton()

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.

Parameters
labelButton label
group_nameThe palette group name
palette_indexThe palette index within the group
editorPointer to palette editor (can be null)
Returns
true if button was clicked

Definition at line 14 of file palette_utility.cc.

References ICON_MD_PALETTE, and yaze::editor::PaletteEditor::JumpToPalette().

Referenced by DrawPaletteIdSelector().

Here is the call graph for this function:

◆ DrawInlineColorEdit()

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.

Parameters
labelLabel for the color widget
colorColor to edit
group_namePalette group this color belongs to
palette_indexPalette index within group
color_indexColor index within palette
editorPointer to palette editor (can be null)
Returns
true if color was changed

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().

Here is the call graph for this function:

◆ DrawPaletteIdSelector()

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.

Parameters
labelLabel for the widget
palette_idCurrent palette ID (in/out)
group_nameThe palette group name
editorPointer to palette editor (can be null)
Returns
true if palette ID changed

Definition at line 69 of file palette_utility.cc.

References DrawPaletteJumpButton().

Here is the call graph for this function:

◆ DrawColorInfoTooltip()

void yaze::editor::palette_utility::DrawColorInfoTooltip ( const gfx::SnesColor color)

Draw color info tooltip on hover.

Parameters
colorThe 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().

Here is the call graph for this function:

◆ 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)

Parameters
group_namePalette group name
palette_indexPalette index
romROM 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().

Here is the call graph for this function: