Updated Combat System to Hide Quest Widget in Combat
This commit is contained in:
parent
38591bfcac
commit
0115b7db1f
@ -32,6 +32,9 @@ public:
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
||||
bool bHasSubQuest = false;
|
||||
|
||||
UPROPERTY()
|
||||
UUserWidget* QuestWidgetInstance;
|
||||
|
||||
protected:
|
||||
// Called when the game starts
|
||||
virtual void BeginPlay() override;
|
||||
@ -39,8 +42,6 @@ protected:
|
||||
UPROPERTY()
|
||||
TSubclassOf<UUserWidget> QuestWidget;
|
||||
UPROPERTY()
|
||||
UUserWidget* QuestWidgetInstance;
|
||||
UPROPERTY()
|
||||
TSubclassOf<UUserWidget> QuestCompletionWidget;
|
||||
UPROPERTY()
|
||||
UUserWidget* QuestCompletionWidgetInstance;
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "Kismet/KismetMathLibrary.h"
|
||||
#include "Misc/OutputDeviceNull.h"
|
||||
#include "the_twilight_abyss/PlayerTemp/TempCharacter.h"
|
||||
#include "the_twilight_abyss/Quest/QuestSystem.h"
|
||||
|
||||
// Sets default values
|
||||
ATurnBaseCombatV2::ATurnBaseCombatV2()
|
||||
@ -46,7 +47,8 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy, bool bWasShot)
|
||||
EscapePercentageTextBlock->SetText(FText::Join(FText::FromString(""), FText::FromString(FString::FromInt(EscapePercentage * 100)), FText::FromString("%")));
|
||||
bIsInCombat = true;
|
||||
UBlackboardComponent* EnemyBlackboard = Cast<AAIController>(Enemy->GetInstigatorController())->GetBlackboardComponent();
|
||||
|
||||
Cast<UQuestSystem>(PlayerActor->GetComponentByClass(UQuestSystem::StaticClass()))->QuestWidgetInstance->SetVisibility(ESlateVisibility::Hidden);
|
||||
|
||||
//Disable Character Movement
|
||||
APlayerController* PlayerController = GetWorld()->GetFirstPlayerController();
|
||||
PlayerController->SetIgnoreMoveInput(true);
|
||||
@ -126,6 +128,7 @@ void ATurnBaseCombatV2::EndCombat()
|
||||
BookHUD->SetVisibility(ESlateVisibility::Hidden);
|
||||
HUD->RemoveFromParent();
|
||||
BookStaticMeshComponent->SetVisibility(false);
|
||||
Cast<UQuestSystem>(PlayerActor->GetComponentByClass(UQuestSystem::StaticClass()))->QuestWidgetInstance->SetVisibility(ESlateVisibility::HitTestInvisible);
|
||||
Cast<ATempCharacter>(PlayerActor)->ResetWidgetPointer();
|
||||
TurnIndicatorTextBlock->SetText(FText::FromString(""));
|
||||
bEnemyHasExtraTurn = false;
|
||||
|
Loading…
Reference in New Issue
Block a user