yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
editor_manager.cc
Go to the documentation of this file.
1#include "editor_manager.h"
2
3#include "absl/status/status.h"
4#include "absl/strings/match.h"
7#include "app/core/project.h"
17#include "app/emu/emulator.h"
18#include "app/gui/icons.h"
19#include "app/gui/input.h"
20#include "app/gui/style.h"
21#include "app/rom.h"
22#include "editor/editor.h"
23#include "imgui/imgui.h"
24#include "imgui/misc/cpp/imgui_stdlib.h"
25
26namespace yaze {
27namespace app {
28namespace editor {
29
30using namespace ImGui;
31using core::FileDialogWrapper;
32
33namespace {
34
35bool BeginCentered(const char* name) {
36 ImGuiIO const& io = GetIO();
37 ImVec2 pos(io.DisplaySize.x * 0.5f, io.DisplaySize.y * 0.5f);
38 SetNextWindowPos(pos, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
39 ImGuiWindowFlags flags =
40 ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration |
41 ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings;
42 return Begin(name, nullptr, flags);
43}
44
45bool IsEditorActive(Editor* editor, std::vector<Editor*>& active_editors) {
46 return std::find(active_editors.begin(), active_editors.end(), editor) !=
47 active_editors.end();
48}
49
50} // namespace
51
52void EditorManager::SetupScreen(std::string filename) {
53 if (!filename.empty()) {
54 PRINT_IF_ERROR(rom()->LoadFromFile(filename));
55 }
58}
59
60absl::Status EditorManager::Update() {
62
67
68 if (rom()->is_loaded() && !rom_assets_loaded_) {
69 // Load all of the graphics data from the game.
70 RETURN_IF_ERROR(rom()->LoadAllGraphicsData())
71 // Initialize overworld graphics, maps, and palettes
73 rom_assets_loaded_ = true;
74 }
75
78 else
80
81 return absl::OkStatus();
82}
83
85 // Show popup pane to select an editor to add
86 static bool show_add_editor = false;
87 if (show_add_editor) OpenPopup("AddEditor");
88
89 if (BeginPopup("AddEditor", ImGuiWindowFlags_AlwaysAutoResize)) {
90 if (MenuItem("Overworld", nullptr, false,
91 !IsEditorActive(&overworld_editor_, active_editors_))) {
93 CloseCurrentPopup();
94 }
95 if (MenuItem("Dungeon", nullptr, false,
96 !IsEditorActive(&dungeon_editor_, active_editors_))) {
98 CloseCurrentPopup();
99 }
100 if (MenuItem("Graphics", nullptr, false,
101 !IsEditorActive(&graphics_editor_, active_editors_))) {
103 CloseCurrentPopup();
104 }
105 if (MenuItem("Music", nullptr, false,
106 !IsEditorActive(&music_editor_, active_editors_))) {
107 active_editors_.push_back(&music_editor_);
108 CloseCurrentPopup();
109 }
110 if (MenuItem("Palette", nullptr, false,
111 !IsEditorActive(&palette_editor_, active_editors_))) {
113 CloseCurrentPopup();
114 }
115 if (MenuItem("Screen", nullptr, false,
116 !IsEditorActive(&screen_editor_, active_editors_))) {
118 CloseCurrentPopup();
119 }
120 if (MenuItem("Sprite", nullptr, false,
121 !IsEditorActive(&sprite_editor_, active_editors_))) {
123 CloseCurrentPopup();
124 }
125 if (MenuItem("Code", nullptr, false,
126 !IsEditorActive(&assembly_editor_, active_editors_))) {
128 CloseCurrentPopup();
129 }
130 if (MenuItem("Message", nullptr, false,
131 !IsEditorActive(&message_editor_, active_editors_))) {
133 CloseCurrentPopup();
134 }
135 if (MenuItem("Settings", nullptr, false,
136 !IsEditorActive(&settings_editor_, active_editors_))) {
138 CloseCurrentPopup();
139 }
140 EndPopup();
141 }
142
143 if (!IsPopupOpen("AddEditor")) {
144 show_add_editor = false;
145 }
146
147 if (BeginTabBar("##TabBar", ImGuiTabBarFlags_Reorderable |
148 ImGuiTabBarFlags_AutoSelectNewTabs)) {
149 for (auto editor : active_editors_) {
150 bool open = true;
151 switch (editor->type()) {
153 if (overworld_editor_.jump_to_tab() == -1) {
154 if (BeginTabItem("Overworld", &open)) {
157 EndTabItem();
158 }
159 }
160 break;
162 if (BeginTabItem("Dungeon", &open)) {
165 if (overworld_editor_.jump_to_tab() != -1) {
168 }
169 EndTabItem();
170 }
171 break;
173 if (BeginTabItem("Graphics", &open)) {
176 EndTabItem();
177 }
178 break;
180 if (BeginTabItem("Music", &open)) {
182
184 EndTabItem();
185 }
186 break;
188 if (BeginTabItem("Palette", &open)) {
191 EndTabItem();
192 }
193 break;
195 if (BeginTabItem("Screen", &open)) {
198 EndTabItem();
199 }
200 break;
202 if (BeginTabItem("Sprite", &open)) {
205 EndTabItem();
206 }
207 break;
209 if (BeginTabItem("Code", &open)) {
212 EndTabItem();
213 }
214 break;
216 if (BeginTabItem("Settings", &open)) {
219 EndTabItem();
220 }
221 break;
223 if (BeginTabItem("Message", &open)) {
226 EndTabItem();
227 }
228 break;
229 default:
230 break;
231 }
232 if (!open) {
233 active_editors_.erase(
234 std::remove(active_editors_.begin(), active_editors_.end(), editor),
235 active_editors_.end());
236 }
237 }
238
239 if (TabItemButton(ICON_MD_ADD, ImGuiTabItemFlags_Trailing)) {
240 show_add_editor = true;
241 }
242
243 EndTabBar();
244 }
245}
246
248 // Dynamic layout for multiple editors to be open at once
249 // Allows for tiling and resizing of editors using ImGui
250 return DrawEditor(&root_layout_);
251}
252
254 bool ctrl_or_super = (GetIO().KeyCtrl || GetIO().KeySuper);
255
257
258 // If CMD + R is pressed, reload the top result of recent files
259 if (IsKeyDown(ImGuiKey_R) && ctrl_or_super) {
260 static RecentFilesManager manager("recent_files.txt");
261 manager.Load();
262 if (!manager.GetRecentFiles().empty()) {
263 auto front = manager.GetRecentFiles().front();
264 OpenRomOrProject(front);
265 }
266 }
267
268 if (IsKeyDown(ImGuiKey_F1)) {
269 about_ = true;
270 }
271
272 // If CMD + Q is pressed, quit the application
273 if (IsKeyDown(ImGuiKey_Q) && ctrl_or_super) {
274 quit_ = true;
275 }
276
277 // If CMD + O is pressed, open a file dialog
278 if (IsKeyDown(ImGuiKey_O) && ctrl_or_super) {
279 LoadRom();
280 }
281
282 // If CMD + S is pressed, save the current ROM
283 if (IsKeyDown(ImGuiKey_S) && ctrl_or_super) {
284 SaveRom();
285 }
286
287 if (IsKeyDown(ImGuiKey_X) && ctrl_or_super) {
289 }
290
291 if (IsKeyDown(ImGuiKey_C) && ctrl_or_super) {
293 }
294
295 if (IsKeyDown(ImGuiKey_V) && ctrl_or_super) {
297 }
298
299 if (IsKeyDown(ImGuiKey_Z) && ctrl_or_super) {
301 }
302
303 if (IsKeyDown(ImGuiKey_Y) && ctrl_or_super) {
305 }
306
307 if (IsKeyDown(ImGuiKey_F) && ctrl_or_super) {
309 }
310}
311
313 if (root_layout_.editor == nullptr) {
315 }
316
317 // New editor popup for window management commands
318 static EditorLayoutParams new_layout;
319 if (ImGui::BeginPopup("NewEditor")) {
320 ImGui::Text("New Editor");
321 ImGui::Separator();
322 if (ImGui::Button("Overworld")) {
323 new_layout.editor = &overworld_editor_;
324 ImGui::CloseCurrentPopup();
325 }
326 if (ImGui::Button("Dungeon")) {
327 new_layout.editor = &dungeon_editor_;
328 ImGui::CloseCurrentPopup();
329 }
330 if (ImGui::Button("Graphics")) {
331 new_layout.editor = &graphics_editor_;
332 ImGui::CloseCurrentPopup();
333 }
334 if (ImGui::Button("Music")) {
335 new_layout.editor = &music_editor_;
336 ImGui::CloseCurrentPopup();
337 }
338 if (ImGui::Button("Palette")) {
339 new_layout.editor = &palette_editor_;
340 ImGui::CloseCurrentPopup();
341 }
342 if (ImGui::Button("Screen")) {
343 new_layout.editor = &screen_editor_;
344 ImGui::CloseCurrentPopup();
345 }
346 if (ImGui::Button("Sprite")) {
347 new_layout.editor = &sprite_editor_;
348 ImGui::CloseCurrentPopup();
349 }
350 if (ImGui::Button("Code")) {
351 new_layout.editor = &assembly_editor_;
352 ImGui::CloseCurrentPopup();
353 }
354 if (ImGui::Button("Settings")) {
355 new_layout.editor = &settings_editor_;
356 ImGui::CloseCurrentPopup();
357 }
358 if (ImGui::Button("Message")) {
359 new_layout.editor = &message_editor_;
360 ImGui::CloseCurrentPopup();
361 }
362 ImGui::EndPopup();
363 }
364
366 "window management", "");
368 "window", "vsplit", '/', "vertical split",
369 "split windows vertically and place editor in new window", [this]() {
370 ImGui::OpenPopup("NewEditor");
371 root_layout_.v_split = true;
372 });
374 "window", "hsplit", '-', "horizontal split",
375 "split windows horizontally and place editor in new window", [this]() {
376 ImGui::OpenPopup("NewEditor");
377 root_layout_.h_split = true;
378 });
380 "window", "close", 'd', "close", "close the current editor", [this]() {
381 if (root_layout_.editor != nullptr) {
382 root_layout_.editor = nullptr;
383 }
384 });
385}
386
388 static absl::Status prev_status;
389 if (!status_.ok()) {
390 show_status_ = true;
391 prev_status = status_;
392 }
393
394 if (show_status_ && (BeginCentered("StatusWindow"))) {
395 Text("%s", ICON_MD_ERROR);
396 Text("%s", prev_status.ToString().c_str());
397 Spacing();
398 NextColumn();
399 Columns(1);
400 Separator();
401 NewLine();
402 SameLine(128);
403 if (Button("OK", gui::kDefaultModalSize) || IsKeyPressed(ImGuiKey_Space)) {
404 show_status_ = false;
405 status_ = absl::OkStatus();
406 }
407 SameLine();
408 if (Button(ICON_MD_CONTENT_COPY, ImVec2(50, 0))) {
409 SetClipboardText(prev_status.ToString().c_str());
410 }
411 End();
412 }
413}
414
416 if (about_) OpenPopup("About");
417 if (BeginPopupModal("About", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
418 Text("Yet Another Zelda3 Editor - v%s", core::kYazeVersion.data());
419 Text("Written by: scawful");
420 Spacing();
421 Text("Special Thanks: Zarby89, JaredBrian");
422 Separator();
423
424 if (Button("Close", gui::kDefaultModalSize)) {
425 about_ = false;
426 CloseCurrentPopup();
427 }
428 EndPopup();
429 }
430}
431
433 if (rom_info_) OpenPopup("ROM Information");
434 if (BeginPopupModal("ROM Information", nullptr,
435 ImGuiWindowFlags_AlwaysAutoResize)) {
436 Text("Title: %s", rom()->title().c_str());
437 Text("ROM Size: %s", core::UppercaseHexLongLong(rom()->size()).c_str());
438
439 if (Button("Close", gui::kDefaultModalSize) ||
440 IsKeyPressed(ImGuiKey_Escape)) {
441 rom_info_ = false;
442 CloseCurrentPopup();
443 }
444 EndPopup();
445 }
446}
447
449 static bool show_display_settings = false;
450
451 if (BeginMenuBar()) {
453 SameLine(GetWindowWidth() - GetStyle().ItemSpacing.x -
454 CalcTextSize(ICON_MD_DISPLAY_SETTINGS).x - 110);
455 PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
456 if (Button(ICON_MD_DISPLAY_SETTINGS)) {
457 show_display_settings = !show_display_settings;
458 }
459 PopStyleColor();
460 Text("yaze v%s", core::kYazeVersion.data());
461 EndMenuBar();
462 }
463
464 if (show_display_settings) {
465 Begin("Display Settings", &show_display_settings, ImGuiWindowFlags_None);
467 End();
468 }
469}
470
472 static bool save_as_menu = false;
473 static bool new_project_menu = false;
474
475 if (BeginMenu("File")) {
476 if (MenuItem("Open", "Ctrl+O")) {
477 LoadRom();
478 }
479
480 if (BeginMenu("Open Recent")) {
481 static RecentFilesManager manager("recent_files.txt");
482 manager.Load();
483 if (manager.GetRecentFiles().empty()) {
484 MenuItem("No Recent Files", nullptr, false, false);
485 } else {
486 for (const auto& filePath : manager.GetRecentFiles()) {
487 if (MenuItem(filePath.c_str())) {
488 OpenRomOrProject(filePath);
489 }
490 }
491 }
492 EndMenu();
493 }
494
495 MENU_ITEM2("Save", "Ctrl+S") {
496 if (rom()->is_loaded()) {
497 SaveRom();
498 }
499 }
500 MENU_ITEM("Save As..") { save_as_menu = true; }
501
502 if (rom()->is_loaded()) {
503 MENU_ITEM("Close") {
504 status_ = rom()->Close();
505 rom_assets_loaded_ = false;
506 }
507 }
508
509 Separator();
510
511 if (BeginMenu("Project")) {
512 if (MenuItem("Create New Project")) {
513 // Create a new project
514 new_project_menu = true;
515 }
516 if (MenuItem("Open Project")) {
517 // Open an existing project
520 if (status_.ok()) {
522 }
523 }
524 if (MenuItem("Save Project")) {
525 // Save the current project
527 }
528
529 EndMenu();
530 }
531
532 if (BeginMenu("Options")) {
533 MenuItem("Backup ROM", "", &backup_rom_);
534 MenuItem("Save New Auto", "", &save_new_auto_);
535 Separator();
536 if (BeginMenu("Experiment Flags")) {
537 static FlagsMenu flags_menu;
538 flags_menu.Draw();
539 EndMenu();
540 }
541 EndMenu();
542 }
543
544 Separator();
545
546 if (MenuItem("Quit", "Ctrl+Q")) {
547 quit_ = true;
548 }
549
550 EndMenu();
551 }
552
553 if (save_as_menu) {
554 static std::string save_as_filename = "";
555 Begin("Save As..", &save_as_menu, ImGuiWindowFlags_AlwaysAutoResize);
556 InputText("Filename", &save_as_filename);
557 if (Button("Save", gui::kDefaultModalSize)) {
558 SaveRom();
559 save_as_menu = false;
560 }
561 SameLine();
562 if (Button("Cancel", gui::kDefaultModalSize)) {
563 save_as_menu = false;
564 }
565 End();
566 }
567
568 if (new_project_menu) {
569 Begin("New Project", &new_project_menu, ImGuiWindowFlags_AlwaysAutoResize);
570 static std::string save_as_filename = "";
571 InputText("Project Name", &save_as_filename);
572 if (Button("Destination Filepath", gui::kDefaultModalSize)) {
574 }
575 SameLine();
576 Text("%s", current_project_.filepath.c_str());
577 if (Button("ROM File", gui::kDefaultModalSize)) {
579 }
580 SameLine();
581 Text("%s", current_project_.rom_filename_.c_str());
582 if (Button("Labels File", gui::kDefaultModalSize)) {
585 }
586 SameLine();
587 Text("%s", current_project_.labels_filename_.c_str());
588 if (Button("Code Folder", gui::kDefaultModalSize)) {
590 }
591 SameLine();
592 Text("%s", current_project_.code_folder_.c_str());
593
594 Separator();
595 if (Button("Create", gui::kDefaultModalSize)) {
596 new_project_menu = false;
597 status_ = current_project_.Create(save_as_filename);
598 if (status_.ok()) {
600 }
601 }
602 SameLine();
603 if (Button("Cancel", gui::kDefaultModalSize)) {
604 new_project_menu = false;
605 }
606 End();
607 }
608
609 if (BeginMenu("Edit")) {
610 MENU_ITEM2("Undo", "Ctrl+Z") { status_ = current_editor_->Undo(); }
611 MENU_ITEM2("Redo", "Ctrl+Y") { status_ = current_editor_->Redo(); }
612 Separator();
613 MENU_ITEM2("Cut", "Ctrl+X") { status_ = current_editor_->Cut(); }
614 MENU_ITEM2("Copy", "Ctrl+C") { status_ = current_editor_->Copy(); }
615 MENU_ITEM2("Paste", "Ctrl+V") { status_ = current_editor_->Paste(); }
616 Separator();
617 MENU_ITEM2("Find", "Ctrl+F") { status_ = current_editor_->Find(); }
618 EndMenu();
619 }
620
621 static bool show_imgui_metrics = false;
622 static bool show_memory_editor = false;
623 static bool show_asm_editor = false;
624 static bool show_imgui_demo = false;
625 static bool show_palette_editor = false;
626 static bool show_emulator = false;
627
628 if (show_imgui_demo) ShowDemoWindow();
629 if (show_imgui_metrics) ShowMetricsWindow(&show_imgui_metrics);
630 if (show_memory_editor) memory_editor_.Update(show_memory_editor);
631 if (show_asm_editor) assembly_editor_.Update(show_asm_editor);
632
633 if (show_emulator) {
634 Begin("Emulator", &show_emulator, ImGuiWindowFlags_MenuBar);
635 emulator_.Run();
636 End();
637 }
638
639 if (show_palette_editor) {
640 Begin("Palette Editor", &show_palette_editor);
642 End();
643 }
644
645 if (BeginMenu("View")) {
646 MenuItem("Dynamic Layout", nullptr, &dynamic_layout_);
647 MenuItem("Emulator", nullptr, &show_emulator);
648 Separator();
649 MenuItem("Memory Editor", nullptr, &show_memory_editor);
650 MenuItem("Assembly Editor", nullptr, &show_asm_editor);
651 MenuItem("Palette Editor", nullptr, &show_palette_editor);
652 Separator();
653 MENU_ITEM("ROM Information") rom_info_ = true;
654 Separator();
655 MenuItem("ImGui Demo", nullptr, &show_imgui_demo);
656 MenuItem("ImGui Metrics", nullptr, &show_imgui_metrics);
657 EndMenu();
658 }
659
660 static bool show_resource_label_manager = false;
662 if (BeginMenu("Project")) {
663 Text("Name: %s", current_project_.name.c_str());
664 Text("ROM: %s", current_project_.rom_filename_.c_str());
665 Text("Labels: %s", current_project_.labels_filename_.c_str());
666 Text("Code: %s", current_project_.code_folder_.c_str());
667 Separator();
668 MenuItem("Resource Labels", nullptr, &show_resource_label_manager);
669 EndMenu();
670 }
671 }
672
673 static bool open_rom_help = false;
674 static bool open_supported_features = false;
675 static bool open_manage_project = false;
676 if (BeginMenu("Help")) {
677 if (MenuItem("How to open a ROM")) open_rom_help = true;
678 if (MenuItem("Supported Features")) open_supported_features = true;
679 if (MenuItem("How to manage a project")) open_manage_project = true;
680
681 if (MenuItem("About", "F1")) about_ = true;
682 EndMenu();
683 }
684
685 if (open_supported_features) OpenPopup("Supported Features");
686 if (BeginPopupModal("Supported Features", nullptr,
687 ImGuiWindowFlags_AlwaysAutoResize)) {
688 Text("Overworld");
689 BulletText("LW/DW/SW Tilemap Editing");
690 BulletText("LW/DW/SW Map Properties");
691 BulletText("Create/Delete/Update Entrances");
692 BulletText("Create/Delete/Update Exits");
693 BulletText("Create/Delete/Update Sprites");
694 BulletText("Create/Delete/Update Items");
695
696 Text("Dungeon");
697 BulletText("View Room Header Properties");
698 BulletText("View Entrance Properties");
699
700 Text("Graphics");
701 BulletText("View Decompressed Graphics Sheets");
702 BulletText("View/Update Graphics Groups");
703
704 Text("Palettes");
705 BulletText("View Palette Groups");
706
707 Text("Saveable");
708 BulletText("All Listed Overworld Features");
709 BulletText("Hex Editor Changes");
710
711 if (Button("Close", gui::kDefaultModalSize)) {
712 open_supported_features = false;
713 CloseCurrentPopup();
714 }
715 EndPopup();
716 }
717
718 if (open_rom_help) OpenPopup("Open a ROM");
719 if (BeginPopupModal("Open a ROM", nullptr,
720 ImGuiWindowFlags_AlwaysAutoResize)) {
721 Text("File -> Open");
722 Text("Select a ROM file to open");
723 Text("Supported ROMs (headered or unheadered):");
724 Text("The Legend of Zelda: A Link to the Past");
725 Text("US Version 1.0");
726 Text("JP Version 1.0");
727
728 if (Button("Close", gui::kDefaultModalSize)) {
729 open_rom_help = false;
730 CloseCurrentPopup();
731 }
732 EndPopup();
733 }
734
735 if (open_manage_project) OpenPopup("Manage Project");
736 if (BeginPopupModal("Manage Project", nullptr,
737 ImGuiWindowFlags_AlwaysAutoResize)) {
738 Text("Project Menu");
739 Text("Create a new project or open an existing one.");
740 Text("Save the project to save the current state of the project.");
741 TextWrapped(
742 "To save a project, you need to first open a ROM and initialize your "
743 "code path and labels file. Label resource manager can be found in "
744 "the View menu. Code path is set in the Code editor after opening a "
745 "folder.");
746
747 if (Button("Close", gui::kDefaultModalSize)) {
748 open_manage_project = false;
749 CloseCurrentPopup();
750 }
751 EndPopup();
752 }
753
754 if (show_resource_label_manager) {
755 rom()->resource_label()->DisplayLabels(&show_resource_label_manager);
758 current_project_.labels_filename_ = rom()->resource_label()->filename_;
759 }
760 }
761}
762
764 auto file_name = FileDialogWrapper::ShowOpenFileDialog();
765 auto load_rom = rom()->LoadFromFile(file_name);
766 if (load_rom.ok()) {
767 static RecentFilesManager manager("recent_files.txt");
768 manager.Load();
769 manager.AddFile(file_name);
770 manager.Save();
771 }
772}
773
775 if (flags()->kSaveDungeonMaps) {
778 }
779
782
783 status_ = rom()->SaveToFile(backup_rom_, save_new_auto_);
784}
785
786void EditorManager::OpenRomOrProject(const std::string& filename) {
787 if (absl::StrContains(filename, ".yaze")) {
788 status_ = current_project_.Open(filename);
789 if (status_.ok()) {
791 }
792 } else {
793 status_ = rom()->LoadFromFile(filename);
794 }
795}
796
799
800 if (!rom()->resource_label()->LoadLabels(current_project_.labels_filename_)) {
801 return absl::InternalError(
802 "Could not load labels file, update your project file.");
803 }
804
805 static RecentFilesManager manager("recent_files.txt");
806 manager.Load();
808 ".yaze");
809 manager.Save();
810
812
814
815 return absl::OkStatus();
816}
817
818} // namespace editor
819} // namespace app
820} // namespace yaze
const std::vector< std::string > & GetRecentFiles() const
Definition project.h:124
void AddFile(const std::string &file_path)
Definition project.h:90
static std::string ShowOpenFileDialog()
ShowOpenFileDialog opens a file dialog and returns the selected filepath.
static std::string ShowOpenFolderDialog()
ShowOpenFolderDialog opens a file dialog and returns the selected folder path.
void OpenFolder(const std::string &folder_path)
void RegisterSubcommand(const std::string &group_name, const std::string &shortcut, const char mnemonic, const std::string &name, const std::string &desc, Command command)
void RegisterPrefix(const std::string &group_name, const char prefix, const std::string &name, const std::string &desc)
absl::Status Update() override
void SetupScreen(std::string filename="")
void OpenRomOrProject(const std::string &filename)
MemoryEditorWithDiffChecker memory_editor_
std::vector< Editor * > active_editors_
Interface for editor classes.
Definition editor.h:54
virtual absl::Status Cut()=0
virtual absl::Status Undo()=0
virtual absl::Status Find()=0
virtual absl::Status Redo()=0
virtual absl::Status Copy()=0
virtual absl::Status Paste()=0
absl::Status Update() override
absl::Status Update() override
absl::Status LoadGraphics()
Load the Bitmap objects for each OverworldMap.
absl::Status Update() override
absl::Status Update() override
absl::Status Update() override
Updates the sprite editor.
#define MENU_ITEM(w)
Definition constants.h:9
#define PRINT_IF_ERROR(expression)
Definition constants.h:36
#define RETURN_IF_ERROR(expression)
Definition constants.h:62
#define MENU_ITEM2(w, v)
Definition constants.h:10
#define RETURN_VOID_IF_ERROR(expression)
Definition constants.h:53
#define ICON_MD_ERROR
Definition icons.h:684
#define ICON_MD_DISPLAY_SETTINGS
Definition icons.h:585
#define ICON_MD_ADD
Definition icons.h:84
#define ICON_MD_CONTENT_COPY
Definition icons.h:463
Definition input.cc:18
std::string UppercaseHexLongLong(uint64_t qword)
Definition common.cc:123
constexpr std::string_view kYazeVersion
Definition common.h:22
bool IsEditorActive(Editor *editor, std::vector< Editor * > &active_editors)
absl::Status DrawEditor(EditorLayoutParams *params)
Definition editor.cc:10
constexpr ImVec2 kDefaultModalSize
Definition input.h:27
void DrawDisplaySettings(ImGuiStyle *ref)
Definition style.cc:60
Definition common.cc:22
std::string name
Definition project.h:48
std::string filepath
Definition project.h:50
std::string code_folder_
Definition project.h:52
absl::Status Open(const std::string &project_path)
Definition project.cc:14
std::string labels_filename_
Definition project.h:53
absl::Status Create(const std::string &project_name)
Definition project.h:29
absl::Status Save()
Definition project.cc:43
std::string rom_filename_
Definition project.h:51
static CommandManager command_manager
Definition editor.h:24
Dynamic Editor Layout Parameters.
Definition editor.h:80
void Update(bool &show_memory_editor)