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

Authoritative component for entity editing state and UI. More...

#include <entity_workbench.h>

Inheritance diagram for yaze::editor::OverworldEntityWorkbench:
Collaboration diagram for yaze::editor::OverworldEntityWorkbench:

Public Member Functions

 OverworldEntityWorkbench ()=default
 
std::string GetId () const override
 Unique identifier for this panel.
 
std::string GetDisplayName () const override
 Human-readable name shown in menus and title bars.
 
std::string GetIcon () const override
 Material Design icon for this panel.
 
std::string GetEditorCategory () const override
 Editor category this panel belongs to.
 
void Draw (bool *p_open) override
 Draw the panel content.
 
void SetActiveEntity (zelda3::GameEntity *entity)
 
void OpenEditorFor (zelda3::GameEntity *entity)
 
void OpenContextMenuFor (zelda3::GameEntity *entity)
 
void DrawPopups ()
 
void SetPendingInsertion (const std::string &type, ImVec2 pos)
 
void ProcessPendingInsertion (EntityMutationService *mutation_service, int current_map, int game_state)
 
void DrawEntityContextMenu ()
 
- Public Member Functions inherited from yaze::editor::WindowContent
virtual ~WindowContent ()=default
 
virtual void OnFirstDraw ()
 Called once before the first Draw() in a session.
 
virtual bool RequiresLazyInit () const
 Whether this panel uses lazy initialization.
 
void InvalidateLazyInit ()
 Reset lazy init state so OnFirstDraw() runs again.
 
virtual void OnOpen ()
 Called when panel becomes visible.
 
virtual void OnClose ()
 Called when panel is hidden.
 
virtual void OnFocus ()
 Called when panel receives focus.
 
virtual WindowLifecycle GetWindowLifecycle () const
 Get the lifecycle category for this window.
 
virtual WindowContextScope GetContextScope () const
 Optional context binding for this window (room/selection/etc)
 
virtual WindowScope GetScope () const
 Get the registration scope for this window.
 
virtual bool IsEnabled () const
 Check if this panel is currently enabled.
 
virtual std::string GetDisabledTooltip () const
 Get tooltip text when panel is disabled.
 
virtual std::string GetShortcutHint () const
 Get keyboard shortcut hint for display.
 
virtual int GetPriority () const
 Get display priority for menu ordering.
 
virtual std::string GetWorkflowGroup () const
 Optional workflow group for hack-centric actions.
 
virtual std::string GetWorkflowLabel () const
 Optional workflow label for menus/command palette.
 
virtual std::string GetWorkflowDescription () const
 Optional workflow description for menus/command palette.
 
virtual int GetWorkflowPriority () const
 Optional workflow ordering priority (lower sorts first).
 
virtual float GetPreferredWidth () const
 Get preferred width for this panel (optional)
 
virtual bool PreferAutoHideTabBar () const
 Whether the dock node hosting this panel should auto-hide its tab bar.
 
virtual bool IsVisibleByDefault () const
 Whether this panel should be visible by default.
 
virtual std::string GetParentPanelId () const
 Get parent panel ID for cascade behavior.
 
virtual bool CascadeCloseChildren () const
 Whether closing this panel should close child panels.
 
void DrawWithLazyInit (bool *p_open)
 Execute lazy initialization if needed, then call Draw()
 

Private Attributes

zelda3::GameEntityediting_entity_ = nullptr
 

Static Private Attributes

static constexpr const char * kContextMenuPopupId
 

Additional Inherited Members

- Protected Member Functions inherited from yaze::editor::WindowContent
void InvalidateCache ()
 Invalidate all cached computations.
 
template<typename T >
T & GetCached (const std::string &key, std::function< T()> compute)
 Get or compute a cached value.
 
bool IsCacheValid () const
 Check if cache has been invalidated.
 
void ClearCache ()
 Clear all cached values (more aggressive than InvalidateCache)
 

Detailed Description

Authoritative component for entity editing state and UI.

This WindowContent manages the active editing context for overworld entities (items, sprites, entrances, exits). It hosts the property popups and tracks the "currently editing" entity state.

Definition at line 34 of file entity_workbench.h.

Constructor & Destructor Documentation

◆ OverworldEntityWorkbench()

yaze::editor::OverworldEntityWorkbench::OverworldEntityWorkbench ( )
default

Member Function Documentation

◆ GetId()

std::string yaze::editor::OverworldEntityWorkbench::GetId ( ) const
inlineoverridevirtual

Unique identifier for this panel.

Returns
Panel ID in format "{category}.{name}" (e.g., "dungeon.room_selector")

IDs should be:

  • Lowercase with underscores
  • Prefixed with editor category
  • Unique across all panels

Implements yaze::editor::WindowContent.

Definition at line 39 of file entity_workbench.h.

◆ GetDisplayName()

std::string yaze::editor::OverworldEntityWorkbench::GetDisplayName ( ) const
inlineoverridevirtual

Human-readable name shown in menus and title bars.

Returns
Display name (e.g., "Room Selector")

Implements yaze::editor::WindowContent.

Definition at line 40 of file entity_workbench.h.

◆ GetIcon()

std::string yaze::editor::OverworldEntityWorkbench::GetIcon ( ) const
inlineoverridevirtual

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::WindowContent.

Definition at line 41 of file entity_workbench.h.

References ICON_MD_EDIT.

◆ GetEditorCategory()

std::string yaze::editor::OverworldEntityWorkbench::GetEditorCategory ( ) const
inlineoverridevirtual

Editor category this panel belongs to.

Returns
Category name matching EditorType (e.g., "Dungeon", "Overworld")

Implements yaze::editor::WindowContent.

Definition at line 42 of file entity_workbench.h.

◆ Draw()

void yaze::editor::OverworldEntityWorkbench::Draw ( bool * p_open)
overridevirtual

Draw the panel content.

Parameters
p_openPointer to visibility flag (nullptr if not closable)

Called by WorkspaceWindowManager when the panel is visible. Do NOT call ImGui::Begin/End - the PanelWindow wrapper handles that. Just draw your content directly.

Implements yaze::editor::WindowContent.

Definition at line 42 of file entity_workbench.cc.

References yaze::editor::CurrentOverworldWindowContext(), ICON_MD_SETTINGS, and OpenEditorFor().

Here is the call graph for this function:

◆ SetActiveEntity()

void yaze::editor::OverworldEntityWorkbench::SetActiveEntity ( zelda3::GameEntity * entity)

◆ OpenEditorFor()

◆ OpenContextMenuFor()

void yaze::editor::OverworldEntityWorkbench::OpenContextMenuFor ( zelda3::GameEntity * entity)

Definition at line 111 of file entity_workbench.cc.

References yaze::editor::CurrentOverworldWindowContext(), and kContextMenuPopupId.

Referenced by yaze::editor::OverworldEditor::InitInteractionCoordinator().

Here is the call graph for this function:

◆ DrawPopups()

◆ SetPendingInsertion()

void yaze::editor::OverworldEntityWorkbench::SetPendingInsertion ( const std::string & type,
ImVec2 pos )

Definition at line 195 of file entity_workbench.cc.

References yaze::editor::CurrentOverworldWindowContext().

Here is the call graph for this function:

◆ ProcessPendingInsertion()

void yaze::editor::OverworldEntityWorkbench::ProcessPendingInsertion ( EntityMutationService * mutation_service,
int current_map,
int game_state )

Definition at line 204 of file entity_workbench.cc.

References yaze::editor::CurrentOverworldWindowContext(), yaze::editor::EntityMutationService::InsertEntity(), and OpenEditorFor().

Here is the call graph for this function:

◆ DrawEntityContextMenu()

void yaze::editor::OverworldEntityWorkbench::DrawEntityContextMenu ( )

Member Data Documentation

◆ kContextMenuPopupId

constexpr const char* yaze::editor::OverworldEntityWorkbench::kContextMenuPopupId
staticconstexprprivate
Initial value:
=
"##OverworldEntityContextMenu"

Definition at line 62 of file entity_workbench.h.

Referenced by DrawPopups(), and OpenContextMenuFor().

◆ editing_entity_

zelda3::GameEntity* yaze::editor::OverworldEntityWorkbench::editing_entity_ = nullptr
private

Definition at line 65 of file entity_workbench.h.

Referenced by DrawPopups(), and OpenEditorFor().


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