Skip to content
Snippets Groups Projects
Commit 6a50dfc9 authored by Malte Christian Kögel's avatar Malte Christian Kögel
Browse files

Displaying notification "DEBUG MODE" now works

parent b200393b
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -57,14 +57,14 @@ void USFHUDWidget::SetStatus(const FString& Text)
void USFHUDWidget::SetbInDebugMode(bool InDebugMode) {
bInDebugMode = InDebugMode;
if (bInDebugModeTextBox){
if (InDebugModeBorder && InDebugModeText){
if (bInDebugMode) {
bInDebugModeTextBox->SetText(FText::FromString("DEBUG MODE ||"));
bInDebugModeTextBox->SetColorAndOpacity(UKismetMathLibrary::MakeColor(0, 0, 1, 1));
bInDebugModeTextBox->SetVisibility(ESlateVisibility::Visible);
InDebugModeBorder->SetVisibility(ESlateVisibility::Visible);
InDebugModeText->SetVisibility(ESlateVisibility::Visible);
}
else{
bInDebugModeTextBox->SetText(FText::FromString(""));
InDebugModeBorder->SetVisibility(ESlateVisibility::Collapsed);
InDebugModeText->SetVisibility(ESlateVisibility::Collapsed);
}
}
}
......@@ -99,7 +99,7 @@ void USFHUDWidget::ClearWidget()
FHUDSavedData USFHUDWidget::GetData()
{
FHUDSavedData Data;
Data.bInDebugMode = bInDebugMode; // TODO: Do we want to save, whether data has been collected in debug mode? Or should we treat it the same? What happens, if the first half is collected in debug mode, the second half in normal mode
//Data.bInDebugMode = bInDebugMode; // TODO: Do we want to save, whether data has been collected in debug mode? Or should we treat it the same? What happens, if the first half is collected in debug mode, the second half in normal mode
Data.Status = StatusTextBox->GetText().ToString();
Data.Participant = ParticipantTextBox->GetText().ToString();
Data.Phase = PhaseTextBox->GetText().ToString();
......
......@@ -83,7 +83,7 @@ void ASFMasterHUD::BeginPlay()
FHUDSavedData& Data = USFGameInstance::Get()->HUDSavedData;
HUDWidget->SetData(Data);
HUDWidget->SetbInDebugMode(bInDebugMode);
HUDWidget->SetbInDebugMode(USFGameInstance::Get()->IsInDebugMode());
if(UnForwardedParticipant)
{
......@@ -198,14 +198,6 @@ void ASFMasterHUD::SetNextConditionButtonVisibility(ESlateVisibility Visibility)
HUDWidget->GetNextButton()->SetVisibility(Visibility);
}
void ASFMasterHUD::SetbInDebugMode(bool InDebugMode)
{
bInDebugMode = InDebugMode;
if (HUDWidget) {
HUDWidget->SetbInDebugMode(InDebugMode);
}
}
void ASFMasterHUD::DrawBackground()
{
FLinearColor BackgroundColor = FLinearColor::Black;
......
......@@ -155,7 +155,7 @@ void USFGameInstance::RestoreLastParticipantForDebugStart(USFCondition* InStartC
Participant->Initialize(ParticipantSequenceNumber, ParticipantID);
Participant->LoadConditionsFromJson();
Cast<ASFMasterHUD>(GetWorld()->GetFirstPlayerController()->GetHUD())->SetbInDebugMode(true); //Display notification in HUD, that we are in debug mode
bInDebugMode = true;
InitFadeHandler(StudySetup->FadeConfig);
......@@ -604,6 +604,11 @@ bool USFGameInstance::IsStarted() const
return bStudyStarted;
}
bool USFGameInstance::IsInDebugMode() const
{
return bInDebugMode;
}
bool USFGameInstance::HasEnded() const
{
return bStudyEnded;
......
......@@ -17,7 +17,6 @@ USTRUCT()
struct FHUDSavedData
{
GENERATED_BODY()
bool bInDebugMode;
FString Status;
FString Participant;
FString Phase;
......@@ -65,7 +64,8 @@ private:
// Notiy user in HUD, if level is used in Debug-Mode
bool bInDebugMode = false;
UPROPERTY(EditAnywhere, meta = (BindWidget)) UTextBlock* bInDebugModeTextBox;
UPROPERTY(EditAnywhere, meta = (BindWidget)) UBorder* InDebugModeBorder;
UPROPERTY(EditAnywhere, meta = (BindWidget)) UTextBlock* InDebugModeText;
UPROPERTY(EditAnywhere, meta = (BindWidget)) UTextBlock* StatusTextBox;
UPROPERTY(EditAnywhere, meta = (BindWidget)) UTextBlock* ParticipantTextBox;
......
......@@ -49,9 +49,6 @@ public:
UFUNCTION()
void SetNextConditionButtonVisibility(ESlateVisibility Visibility);
UFUNCTION()
void SetbInDebugMode(bool InDebugMode);
UPROPERTY(EditDefaultsOnly, Category = "Interactive")
TSubclassOf<USFHUDWidget> SFWidgetClass;
UPROPERTY(EditDefaultsOnly, Category = "Interactive")
......@@ -78,8 +75,6 @@ private:
void DrawBackground();
float BackgroundAlpha = 1.0f;
bool bInDebugMode=false;
ASFHMDSpectatorHUDHelp* HMDHUDHelper;
bool bHMDHUDHelperTextureSet= false;
......
......@@ -69,6 +69,10 @@ public:
UFUNCTION(BlueprintCallable)
bool IsStarted() const;
UFUNCTION(BlueprintCallable)
bool IsInDebugMode() const;
//Whether the study is done (this is actually only true for a short duration), as once faded out Unreal is quit
UFUNCTION(BlueprintCallable)
bool HasEnded() const;
......@@ -237,6 +241,7 @@ protected:
USFCondition* ConditionToStartAtInit=nullptr;
bool bStartedOnUnrelatedMap = false;
bool bInDebugMode = false;
UPROPERTY()
USFGazeTracker* GazeTracker;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment