yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
session_types.cc
Go to the documentation of this file.
2
3#include "app/editor/editor.h" // For EditorDependencies, needed by ApplyDependencies
4#include "app/editor/system/user_settings.h" // For UserSettings forward decl in header
5
6namespace yaze::editor {
7
8EditorSet::EditorSet(Rom* rom, UserSettings* user_settings, size_t session_id)
9 : session_id_(session_id),
10 assembly_editor_(rom),
11 dungeon_editor_(rom),
12 graphics_editor_(rom),
13 music_editor_(rom),
14 overworld_editor_(rom),
15 palette_editor_(rom),
16 screen_editor_(rom),
17 sprite_editor_(rom),
18 settings_editor_(rom, user_settings),
19 message_editor_(rom),
20 memory_editor_(rom) {
25}
26
30
32 for (auto* editor : active_editors_) {
33 editor->SetDependencies(dependencies);
34 }
35 memory_editor_.set_rom(dependencies.rom);
36}
37
38RomSession::RomSession(Rom&& r, UserSettings* user_settings, size_t session_id)
39 : rom(std::move(r)), editors(&rom, user_settings, session_id) {
42}
43
44std::string RomSession::GetDisplayName() const {
45 if (!custom_name.empty()) {
46 return custom_name;
47 }
48 return rom.title().empty() ? "Untitled Session" : rom.title();
49}
50
51} // namespace yaze::editor
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:74
auto filename() const
Definition rom.h:211
auto title() const
Definition rom.h:204
SettingsEditor settings_editor_
ScreenEditor screen_editor_
DungeonEditorV2 dungeon_editor_
MemoryEditorWithDiffChecker memory_editor_
void ApplyDependencies(const EditorDependencies &dependencies)
GraphicsEditor graphics_editor_
void set_user_settings(UserSettings *settings)
AssemblyEditor assembly_editor_
EditorSet(Rom *rom=nullptr, UserSettings *user_settings=nullptr, size_t session_id=0)
SpriteEditor sprite_editor_
OverworldEditor overworld_editor_
MessageEditor message_editor_
std::vector< Editor * > active_editors_
PaletteEditor palette_editor_
void set_user_settings(UserSettings *settings)
Manages user preferences and settings persistence.
Editors are the view controllers for the application.
Unified dependency container for all editor types.
Definition editor.h:64
core::FeatureFlags::Flags feature_flags
std::string GetDisplayName() const