yaze 0.2.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
editor_manager.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_EDITOR_MANAGER_H
2#define YAZE_APP_EDITOR_EDITOR_MANAGER_H
3
4#define IMGUI_DEFINE_MATH_OPERATORS
5
6#include <deque>
7#include <vector>
8
9#include "absl/status/status.h"
10#include "app/core/project.h"
24#include "app/emu/emulator.h"
25#include "app/rom.h"
26#include "yaze_config.h"
27
28namespace yaze {
29namespace editor {
30
69
82 public:
84 std::stringstream ss;
85 ss << YAZE_VERSION_MAJOR << "." << YAZE_VERSION_MINOR << "."
86 << YAZE_VERSION_PATCH;
87 ss >> version_;
88 context_.popup_manager = popup_manager_.get();
89 }
90
91 void Initialize(const std::string& filename = "");
92 absl::Status Update();
93 void DrawMenuBar();
94
95 auto emulator() -> emu::Emulator& { return emulator_; }
96 auto quit() const { return quit_; }
97 auto version() const { return version_; }
98
99 absl::Status SetCurrentRom(Rom* rom);
100 auto GetCurrentRom() -> Rom* { return current_rom_; }
102
103 private:
104 void DrawHomepage();
105 absl::Status DrawRomSelector();
106 absl::Status LoadRom();
107 absl::Status LoadAssets();
108 absl::Status SaveRom();
109 absl::Status OpenRomOrProject(const std::string& filename);
110 absl::Status OpenProject();
111 absl::Status SaveProject();
112
113 bool quit_ = false;
114 bool backup_rom_ = false;
115 bool save_new_auto_ = true;
116 bool autosave_enabled_ = false;
118 float autosave_timer_ = 0.0f;
119 bool new_project_menu = false;
120
121 bool show_emulator_ = false;
123 bool show_asm_editor_ = false;
125 bool show_imgui_demo_ = false;
131 bool show_homepage_ = true;
134
135 std::string version_ = "";
136 std::string settings_filename_ = "settings.ini";
137 float font_global_scale_ = 1.0f;
138 std::vector<std::string> workspace_presets_;
139 std::string last_workspace_preset_ = "";
140 std::string status_message_ = "";
141
142 absl::Status status_;
144
145 struct RomSession {
148
149 RomSession() = default;
150 explicit RomSession(Rom&& r)
151 : rom(std::move(r)), editors(&rom) {}
152 };
153
154 std::deque<RomSession> sessions_;
155 Rom* current_rom_ = nullptr;
159
162 std::unique_ptr<PopupManager> popup_manager_;
164
165 // Settings helpers
166 void LoadUserSettings();
167 void SaveUserSettings();
169 void SaveWorkspacePreset(const std::string& name);
170 void LoadWorkspacePreset(const std::string& name);
171};
172
173} // namespace editor
174} // namespace yaze
175
176#endif // YAZE_APP_EDITOR_EDITOR_MANAGER_H
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:57
Text editor for modifying assembly code.
DungeonEditor class for editing dungeons.
std::deque< RomSession > sessions_
void SaveWorkspacePreset(const std::string &name)
void LoadWorkspacePreset(const std::string &name)
auto GetCurrentEditorSet() -> EditorSet *
std::vector< std::string > workspace_presets_
void Initialize(const std::string &filename="")
auto emulator() -> emu::Emulator &
absl::Status OpenRomOrProject(const std::string &filename)
std::unique_ptr< PopupManager > popup_manager_
absl::Status SetCurrentRom(Rom *rom)
Contains a complete set of editors for a single ROM instance.
DungeonEditor dungeon_editor_
SettingsEditor settings_editor_
EditorSet(Rom *rom=nullptr)
MemoryEditorWithDiffChecker memory_editor_
GraphicsEditor graphics_editor_
AssemblyEditor assembly_editor_
OverworldEditor overworld_editor_
MessageEditor message_editor_
std::vector< Editor * > active_editors_
PaletteEditor palette_editor_
Interface for editor classes.
Definition editor.h:69
Allows the user to edit graphics sheets from the game or view prototype graphics.
A class for editing music data in a Rom.
Manipulates the Overworld and OverworldMap data in a Rom.
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...
Allows the user to edit sprites.
A class for emulating and debugging SNES games.
Definition emulator.h:39
Main namespace for the application.
Definition controller.cc:12
Represents a project in the application.
Definition project.h:25