IPL Fix & Formatting (#3082)

This commit is contained in:
R.K 2024-05-10 02:42:21 -07:00 committed by GitHub
parent f44edb83a5
commit 3a7cad7f72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 14 deletions

View File

@ -74,10 +74,11 @@ const ipl_libary ipls[] = {
{{"jewel2fake"}},
{{"jewel2fake"}, {"bh1_16_refurb"}},
}, // Jewelry Interior
{"Coroner Morgue Interior",
{244.9, -1374.7, 39.5},
{{"coroner_int_on"}, {"coronertrash"}},
{{"coroner_int_off"}},
{{"coroner_int_off"}},
{
"Coroner Morgue Interior",
{244.9, -1374.7, 39.5},
{{"coroner_int_on"}, {"coronertrash"}},
{{"coroner_int_off"}},
{{"coroner_int_off"}},
}, // Coroner Morgue Interior
};

View File

@ -94,7 +94,7 @@ namespace big
ImGui::SeparatorText("GUI_TAB_IPL"_T.data());
static int current_select = 0;
static int last_select = current_select;
static int last_select = -1;
ImGui::SetNextItemWidth(400);
if (ImGui::BeginCombo("##Ipllocation", ipls[current_select].friendly_name))
@ -120,18 +120,22 @@ namespace big
if (current_select != last_select)
{
// Unload previously loaded IPL of the last selection
for (auto& ipl_name_unload : ipls[last_select].ipl_names)
// If this is our first time loading an IPL (especially the first one in the list, then don't unload anything)
if (last_select != -1)
{
if (STREAMING::IS_IPL_ACTIVE(ipl_name_unload))
for (auto& ipl_name_unload : ipls[last_select].ipl_names)
{
STREAMING::REMOVE_IPL(ipl_name_unload);
if (STREAMING::IS_IPL_ACTIVE(ipl_name_unload))
{
STREAMING::REMOVE_IPL(ipl_name_unload);
}
}
}
// Load previously deleted IPLs of the last selection
for (auto& ipl_name_load : ipls[last_select].ipl_names_remove)
{
STREAMING::REQUEST_IPL(ipl_name_load);
// Load previously deleted IPLs of the last selection
for (auto& ipl_name_load : ipls[last_select].ipl_names_remove)
{
STREAMING::REQUEST_IPL(ipl_name_load);
}
}
// Load new IPLs of the current selection