Skip to content
Snippets Groups Projects
Commit 09457898 authored by Jonathan Ehret's avatar Jonathan Ehret
Browse files

do not allow closing the "how to proceed after unfinished run detected" dialog...

do not allow closing the "how to proceed after unfinished run detected" dialog without giving an answer by just reopening it!
closes #108
parent 9287c2e8
No related branches found
No related tags found
No related merge requests found
......@@ -246,29 +246,42 @@ void USFGameInstance::PrepareWithStudySetup(ASFStudySetup* Setup)
"Next Participant",
"Restart Study"
};
int Answer = FSFUtils::OpenCustomDialog(MessageTitle, MessageText, Buttons);
switch (Answer)
{
case 2:
FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup]: Restart entire study");
ParticipantSequenceNumber = 0;
Conditions = StudySetup->GetAllConditionsForRun(ParticipantSequenceNumber);
//clear data
USFParticipant::ClearLogData(Setup);
break;
case 0:
FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup]: Continue last participant");
Conditions = USFParticipant::GetLastParticipantsConditions();
StartCondition = Conditions[USFParticipant::GetLastParticipantLastConditionStarted()];
bRecoverParticipantData = true;
break;
case 1:
FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup]: Continue with the next participant");
ParticipantSequenceNumber++;
Conditions = StudySetup->GetAllConditionsForRun(ParticipantSequenceNumber);
break;
default:;
bool bValidDecision = false;
while (!bValidDecision) {
int Answer = FSFUtils::OpenCustomDialog(MessageTitle, MessageText, Buttons);
if (Answer < 0) {
FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup] The window for deciding on how to recover from an unfinished run was closed without giving an answer, repeat question!", false);
continue;
}
switch (Answer)
{
case 2:
FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup]: Restart entire study");
ParticipantSequenceNumber = 0;
Conditions = StudySetup->GetAllConditionsForRun(ParticipantSequenceNumber);
//clear data
USFParticipant::ClearLogData(Setup);
bValidDecision = true;
break;
case 0:
FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup]: Continue last participant");
Conditions = USFParticipant::GetLastParticipantsConditions();
StartCondition = Conditions[USFParticipant::GetLastParticipantLastConditionStarted()];
bRecoverParticipantData = true;
bValidDecision = true;
break;
case 1:
FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup]: Continue with the next participant");
ParticipantSequenceNumber++;
Conditions = StudySetup->GetAllConditionsForRun(ParticipantSequenceNumber);
bValidDecision = true;
break;
default:;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment