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()
|
void UDialogueNPC::StartDialogue()
|
||||||
{
|
{
|
||||||
|
bIsInDialogue = true;
|
||||||
Quests.Empty();
|
Quests.Empty();
|
||||||
BlueprintFunctions.Empty();
|
BlueprintFunctions.Empty();
|
||||||
ItemIndexes.Empty();
|
ItemIndexes.Empty();
|
||||||
@ -178,6 +179,7 @@ void UDialogueNPC::StartDialogue()
|
|||||||
|
|
||||||
void UDialogueNPC::EndDialogue()
|
void UDialogueNPC::EndDialogue()
|
||||||
{
|
{
|
||||||
|
bIsInDialogue = false;
|
||||||
TextAnimationTimerHandle.Invalidate();
|
TextAnimationTimerHandle.Invalidate();
|
||||||
DialogueWidgetInstance->RemoveFromParent();
|
DialogueWidgetInstance->RemoveFromParent();
|
||||||
|
|
||||||
|
@ -57,6 +57,9 @@ public:
|
|||||||
UPROPERTY(EditAnywhere)
|
UPROPERTY(EditAnywhere)
|
||||||
float TextAnimationSpeed = 0.05f;
|
float TextAnimationSpeed = 0.05f;
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
bool bIsInDialogue = false;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Called when the game starts
|
// Called when the game starts
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
@ -92,14 +95,15 @@ private:
|
|||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
UButton* NextButton;
|
UButton* NextButton;
|
||||||
|
|
||||||
|
UPROPERTY()
|
||||||
int DialogueIndex = 1;
|
int DialogueIndex = 1;
|
||||||
|
UPROPERTY()
|
||||||
FString CurrentDialogue;
|
FString CurrentDialogue;
|
||||||
|
|
||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
FTimerHandle TextAnimationTimerHandle;
|
FTimerHandle TextAnimationTimerHandle;
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void NextDialogue();
|
|
||||||
void NextCharacter();
|
void NextCharacter();
|
||||||
|
|
||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
@ -122,10 +126,12 @@ public:
|
|||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void StartDialogue();
|
void StartDialogue();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void EndDialogue();
|
void EndDialogue();
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void NextDialogue();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
UDialoguePath* CreateRootDialoguePath(bool ResetUserControls = true);
|
UDialoguePath* CreateRootDialoguePath(bool ResetUserControls = true);
|
||||||
|
|
||||||
|
@ -47,7 +47,13 @@ void UInteractNPC::Interact()
|
|||||||
if (HitResult.GetActor()->Tags.Contains("NPC"))
|
if (HitResult.GetActor()->Tags.Contains("NPC"))
|
||||||
{
|
{
|
||||||
//DrawDebugLine(GetWorld(), Start, End, FColor::Green, false, 5.0f, 0, 10.0f);
|
//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);
|
//DrawDebugLine(GetWorld(), Start, End, FColor::Red, false, 5.0f, 0, 10.0f);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user