yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::ContentRegistry::Context Namespace Reference

Global context for accessing shared resources. More...

Functions

void SetGlobalContext (GlobalEditorContext *ctx)
 
Romrom ()
 Get the current ROM instance.
 
void SetRom (Rom *rom)
 Set the current ROM instance.
 
::yaze::EventBusevent_bus ()
 Get the current EventBus instance.
 
void SetEventBus (::yaze::EventBus *bus)
 Set the current EventBus instance.
 
Editorcurrent_editor ()
 Get the currently active editor.
 
void SetCurrentEditor (Editor *editor)
 Set the currently active editor.
 
::yaze::zelda3::GameDatagame_data ()
 Get the current game data instance.
 
void SetGameData (::yaze::zelda3::GameData *data)
 Set the current game data instance.
 
::yaze::project::YazeProjectcurrent_project ()
 Get the current project instance.
 
void SetCurrentProject (::yaze::project::YazeProject *project)
 Set the current project instance.
 
void Clear ()
 Clear all context state.
 
void SetGlobalContext (::yaze::editor::GlobalEditorContext *ctx)
 Set the backing GlobalEditorContext instance.
 

Detailed Description

Global context for accessing shared resources.

Context provides access to the current ROM and other shared state. This replaces the need for panels to receive dependencies via constructor.

Function Documentation

◆ SetGlobalContext() [1/2]

void yaze::editor::ContentRegistry::Context::SetGlobalContext ( GlobalEditorContext * ctx)

Definition at line 58 of file content_registry.cc.

Referenced by yaze::editor::EditorManager::EditorManager().

◆ rom()

◆ SetRom()

void yaze::editor::ContentRegistry::Context::SetRom ( Rom * rom)

◆ event_bus()

◆ SetEventBus()

void yaze::editor::ContentRegistry::Context::SetEventBus ( ::yaze::EventBus * bus)

Set the current EventBus instance.

Parameters
busPointer to the EventBus to set as current.

Definition at line 86 of file content_registry.cc.

Referenced by yaze::editor::EditorManager::InitializeSubsystems().

◆ current_editor()

◆ SetCurrentEditor()

void yaze::editor::ContentRegistry::Context::SetCurrentEditor ( Editor * editor)

Set the currently active editor.

Parameters
editorPointer to the editor to set as current.

Called when switching between editors (Overworld, Dungeon, etc.)

Definition at line 101 of file content_registry.cc.

Referenced by yaze::editor::PanelManager::DrawAllVisiblePanels(), and yaze::editor::EditorManager::SetCurrentEditor().

◆ game_data()

yaze::zelda3::GameData * yaze::editor::ContentRegistry::Context::game_data ( )

Get the current game data instance.

Returns
Pointer to the current GameData, or nullptr if not set.

Definition at line 110 of file content_registry.cc.

◆ SetGameData()

void yaze::editor::ContentRegistry::Context::SetGameData ( ::yaze::zelda3::GameData * data)

Set the current game data instance.

Parameters
dataPointer to the GameData to set as current.

Called when loading a ROM or switching sessions.

Definition at line 117 of file content_registry.cc.

Referenced by yaze::editor::EditorManager::EnsureGameDataLoaded(), yaze::editor::EditorManager::HandleSessionRomLoaded(), and yaze::editor::EditorManager::HandleSessionSwitched().

◆ current_project()

yaze::project::YazeProject * yaze::editor::ContentRegistry::Context::current_project ( )

◆ SetCurrentProject()

void yaze::editor::ContentRegistry::Context::SetCurrentProject ( ::yaze::project::YazeProject * project)

Set the current project instance.

Parameters
projectPointer to the project to set as current.

Called when opening or switching projects.

Definition at line 133 of file content_registry.cc.

Referenced by yaze::editor::EditorManager::LoadProjectWithRom().

◆ Clear()

void yaze::editor::ContentRegistry::Context::Clear ( )

Clear all context state.

Called during shutdown or when switching sessions.

Definition at line 142 of file content_registry.cc.

Referenced by yaze::editor::EditorManager::HandleSessionClosed(), and yaze::test::CoreSystemsTestSuite::RunContentRegistryContextClearTest().

◆ SetGlobalContext() [2/2]

void yaze::editor::ContentRegistry::Context::SetGlobalContext ( ::yaze::editor::GlobalEditorContext * ctx)

Set the backing GlobalEditorContext instance.

When set, Context getters/setters delegate to this instance. Called once during EditorManager initialization. Pass nullptr to revert to standalone static storage.