added session loss sequence, added energy and stamina to HUD, added home location trigger
This commit is contained in:
@@ -15,9 +15,21 @@ void UHUDWidget::NativeConstruct()
|
||||
return;
|
||||
|
||||
Player->StatsManager->EmbarrassmentUpdate.AddUniqueDynamic(this, &UHUDWidget::OnEmbarrassmentUpdated);
|
||||
Player->StatsManager->EnergyUpdate.AddUniqueDynamic(this, &UHUDWidget::OnEnergyUpdated);
|
||||
Player->StatsManager->StaminaUpdate.AddUniqueDynamic(this, &UHUDWidget::OnStaminaUpdated);
|
||||
}
|
||||
|
||||
void UHUDWidget::OnEmbarrassmentUpdated(float CurrentValue, float MaxValue)
|
||||
{
|
||||
EmbarrassmentBar->SetPercent(CurrentValue / MaxValue);
|
||||
}
|
||||
|
||||
void UHUDWidget::OnEnergyUpdated(float CurrentValue, float MaxValue)
|
||||
{
|
||||
EnergyBar->SetPercent(CurrentValue / MaxValue);
|
||||
}
|
||||
|
||||
void UHUDWidget::OnStaminaUpdated(float CurrentValue, float MaxValue)
|
||||
{
|
||||
StaminaBar->SetPercent(CurrentValue / MaxValue);
|
||||
}
|
||||
|
||||
@@ -16,10 +16,22 @@ class NAKEDDESIRE_API UHUDWidget : public UCommonUserWidget
|
||||
UPROPERTY(meta = (BindWidget))
|
||||
TObjectPtr<UProgressBar> EmbarrassmentBar;
|
||||
|
||||
UPROPERTY(meta = (BindWidget))
|
||||
TObjectPtr<UProgressBar> EnergyBar;
|
||||
|
||||
UPROPERTY(meta = (BindWidget))
|
||||
TObjectPtr<UProgressBar> StaminaBar;
|
||||
|
||||
protected:
|
||||
virtual void NativeConstruct() override;
|
||||
|
||||
private:
|
||||
UFUNCTION()
|
||||
void OnEmbarrassmentUpdated(float CurrentValue, float MaxValue);
|
||||
|
||||
UFUNCTION()
|
||||
void OnEnergyUpdated(float CurrentValue, float MaxValue);
|
||||
|
||||
UFUNCTION()
|
||||
void OnStaminaUpdated(float CurrentValue, float MaxValue);
|
||||
};
|
||||
|
||||
@@ -104,8 +104,17 @@ FString UForumCommissionWidget::BuildObjectivesString() const
|
||||
if (!Result.IsEmpty())
|
||||
Result += LINE_TERMINATOR;
|
||||
|
||||
FString Line = FString::Printf(TEXT("• %s"), *Objective->GetDescription().ToString());
|
||||
|
||||
// Append any "while Y" constraint text so the row reads "Be fully naked while at Beach (50%)".
|
||||
const FString Constraints = Objective->GetConstraintsDescription().ToString();
|
||||
if (!Constraints.IsEmpty())
|
||||
Line += FString::Printf(TEXT(" %s"), *Constraints);
|
||||
|
||||
const int32 Pct = FMath::RoundToInt(Objective->GetProgress() * 100.0f);
|
||||
Result += FString::Printf(TEXT("• %s (%d%%)"), *Objective->GetDescription().ToString(), Pct);
|
||||
Line += FString::Printf(TEXT(" (%d%%)"), Pct);
|
||||
|
||||
Result += Line;
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user