mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
overlay: prevent save button shifting patches text (#709)
## Link to GitHub Issue or related Pull Request, if one exists #0 ## Description of change When opening the patches tab by pressing F4 in game, the Save button doesn't appear until after initially selecting/deselecting a patch, then it shifts all of the patch text below. To solve this annoyance, this keeps the Save button in a fixed position (starts greyed out until a selection) and no longer shifts the text. ## Testing Confirmed saving selected patches still works properly in the overlay and standalone cfg
This commit is contained in:
@@ -365,21 +365,24 @@ namespace overlay::windows {
|
|||||||
config_dirty = true;
|
config_dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for dirty state
|
// handle dirty state
|
||||||
if (config_dirty) {
|
if (cfg::CONFIGURATOR_STANDALONE) {
|
||||||
if (cfg::CONFIGURATOR_STANDALONE) {
|
// auto save for configurator version
|
||||||
// auto save for configurator version
|
if (config_dirty) {
|
||||||
this->config_save();
|
this->config_save();
|
||||||
|
|
||||||
} else {
|
|
||||||
// manual save for live version
|
|
||||||
ImGui::AlignTextToFramePadding();
|
|
||||||
ImGui::HelpMarker("Save current patch state to the configuration file.");
|
|
||||||
ImGui::SameLine();
|
|
||||||
if (ImGui::Button("Save")) {
|
|
||||||
this->config_save();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// manual save for live version: always render the row so the rest
|
||||||
|
// of the panel doesn't shift when config_dirty flips. Disable the
|
||||||
|
// button when there is nothing to save.
|
||||||
|
ImGui::AlignTextToFramePadding();
|
||||||
|
ImGui::HelpMarker("Save current patch state to the configuration file.");
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::BeginDisabled(!config_dirty);
|
||||||
|
if (ImGui::Button("Save")) {
|
||||||
|
this->config_save();
|
||||||
|
}
|
||||||
|
ImGui::EndDisabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool disable_all_patches = false;
|
bool disable_all_patches = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user