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

Contains a complete set of editors for a single ROM instance. More...

#include <session_types.h>

Collaboration diagram for yaze::editor::EditorSet:

Public Member Functions

 EditorSet (Rom *rom=nullptr, zelda3::GameData *game_data=nullptr, UserSettings *user_settings=nullptr, size_t session_id=0, EditorRegistry *editor_registry=nullptr)
 
 ~EditorSet ()
 
void set_user_settings (UserSettings *settings)
 
void SetGameData (zelda3::GameData *game_data)
 
void ApplyDependencies (const EditorDependencies &dependencies)
 
void PrepareForSessionTeardown ()
 
size_t session_id () const
 
Editor * GetEditor (EditorType type) const
 
Editor * GetExistingEditor (EditorType type) const
 
template<typename T >
T * GetEditorAs (EditorType type) const
 
void OpenAssemblyFolder (const std::string &folder_path) const
 
void ChangeActiveAssemblyFile (std::string_view path) const
 
core::AsarWrapper * GetAsarWrapper () const
 
const std::map< std::string, core::AsarSymbol > & GetAssemblySymbols () const
 
int LoadedDungeonRoomCount () const
 
int TotalDungeonRoomCount () const
 
std::vector< std::pair< uint32_t, uint32_t > > CollectDungeonWriteRanges () const
 
bool HasPendingGraphicsChanges () const
 
bool HasPendingScreenChanges () const
 
void InvalidateScreenRomBackedState ()
 
bool HasPendingProjectDraftChanges () const
 
absl::Status PrepareProjectSave ()
 
zelda3::Overworld * GetOverworldData () const
 
AssemblyEditor * GetAssemblyEditor () const
 
DungeonEditorV2 * GetDungeonEditor () const
 
GraphicsEditor * GetGraphicsEditor () const
 
MusicEditor * GetMusicEditor () const
 
OverworldEditor * GetOverworldEditor () const
 
PaletteEditor * GetPaletteEditor () const
 
ScreenEditor * GetScreenEditor () const
 
SpriteEditor * GetSpriteEditor () const
 
SettingsPanel * GetSettingsPanel () const
 
MessageEditor * GetMessageEditor () const
 
MemoryEditor * GetMemoryEditor () const
 
GfxGroupWorkspaceState * gfx_group_workspace ()
 
const GfxGroupWorkspaceState * gfx_group_workspace () const
 

Public Attributes

std::vector< Editor * > active_editors_
 

Private Types

using EditorFactory = std::function<std::unique_ptr<Editor>()>
 

Private Member Functions

Editor * FindEditor (EditorType type) const
 
Editor * EnsureEditorCreated (EditorType type) const
 
bool ShouldTrackAsActiveEditor (EditorType type) const
 
void TrackActiveEditor (Editor *editor)
 

Private Attributes

size_t session_id_ = 0
 
Rom * rom_ = nullptr
 
zelda3::GameData * game_data_ = nullptr
 
UserSettings * user_settings_ = nullptr
 
EditorRegistry * editor_registry_ = nullptr
 
std::optional< EditorDependencies > dependencies_
 
std::unordered_map< EditorType, std::unique_ptr< Editor > > editors_
 
std::unordered_map< EditorType, EditorFactory > editor_factories_
 
bool session_teardown_prepared_ = false
 
std::unique_ptr< GfxGroupWorkspaceState > gfx_group_workspace_
 

Detailed Description

Contains a complete set of editors for a single ROM instance.

Definition at line 58 of file session_types.h.

Member Typedef Documentation

◆ EditorFactory

using yaze::editor::EditorSet::EditorFactory = std::function<std::unique_ptr<Editor>()>
private

Definition at line 145 of file session_types.h.

Constructor & Destructor Documentation

◆ EditorSet()

yaze::editor::EditorSet::EditorSet ( Rom * rom = nullptr,
zelda3::GameData * game_data = nullptr,
UserSettings * user_settings = nullptr,
size_t session_id = 0,
EditorRegistry * editor_registry = nullptr )
explicit

◆ ~EditorSet()

yaze::editor::EditorSet::~EditorSet ( )
default

Member Function Documentation

◆ set_user_settings()

void yaze::editor::EditorSet::set_user_settings ( UserSettings * settings)

Definition at line 83 of file session_types.cc.

References GetSettingsPanel(), and user_settings_.

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

Here is the call graph for this function:

◆ SetGameData()

void yaze::editor::EditorSet::SetGameData ( zelda3::GameData * game_data)

Definition at line 90 of file session_types.cc.

References editors_, and game_data_.

◆ ApplyDependencies()

void yaze::editor::EditorSet::ApplyDependencies ( const EditorDependencies & dependencies)

Definition at line 98 of file session_types.cc.

References dependencies_, and editors_.

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

◆ PrepareForSessionTeardown()

void yaze::editor::EditorSet::PrepareForSessionTeardown ( )

