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/gui/input.h"
24#include "app/rom.h"
25#include "yaze_config.h"
26
27namespace yaze {
28namespace editor {
29
30// Forward declaration
31class EditorSet;
32
45 public:
47 std::stringstream ss;
48 ss << YAZE_VERSION_MAJOR << "." << YAZE_VERSION_MINOR << "."
49 << YAZE_VERSION_PATCH;
50 ss >> version_;
51 context_.popup_manager = popup_manager_.get();
52 }
53
54 void Initialize(const std::string& filename = "");
55 absl::Status Update();
56 void DrawMenuBar();
57
58 auto emulator() -> emu::Emulator& { return emulator_; }
59 auto quit() const { return quit_; }
60 auto version() const { return version_; }
61
62 absl::Status SetCurrentRom(Rom* rom);
63 auto GetCurrentRom() -> Rom* { return current_rom_; }
65
66 private:
67 void DrawHomepage();
68 absl::Status DrawRomSelector();
69 absl::Status LoadRom();
70 absl::Status LoadAssets();
71 absl::Status SaveRom();
72 absl::Status OpenRomOrProject(const std::string& filename);
73 absl::Status OpenProject();
74 absl::Status SaveProject();
75
76 bool quit_ = false;
77 bool backup_rom_ = false;
78 bool save_new_auto_ = true;
79 bool new_project_menu = false;
80
81 bool show_emulator_ = false;
82 bool show_memory_editor_ = false;
83 bool show_asm_editor_ = false;
84 bool show_imgui_metrics_ = false;
85 bool show_imgui_demo_ = false;
89 bool show_homepage_ = true;
90
91 std::string version_ = "";
92
93 absl::Status status_;
95 std::vector<std::shared_ptr<Rom>> roms_;
96 std::unordered_map<Rom*, std::unique_ptr<EditorSet>> editor_sets_;
97 Rom* current_rom_ = nullptr;
100
103 std::unique_ptr<PopupManager> popup_manager_;
104};
105
152
153} // namespace editor
154} // namespace yaze
155
156#endif // YAZE_APP_EDITOR_EDITOR_MANAGER_H
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:59
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_
void CleanupUnusedTextures(uint64_t current_time, uint64_t timeout)
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
Editors are the view controllers for the application.
Main namespace for the application.
Definition controller.cc:18
Represents a project in the application.
Definition project.h:26