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,8 +246,17 @@ void USFGameInstance::PrepareWithStudySetup(ASFStudySetup* Setup) ...@@ -246,8 +246,17 @@ void USFGameInstance::PrepareWithStudySetup(ASFStudySetup* Setup)
"Next Participant", "Next Participant",
"Restart Study" "Restart Study"
}; };
bool bValidDecision = false;
while (!bValidDecision) {
int Answer = FSFUtils::OpenCustomDialog(MessageTitle, MessageText, Buttons); 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) switch (Answer)
{ {
case 2: case 2:
...@@ -256,21 +265,25 @@ void USFGameInstance::PrepareWithStudySetup(ASFStudySetup* Setup) ...@@ -256,21 +265,25 @@ void USFGameInstance::PrepareWithStudySetup(ASFStudySetup* Setup)
Conditions = StudySetup->GetAllConditionsForRun(ParticipantSequenceNumber); Conditions = StudySetup->GetAllConditionsForRun(ParticipantSequenceNumber);
//clear data //clear data
USFParticipant::ClearLogData(Setup); USFParticipant::ClearLogData(Setup);
bValidDecision = true;
break; break;
case 0: case 0:
FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup]: Continue last participant"); FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup]: Continue last participant");
Conditions = USFParticipant::GetLastParticipantsConditions(); Conditions = USFParticipant::GetLastParticipantsConditions();
StartCondition = Conditions[USFParticipant::GetLastParticipantLastConditionStarted()]; StartCondition = Conditions[USFParticipant::GetLastParticipantLastConditionStarted()];
bRecoverParticipantData = true; bRecoverParticipantData = true;
bValidDecision = true;
break; break;
case 1: case 1:
FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup]: Continue with the next participant"); FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup]: Continue with the next participant");
ParticipantSequenceNumber++; ParticipantSequenceNumber++;
Conditions = StudySetup->GetAllConditionsForRun(ParticipantSequenceNumber); Conditions = StudySetup->GetAllConditionsForRun(ParticipantSequenceNumber);
bValidDecision = true;
break; break;
default:; default:;
} }
} }
}
if (StudySetup->bPreloadAllMapsOnStart) if (StudySetup->bPreloadAllMapsOnStart)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment