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

Room-level annotation management for Oracle projects. More...

#include <annotation_overlay_panel.h>

Inheritance diagram for yaze::editor::AnnotationOverlayPanel:
Collaboration diagram for yaze::editor::AnnotationOverlayPanel:

Public Member Functions

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.
 
std::string GetWorkflowGroup () const override
 Optional workflow group for hack-centric actions.
 
std::string GetWorkflowDescription () const override
 Optional workflow description for menus/command palette.
 
WindowLifecycle GetWindowLifecycle () const override
 Get the lifecycle category for this window.
 
void SetAnnotationsPath (const std::string &path)
 
void Draw (bool *) override
 Draw the panel content.
 
std::vector< const AnnotationEntry * > GetAnnotationsForRoom (int room_id) const
 Get annotations for a specific room.
 
int GetMaxPriorityForRoom (int room_id) const
 Get the highest priority for a room (for dot color). Returns -1 if no annotations.
 
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.
 
std::string GetWorkflowGroup () const override
 Optional workflow group for hack-centric actions.
 
std::string GetWorkflowDescription () const override
 Optional workflow description for menus/command palette.
 
WindowLifecycle GetWindowLifecycle () const override
 Get the lifecycle category for this window.
 
void SetAnnotationsPath (const std::string &path)
 
void Draw (bool *) override
 Draw the panel content.
 
std::vector< const AnnotationEntry * > GetAnnotationsForRoom (int room_id) const
 Get annotations for a specific room.
 
int GetMaxPriorityForRoom (int room_id) const
 Get the highest priority for a room (for dot color). Returns -1 if no annotations.
 
- 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 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 GetWorkflowLabel () const
 Optional workflow label 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()
 

Static Public Member Functions

static ImU32 GetPriorityColor (AnnotationPriority priority)
 
static ImU32 GetPriorityColor (AnnotationPriority priority)
 

Private Member Functions

void LoadAnnotations ()
 
void SaveAnnotations ()
 
void LoadAnnotations ()
 
void SaveAnnotations ()
 

Private Attributes

std::string annotations_path_
 
std::vector< AnnotationEntryannotations_
 
int filter_room_id_ = -1
 
int filter_priority_ = 0
 
int selected_index_ = -1
 
int edit_room_ = 0
 
char edit_text_ [256] = {0}
 
int edit_priority_ = 0
 
char edit_category_ [64] = {0}
 

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

Room-level annotation management for Oracle projects.

Reads/writes annotations from annotations.json in the project folder. Provides a list view for browsing and editing annotations.

On iOS (F3), annotations sync via CloudKit. On desktop, this JSON file can be committed to git for version-controlled notes.

Integration with DungeonMapPanel: colored dots drawn on rooms (red=blocker, orange=bug, blue=note).

Definition at line 53 of file annotation_overlay_panel.h.

Member Function Documentation

◆ GetId() [1/2]

std::string yaze::editor::AnnotationOverlayPanel::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 55 of file annotation_overlay_panel.h.

◆ GetDisplayName() [1/2]

std::string yaze::editor::AnnotationOverlayPanel::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 56 of file annotation_overlay_panel.h.

◆ GetIcon() [1/2]

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

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::WindowContent.

Definition at line 57 of file annotation_overlay_panel.h.

References ICON_MD_NOTES.

◆ GetEditorCategory() [1/2]

std::string yaze::editor::AnnotationOverlayPanel::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 58 of file annotation_overlay_panel.h.

◆ GetWorkflowGroup() [1/2]

std::string yaze::editor::AnnotationOverlayPanel::GetWorkflowGroup ( ) const
inlineoverridevirtual

Optional workflow group for hack-centric actions.

Returns
Non-empty group name to surface this panel in hack workflows.

Reimplemented from yaze::editor::WindowContent.

Definition at line 59 of file annotation_overlay_panel.h.

◆ GetWorkflowDescription() [1/2]

std::string yaze::editor::AnnotationOverlayPanel::GetWorkflowDescription ( ) const
inlineoverridevirtual

Optional workflow description for menus/command palette.

Reimplemented from yaze::editor::WindowContent.

Definition at line 60 of file annotation_overlay_panel.h.

