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

Full-editing properties panel for selected entities. More...

#include <selection_properties_panel.h>

Collaboration diagram for yaze::editor::SelectionPropertiesPanel:

Public Types

using ChangeCallback = std::function<void(const SelectionContext&)>
 

Public Member Functions

 SelectionPropertiesPanel ()=default
 
 ~SelectionPropertiesPanel ()=default
 
 SelectionPropertiesPanel (const SelectionPropertiesPanel &)=delete
 
SelectionPropertiesPaneloperator= (const SelectionPropertiesPanel &)=delete
 
void SetRom (Rom *rom)
 
void SetChangeCallback (ChangeCallback callback)
 
void SetSelection (const SelectionContext &context)
 Set the current selection to display/edit.
 
void ClearSelection ()
 Clear the current selection.
 
const SelectionContextGetSelection () const
 Get the current selection context.
 
bool HasSelection () const
 Check if there's an active selection.
 
void Draw ()
 Draw the properties panel content.
 

Private Member Functions

void DrawNoSelection ()
 
void DrawDungeonRoomProperties ()
 
void DrawDungeonObjectProperties ()
 
void DrawDungeonSpriteProperties ()
 
void DrawDungeonEntranceProperties ()
 
void DrawOverworldMapProperties ()
 
void DrawOverworldTileProperties ()
 
void DrawOverworldSpriteProperties ()
 
void DrawOverworldEntranceProperties ()
 
void DrawOverworldExitProperties ()
 
void DrawOverworldItemProperties ()
 
void DrawGraphicsSheetProperties ()
 
void DrawPaletteProperties ()
 
void DrawPropertyHeader (const char *icon, const char *title)
 
bool DrawPositionEditor (const char *label, int *x, int *y, int min_val=0, int max_val=512)
 
bool DrawSizeEditor (const char *label, int *width, int *height)
 
bool DrawByteProperty (const char *label, uint8_t *value, const char *tooltip=nullptr)
 
bool DrawWordProperty (const char *label, uint16_t *value, const char *tooltip=nullptr)
 
bool DrawComboProperty (const char *label, int *current_item, const char *const items[], int items_count)
 
bool DrawFlagsProperty (const char *label, uint8_t *flags, const char *const flag_names[], int flag_count)
 
void DrawReadOnlyText (const char *label, const char *value)
 
void DrawReadOnlyHex (const char *label, uint32_t value, int digits=4)
 
void NotifyChange ()
 

Private Attributes

SelectionContext selection_
 
Romrom_ = nullptr
 
ChangeCallback on_change_
 
bool show_advanced_ = false
 
bool show_raw_data_ = false
 

Detailed Description

Full-editing properties panel for selected entities.

This panel displays and allows editing of properties for whatever entity is currently selected in the active editor. It adapts its UI based on the selection type and provides appropriate editing controls.

Usage:

panel.SetRom(rom);
// When selection changes:
ctx.id = object_id;
ctx.data = &object;
panel.SetSelection(ctx);
// In render loop:
panel.Draw();
Full-editing properties panel for selected entities.
void Draw()
Draw the properties panel content.
void SetSelection(const SelectionContext &context)
Set the current selection to display/edit.
Holds information about the current selection.

Definition at line 81 of file selection_properties_panel.h.

Member Typedef Documentation

◆ ChangeCallback

Definition at line 83 of file selection_properties_panel.h.

Constructor & Destructor Documentation

◆ SelectionPropertiesPanel() [1/2]

yaze::editor::SelectionPropertiesPanel::SelectionPropertiesPanel ( )
default

◆ ~SelectionPropertiesPanel()

yaze::editor::SelectionPropertiesPanel::~SelectionPropertiesPanel ( )
default

◆ SelectionPropertiesPanel() [2/2]

yaze::editor::SelectionPropertiesPanel::SelectionPropertiesPanel ( const SelectionPropertiesPanel & )
delete

Member Function Documentation

◆ operator=()

SelectionPropertiesPanel & yaze::editor::SelectionPropertiesPanel::operator= ( const SelectionPropertiesPanel & )
delete

◆ SetRom()

void yaze::editor::SelectionPropertiesPanel::SetRom ( Rom * rom)
inline

◆ SetChangeCallback()

