28 : session_id_(session_id),
30 game_data_(game_data),
31 user_settings_(user_settings),
32 editor_registry_(editor_registry),
34 auto register_factory = [&](
EditorType type,
auto&& fallback) {
37 fallback = std::forward<decltype(fallback)>(
38 fallback)]()
mutable -> std::unique_ptr<Editor> {
49 [
this]() {
return std::make_unique<AssemblyEditor>(
rom_); });
51 return std::make_unique<DungeonEditorV2>(
rom_);
54 [
this]() {
return std::make_unique<GraphicsEditor>(
rom_); });
56 [
this]() {
return std::make_unique<MusicEditor>(
rom_); });
58 return std::make_unique<OverworldEditor>(
rom_);
61 [
this]() {
return std::make_unique<PaletteEditor>(
rom_); });
63 [
this]() {
return std::make_unique<ScreenEditor>(
rom_); });
65 [
this]() {
return std::make_unique<SpriteEditor>(
rom_); });
67 [
this]() {
return std::make_unique<MessageEditor>(
rom_); });
69 [
this]() {
return std::make_unique<MemoryEditor>(
rom_); });
71 []() {
return std::make_unique<SettingsPanel>(); });
79 panel->SetUserSettings(settings);
85 for (
auto& [type, editor] :
editors_) {
93 for (
auto& [type, editor] :
editors_) {
94 editor->SetDependencies(dependencies);
108 return it->second.get();
127 auto editor = factory_it->second();
139 if (
auto* settings_panel =
static_cast<SettingsPanel*
>(editor.get())) {
144 Editor* editor_ptr = editor.get();
172 if (editor ==
nullptr) {
183 editor->OpenFolder(folder_path);
189 editor->ChangeActiveFile(path);
196 return editor->asar_wrapper();
203 static const std::map<std::string, core::AsarSymbol> kEmpty;
206 return editor->symbols();
214 return editor->LoadedRoomCount();
222 return editor->TotalRoomCount();
227std::vector<std::pair<uint32_t, uint32_t>>
231 return editor->CollectWriteRanges();
239 return &editor->overworld();
282 editors(&rom, &game_data, user_settings, session_id, editor_registry) {}
288 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.
static PaletteManager & Get()
Get the singleton instance.
void ReleaseSession(const zelda3::GameData *game_data)
Forget all palette tracking for a closing or reloaded ROM session.
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
zelda3::GameData game_data
std::string GetDisplayName() const