1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Fix infinitely updating simultaneous turns slider

This commit is contained in:
Ivan Savenko
2024-07-31 21:03:24 +00:00
parent 9f7abfe6e9
commit 2c42737b28
3 changed files with 12 additions and 11 deletions

View File

@@ -340,10 +340,10 @@ void OptionsTabBase::recreate(bool campaign)
//Simultaneous turns
if(auto turnSlider = widget<CSlider>("simturnsDurationMin"))
turnSlider->setValue(SEL->getStartInfo()->simturnsInfo.requiredTurns);
turnSlider->setValue(SEL->getStartInfo()->simturnsInfo.requiredTurns, false);
if(auto turnSlider = widget<CSlider>("simturnsDurationMax"))
turnSlider->setValue(SEL->getStartInfo()->simturnsInfo.optionalTurns);
turnSlider->setValue(SEL->getStartInfo()->simturnsInfo.optionalTurns, false);
if(auto w = widget<CLabel>("labelSimturnsDurationValueMin"))
w->setText(generateSimturnsDurationText(SEL->getStartInfo()->simturnsInfo.requiredTurns));
@@ -388,7 +388,7 @@ void OptionsTabBase::recreate(bool campaign)
auto & tpreset = variables["timerPresets"].Vector()[idx];
if(tpreset.Vector().at(1).Integer() == turnTimerRemote.turnTimer / 1000)
{
turnSlider->scrollTo(idx);
turnSlider->scrollTo(idx, false);
if(auto w = widget<CLabel>("labelTurnDurationValue"))
w->setText(CGI->generaltexth->turnDurations[idx]);
}