void yaze::editor::SelectionPropertiesPanel::SetChangeCallback ( ChangeCallback callback)
inline

Definition at line 97 of file selection_properties_panel.h.

References on_change_.

◆ SetSelection()

void yaze::editor::SelectionPropertiesPanel::SetSelection ( const SelectionContext & context)

Set the current selection to display/edit.

Definition at line 45 of file selection_properties_panel.cc.

References selection_.

◆ ClearSelection()

void yaze::editor::SelectionPropertiesPanel::ClearSelection ( )

Clear the current selection.

Definition at line 49 of file selection_properties_panel.cc.

References selection_.

◆ GetSelection()

const SelectionContext & yaze::editor::SelectionPropertiesPanel::GetSelection ( ) const
inline

Get the current selection context.

Definition at line 118 of file selection_properties_panel.h.

References selection_.

◆ HasSelection()

bool yaze::editor::SelectionPropertiesPanel::HasSelection ( ) const
inline

Check if there's an active selection.

Definition at line 123 of file selection_properties_panel.h.

References yaze::editor::kNone, selection_, and yaze::editor::SelectionContext::type.

◆ Draw()

◆ DrawNoSelection()

void yaze::editor::SelectionPropertiesPanel::DrawNoSelection ( )
private

Definition at line 105 of file selection_properties_panel.cc.

References yaze::gui::ThemeManager::Get(), yaze::gui::ThemeManager::GetCurrentTheme(), yaze::gui::GetTextDisabledVec4(), and ICON_MD_TOUCH_APP.

Referenced by Draw().

Here is the call graph for this function:

◆ DrawDungeonRoomProperties()

void yaze::editor::SelectionPropertiesPanel::DrawDungeonRoomProperties ( )
private

◆ DrawDungeonObjectProperties()

void yaze::editor::SelectionPropertiesPanel::DrawDungeonObjectProperties ( )
private

Definition at line 331 of file selection_properties_panel.cc.

References DrawPositionEditor(), DrawPropertyHeader(), DrawSizeEditor(), ICON_MD_CATEGORY, NotifyChange(), and show_raw_data_.

Referenced by Draw().

Here is the call graph for this function:

◆ DrawDungeonSpriteProperties()

void yaze::editor::SelectionPropertiesPanel::DrawDungeonSpriteProperties ( )
private

Definition at line 361 of file selection_properties_panel.cc.

References DrawPositionEditor(), DrawPropertyHeader(), ICON_MD_PEST_CONTROL, and NotifyChange().

Referenced by Draw().

Here is the call graph for this function:

◆ DrawDungeonEntranceProperties()

void yaze::editor::SelectionPropertiesPanel::DrawDungeonEntranceProperties ( )
private

Definition at line 378 of file selection_properties_panel.cc.

References DrawPropertyHeader(), and ICON_MD_DOOR_FRONT.

Referenced by Draw().

Here is the call graph for this function:

◆ DrawOverworldMapProperties()

void yaze::editor::SelectionPropertiesPanel::DrawOverworldMapProperties ( )
private

◆ DrawOverworldTileProperties()

void yaze::editor::SelectionPropertiesPanel::DrawOverworldTileProperties ( )
private

Definition at line 414 of file selection_properties_panel.cc.

References DrawPropertyHeader(), DrawReadOnlyHex(), ICON_MD_GRID_ON, yaze::editor::SelectionContext::id, selection_, and show_advanced_.

Referenced by Draw().

Here is the call graph for this function:

◆ DrawOverworldSpriteProperties()

void yaze::editor::SelectionPropertiesPanel::DrawOverworldSpriteProperties ( )
private

Definition at line 431 of file selection_properties_panel.cc.

References DrawPositionEditor(), DrawPropertyHeader(), ICON_MD_PEST_CONTROL, and NotifyChange().

Referenced by Draw().

Here is the call graph for this function:

◆ DrawOverworldEntranceProperties()

void yaze::editor::SelectionPropertiesPanel::DrawOverworldEntranceProperties ( )
private

Definition at line 447 of file selection_properties_panel.cc.

References DrawPositionEditor(), DrawPropertyHeader(), ICON_MD_DOOR_FRONT, and NotifyChange().

Referenced by Draw().

Here is the call graph for this function:

◆ DrawOverworldExitProperties()

