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"
23#include "app/emu/emulator.h"
24#include "app/rom.h"
25#include "yaze_config.h"
26
27namespace yaze {
28namespace editor {
29
68
81 public:
83 std::stringstream ss;
84 ss << YAZE_VERSION_MAJOR << "." << YAZE_VERSION_MINOR << "."
85 << YAZE_VERSION_PATCH;
86 ss >> version_;
87 context_.popup_manager = popup_manager_.get();
88 }
89
90 void Initialize(const std::string& filename = "");
91 absl::Status Update();
92 void DrawMenuBar();
93
94 auto emulator() -> emu::Emulator& { return emulator_; }
95 auto quit() const { return quit_; }
96 auto version() const { return version_; }
97
98 absl::Status SetCurrentRom(Rom* rom);
99 auto GetCurrentRom() -> Rom* { return current_rom_; }
101
102 private:
103 void DrawHomepage();
104 absl::Status DrawRomSelector();
105 absl::Status LoadRom();
106 absl::Status LoadAssets();
107 absl::Status SaveRom();
108 absl::Status OpenRomOrProject(const std::string& filename);
109 absl::Status OpenProject();
110 absl::Status SaveProject();
111
112 bool quit_ = false;
113 bool backup_rom_ = false;
114 bool save_new_auto_ = true;
115 bool new_project_menu = false;
116
117 bool show_emulator_ = false;
119 bool show_asm_editor_ = false;
121 bool show_imgui_demo_ = false;
125 bool show_homepage_ = true;
126
127 std::string version_ = "";
128
129 absl::Status status_;
131
132 struct RomSession {
135
136 RomSession() = default;
137 explicit RomSession(Rom&& r)
138 : rom(std::move(r)), editors(&rom) {}
139 };
140
141 std::deque<RomSession> sessions_;
142 Rom* current_rom_ = nullptr;
146
149 std::unique_ptr<PopupManager> popup_manager_;
150};
151
152} // namespace editor
153} // namespace yaze
154
155#endif // YAZE_APP_EDITOR_EDITOR_MANAGER_H
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:58
Text editor for modifying assembly code.
DungeonEditor class for editing dungeons.
std::deque< RomSession > sessions_
auto GetCurrentEditorSet() -> EditorSet *
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:53
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