1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

unlimited replay option

This commit is contained in:
Laserlicht
2023-12-28 20:48:19 +01:00
parent a3e27b859e
commit cb9c4bbaf0
17 changed files with 133 additions and 38 deletions

View File

@ -91,7 +91,15 @@ OptionsTabBase::OptionsTabBase(const JsonPath & configPath)
});
addCallback("setCheatAllowed", [&](int index){
CSH->setCheatAllowedInfo(index);
ExtraOptionsInfo info = SEL->getStartInfo()->extraOptionsInfo;
info.cheatsAllowed = index;
CSH->setExtraOptionsInfo(info);
});
addCallback("setUnlimitedReplay", [&](int index){
ExtraOptionsInfo info = SEL->getStartInfo()->extraOptionsInfo;
info.unlimitedReplay = index;
CSH->setExtraOptionsInfo(info);
});
addCallback("setTurnTimerAccumulate", [&](int index){
@ -391,5 +399,8 @@ void OptionsTabBase::recreate()
}
if(auto buttonCheatAllowed = widget<CToggleButton>("buttonCheatAllowed"))
buttonCheatAllowed->setSelectedSilent(SEL->getStartInfo()->cheatAllowed);
buttonCheatAllowed->setSelectedSilent(SEL->getStartInfo()->extraOptionsInfo.cheatsAllowed);
if(auto buttonUnlimitedReplay = widget<CToggleButton>("buttonUnlimitedReplay"))
buttonUnlimitedReplay->setSelectedSilent(SEL->getStartInfo()->extraOptionsInfo.unlimitedReplay);
}