Definition at line 105 of file session_types.cc.

References editors_, and session_teardown_prepared_.

◆ session_id()

size_t yaze::editor::EditorSet::session_id ( ) const
inline

◆ GetEditor()

Editor * yaze::editor::EditorSet::GetEditor ( EditorType type) const

Definition at line 116 of file session_types.cc.

References EnsureEditorCreated().

Referenced by GetEditorAs(), and yaze::editor::EditorManager::GetEditorByType().

Here is the call graph for this function:

◆ GetExistingEditor()

Editor * yaze::editor::EditorSet::GetExistingEditor ( EditorType type) const
inline

Definition at line 80 of file session_types.h.

References FindEditor().

Referenced by EnsureEditorCreated().

Here is the call graph for this function:

◆ GetEditorAs()

template<typename T >
T * yaze::editor::EditorSet::GetEditorAs ( EditorType type) const
inline

Definition at line 83 of file session_types.h.

References GetEditor().

Here is the call graph for this function:

◆ OpenAssemblyFolder()

void yaze::editor::EditorSet::OpenAssemblyFolder ( const std::string & folder_path) const

Definition at line 256 of file session_types.cc.

References GetAssemblyEditor().

Here is the call graph for this function:

◆ ChangeActiveAssemblyFile()

void yaze::editor::EditorSet::ChangeActiveAssemblyFile ( std::string_view path) const

Definition at line 262 of file session_types.cc.

References GetAssemblyEditor().

Here is the call graph for this function:

◆ GetAsarWrapper()

core::AsarWrapper * yaze::editor::EditorSet::GetAsarWrapper ( ) const

Definition at line 268 of file session_types.cc.

References FindEditor(), and yaze::editor::kAssembly.

Here is the call graph for this function:

◆ GetAssemblySymbols()

const std::map< std::string, core::AsarSymbol > & yaze::editor::EditorSet::GetAssemblySymbols ( ) const

Definition at line 276 of file session_types.cc.

References FindEditor(), and yaze::editor::kAssembly.

Here is the call graph for this function:

◆ LoadedDungeonRoomCount()

int yaze::editor::EditorSet::LoadedDungeonRoomCount ( ) const

Definition at line 286 of file session_types.cc.

References FindEditor(), and yaze::editor::kDungeon.

Here is the call graph for this function:

◆ TotalDungeonRoomCount()

int yaze::editor::EditorSet::TotalDungeonRoomCount ( ) const

Definition at line 294 of file session_types.cc.

References FindEditor(), and yaze::editor::kDungeon.

Here is the call graph for this function:

◆ CollectDungeonWriteRanges()

std::vector< std::pair< uint32_t, uint32_t > > yaze::editor::EditorSet::CollectDungeonWriteRanges ( ) const

Definition at line 303 of file session_types.cc.

References FindEditor(), and yaze::editor::kDungeon.

Here is the call graph for this function:

◆ HasPendingGraphicsChanges()

bool yaze::editor::EditorSet::HasPendingGraphicsChanges ( ) const

Definition at line 319 of file session_types.cc.

References FindEditor(), and yaze::editor::kGraphics.

Here is the call graph for this function:

◆ HasPendingScreenChanges()

bool yaze::editor::EditorSet::HasPendingScreenChanges ( ) const

Definition at line 327 of file session_types.cc.

References FindEditor(), and yaze::editor::kScreen.

Here is the call graph for this function:

◆ InvalidateScreenRomBackedState()

void yaze::editor::EditorSet::InvalidateScreenRomBackedState ( )

Definition at line 335 of file session_types.cc.

References FindEditor(), and yaze::editor::kScreen.

Here is the call graph for this function:

◆ HasPendingProjectDraftChanges()

bool yaze::editor::EditorSet::HasPendingProjectDraftChanges ( ) const

Definition at line 342 of file session_types.cc.

References FindEditor(), and yaze::editor::kDungeon.

Here is the call graph for this function:

◆ PrepareProjectSave()

absl::Status yaze::editor::EditorSet::PrepareProjectSave ( )

Definition at line 350 of file session_types.cc.

References FindEditor(), and yaze::editor::kDungeon.

Here is the call graph for this function:

◆ GetOverworldData()

zelda3::Overworld * yaze::editor::EditorSet::GetOverworldData ( ) const

Definition at line 358 of file session_types.cc.

References FindEditor(), and yaze::editor::kOverworld.

Referenced by EnsureEditorCreated().

Here is the call graph for this function:

◆ GetAssemblyEditor()

AssemblyEditor * yaze::editor::EditorSet::GetAssemblyEditor ( ) const

Definition at line 367 of file session_types.cc.

References yaze::editor::kAssembly.

Referenced by ChangeActiveAssemblyFile(), and OpenAssemblyFolder().

◆ GetDungeonEditor()

DungeonEditorV2 * yaze::editor::EditorSet::GetDungeonEditor ( ) const

Definition at line 370 of file session_types.cc.

