mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-23 00:28:08 +02:00
Implement AI simturns checkbox
This commit is contained in:
@ -53,6 +53,12 @@ OptionsTabBase::OptionsTabBase(const JsonPath & configPath)
|
||||
CSH->setSimturnsInfo(info);
|
||||
});
|
||||
|
||||
addCallback("setSimturnAI", [&](int index){
|
||||
SimturnsInfo info = SEL->getStartInfo()->simturnsInfo;
|
||||
info.allowHumanWithAI = index;
|
||||
CSH->setSimturnsInfo(info);
|
||||
});
|
||||
|
||||
//helper function to parse string containing time to integer reflecting time in seconds
|
||||
//assumed that input string can be modified by user, function shall support user's intention
|
||||
// normal: 2:00, 12:30
|
||||
@ -237,6 +243,9 @@ void OptionsTabBase::recreate()
|
||||
if(auto w = widget<CLabel>("labelSimturnsDurationValueMax"))
|
||||
w->setText(generateSimturnsDurationText(SEL->getStartInfo()->simturnsInfo.optionalTurns));
|
||||
|
||||
if(auto buttonSimturnsAI = widget<CToggleButton>("buttonSimturnsAI"))
|
||||
buttonSimturnsAI->setSelectedSilent(SEL->getStartInfo()->simturnsInfo.allowHumanWithAI);
|
||||
|
||||
const auto & turnTimerRemote = SEL->getStartInfo()->turnTimerInfo;
|
||||
|
||||
//classic timer
|
||||
|
Reference in New Issue
Block a user