patcher: fix plus minus buttons for number patches (#825)

## Link to GitHub Issue or related Pull Request, if one exists
Reported by a certain sea reptile

## Description of change
Fix the + / - buttons for number patches not working. Regressed by one
of the ImGui version updates.

## Testing
seems fine now
This commit is contained in:
bicarus
2026-07-21 17:46:18 -07:00
committed by GitHub
parent 4836cd94ab
commit 39bf17aafe
@@ -936,14 +936,17 @@ namespace overlay::windows {
} else if (patch.type == patcher::PatchType::Integer) { } else if (patch.type == patcher::PatchType::Integer) {
set_patch_option_width(); set_patch_option_width();
auto& numpatch = patch.patch_number; auto& numpatch = patch.patch_number;
ImGui::InputInt("##int_input", &numpatch.value, 1, 10); const bool value_changed = ImGui::InputInt(
if (ImGui::IsItemDeactivatedAfterEdit()) { "##int_input", &numpatch.value, 1, 10);
if (value_changed || ImGui::IsItemDeactivatedAfterEdit()) {
numpatch.value = CLAMP( numpatch.value = CLAMP(
numpatch.value, numpatch.value,
numpatch.min, numpatch.min,
numpatch.max); numpatch.max);
patcher::apply_patch(patch, true); patcher::apply_patch(patch, true);
}
if (ImGui::IsItemDeactivated()) {
patcher::config_dirty = true; patcher::config_dirty = true;
} }
if (ImGui::IsItemHovered(ImGui::TOOLTIP_FLAGS)) { if (ImGui::IsItemHovered(ImGui::TOOLTIP_FLAGS)) {