Updated Combat to Hide Book in Non-Combat
This commit is contained in:
parent
11c905613a
commit
4f8f2b37d1
BIN
Content/Blueprints/Combat_UI/CombatCharacter.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Combat_UI/CombatCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
@ -40,6 +40,7 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy, bool bWasShot)
|
||||
if (bIsInCombat) return;
|
||||
BookHUD->SetVisibility(ESlateVisibility::SelfHitTestInvisible);
|
||||
HUD->AddToViewport(-1);
|
||||
BookStaticMeshComponent->SetVisibility(true);
|
||||
EscapePercentage = CalculateEscapePercentage();
|
||||
EscapePercentageTextBlock->SetText(FText::Join(FText::FromString(""), FText::FromString(FString::FromInt(EscapePercentage * 100)), FText::FromString("%")));
|
||||
bIsInCombat = true;
|
||||
@ -113,6 +114,7 @@ void ATurnBaseCombatV2::EndCombat()
|
||||
{
|
||||
BookHUD->SetVisibility(ESlateVisibility::Hidden);
|
||||
HUD->RemoveFromParent();
|
||||
BookStaticMeshComponent->SetVisibility(false);
|
||||
Cast<ATempCharacter>(PlayerActor)->ResetWidgetPointer();
|
||||
TurnIndicatorTextBlock->SetText(FText::FromString(""));
|
||||
bEnemyHasExtraTurn = false;
|
||||
@ -164,6 +166,11 @@ void ATurnBaseCombatV2::BeginPlay()
|
||||
PostProcessVolume->Settings.WeightedBlendables.Array.Add(WeightedBlendable);
|
||||
}
|
||||
|
||||
TArray<UStaticMeshComponent*> StaticMeshComponents;
|
||||
PlayerActor->GetComponents<UStaticMeshComponent>(StaticMeshComponents);
|
||||
BookStaticMeshComponent = StaticMeshComponents[1];
|
||||
BookStaticMeshComponent->SetVisibility(false);
|
||||
|
||||
CombatTutorialWidgetInstance = CreateWidget<UUserWidget>(GetWorld(), CombatTutorialWidget);
|
||||
HUD = CreateWidget<UUserWidget>(GetWorld(), HUDWidget);
|
||||
TArray<AActor*> PlayerChildActors;
|
||||
|
@ -237,4 +237,6 @@ private:
|
||||
UUserWidget* DeathScreenWidget;
|
||||
UPROPERTY()
|
||||
TSubclassOf<UUserWidget> DeathScreenWidgetSubclass;
|
||||
UPROPERTY()
|
||||
UStaticMeshComponent* BookStaticMeshComponent;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user