Add Changes stack to ROM for saving

This commit is contained in:
Justin Scofield
2023-08-27 10:20:10 -04:00
parent 168030ee31
commit 190917ff6f
4 changed files with 33 additions and 13 deletions

View File

@@ -306,12 +306,10 @@ void MasterEditor::DrawHelpMenu() {
ImGuiWindowFlags_AlwaysAutoResize)) {
ImGui::Text("File -> Open");
ImGui::Text("Select a ROM file to open");
ImGui::Text("Supported ROMs:");
ImGui::Text("Supported ROMs (headered or unheadered):");
ImGui::Text("The Legend of Zelda: A Link to the Past");
ImGui::Text("US Version 1.0");
ImGui::Separator();
ImGui::Text("Must remove header before opening");
ImGui::Text("Header is 0x200 bytes of data at the beginning of the ROM");
ImGui::Text("JP Version 1.0");
if (ImGui::Button("Close", gui::kDefaultModalSize)) {
open_rom_help = false;

View File

@@ -245,13 +245,15 @@ void OverworldEditor::RenderUpdatedMapBitmap(const ImVec2 &click_position,
void OverworldEditor::QueueROMChanges(int index, ushort new_tile16) {
// Store the changes made by the user to the ROM (or project file)
overworld_.SaveOverworldMaps();
if (!overworld_.CreateTile32Tilemap()) {
// overworld_.SaveMap16Tiles();
overworld_.SaveMap32Tiles();
} else {
std::cout << "Failed to create tile32 tilemap" << std::endl;
}
rom()->QueueChanges([&]() {
overworld_.SaveOverworldMaps();
if (!overworld_.CreateTile32Tilemap()) {
// overworld_.SaveMap16Tiles();
overworld_.SaveMap32Tiles();
} else {
std::cout << "Failed to create tile32 tilemap" << std::endl;
}
});
}
void OverworldEditor::DetermineActiveMap(const ImVec2 &mouse_position) {