mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 14:23:44 -07:00
Fix currently selected presets getting deleted still being selected in satellite selectors.
This commit is contained in:
parent
43e6192ad0
commit
61deb040e2
1 changed files with 4 additions and 0 deletions
|
@ -130,6 +130,10 @@ void DrawPresetSelector(std::vector<PresetSection> includeSections, std::string
|
||||||
}
|
}
|
||||||
std::string selectorCvar = fmt::format(CVAR_GENERAL("{}SelectedPreset"), presetLoc);
|
std::string selectorCvar = fmt::format(CVAR_GENERAL("{}SelectedPreset"), presetLoc);
|
||||||
std::string currentIndex = CVarGetString(selectorCvar.c_str(), includedPresets[0].c_str());
|
std::string currentIndex = CVarGetString(selectorCvar.c_str(), includedPresets[0].c_str());
|
||||||
|
if (!presets.contains(currentIndex)) {
|
||||||
|
currentIndex = *includedPresets.begin();
|
||||||
|
CVarSetString(selectorCvar.c_str(), currentIndex.c_str());
|
||||||
|
}
|
||||||
UIWidgets::PushStyleCombobox(THEME_COLOR);
|
UIWidgets::PushStyleCombobox(THEME_COLOR);
|
||||||
if (ImGui::BeginCombo("##PresetsComboBox", currentIndex.c_str())) {
|
if (ImGui::BeginCombo("##PresetsComboBox", currentIndex.c_str())) {
|
||||||
for (auto iter = includedPresets.begin(); iter != includedPresets.end(); ++iter) {
|
for (auto iter = includedPresets.begin(); iter != includedPresets.end(); ++iter) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue