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

Merge remote-tracking branch 'origin/HEAD' into dev/5.3

# Conflicts:
#	Source/StudyFrameworkPlugin/Private/SFGameInstance.cpp
parents ae685d20 09457898
Branches
Tags
No related merge requests found
...@@ -248,9 +248,16 @@ void USFGameInstance::PrepareWithStudySetup(ASFStudySetup* Setup) ...@@ -248,9 +248,16 @@ void USFGameInstance::PrepareWithStudySetup(ASFStudySetup* Setup)
"Restart Study" "Restart Study"
}; };
bool bValidDecision = false;
while (!bValidDecision) {
int Answer = FSFUtils::OpenCustomDialog(MessageTitle, MessageText, Buttons); int Answer = FSFUtils::OpenCustomDialog(MessageTitle, MessageText, Buttons);
const FString ModeSelection = Buttons[Answer]; const FString ModeSelection = Buttons[Answer];
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:
...@@ -258,19 +265,23 @@ void USFGameInstance::PrepareWithStudySetup(ASFStudySetup* Setup) ...@@ -258,19 +265,23 @@ void USFGameInstance::PrepareWithStudySetup(ASFStudySetup* Setup)
ParticipantSequenceNumber = 0; ParticipantSequenceNumber = 0;
//clear data (but only on primary to avoid data races) //clear data (but only on primary to avoid data races)
USFParticipant::ClearLogData(); USFParticipant::ClearLogData();
bValidDecision = true;
break; break;
case 0: case 0:
FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup]: Continue last participant"); FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup]: Continue last participant");
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++;
bValidDecision = true;
break; break;
default: default:
FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup]: Unknown UnfinishedRunDetectedDialog answer: " + FString::FromInt(Answer), true); FSFLoggingUtils::Log("[USFGameInstance::PrepareWithStudySetup]: Unknown UnfinishedRunDetectedDialog answer: " + FString::FromInt(Answer), true);
break; break;
} }
}
// Participant // Participant
FString ParticipantID = ""; FString ParticipantID = "";
...@@ -296,6 +307,10 @@ void USFGameInstance::PrepareWithStudySetup(ASFStudySetup* Setup) ...@@ -296,6 +307,10 @@ void USFGameInstance::PrepareWithStudySetup(ASFStudySetup* Setup)
{ {
FSFUtils::OpenMessageBox("Participant ID \"" + IDGiven + "\"was already used, you have to choose another one!"); FSFUtils::OpenMessageBox("Participant ID \"" + IDGiven + "\"was already used, you have to choose another one!");
} }
else if (IDGiven.IsEmpty())
{
FSFUtils::OpenMessageBox("Participant ID given is empty, you have to choose one!");
}
else else
{ {
ParticipantID = IDGiven; ParticipantID = IDGiven;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment