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 SetAgentCallbacks (std::function< void(const std::string &)> send_callback, std::function< void()> focus_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 DrawSelectionSummary ()
 
void DrawAgentActions ()
 
std::string BuildSelectionContext () const
 
std::string BuildAgentPrompt (const char *intent) const
 
void SendAgentPrompt (const char *intent)
 
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_
 
std::function< void(const std::string &) send_to_agent_ )
 
std::function< void()> focus_agent_panel_
 
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_.

◆ SetAgentCallbacks()

void yaze::editor::SelectionPropertiesPanel::SetAgentCallbacks ( std::function< void(const std::string &)> send_callback,
std::function< void()> focus_callback )
inline

◆ SetSelection()

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

Set the current selection to display/edit.

Definition at line 55 of file selection_properties_panel.cc.

References selection_.

◆ ClearSelection()

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

Clear the current selection.

Definition at line 59 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 123 of file selection_properties_panel.h.

References selection_.

Referenced by yaze::editor::RightPanelManager::DrawAgentQuickActions().

◆ HasSelection()

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

Check if there's an active selection.

Definition at line 128 of file selection_properties_panel.h.

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

Referenced by yaze::editor::RightPanelManager::DrawAgentQuickActions().

◆ Draw()

◆ DrawNoSelection()

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

◆ DrawDungeonRoomProperties()

◆ DrawDungeonObjectProperties()

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

Definition at line 502 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 532 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 549 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 585 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 602 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 618 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 634 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 651 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 667 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 684 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:

◆ DrawSelectionSummary()

◆ DrawAgentActions()

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

◆ BuildSelectionContext()

std::string yaze::editor::SelectionPropertiesPanel::BuildSelectionContext ( ) const
private

◆ BuildAgentPrompt()

std::string yaze::editor::SelectionPropertiesPanel::BuildAgentPrompt ( const char * intent) const
private

Definition at line 258 of file selection_properties_panel.cc.

References BuildSelectionContext().

Referenced by SendAgentPrompt().

Here is the call graph for this function:

◆ SendAgentPrompt()

void yaze::editor::SelectionPropertiesPanel::SendAgentPrompt ( const char * intent)
private

Definition at line 266 of file selection_properties_panel.cc.

References BuildAgentPrompt(), focus_agent_panel_, and send_to_agent_.

Referenced by DrawAgentActions().

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 306 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 335 of file selection_properties_panel.cc.

Referenced by DrawDungeonRoomProperties().

◆ DrawWordProperty()

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

Definition at line 355 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 375 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 382 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 182 of file selection_properties_panel.h.

Referenced by SetRom().

◆ on_change_

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

Definition at line 183 of file selection_properties_panel.h.

Referenced by NotifyChange(), and SetChangeCallback().

◆ send_to_agent_

std::function<void(const std::string&) yaze::editor::SelectionPropertiesPanel::send_to_agent_)
private

◆ focus_agent_panel_

std::function<void()> yaze::editor::SelectionPropertiesPanel::focus_agent_panel_
private

Definition at line 185 of file selection_properties_panel.h.

Referenced by SendAgentPrompt(), and SetAgentCallbacks().

◆ show_advanced_

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

◆ show_raw_data_

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

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