Update ScreenEditor load order
This commit is contained in:
@@ -29,7 +29,11 @@ ScreenEditor::ScreenEditor() { screen_canvas_.SetCanvasSize(ImVec2(512, 512)); }
|
|||||||
|
|
||||||
void ScreenEditor::Update() {
|
void ScreenEditor::Update() {
|
||||||
TAB_BAR("##TabBar")
|
TAB_BAR("##TabBar")
|
||||||
DrawDungeonMapsEditor();
|
TAB_ITEM("Dungeon Maps")
|
||||||
|
if (rom()->is_loaded()) {
|
||||||
|
DrawDungeonMapsEditor();
|
||||||
|
}
|
||||||
|
END_TAB_ITEM()
|
||||||
DrawInventoryMenuEditor();
|
DrawInventoryMenuEditor();
|
||||||
DrawOverworldMapEditor();
|
DrawOverworldMapEditor();
|
||||||
DrawTitleScreenEditor();
|
DrawTitleScreenEditor();
|
||||||
@@ -323,7 +327,7 @@ void ScreenEditor::DrawDungeonMapsTabs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ScreenEditor::DrawDungeonMapsEditor() {
|
void ScreenEditor::DrawDungeonMapsEditor() {
|
||||||
if (rom()->is_loaded() && !dungeon_maps_loaded_) {
|
if (!dungeon_maps_loaded_) {
|
||||||
if (LoadDungeonMaps().ok()) {
|
if (LoadDungeonMaps().ok()) {
|
||||||
if (LoadDungeonMapTile16().ok()) {
|
if (LoadDungeonMapTile16().ok()) {
|
||||||
auto bitmap_manager = rom()->mutable_bitmap_manager();
|
auto bitmap_manager = rom()->mutable_bitmap_manager();
|
||||||
@@ -333,10 +337,10 @@ void ScreenEditor::DrawDungeonMapsEditor() {
|
|||||||
sheets_.emplace(3, *bitmap_manager->mutable_bitmap(215));
|
sheets_.emplace(3, *bitmap_manager->mutable_bitmap(215));
|
||||||
dungeon_maps_loaded_ = true;
|
dungeon_maps_loaded_ = true;
|
||||||
} else {
|
} else {
|
||||||
throw std::runtime_error("Failed to load dungeon map tile16");
|
ImGui::Text("Failed to load dungeon map tile16");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw std::runtime_error("Failed to load dungeon maps");
|
ImGui::Text("Failed to load dungeon maps");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,8 +351,6 @@ void ScreenEditor::DrawDungeonMapsEditor() {
|
|||||||
"Thieves' Town", "Ice Palace", "Misery Mire",
|
"Thieves' Town", "Ice Palace", "Misery Mire",
|
||||||
"Turtle Rock", "Ganon's Tower"};
|
"Turtle Rock", "Ganon's Tower"};
|
||||||
|
|
||||||
TAB_ITEM("Dungeon Maps")
|
|
||||||
|
|
||||||
if (ImGui::BeginTable("DungeonMapsTable", 4, ImGuiTableFlags_Resizable)) {
|
if (ImGui::BeginTable("DungeonMapsTable", 4, ImGuiTableFlags_Resizable)) {
|
||||||
ImGui::TableSetupColumn("Dungeon");
|
ImGui::TableSetupColumn("Dungeon");
|
||||||
ImGui::TableSetupColumn("Map");
|
ImGui::TableSetupColumn("Map");
|
||||||
@@ -393,8 +395,6 @@ void ScreenEditor::DrawDungeonMapsEditor() {
|
|||||||
|
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TAB_ITEM()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenEditor::DrawTitleScreenEditor() {
|
void ScreenEditor::DrawTitleScreenEditor() {
|
||||||
|
|||||||
Reference in New Issue
Block a user