Updated Boss for Dialogue and End Game Dialogue

This commit is contained in:
Philip W 2023-05-13 16:25:07 +01:00
parent c6e5cb5e00
commit b8709401da
13 changed files with 34 additions and 37 deletions

BIN
Content/BlueprintAI/AI/AIBruh_Boss.uasset (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Blueprints/Combat_UI/EndDialogue.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Dialogue/TextPrompt.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Content/Levels/Build.umap (Stored with Git LFS)

Binary file not shown.

BIN
Content/Levels/Enemy_Test.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -70,7 +70,7 @@ void UDialogueNPC::NextDialogue()
FOutputDeviceNull AR; FOutputDeviceNull AR;
const FString Command = BlueprintFunctions[UKismetStringLibrary::Conv_StringToInt(CurrentDialogueStringPath[DialogueIndex].RightChop(3))];; const FString Command = BlueprintFunctions[UKismetStringLibrary::Conv_StringToInt(CurrentDialogueStringPath[DialogueIndex].RightChop(3))];;
GetOwner()->CallFunctionByNameWithArguments(*Command, AR, nullptr, true); GetOwner()->CallFunctionByNameWithArguments(*Command, AR, nullptr, true);
if (Command == "OpenShop") bInShop = true; if (Command == "OpenShop") bResetUserControls = false;
DialogueIndex++; DialogueIndex++;
} }
else if (CurrentDialogueStringPath[FMath::Clamp(DialogueIndex + 1, 0, CurrentDialogueStringPath.Num() - 1)].Mid(0, 2) == "$$") else if (CurrentDialogueStringPath[FMath::Clamp(DialogueIndex + 1, 0, CurrentDialogueStringPath.Num() - 1)].Mid(0, 2) == "$$")
@ -139,7 +139,6 @@ void UDialogueNPC::TickComponent(float DeltaTime, ELevelTick TickType, FActorCom
void UDialogueNPC::StartDialogue() void UDialogueNPC::StartDialogue()
{ {
Quests.Empty(); Quests.Empty();
bInShop = false;
FOutputDeviceNull AR; FOutputDeviceNull AR;
const FString Command = FString::Printf(TEXT("SetRootDialoguePath")); const FString Command = FString::Printf(TEXT("SetRootDialoguePath"));
GetOwner()->CallFunctionByNameWithArguments(*Command, AR, nullptr, true); GetOwner()->CallFunctionByNameWithArguments(*Command, AR, nullptr, true);
@ -149,14 +148,11 @@ void UDialogueNPC::StartDialogue()
UE_LOG(LogTemp, Warning, TEXT("Dialogue Path is Empty")); UE_LOG(LogTemp, Warning, TEXT("Dialogue Path is Empty"));
return; return;
} }
//Disable Character Movement
if (ACharacter* PlayerCharacter = Cast<ACharacter>(GetWorld()->GetFirstPlayerController()->GetPawn()))
{
PlayerCharacter->DisableInput(GetWorld()->GetFirstPlayerController());
}
//Set to UI Mode Only //Set to UI Mode Only
APlayerController* PlayerController = GetWorld()->GetFirstPlayerController(); APlayerController* PlayerController = GetWorld()->GetFirstPlayerController();
PlayerController->SetInputMode(FInputModeUIOnly()); PlayerController->SetIgnoreMoveInput(true);
PlayerController->SetIgnoreLookInput(true);
PlayerController->SetInputMode(FInputModeGameAndUI());
PlayerController->bShowMouseCursor = true; PlayerController->bShowMouseCursor = true;
Choice1Button->SetVisibility(ESlateVisibility::Hidden); Choice1Button->SetVisibility(ESlateVisibility::Hidden);
@ -178,22 +174,20 @@ void UDialogueNPC::EndDialogue()
TextAnimationTimerHandle.Invalidate(); TextAnimationTimerHandle.Invalidate();
DialogueWidgetInstance->RemoveFromParent(); DialogueWidgetInstance->RemoveFromParent();
if (!bInShop) if (bResetUserControls)
{ {
//Enable Character Movement
if (ACharacter* PlayerCharacter = Cast<ACharacter>(GetWorld()->GetFirstPlayerController()->GetPawn()))
{
PlayerCharacter->EnableInput(GetWorld()->GetFirstPlayerController());
}
//Reset UI Mode //Reset UI Mode
APlayerController* PlayerController = GetWorld()->GetFirstPlayerController(); APlayerController* PlayerController = GetWorld()->GetFirstPlayerController();
PlayerController->SetIgnoreMoveInput(false);
PlayerController->SetIgnoreLookInput(false);
PlayerController->SetInputMode(FInputModeGameOnly()); PlayerController->SetInputMode(FInputModeGameOnly());
PlayerController->bShowMouseCursor = false; PlayerController->bShowMouseCursor = false;
} }
} }
UDialoguePath* UDialogueNPC::CreateRootDialoguePath() UDialoguePath* UDialogueNPC::CreateRootDialoguePath(const bool ResetUserControls)
{ {
bResetUserControls = ResetUserControls;
return NewObject<UDialoguePath>(); return NewObject<UDialoguePath>();
} }

View File

@ -105,7 +105,7 @@ private:
TMap<int, FString> QuestFlags; TMap<int, FString> QuestFlags;
UPROPERTY() UPROPERTY()
bool bInShop = false; bool bResetUserControls = true;
void ResetDialogueUI(); void ResetDialogueUI();
@ -120,7 +120,7 @@ public:
void EndDialogue(); void EndDialogue();
UFUNCTION(BlueprintCallable) UFUNCTION(BlueprintCallable)
UDialoguePath* CreateRootDialoguePath(); UDialoguePath* CreateRootDialoguePath(bool ResetUserControls = true);
UFUNCTION(BlueprintCallable) UFUNCTION(BlueprintCallable)
UDialoguePath* AddDialogue(UDialoguePath* DialoguePath, FText TextInput); UDialoguePath* AddDialogue(UDialoguePath* DialoguePath, FText TextInput);