Bugfix Pressing E in Dialogue Stops Player from Moving
This commit is contained in:
parent
dcd4cbf356
commit
09b55ac425
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.
BIN
Content/Levels/Build.umap
(Stored with Git LFS)
BIN
Content/Levels/Build.umap
(Stored with Git LFS)
Binary file not shown.
@ -142,6 +142,7 @@ void UDialogueNPC::TickComponent(float DeltaTime, ELevelTick TickType, FActorCom
|
||||
|
||||
void UDialogueNPC::StartDialogue()
|
||||
{
|
||||
bIsInDialogue = true;
|
||||
Quests.Empty();
|
||||
BlueprintFunctions.Empty();
|
||||
ItemIndexes.Empty();
|
||||
@ -178,6 +179,7 @@ void UDialogueNPC::StartDialogue()
|
||||
|
||||
void UDialogueNPC::EndDialogue()
|
||||
{
|
||||
bIsInDialogue = false;
|
||||
TextAnimationTimerHandle.Invalidate();
|
||||
DialogueWidgetInstance->RemoveFromParent();
|
||||
|
||||
|
@ -57,6 +57,9 @@ public:
|
||||
UPROPERTY(EditAnywhere)
|
||||
float TextAnimationSpeed = 0.05f;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly)
|
||||
bool bIsInDialogue = false;
|
||||
|
||||
protected:
|
||||
// Called when the game starts
|
||||
virtual void BeginPlay() override;
|
||||
@ -92,14 +95,15 @@ private:
|
||||
UPROPERTY()
|
||||
UButton* NextButton;
|
||||
|
||||
UPROPERTY()
|
||||
int DialogueIndex = 1;
|
||||
UPROPERTY()
|
||||
FString CurrentDialogue;
|
||||
|
||||
UPROPERTY()
|
||||
FTimerHandle TextAnimationTimerHandle;
|
||||
|
||||
|
||||
UFUNCTION()
|
||||
void NextDialogue();
|
||||
void NextCharacter();
|
||||
|
||||
UPROPERTY()
|
||||
@ -122,10 +126,12 @@ public:
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void StartDialogue();
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void EndDialogue();
|
||||
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void NextDialogue();
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
UDialoguePath* CreateRootDialoguePath(bool ResetUserControls = true);
|
||||
|
||||
|
@ -47,7 +47,13 @@ void UInteractNPC::Interact()
|
||||
if (HitResult.GetActor()->Tags.Contains("NPC"))
|
||||
{
|
||||
//DrawDebugLine(GetWorld(), Start, End, FColor::Green, false, 5.0f, 0, 10.0f);
|
||||
HitResult.GetActor()->FindComponentByClass<UDialogueNPC>()->StartDialogue();
|
||||
UDialogueNPC* DialogueNPC = HitResult.GetActor()->FindComponentByClass<UDialogueNPC>();
|
||||
if (DialogueNPC->bIsInDialogue)
|
||||
{
|
||||
DialogueNPC->NextDialogue();
|
||||
return;
|
||||
}
|
||||
DialogueNPC->StartDialogue();
|
||||
}
|
||||
//DrawDebugLine(GetWorld(), Start, End, FColor::Red, false, 5.0f, 0, 10.0f);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user