◆ GetWindowLifecycle() [1/2]

WindowLifecycle yaze::editor::AnnotationOverlayPanel::GetWindowLifecycle ( ) const
inlineoverridevirtual

Get the lifecycle category for this window.

Returns
WindowLifecycle determining visibility behavior on editor switch

Default is EditorBound (hidden when switching editors).

Reimplemented from yaze::editor::WindowContent.

Definition at line 63 of file annotation_overlay_panel.h.

References yaze::editor::CrossEditor.

◆ SetAnnotationsPath() [1/2]

void yaze::editor::AnnotationOverlayPanel::SetAnnotationsPath ( const std::string & path)
inline

Definition at line 67 of file annotation_overlay_panel.h.

References annotations_path_, and LoadAnnotations().

Referenced by Draw().

Here is the call graph for this function:

◆ Draw() [1/2]

void yaze::editor::AnnotationOverlayPanel::Draw ( bool * p_open)
inlineoverridevirtual

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 72 of file annotation_overlay_panel.h.

References annotations_, annotations_path_, yaze::editor::AnnotationEntry::category, yaze::editor::ContentRegistry::Context::current_project(), edit_category_, edit_priority_, edit_room_, edit_text_, filter_priority_, filter_room_id_, GetPriorityColor(), yaze::editor::AnnotationEntry::priority, yaze::editor::AnnotationEntry::room_id, SaveAnnotations(), selected_index_, SetAnnotationsPath(), and yaze::editor::AnnotationEntry::text.

Here is the call graph for this function:

◆ GetAnnotationsForRoom() [1/2]

std::vector< const AnnotationEntry * > yaze::editor::AnnotationOverlayPanel::GetAnnotationsForRoom ( int room_id) const
inline

Get annotations for a specific room.

Definition at line 191 of file annotation_overlay_panel.h.

References annotations_.

◆ GetMaxPriorityForRoom() [1/2]

int yaze::editor::AnnotationOverlayPanel::GetMaxPriorityForRoom ( int room_id) const
inline

Get the highest priority for a room (for dot color). Returns -1 if no annotations.

Definition at line 205 of file annotation_overlay_panel.h.

References annotations_.

◆ GetPriorityColor() [1/2]

static ImU32 yaze::editor::AnnotationOverlayPanel::GetPriorityColor ( AnnotationPriority priority)
inlinestatic

Definition at line 215 of file annotation_overlay_panel.h.

References yaze::editor::kBlocker, yaze::editor::kBug, and yaze::editor::kNote.

Referenced by Draw().

◆ LoadAnnotations() [1/2]

◆ SaveAnnotations() [1/2]

void yaze::editor::AnnotationOverlayPanel::SaveAnnotations ( )
inlineprivate

Definition at line 258 of file annotation_overlay_panel.h.

References annotations_, and annotations_path_.

Referenced by Draw().

◆ GetId() [2/2]

std::string yaze::editor::AnnotationOverlayPanel::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 55 of file annotation_overlay_panel.h.

◆ GetDisplayName() [2/2]

std::string yaze::editor::AnnotationOverlayPanel::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 56 of file annotation_overlay_panel.h.

◆ GetIcon() [2/2]

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

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::WindowContent.

Definition at line 57 of file annotation_overlay_panel.h.

References ICON_MD_NOTES.

◆ GetEditorCategory() [2/2]

std::string yaze::editor::AnnotationOverlayPanel::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 58 of file annotation_overlay_panel.h.

◆ GetWorkflowGroup() [2/2]

std::string yaze::editor::AnnotationOverlayPanel::GetWorkflowGroup ( ) const
inlineoverridevirtual

Optional workflow group for hack-centric actions.

Returns
Non-empty group name to surface this panel in hack workflows.

Reimplemented from yaze::editor::WindowContent.

Definition at line 59 of file annotation_overlay_panel.h.

◆ GetWorkflowDescription() [2/2]

std::string yaze::editor::AnnotationOverlayPanel::GetWorkflowDescription ( ) const
inlineoverridevirtual

Optional workflow description for menus/command palette.

Reimplemented from yaze::editor::WindowContent.

Definition at line 60 of file annotation_overlay_panel.h.

◆ GetWindowLifecycle() [2/2]