References yaze::editor::kDungeon.

◆ GetGraphicsEditor()

GraphicsEditor * yaze::editor::EditorSet::GetGraphicsEditor ( ) const

Definition at line 373 of file session_types.cc.

References yaze::editor::kGraphics.

◆ GetMusicEditor()

MusicEditor * yaze::editor::EditorSet::GetMusicEditor ( ) const

Definition at line 376 of file session_types.cc.

References yaze::editor::kMusic.

◆ GetOverworldEditor()

OverworldEditor * yaze::editor::EditorSet::GetOverworldEditor ( ) const

Definition at line 379 of file session_types.cc.

References yaze::editor::kOverworld.

◆ GetPaletteEditor()

PaletteEditor * yaze::editor::EditorSet::GetPaletteEditor ( ) const

Definition at line 382 of file session_types.cc.

References yaze::editor::kPalette.

◆ GetScreenEditor()

ScreenEditor * yaze::editor::EditorSet::GetScreenEditor ( ) const

Definition at line 385 of file session_types.cc.

References yaze::editor::kScreen.

◆ GetSpriteEditor()

SpriteEditor * yaze::editor::EditorSet::GetSpriteEditor ( ) const

Definition at line 388 of file session_types.cc.

References yaze::editor::kSprite.

◆ GetSettingsPanel()

SettingsPanel * yaze::editor::EditorSet::GetSettingsPanel ( ) const

◆ GetMessageEditor()

MessageEditor * yaze::editor::EditorSet::GetMessageEditor ( ) const

Definition at line 394 of file session_types.cc.

References yaze::editor::kMessage.

◆ GetMemoryEditor()

MemoryEditor * yaze::editor::EditorSet::GetMemoryEditor ( ) const

Definition at line 397 of file session_types.cc.

References yaze::editor::kHex.

◆ gfx_group_workspace() [1/2]

GfxGroupWorkspaceState * yaze::editor::EditorSet::gfx_group_workspace ( )
inline

Shared Gfx Groups UI state for this ROM session (Graphics + Overworld).

Definition at line 135 of file session_types.h.

References gfx_group_workspace_.

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

◆ gfx_group_workspace() [2/2]

const GfxGroupWorkspaceState * yaze::editor::EditorSet::gfx_group_workspace ( ) const
inline

Definition at line 138 of file session_types.h.

References gfx_group_workspace_.

◆ FindEditor()

◆ EnsureEditorCreated()

◆ ShouldTrackAsActiveEditor()

◆ TrackActiveEditor()

void yaze::editor::EditorSet::TrackActiveEditor ( Editor * editor)
private

Definition at line 246 of file session_types.cc.

References active_editors_.

Referenced by EnsureEditorCreated().

Member Data Documentation

◆ active_editors_

std::vector<Editor*> yaze::editor::EditorSet::active_editors_

◆ session_id_

size_t yaze::editor::EditorSet::session_id_ = 0
private

Definition at line 152 of file session_types.h.

Referenced by session_id().

◆ rom_

Rom* yaze::editor::EditorSet::rom_ = nullptr
private

Definition at line 153 of file session_types.h.

Referenced by EditorSet(), and EnsureEditorCreated().

◆ game_data_

zelda3::GameData* yaze::editor::EditorSet::game_data_ = nullptr
private

Definition at line 154 of file session_types.h.

Referenced by EnsureEditorCreated(), and SetGameData().

◆ user_settings_

UserSettings* yaze::editor::EditorSet::user_settings_ = nullptr
private

Definition at line 155 of file session_types.h.

Referenced by EnsureEditorCreated(), and set_user_settings().

◆ editor_registry_

EditorRegistry* yaze::editor::EditorSet::editor_registry_ = nullptr
private

Definition at line 156 of file session_types.h.

Referenced by EditorSet().

◆ dependencies_

std::optional<EditorDependencies> yaze::editor::EditorSet::dependencies_
private

Definition at line 158 of file session_types.h.

Referenced by ApplyDependencies(), and EnsureEditorCreated().

◆ editors_

std::unordered_map<EditorType, std::unique_ptr<Editor> > yaze::editor::EditorSet::editors_
mutableprivate

◆ editor_factories_

std::unordered_map<EditorType, EditorFactory> yaze::editor::EditorSet::editor_factories_
private

Definition at line 160 of file session_types.h.

Referenced by EditorSet(), and EnsureEditorCreated().

◆ session_teardown_prepared_

bool yaze::editor::EditorSet::session_teardown_prepared_ = false
private

Definition at line 161 of file session_types.h.

Referenced by EnsureEditorCreated(), and PrepareForSessionTeardown().

◆ gfx_group_workspace_

std::unique_ptr<GfxGroupWorkspaceState> yaze::editor::EditorSet::gfx_group_workspace_
private

Definition at line 163 of file session_types.h.

Referenced by gfx_group_workspace(), and gfx_group_workspace().


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