26 : session_id_(session_id),
28 game_data_(game_data),
29 user_settings_(user_settings),
30 editor_registry_(editor_registry),
32 auto register_factory = [&](
EditorType type,
auto&& fallback) {
35 fallback = std::forward<decltype(fallback)>(
36 fallback)]()
mutable -> std::unique_ptr<Editor> {
47 [
this]() {
return std::make_unique<AssemblyEditor>(
rom_); });
49 return std::make_unique<DungeonEditorV2>(
rom_);
52 [
this]() {
return std::make_unique<GraphicsEditor>(
rom_); });
54 [
this]() {
return std::make_unique<MusicEditor>(
rom_); });
56 return std::make_unique<OverworldEditor>(
rom_);
59 [
this]() {
return std::make_unique<PaletteEditor>(
rom_); });
61 [
this]() {
return std::make_unique<ScreenEditor>(
rom_); });
63 [
this]() {
return std::make_unique<SpriteEditor>(
rom_); });
65 [
this]() {
return std::make_unique<MessageEditor>(
rom_); });
67 [
this]() {
return std::make_unique<MemoryEditor>(
rom_); });
69 []() {
return std::make_unique<SettingsPanel>(); });
77 panel->SetUserSettings(settings);
83 for (
auto& [type, editor] :
editors_) {
91 for (
auto& [type, editor] :
editors_) {
92 editor->SetDependencies(dependencies);
106 return it->second.get();
125 auto editor = factory_it->second();
137 if (
auto* settings_panel =
static_cast<SettingsPanel*
>(editor.get())) {
142 Editor* editor_ptr = editor.get();
170 if (editor ==
nullptr) {
181 editor->OpenFolder(folder_path);
187 editor->ChangeActiveFile(path);
194 return editor->asar_wrapper();
199const std::map<std::string, core::AsarSymbol>&
201 static const std::map<std::string, core::AsarSymbol> kEmpty;
204 return editor->symbols();
212 return editor->LoadedRoomCount();
220 return editor->TotalRoomCount();
225std::vector<std::pair<uint32_t, uint32_t>>
229 return editor->CollectWriteRanges();
237 return &editor->overworld();
281 editors(&rom, &game_data, user_settings, session_id, editor_registry) {
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Modern C++ wrapper for Asar 65816 assembler integration.
Text editor for modifying assembly code.
DungeonEditorV2 - Simplified dungeon editor using component delegation.
Manages editor types, categories, and lifecycle.
std::unique_ptr< Editor > CreateEditor(EditorType type, Rom *rom) const
Contains a complete set of editors for a single ROM instance.
std::optional< EditorDependencies > dependencies_
MemoryEditor * GetMemoryEditor() const
std::unordered_map< EditorType, std::unique_ptr< Editor > > editors_
DungeonEditorV2 * GetDungeonEditor() const
void OpenAssemblyFolder(const std::string &folder_path) const
MusicEditor * GetMusicEditor() const
ScreenEditor * GetScreenEditor() const
void SetGameData(zelda3::GameData *game_data)
bool ShouldTrackAsActiveEditor(EditorType type) const
core::AsarWrapper * GetAsarWrapper() const
void TrackActiveEditor(Editor *editor)
void ChangeActiveAssemblyFile(std::string_view path) const
void ApplyDependencies(const EditorDependencies &dependencies)
const std::map< std::string, core::AsarSymbol > & GetAssemblySymbols() const
EditorSet(Rom *rom=nullptr, zelda3::GameData *game_data=nullptr, UserSettings *user_settings=nullptr, size_t session_id=0, EditorRegistry *editor_registry=nullptr)
Editor * EnsureEditorCreated(EditorType type) const
SpriteEditor * GetSpriteEditor() const
UserSettings * user_settings_
Editor * GetEditor(EditorType type) const
GraphicsEditor * GetGraphicsEditor() const
int LoadedDungeonRoomCount() const
Editor * FindEditor(EditorType type) const
PaletteEditor * GetPaletteEditor() const
std::unordered_map< EditorType, EditorFactory > editor_factories_
EditorRegistry * editor_registry_
void set_user_settings(UserSettings *settings)
zelda3::Overworld * GetOverworldData() const
MessageEditor * GetMessageEditor() const
int TotalDungeonRoomCount() const
SettingsPanel * GetSettingsPanel() const
std::vector< Editor * > active_editors_
zelda3::GameData * game_data_
OverworldEditor * GetOverworldEditor() const
AssemblyEditor * GetAssemblyEditor() const
std::vector< std::pair< uint32_t, uint32_t > > CollectDungeonWriteRanges() const
Interface for editor classes.
virtual void SetDependencies(const EditorDependencies &deps)
Allows the user to edit graphics sheets from the game or view prototype graphics.
A class for editing music data in a Rom.
Main UI class for editing overworld maps in A Link to the Past.
Allows the user to view and edit in game palettes.
The ScreenEditor class allows the user to edit a variety of screens in the game or create a custom me...
Manages the settings UI displayed in the right sidebar.
Allows the user to edit sprites.
Manages user preferences and settings persistence.
Represents the full Overworld data, light and dark world.
Editors are the view controllers for the application.
Unified dependency container for all editor types.
Per-ROM-session UI state shared by all GfxGroupEditor surfaces.
core::FeatureFlags::Flags feature_flags
std::string GetDisplayName() const