WindowLifecycle yaze::editor::AnnotationOverlayPanel::GetWindowLifecycle ( ) const
inlineoverridevirtual

Get the lifecycle category for this window.

Returns
WindowLifecycle determining visibility behavior on editor switch

Default is EditorBound (hidden when switching editors).

Reimplemented from yaze::editor::WindowContent.

Definition at line 63 of file annotation_overlay_panel.h.

References yaze::editor::CrossEditor.

◆ SetAnnotationsPath() [2/2]

void yaze::editor::AnnotationOverlayPanel::SetAnnotationsPath ( const std::string & path)
inline

Definition at line 67 of file annotation_overlay_panel.h.

References annotations_path_, and LoadAnnotations().

Here is the call graph for this function:

◆ Draw() [2/2]

void yaze::editor::AnnotationOverlayPanel::Draw ( bool * p_open)
inlineoverridevirtual

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 72 of file annotation_overlay_panel.h.

References annotations_, annotations_path_, yaze::editor::ContentRegistry::Context::current_project(), edit_category_, edit_priority_, edit_room_, edit_text_, filter_priority_, filter_room_id_, GetPriorityColor(), SaveAnnotations(), selected_index_, and SetAnnotationsPath().

Here is the call graph for this function:

◆ GetAnnotationsForRoom() [2/2]

std::vector< const AnnotationEntry * > yaze::editor::AnnotationOverlayPanel::GetAnnotationsForRoom ( int room_id) const
inline

Get annotations for a specific room.

Definition at line 189 of file annotation_overlay_panel.h.

References annotations_.

◆ GetMaxPriorityForRoom() [2/2]

int yaze::editor::AnnotationOverlayPanel::GetMaxPriorityForRoom ( int room_id) const
inline

Get the highest priority for a room (for dot color). Returns -1 if no annotations.

Definition at line 204 of file annotation_overlay_panel.h.

References annotations_.

◆ GetPriorityColor() [2/2]

static ImU32 yaze::editor::AnnotationOverlayPanel::GetPriorityColor ( AnnotationPriority priority)
inlinestatic

◆ LoadAnnotations() [2/2]

void yaze::editor::AnnotationOverlayPanel::LoadAnnotations ( )
inlineprivate

Definition at line 227 of file annotation_overlay_panel.h.

References annotations_, and annotations_path_.

◆ SaveAnnotations() [2/2]

void yaze::editor::AnnotationOverlayPanel::SaveAnnotations ( )
inlineprivate

Definition at line 255 of file annotation_overlay_panel.h.

References annotations_, and annotations_path_.

Member Data Documentation

◆ annotations_path_

std::string yaze::editor::AnnotationOverlayPanel::annotations_path_
private

◆ annotations_

std::vector< AnnotationEntry > yaze::editor::AnnotationOverlayPanel::annotations_
private

◆ filter_room_id_

int yaze::editor::AnnotationOverlayPanel::filter_room_id_ = -1
private

Definition at line 287 of file annotation_overlay_panel.h.

Referenced by Draw().

◆ filter_priority_

int yaze::editor::AnnotationOverlayPanel::filter_priority_ = 0
private

Definition at line 288 of file annotation_overlay_panel.h.

Referenced by Draw().

◆ selected_index_

int yaze::editor::AnnotationOverlayPanel::selected_index_ = -1
private

Definition at line 291 of file annotation_overlay_panel.h.

Referenced by Draw().

◆ edit_room_

int yaze::editor::AnnotationOverlayPanel::edit_room_ = 0
private

Definition at line 292 of file annotation_overlay_panel.h.

Referenced by Draw().

◆ edit_text_

char yaze::editor::AnnotationOverlayPanel::edit_text_ = {0}
private

Definition at line 293 of file annotation_overlay_panel.h.

Referenced by Draw().

◆ edit_priority_

int yaze::editor::AnnotationOverlayPanel::edit_priority_ = 0
private

Definition at line 294 of file annotation_overlay_panel.h.

Referenced by Draw().

◆ edit_category_

char yaze::editor::AnnotationOverlayPanel::edit_category_ = {0}
private

Definition at line 295 of file annotation_overlay_panel.h.

Referenced by Draw().


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