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

#include <cutscene_camera_panel.h>

Inheritance diagram for yaze::editor::CutsceneCameraPanel:
Collaboration diagram for yaze::editor::CutsceneCameraPanel:

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.
 
WindowPresentationPolicy GetPresentationPolicy () const override
 How this content is hosted and advertised by workspace chrome.
 
WindowScope GetScope () const override
 Get the registration scope for this window.
 
void Draw (bool *p_open) override
 Draw the panel content.
 
- 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 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 HasExactPreferredWidth () const
 Whether GetPreferredWidth() is an exact content width.
 
virtual float GetPreferredHeight () const
 Get preferred height for this panel (optional)
 
virtual bool PrefersFloating () const
 
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 Types

enum class  Drag { kNone , kViewport , kLink , kActor }
 

Private Member Functions

std::optional< std::filesystem::path > ShotsPath () const
 
void Load ()
 
void Save ()
 
void DrawShotList ()
 
void DrawShotFields (zelda3::CutsceneShot &shot)
 
void DrawCanvas (zelda3::CutsceneShot &shot)
 
zelda3::AreaExtent ExtentFor (const zelda3::CutsceneShot &shot) const
 
class OverworldEditor * OverworldSource () const
 

Private Attributes

zelda3::CutsceneShotSet shots_
 
std::optional< std::string > loaded_bytes_
 
std::string loaded_path_
 
std::string status_
 
bool status_is_error_ = false
 
bool loaded_once_ = false
 
bool dirty_ = false
 
int selected_ = -1
 
int size_override_
 
Drag drag_ = Drag::kNone
 
int drag_actor_ = -1
 

Friends

class CutsceneCameraPanelTestPeer
 

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

Definition at line 22 of file cutscene_camera_panel.h.

Member Enumeration Documentation

◆ Drag

enum class yaze::editor::CutsceneCameraPanel::Drag
strongprivate
Enumerator
kNone 
kViewport 
kLink 
kActor 

Definition at line 58 of file cutscene_camera_panel.h.

Member Function Documentation

◆ GetId()

std::string yaze::editor::CutsceneCameraPanel::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 24 of file cutscene_camera_panel.h.

◆ GetDisplayName()

std::string yaze::editor::CutsceneCameraPanel::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 25 of file cutscene_camera_panel.h.

◆ GetIcon()

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

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::WindowContent.

Definition at line 26 of file cutscene_camera_panel.h.

References ICON_MD_VIDEOCAM.

◆ GetEditorCategory()

std::string yaze::editor::CutsceneCameraPanel::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 27 of file cutscene_camera_panel.h.

◆ GetPresentationPolicy()

WindowPresentationPolicy yaze::editor::CutsceneCameraPanel::GetPresentationPolicy ( ) const
inlineoverridevirtual

How this content is hosted and advertised by workspace chrome.

Every panel must override this and return one of the named policies (CoreWorkspace, EmbeddedTool, OptionalPopOut, Diagnostic). The base implementation returns an undeclared policy that keeps the historical listed pop-out behavior, but the panel admission audit (test/unit/editor/panel_admission_test.cc) fails until the panel chooses. See docs/internal/architecture/editor-ui-module-pattern.md, "Panel admission".

Reimplemented from yaze::editor::WindowContent.

Definition at line 28 of file cutscene_camera_panel.h.

References yaze::editor::WindowPresentationPolicy::OptionalPopOut().

Here is the call graph for this function:

◆ GetScope()

WindowScope yaze::editor::CutsceneCameraPanel::GetScope ( ) const
inlineoverridevirtual

Get the registration scope for this window.

Returns
WindowScope indicating session or global scope

Default is session-scoped.

Reimplemented from yaze::editor::WindowContent.

Definition at line 31 of file cutscene_camera_panel.h.

References yaze::editor::kGlobal.

◆ Draw()

void yaze::editor::CutsceneCameraPanel::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 219 of file cutscene_camera_panel.cc.