void yaze::editor::SelectionPropertiesPanel::DrawOverworldExitProperties ( )
private

Definition at line 463 of file selection_properties_panel.cc.

References DrawPositionEditor(), DrawPropertyHeader(), ICON_MD_EXIT_TO_APP, and NotifyChange().

Referenced by Draw().

Here is the call graph for this function:

◆ DrawOverworldItemProperties()

void yaze::editor::SelectionPropertiesPanel::DrawOverworldItemProperties ( )
private

Definition at line 480 of file selection_properties_panel.cc.

References DrawPositionEditor(), DrawPropertyHeader(), ICON_MD_STAR, and NotifyChange().

Referenced by Draw().

Here is the call graph for this function:

◆ DrawGraphicsSheetProperties()

void yaze::editor::SelectionPropertiesPanel::DrawGraphicsSheetProperties ( )
private

Definition at line 496 of file selection_properties_panel.cc.

References DrawPropertyHeader(), DrawReadOnlyHex(), ICON_MD_IMAGE, yaze::editor::SelectionContext::id, selection_, and show_advanced_.

Referenced by Draw().

Here is the call graph for this function:

◆ DrawPaletteProperties()

void yaze::editor::SelectionPropertiesPanel::DrawPaletteProperties ( )
private

Definition at line 513 of file selection_properties_panel.cc.

References DrawPropertyHeader(), DrawReadOnlyHex(), ICON_MD_PALETTE, yaze::editor::SelectionContext::id, and selection_.

Referenced by Draw().

Here is the call graph for this function:

◆ DrawPropertyHeader()

◆ DrawPositionEditor()

bool yaze::editor::SelectionPropertiesPanel::DrawPositionEditor ( const char * label,
int * x,
int * y,
int min_val = 0,
int max_val = 512 )
private

◆ DrawSizeEditor()

bool yaze::editor::SelectionPropertiesPanel::DrawSizeEditor ( const char * label,
int * width,
int * height )
private

Definition at line 179 of file selection_properties_panel.cc.

Referenced by DrawDungeonObjectProperties().

◆ DrawByteProperty()

bool yaze::editor::SelectionPropertiesPanel::DrawByteProperty ( const char * label,
uint8_t * value,
const char * tooltip = nullptr )
private

Definition at line 208 of file selection_properties_panel.cc.

◆ DrawWordProperty()

bool yaze::editor::SelectionPropertiesPanel::DrawWordProperty ( const char * label,
uint16_t * value,
const char * tooltip = nullptr )
private

Definition at line 228 of file selection_properties_panel.cc.

◆ DrawComboProperty()

bool yaze::editor::SelectionPropertiesPanel::DrawComboProperty ( const char * label,
int * current_item,
const char *const items[],
int items_count )
private

Definition at line 248 of file selection_properties_panel.cc.

◆ DrawFlagsProperty()

bool yaze::editor::SelectionPropertiesPanel::DrawFlagsProperty ( const char * label,
uint8_t * flags,
const char *const flag_names[],
int flag_count )
private

Definition at line 255 of file selection_properties_panel.cc.

◆ DrawReadOnlyText()

void yaze::editor::SelectionPropertiesPanel::DrawReadOnlyText ( const char * label,
const char * value )
private

◆ DrawReadOnlyHex()

void yaze::editor::SelectionPropertiesPanel::DrawReadOnlyHex ( const char * label,
uint32_t value,
int digits = 4 )
private

◆ NotifyChange()

Member Data Documentation

◆ selection_

◆ rom_

Rom* yaze::editor::SelectionPropertiesPanel::rom_ = nullptr
private

Definition at line 172 of file selection_properties_panel.h.

Referenced by SetRom().

◆ on_change_

ChangeCallback yaze::editor::SelectionPropertiesPanel::on_change_
private

Definition at line 173 of file selection_properties_panel.h.

Referenced by NotifyChange(), and SetChangeCallback().

◆ show_advanced_

bool yaze::editor::SelectionPropertiesPanel::show_advanced_ = false
private

◆ show_raw_data_

bool yaze::editor::SelectionPropertiesPanel::show_raw_data_ = false
private

Definition at line 177 of file selection_properties_panel.h.

Referenced by Draw(), and DrawDungeonObjectProperties().


The documentation for this class was generated from the following files: