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 <unordered_map>
7
8#include "absl/status/status.h"
9#include "app/core/project.h"
22#include "app/emu/emulator.h"
23#include "app/rom.h"
24#include "yaze_config.h"
25
26namespace yaze {
27namespace editor {
28
29// Forward declaration
30class EditorSet;
31
44 public:
46 std::stringstream ss;
47 ss << YAZE_VERSION_MAJOR << "." << YAZE_VERSION_MINOR << "."
48 << YAZE_VERSION_PATCH;
49 ss >> version_;
50 context_.popup_manager = popup_manager_.get();
51 }
52
53 void Initialize(const std::string& filename = "");
54 absl::Status Update();
55 void DrawMenuBar();
56
57 auto emulator() -> emu::Emulator& { return emulator_; }
58 auto quit() const { return quit_; }
59 auto version() const { return version_; }
60
61 absl::Status SetCurrentRom(Rom* rom);
62 auto GetCurrentRom() -> Rom* { return current_rom_; }
64
65 private:
66 void DrawHomepage();
67 absl::Status DrawRomSelector();
68 absl::Status LoadRom();
69 absl::Status LoadAssets();
70 absl::Status SaveRom();
71 absl::Status OpenRomOrProject(const std::string& filename);
72 absl::Status OpenProject();
73 absl::Status SaveProject();
74
75 bool quit_ = false;
76 bool backup_rom_ = false;
77 bool save_new_auto_ = true;
78 bool new_project_menu = false;
79
80 bool show_emulator_ = false;
81 bool show_memory_editor_ = false;
82 bool show_asm_editor_ = false;
83 bool show_imgui_metrics_ = false;
84 bool show_imgui_demo_ = false;
88 bool show_homepage_ = true;
89
90 std::string version_ = "";
91
92 absl::Status status_;
94 std::vector<std::shared_ptr<Rom>> roms_;
95 std::unordered_map<Rom*, std::unique_ptr<EditorSet>> editor_sets_;
96 Rom* current_rom_ = nullptr;
99
102 std::unique_ptr<PopupManager> popup_manager_;
103};
104
143
144} // namespace editor
145} // namespace yaze
146
147#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::unordered_map< Rom *, std::unique_ptr< EditorSet > > editor_sets_
auto GetCurrentEditorSet() -> EditorSet *
void Initialize(const std::string &filename="")
auto emulator() -> emu::Emulator &
absl::Status OpenRomOrProject(const std::string &filename)
std::vector< std::shared_ptr< Rom > > roms_
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:18
Represents a project in the application.
Definition project.h:26