mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-18 06:12:20 -05:00
Surround BeginTable() calls and table-related draw code in if(){} blocks to fix resize crash. (#4700)
This commit is contained in:
parent
2a3bdca8a2
commit
e1a53a77d4
@ -884,7 +884,7 @@ void PlandomizerDrawIceTrapSetup(uint32_t index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PlandomizerDrawOptions() {
|
void PlandomizerDrawOptions() {
|
||||||
ImGui::BeginTable("LoadSpoiler", 2);
|
if (ImGui::BeginTable("LoadSpoiler", 2)) {
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::SeparatorText("Load/Save Spoiler Log");
|
ImGui::SeparatorText("Load/Save Spoiler Log");
|
||||||
PlandomizerPopulateSeedList();
|
PlandomizerPopulateSeedList();
|
||||||
@ -902,7 +902,8 @@ void PlandomizerDrawOptions() {
|
|||||||
}
|
}
|
||||||
ImGui::EndCombo();
|
ImGui::EndCombo();
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
ImGui::Text("No Spoiler Logs found.");
|
ImGui::Text("No Spoiler Logs found.");
|
||||||
}
|
}
|
||||||
ImGui::BeginDisabled(existingSeedList.empty());
|
ImGui::BeginDisabled(existingSeedList.empty());
|
||||||
@ -922,7 +923,7 @@ void PlandomizerDrawOptions() {
|
|||||||
ImGui::SeparatorText("Current Seed Hash");
|
ImGui::SeparatorText("Current Seed Hash");
|
||||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + (ImGui::GetContentRegionAvail().x * 0.5f) - (34.0f * 5.0f));
|
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + (ImGui::GetContentRegionAvail().x * 0.5f) - (34.0f * 5.0f));
|
||||||
if (spoilerLogData.size() > 0) {
|
if (spoilerLogData.size() > 0) {
|
||||||
ImGui::BeginTable("HashIcons", 5);
|
if (ImGui::BeginTable("HashIcons", 5)) {
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
ImGui::TableSetupColumn("Icon", ImGuiTableColumnFlags_WidthFixed, 34.0f);
|
ImGui::TableSetupColumn("Icon", ImGuiTableColumnFlags_WidthFixed, 34.0f);
|
||||||
}
|
}
|
||||||
@ -937,7 +938,8 @@ void PlandomizerDrawOptions() {
|
|||||||
ImVec2(35.0f, 18.0f), ImVec2(1, 1), ImVec2(0, 0), 2.0f, ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1))) {
|
ImVec2(35.0f, 18.0f), ImVec2(1, 1), ImVec2(0, 0), 2.0f, ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1))) {
|
||||||
if (hash + 1 >= gSeedTextures.size()) {
|
if (hash + 1 >= gSeedTextures.size()) {
|
||||||
hash = 0;
|
hash = 0;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
hash++;
|
hash++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -946,7 +948,8 @@ void PlandomizerDrawOptions() {
|
|||||||
ImVec2(35.0f, 18.0f), ImVec2(0, 0), ImVec2(1, 1), 2.0f, ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1))) {
|
ImVec2(35.0f, 18.0f), ImVec2(0, 0), ImVec2(1, 1), 2.0f, ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1))) {
|
||||||
if (hash == 0) {
|
if (hash == 0) {
|
||||||
hash = gSeedTextures.size() - 1;
|
hash = gSeedTextures.size() - 1;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
hash--;
|
hash--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -958,10 +961,13 @@ void PlandomizerDrawOptions() {
|
|||||||
}
|
}
|
||||||
PlandoPopImageButtonStyle();
|
PlandoPopImageButtonStyle();
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
ImGui::Text("No Spoiler Log Loaded");
|
ImGui::Text("No Spoiler Log Loaded");
|
||||||
}
|
}
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::SeparatorText("Options");
|
ImGui::SeparatorText("Options");
|
||||||
if (plandoLogData.size() == 0) {
|
if (plandoLogData.size() == 0) {
|
||||||
@ -1019,7 +1025,7 @@ void PlandomizerDrawHintsWindow() {
|
|||||||
std::string hintInputText;
|
std::string hintInputText;
|
||||||
|
|
||||||
ImGui::BeginChild("Hints");
|
ImGui::BeginChild("Hints");
|
||||||
ImGui::BeginTable("Hints Window", 1, ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_ScrollY);
|
if (ImGui::BeginTable("Hints Window", 1, ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_ScrollY)) {
|
||||||
ImGui::TableSetupColumn("Hint Entries");
|
ImGui::TableSetupColumn("Hint Entries");
|
||||||
ImGui::TableSetupScrollFreeze(0, 1);
|
ImGui::TableSetupScrollFreeze(0, 1);
|
||||||
ImGui::TableHeadersRow();
|
ImGui::TableHeadersRow();
|
||||||
@ -1052,13 +1058,14 @@ void PlandomizerDrawHintsWindow() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
|
}
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlandomizerDrawLocationsWindow(RandomizerCheckArea rcArea) {
|
void PlandomizerDrawLocationsWindow(RandomizerCheckArea rcArea) {
|
||||||
uint32_t index = 0;
|
uint32_t index = 0;
|
||||||
ImGui::BeginChild("Locations");
|
ImGui::BeginChild("Locations");
|
||||||
ImGui::BeginTable("Locations Window", 4, ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_ScrollY);
|
if (ImGui::BeginTable("Locations Window", 4, ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_ScrollY)) {
|
||||||
ImGui::TableSetupColumn("Spoiler Log Check Name", ImGuiTableColumnFlags_WidthFixed, 250.0f);
|
ImGui::TableSetupColumn("Spoiler Log Check Name", ImGuiTableColumnFlags_WidthFixed, 250.0f);
|
||||||
ImGui::TableSetupColumn("Spoiler Log Reward", ImGuiTableColumnFlags_WidthFixed, 190.0f);
|
ImGui::TableSetupColumn("Spoiler Log Reward", ImGuiTableColumnFlags_WidthFixed, 190.0f);
|
||||||
ImGui::TableSetupColumn("New Reward", ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoHeaderLabel, 34.0f);
|
ImGui::TableSetupColumn("New Reward", ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoHeaderLabel, 34.0f);
|
||||||
@ -1079,7 +1086,8 @@ void PlandomizerDrawLocationsWindow(RandomizerCheckArea rcArea) {
|
|||||||
if (plandoLogData[index].checkRewardItem.GetRandomizerGet() == RG_ICE_TRAP) {
|
if (plandoLogData[index].checkRewardItem.GetRandomizerGet() == RG_ICE_TRAP) {
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
PlandomizerDrawIceTrapSetup(index);
|
PlandomizerDrawIceTrapSetup(index);
|
||||||
} else if (spoilerData.shopPrice != -1) {
|
}
|
||||||
|
else if (spoilerData.shopPrice != -1) {
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::BeginTable("Shops", 1, ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersInner);
|
ImGui::BeginTable("Shops", 1, ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersInner);
|
||||||
ImGui::TableSetupColumn("Shop Price");
|
ImGui::TableSetupColumn("Shop Price");
|
||||||
@ -1087,13 +1095,15 @@ void PlandomizerDrawLocationsWindow(RandomizerCheckArea rcArea) {
|
|||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
PlandomizerDrawShopSlider(index);
|
PlandomizerDrawShopSlider(index);
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
|
}
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user