Updated Dialogue for Optimisations and Abstraction
This commit is contained in:
parent
d237e6c8de
commit
9bb98b314b
BIN
Content/Blueprints/Game_UI/WBP_IntroText.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Game_UI/WBP_IntroText.uasset
(Stored with Git LFS)
Binary file not shown.
@ -6,7 +6,6 @@
|
||||
#include "Components/TextBlock.h"
|
||||
#include "GameFramework/Character.h"
|
||||
#include "Kismet/KismetStringLibrary.h"
|
||||
#include "the_twilight_abyss/PlayerTemp/TempCharacter.h"
|
||||
#include "the_twilight_abyss/Quest/QuestSystem.h"
|
||||
|
||||
// Sets default values for this component's properties
|
||||
@ -94,6 +93,18 @@ void UDialogueNPC::NextCharacter()
|
||||
}
|
||||
}
|
||||
|
||||
void UDialogueNPC::ResetDialogueUI()
|
||||
{
|
||||
DialogueIndex = 0;
|
||||
CurrentDialogue = "";
|
||||
CurrentDialogueStringPath = CurrentDialoguePath->Dialogue;
|
||||
GetWorld()->GetTimerManager().UnPauseTimer(TextAnimationTimerHandle);
|
||||
Choice1Button->SetVisibility(ESlateVisibility::Hidden);
|
||||
Choice2Button->SetVisibility(ESlateVisibility::Hidden);
|
||||
Choice3Button->SetVisibility(ESlateVisibility::Hidden);
|
||||
NextArrow->SetVisibility(ESlateVisibility::Visible);
|
||||
}
|
||||
|
||||
// Called every frame
|
||||
void UDialogueNPC::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
||||
{
|
||||
@ -185,38 +196,17 @@ UDialoguePath* UDialogueNPC::AddQuest(UDialoguePath* DialoguePath, UQuest* Quest
|
||||
void UDialogueNPC::Choice1()
|
||||
{
|
||||
CurrentDialoguePath = CurrentDialoguePath->Choices[0];
|
||||
DialogueIndex = 0;
|
||||
CurrentDialogue = "";
|
||||
CurrentDialogueStringPath = CurrentDialoguePath->Dialogue;
|
||||
GetWorld()->GetTimerManager().UnPauseTimer(TextAnimationTimerHandle);
|
||||
Choice1Button->SetVisibility(ESlateVisibility::Hidden);
|
||||
Choice2Button->SetVisibility(ESlateVisibility::Hidden);
|
||||
Choice3Button->SetVisibility(ESlateVisibility::Hidden);
|
||||
NextArrow->SetVisibility(ESlateVisibility::Visible);
|
||||
ResetDialogueUI();
|
||||
}
|
||||
|
||||
void UDialogueNPC::Choice2()
|
||||
{
|
||||
CurrentDialoguePath = CurrentDialoguePath->Choices[1];
|
||||
DialogueIndex = 0;
|
||||
CurrentDialogue = "";
|
||||
CurrentDialogueStringPath = CurrentDialoguePath->Dialogue;
|
||||
GetWorld()->GetTimerManager().UnPauseTimer(TextAnimationTimerHandle);
|
||||
Choice1Button->SetVisibility(ESlateVisibility::Hidden);
|
||||
Choice2Button->SetVisibility(ESlateVisibility::Hidden);
|
||||
Choice3Button->SetVisibility(ESlateVisibility::Hidden);
|
||||
NextArrow->SetVisibility(ESlateVisibility::Visible);
|
||||
ResetDialogueUI();
|
||||
}
|
||||
|
||||
void UDialogueNPC::Choice3()
|
||||
{
|
||||
CurrentDialoguePath = CurrentDialoguePath->Choices[2];
|
||||
DialogueIndex = 0;
|
||||
CurrentDialogue = "";
|
||||
CurrentDialogueStringPath = CurrentDialoguePath->Dialogue;
|
||||
GetWorld()->GetTimerManager().UnPauseTimer(TextAnimationTimerHandle);
|
||||
Choice1Button->SetVisibility(ESlateVisibility::Hidden);
|
||||
Choice2Button->SetVisibility(ESlateVisibility::Hidden);
|
||||
Choice3Button->SetVisibility(ESlateVisibility::Hidden);
|
||||
NextArrow->SetVisibility(ESlateVisibility::Visible);
|
||||
ResetDialogueUI();
|
||||
}
|
||||
|
@ -95,6 +95,8 @@ private:
|
||||
UPROPERTY()
|
||||
TMap<int, UQuest*> Quests;
|
||||
|
||||
void ResetDialogueUI();
|
||||
|
||||
public:
|
||||
// Called every frame
|
||||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||
|
Loading…
Reference in New Issue
Block a user