References dirty_, DrawCanvas(), DrawShotFields(), DrawShotList(), yaze::gui::GetDisabledColor(), yaze::gui::GetErrorColor(), ICON_MD_CONTENT_COPY, ICON_MD_REFRESH, ICON_MD_SAVE, Load(), loaded_once_, Save(), selected_, yaze::zelda3::SerializeCutsceneShots(), yaze::zelda3::CutsceneShotSet::shots, shots_, ShotsPath(), status_, and status_is_error_.

◆ ShotsPath()

std::optional< std::filesystem::path > yaze::editor::CutsceneCameraPanel::ShotsPath ( ) const
private

Definition at line 52 of file cutscene_camera_panel.cc.

References yaze::editor::ContentRegistry::Context::current_project().

Referenced by Draw(), Load(), and Save().

Here is the call graph for this function:

◆ Load()

void yaze::editor::CutsceneCameraPanel::Load ( )
private

◆ Save()

◆ DrawShotList()

◆ DrawShotFields()

◆ DrawCanvas()

◆ ExtentFor()

zelda3::AreaExtent yaze::editor::CutsceneCameraPanel::ExtentFor ( const zelda3::CutsceneShot & shot) const
private

◆ OverworldSource()

OverworldEditor * yaze::editor::CutsceneCameraPanel::OverworldSource ( ) const
private

Definition at line 181 of file cutscene_camera_panel.cc.

References yaze::editor::CurrentOverworldEditor().

Referenced by DrawCanvas(), and ExtentFor().

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ CutsceneCameraPanelTestPeer

friend class CutsceneCameraPanelTestPeer
friend

Definition at line 36 of file cutscene_camera_panel.h.

Member Data Documentation

◆ shots_

zelda3::CutsceneShotSet yaze::editor::CutsceneCameraPanel::shots_
private

Definition at line 48 of file cutscene_camera_panel.h.

Referenced by Draw(), DrawShotList(), Load(), and Save().

◆ loaded_bytes_

std::optional<std::string> yaze::editor::CutsceneCameraPanel::loaded_bytes_
private

Definition at line 49 of file cutscene_camera_panel.h.

Referenced by Load(), and Save().

◆ loaded_path_

std::string yaze::editor::CutsceneCameraPanel::loaded_path_
private

Definition at line 50 of file cutscene_camera_panel.h.

Referenced by Load().

◆ status_

std::string yaze::editor::CutsceneCameraPanel::status_
private

Definition at line 51 of file cutscene_camera_panel.h.

Referenced by Draw(), Load(), and Save().

◆ status_is_error_

bool yaze::editor::CutsceneCameraPanel::status_is_error_ = false
private

Definition at line 52 of file cutscene_camera_panel.h.

Referenced by Draw(), Load(), and Save().

◆ loaded_once_

bool yaze::editor::CutsceneCameraPanel::loaded_once_ = false
private

Definition at line 53 of file cutscene_camera_panel.h.

Referenced by Draw(), and Load().

◆ dirty_

bool yaze::editor::CutsceneCameraPanel::dirty_ = false
private

Definition at line 54 of file cutscene_camera_panel.h.

Referenced by Draw(), DrawCanvas(), DrawShotFields(), DrawShotList(), Load(), and Save().

◆ selected_

int yaze::editor::CutsceneCameraPanel::selected_ = -1
private

Definition at line 55 of file cutscene_camera_panel.h.

Referenced by Draw(), DrawShotList(), and Load().

◆ size_override_

int yaze::editor::CutsceneCameraPanel::size_override_
private
Initial value:
=
0

Definition at line 56 of file cutscene_camera_panel.h.

Referenced by DrawShotFields(), and ExtentFor().

◆ drag_

Drag yaze::editor::CutsceneCameraPanel::drag_ = Drag::kNone
private

Definition at line 59 of file cutscene_camera_panel.h.

Referenced by DrawCanvas().

◆ drag_actor_

int yaze::editor::CutsceneCameraPanel::drag_actor_ = -1
private

Definition at line 60 of file cutscene_camera_panel.h.

Referenced by DrawCanvas().


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