diff --git a/src/app/editor/master_editor.cc b/src/app/editor/master_editor.cc index 14dbcb4f..16ae7243 100644 --- a/src/app/editor/master_editor.cc +++ b/src/app/editor/master_editor.cc @@ -10,6 +10,7 @@ #include "app/core/constants.h" #include "app/editor/assembly_editor.h" #include "app/editor/dungeon_editor.h" +#include "app/editor/music_editor.h" #include "app/editor/overworld_editor.h" #include "app/gfx/snes_palette.h" #include "app/gfx/snes_tile.h" @@ -88,9 +89,10 @@ void MasterEditor::UpdateScreen() { TAB_BAR("##TabBar") DrawOverworldEditor(); DrawDungeonEditor(); - DrawPaletteEditor(); + DrawMusicEditor(); DrawSpriteEditor(); DrawScreenEditor(); + DrawPaletteEditor(); END_TAB_BAR() ImGui::End(); @@ -209,6 +211,7 @@ void MasterEditor::DrawViewMenu() { static bool show_memory_editor = false; static bool show_asm_editor = false; static bool show_imgui_demo = false; + static bool show_memory_viewer = false; if (show_imgui_metrics) { ImGui::ShowMetricsWindow(&show_imgui_metrics); @@ -233,9 +236,33 @@ void MasterEditor::DrawViewMenu() { ImGui::End(); } + if (show_memory_viewer) { + ImGui::Begin("Memory Viewer (ImGui)", &show_memory_viewer); + + const float TEXT_BASE_HEIGHT = ImGui::GetTextLineHeightWithSpacing(); + static ImGuiTableFlags flags = + ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | + ImGuiTableFlags_ContextMenuInBody | ImGuiTableFlags_RowBg | + ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_NoHostExtendX; + if (auto outer_size = ImVec2(0.0f, TEXT_BASE_HEIGHT * 5.5f); + ImGui::BeginTable("table1", 3, flags, outer_size)) { + for (int row = 0; row < 10; row++) { + ImGui::TableNextRow(); + for (int column = 0; column < 3; column++) { + ImGui::TableNextColumn(); + ImGui::Text("Cell %d,%d", column, row); + } + } + ImGui::EndTable(); + } + + ImGui::End(); + } + if (ImGui::BeginMenu("View")) { ImGui::MenuItem("HEX Editor", nullptr, &show_memory_editor); ImGui::MenuItem("ASM Editor", nullptr, &show_asm_editor); + ImGui::MenuItem("Memory Viewer", nullptr, &show_memory_viewer); ImGui::MenuItem("ImGui Demo", nullptr, &show_imgui_demo); ImGui::Separator(); if (ImGui::BeginMenu("GUI Tools")) { @@ -279,6 +306,12 @@ void MasterEditor::DrawScreenEditor() { END_TAB_ITEM() } +void MasterEditor::DrawMusicEditor() { + TAB_ITEM("Music") + music_editor_.Update(); + END_TAB_ITEM() +} + void MasterEditor::DrawSpriteEditor() { TAB_ITEM("Sprites") END_TAB_ITEM() diff --git a/src/app/editor/master_editor.h b/src/app/editor/master_editor.h index 4c6ee193..66712aee 100644 --- a/src/app/editor/master_editor.h +++ b/src/app/editor/master_editor.h @@ -11,6 +11,7 @@ #include "app/core/constants.h" #include "app/editor/assembly_editor.h" #include "app/editor/dungeon_editor.h" +#include "app/editor/music_editor.h" #include "app/editor/overworld_editor.h" #include "app/editor/palette_editor.h" #include "app/editor/screen_editor.h" @@ -45,6 +46,7 @@ class MasterEditor { void DrawOverworldEditor(); void DrawDungeonEditor(); void DrawPaletteEditor(); + void DrawMusicEditor(); void DrawScreenEditor(); void DrawSpriteEditor(); @@ -59,6 +61,7 @@ class MasterEditor { OverworldEditor overworld_editor_; PaletteEditor palette_editor_; ScreenEditor screen_editor_; + MusicEditor music_editor_; ROM rom_; };