Add GraphicsEditor class

Super donkey proto graphics import experiment

removed snes_spc and asar_static because of macOS M1 build issues.

music player using snes_spc disabled

included macOS build configuration as it currently is.
This commit is contained in:
scawful
2023-07-08 09:03:27 -04:00
parent 3ada9988aa
commit 931560cfb1
16 changed files with 267 additions and 92 deletions

View File

@@ -73,6 +73,7 @@ void MasterEditor::UpdateScreen() {
TAB_BAR("##TabBar")
DrawOverworldEditor();
DrawDungeonEditor();
DrawGraphicsEditor();
DrawMusicEditor();
DrawSpriteEditor();
DrawScreenEditor();
@@ -88,6 +89,7 @@ void MasterEditor::DrawFileDialog() {
std::string filePathName = ImGuiFileDialog::Instance()->GetFilePathName();
status_ = rom_.LoadFromFile(filePathName);
overworld_editor_.SetupROM(rom_);
graphics_editor_.SetupROM(rom_);
screen_editor_.SetupROM(rom_);
palette_editor_.SetupROM(rom_);
music_editor_.SetupROM(rom_);
@@ -162,6 +164,8 @@ void MasterEditor::DrawYazeMenu() {
}
void MasterEditor::DrawFileMenu() {
static bool save_as_menu = false;
if (ImGui::BeginMenu("File")) {
if (ImGui::MenuItem("Open", "Ctrl+O")) {
ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", "Open ROM",
@@ -169,7 +173,7 @@ void MasterEditor::DrawFileMenu() {
}
MENU_ITEM2("Save", "Ctrl+S") { status_ = rom_.SaveToFile(backup_rom_); }
MENU_ITEM("Save As..") {}
MENU_ITEM("Save As..") { save_as_menu = true; }
ImGui::Separator();
@@ -179,6 +183,19 @@ void MasterEditor::DrawFileMenu() {
}
ImGui::EndMenu();
}
if (save_as_menu) {
static std::string save_as_filename = "";
ImGui::Begin("Save As..", nullptr, ImGuiWindowFlags_AlwaysAutoResize);
ImGui::InputText("Filename", &save_as_filename);
if (ImGui::Button("Save", ImVec2(200, 0))) {
status_ = rom_.SaveToFile(backup_rom_, save_as_filename);
}
if (ImGui::Button("Cancel", ImVec2(200, 0))) {
save_as_menu = false;
}
ImGui::End();
}
}
void MasterEditor::DrawEditMenu() {
@@ -294,6 +311,12 @@ void MasterEditor::DrawDungeonEditor() {
END_TAB_ITEM()
}
void MasterEditor::DrawGraphicsEditor() {
TAB_ITEM("Graphics")
graphics_editor_.Update();
END_TAB_ITEM()
}
void MasterEditor::DrawPaletteEditor() {
TAB_ITEM("Palettes")
status_ = palette_editor_.Update();