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.
 
PanelCategory GetPanelCategory () const override
 Get the lifecycle category for this panel.
 
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::EditorPanel
virtual ~EditorPanel ()=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 PanelContextScope GetContextScope () const
 Optional context binding for this panel (room/selection/etc)
 
virtual PanelScope GetScope () const
 Get the registration scope for this panel.
 
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 float GetPreferredWidth () const
 Get preferred width for this panel (optional)
 
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)
 

Private Member Functions

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::EditorPanel
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()

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::EditorPanel.

Definition at line 55 of file annotation_overlay_panel.h.

◆ GetDisplayName()

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::EditorPanel.

Definition at line 56 of file annotation_overlay_panel.h.

◆ GetIcon()

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::EditorPanel.

Definition at line 57 of file annotation_overlay_panel.h.

References ICON_MD_NOTES.

◆ GetEditorCategory()

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::EditorPanel.

Definition at line 58 of file annotation_overlay_panel.h.

◆ GetPanelCategory()

PanelCategory yaze::editor::AnnotationOverlayPanel::GetPanelCategory ( ) const
inlineoverridevirtual

Get the lifecycle category for this panel.

Returns
PanelCategory determining visibility behavior on editor switch

Default is EditorBound (hidden when switching editors).

Reimplemented from yaze::editor::EditorPanel.

Definition at line 59 of file annotation_overlay_panel.h.

References yaze::editor::CrossEditor.

◆ SetAnnotationsPath()

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

Definition at line 63 of file annotation_overlay_panel.h.

References annotations_path_, and LoadAnnotations().

Referenced by Draw().

Here is the call graph for this function:

◆ Draw()

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 PanelManager when the panel is visible. Do NOT call ImGui::Begin/End - the PanelWindow wrapper handles that. Just draw your content directly.

Implements yaze::editor::EditorPanel.

Definition at line 68 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()

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

Get annotations for a specific room.

Definition at line 185 of file annotation_overlay_panel.h.

References annotations_.

◆ GetMaxPriorityForRoom()

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

References annotations_.

◆ GetPriorityColor()

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

Definition at line 210 of file annotation_overlay_panel.h.

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

Referenced by Draw().

◆ LoadAnnotations()

◆ SaveAnnotations()

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

Definition at line 251 of file annotation_overlay_panel.h.

References annotations_, and annotations_path_.

Referenced by Draw().

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

Referenced by Draw().

◆ filter_priority_

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

Definition at line 280 of file annotation_overlay_panel.h.

Referenced by Draw().

◆ selected_index_

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

Definition at line 283 of file annotation_overlay_panel.h.

Referenced by Draw().

◆ edit_room_

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

Definition at line 284 of file annotation_overlay_panel.h.

Referenced by Draw().

◆ edit_text_

char yaze::editor::AnnotationOverlayPanel::edit_text_[256] = {0}
private

Definition at line 285 of file annotation_overlay_panel.h.

Referenced by Draw().

◆ edit_priority_

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

Definition at line 286 of file annotation_overlay_panel.h.

Referenced by Draw().

◆ edit_category_

char yaze::editor::AnnotationOverlayPanel::edit_category_[64] = {0}
private

Definition at line 287 of file annotation_overlay_panel.h.

Referenced by Draw().


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