Updated BookUI for Cast & Clear Buttons
This commit is contained in:
parent
d0eaf37de7
commit
32e65e3f47
@ -81,7 +81,7 @@ DoubleClickTime=0.200000
|
|||||||
+ActionMappings=(ActionName="Jump",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_FaceButton_Bottom)
|
+ActionMappings=(ActionName="Jump",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_FaceButton_Bottom)
|
||||||
+ActionMappings=(ActionName="Jump",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=SpaceBar)
|
+ActionMappings=(ActionName="Jump",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=SpaceBar)
|
||||||
+ActionMappings=(ActionName="Interact",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=E)
|
+ActionMappings=(ActionName="Interact",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=E)
|
||||||
+ActionMappings=(ActionName="RightClick",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=LeftMouseButton)
|
+ActionMappings=(ActionName="Click",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=LeftMouseButton)
|
||||||
+ActionMappings=(ActionName="Sneak",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=LeftControl)
|
+ActionMappings=(ActionName="Sneak",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=LeftControl)
|
||||||
+AxisMappings=(AxisName="Look Up / Down Gamepad",Scale=1.000000,Key=Gamepad_RightY)
|
+AxisMappings=(AxisName="Look Up / Down Gamepad",Scale=1.000000,Key=Gamepad_RightY)
|
||||||
+AxisMappings=(AxisName="Look Up / Down Mouse",Scale=-1.000000,Key=MouseY)
|
+AxisMappings=(AxisName="Look Up / Down Mouse",Scale=-1.000000,Key=MouseY)
|
||||||
|
BIN
Content/Blueprints/Combat_UI/BookCombat_UI.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Combat_UI/BookCombat_UI.uasset
(Stored with Git LFS)
Binary file not shown.
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/Blueprints/Combat_UI/__RealTime/CombatCharacterRT.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Combat_UI/__RealTime/CombatCharacterRT.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Combat_UI/__RealTime/Combat_UI_RT.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Combat_UI/__RealTime/Combat_UI_RT.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Combat_UI/__RealTime/RealTimeCombatTest.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Combat_UI/__RealTime/RealTimeCombatTest.uasset
(Stored with Git LFS)
Binary file not shown.
@ -9,7 +9,6 @@
|
|||||||
#include "BehaviorTree/BlackboardComponent.h"
|
#include "BehaviorTree/BlackboardComponent.h"
|
||||||
#include "Components/TextBlock.h"
|
#include "Components/TextBlock.h"
|
||||||
#include "Components/ProgressBar.h"
|
#include "Components/ProgressBar.h"
|
||||||
#include "GameFramework/Character.h"
|
|
||||||
#include "Kismet/GameplayStatics.h"
|
#include "Kismet/GameplayStatics.h"
|
||||||
#include "the_twilight_abyss/PlayerTemp/TempCharacter.h"
|
#include "the_twilight_abyss/PlayerTemp/TempCharacter.h"
|
||||||
|
|
||||||
@ -36,6 +35,7 @@ ATurnBaseCombatV2::ATurnBaseCombatV2()
|
|||||||
void ATurnBaseCombatV2::StartCombat(AActor* Enemy)
|
void ATurnBaseCombatV2::StartCombat(AActor* Enemy)
|
||||||
{
|
{
|
||||||
if (Enemy == nullptr) return;
|
if (Enemy == nullptr) return;
|
||||||
|
if (bIsInCombat) return;
|
||||||
const FVector2D ViewportSize = FVector2D(GEngine->GameViewport->Viewport->GetSizeXY());
|
const FVector2D ViewportSize = FVector2D(GEngine->GameViewport->Viewport->GetSizeXY());
|
||||||
GetWorld()->GetFirstPlayerController()->SetMouseLocation(ViewportSize.X / 2, ViewportSize.Y / 2);
|
GetWorld()->GetFirstPlayerController()->SetMouseLocation(ViewportSize.X / 2, ViewportSize.Y / 2);
|
||||||
bIsInCombat = true;
|
bIsInCombat = true;
|
||||||
@ -74,14 +74,10 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy)
|
|||||||
IroquoidResource = 10;
|
IroquoidResource = 10;
|
||||||
|
|
||||||
//Disable Character Movement
|
//Disable Character Movement
|
||||||
if (ACharacter* PlayerCharacter = Cast<ACharacter>(GetWorld()->GetFirstPlayerController()->GetPawn()))
|
|
||||||
{
|
|
||||||
PlayerCharacter->DisableInput(GetWorld()->GetFirstPlayerController());
|
|
||||||
}
|
|
||||||
//Set to UI Mode Only
|
|
||||||
APlayerController* PlayerController = GetWorld()->GetFirstPlayerController();
|
APlayerController* PlayerController = GetWorld()->GetFirstPlayerController();
|
||||||
|
PlayerController->SetIgnoreMoveInput(true);
|
||||||
PlayerController->SetInputMode(FInputModeUIOnly());
|
PlayerController->SetIgnoreLookInput(true);
|
||||||
|
PlayerController->SetInputMode(FInputModeGameAndUI());
|
||||||
PlayerController->bShowMouseCursor = true;
|
PlayerController->bShowMouseCursor = true;
|
||||||
|
|
||||||
FVector Direction = Enemy->GetActorLocation() - PlayerActor->GetActorLocation();
|
FVector Direction = Enemy->GetActorLocation() - PlayerActor->GetActorLocation();
|
||||||
@ -117,12 +113,10 @@ void ATurnBaseCombatV2::EndCombat()
|
|||||||
PlayerPawn->bUseControllerRotationYaw = true;
|
PlayerPawn->bUseControllerRotationYaw = true;
|
||||||
PlayerPawn->bUseControllerRotationPitch = true;
|
PlayerPawn->bUseControllerRotationPitch = true;
|
||||||
//Enable Character Movement
|
//Enable Character Movement
|
||||||
if (ACharacter* PlayerCharacter = Cast<ACharacter>(GetWorld()->GetFirstPlayerController()->GetPawn()))
|
|
||||||
{
|
|
||||||
PlayerCharacter->EnableInput(GetWorld()->GetFirstPlayerController());
|
|
||||||
}
|
|
||||||
//Set to Game Mode Only
|
//Set to Game Mode Only
|
||||||
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;
|
||||||
}
|
}
|
||||||
@ -160,13 +154,13 @@ void ATurnBaseCombatV2::BeginPlay()
|
|||||||
EisResourceBar = Cast<UProgressBar>(BookHUD->GetWidgetFromName("EisResourceBar"));
|
EisResourceBar = Cast<UProgressBar>(BookHUD->GetWidgetFromName("EisResourceBar"));
|
||||||
AzosResourceBar = Cast<UProgressBar>(BookHUD->GetWidgetFromName("AzosResourceBar"));
|
AzosResourceBar = Cast<UProgressBar>(BookHUD->GetWidgetFromName("AzosResourceBar"));
|
||||||
IroquoidResourceBar = Cast<UProgressBar>(BookHUD->GetWidgetFromName("IroquoidResourceBar"));
|
IroquoidResourceBar = Cast<UProgressBar>(BookHUD->GetWidgetFromName("IroquoidResourceBar"));
|
||||||
CastButton = Cast<UButton>(HUD->GetWidgetFromName("CastButton"));
|
CastButton = Cast<UButton>(BookHUD->GetWidgetFromName("Cast_Button"));
|
||||||
PButton = Cast<UButton>(HUD->GetWidgetFromName("PButton"));
|
PButton = Cast<UButton>(BookHUD->GetWidgetFromName("Probertium_Button"));
|
||||||
EButton = Cast<UButton>(HUD->GetWidgetFromName("EButton"));
|
EButton = Cast<UButton>(BookHUD->GetWidgetFromName("Eis_Button"));
|
||||||
AButton = Cast<UButton>(HUD->GetWidgetFromName("AButton"));
|
AButton = Cast<UButton>(BookHUD->GetWidgetFromName("Azos_Button"));
|
||||||
IButton = Cast<UButton>(HUD->GetWidgetFromName("IButton"));
|
IButton = Cast<UButton>(BookHUD->GetWidgetFromName("Iroquoid_Button"));
|
||||||
BackspaceButton = Cast<UButton>(HUD->GetWidgetFromName("BackspaceButton"));
|
BackspaceButton = Cast<UButton>(BookHUD->GetWidgetFromName("Clear_Button"));
|
||||||
RunButton = Cast<UButton>(HUD->GetWidgetFromName("RunButton"));
|
RunButton = Cast<UButton>(BookHUD->GetWidgetFromName("Escape_Button"));
|
||||||
CastButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::CastButtonOnClick);
|
CastButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::CastButtonOnClick);
|
||||||
PButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::PButtonOnClick);
|
PButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::PButtonOnClick);
|
||||||
EButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::EButtonOnClick);
|
EButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::EButtonOnClick);
|
||||||
@ -226,7 +220,7 @@ void ATurnBaseCombatV2::ExecuteCast(FString Combo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GunEffect)
|
if (GunEffect && !bIsInCombat)
|
||||||
{
|
{
|
||||||
const UStaticMeshComponent* GunComponent = Cast<UStaticMeshComponent>(PlayerActor->GetComponentsByTag(UPrimitiveComponent::StaticClass(), FName("Gun"))[0]);
|
const UStaticMeshComponent* GunComponent = Cast<UStaticMeshComponent>(PlayerActor->GetComponentsByTag(UPrimitiveComponent::StaticClass(), FName("Gun"))[0]);
|
||||||
const FVector GunLocationOffset = GunComponent->GetSocketTransform("Muzzle").TransformPosition(FVector(-100, 0, 0));
|
const FVector GunLocationOffset = GunComponent->GetSocketTransform("Muzzle").TransformPosition(FVector(-100, 0, 0));
|
||||||
@ -418,31 +412,56 @@ void ATurnBaseCombatV2::IButtonOnClick()
|
|||||||
|
|
||||||
void ATurnBaseCombatV2::BackspaceButtonOnClick()
|
void ATurnBaseCombatV2::BackspaceButtonOnClick()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (CurrentComboString.Len() <= 0)
|
if (CurrentComboString.Len() <= 0)
|
||||||
{
|
{
|
||||||
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Blank Combo"));
|
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Blank Combo"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ReuseActionPoint();
|
for (int i = 0; i < CurrentComboString.Len(); i++)
|
||||||
if (CurrentComboString.Right(1) == "P")
|
|
||||||
{
|
{
|
||||||
ProbertiumResource += 1;
|
if (CurrentComboString[i] == 'P')
|
||||||
|
{
|
||||||
|
ProbertiumResource += 1;
|
||||||
|
}
|
||||||
|
else if (CurrentComboString[i] == 'E')
|
||||||
|
{
|
||||||
|
EisResource += 1;
|
||||||
|
}
|
||||||
|
else if (CurrentComboString[i] == 'A')
|
||||||
|
{
|
||||||
|
AzosResource += 1;
|
||||||
|
}
|
||||||
|
else if (CurrentComboString[i] == 'I')
|
||||||
|
{
|
||||||
|
IroquoidResource += 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (CurrentComboString.Right(1) == "E")
|
CurrentComboString = "";
|
||||||
{
|
|
||||||
EisResource += 1;
|
|
||||||
}
|
|
||||||
else if (CurrentComboString.Right(1) == "A")
|
|
||||||
{
|
|
||||||
AzosResource += 1;
|
|
||||||
}
|
|
||||||
else if (CurrentComboString.Right(1) == "I")
|
|
||||||
{
|
|
||||||
IroquoidResource += 1;
|
|
||||||
}
|
|
||||||
CurrentComboString.RemoveAt(CurrentComboString.Len() - 1);
|
|
||||||
UpdateComboString(CurrentComboString);
|
UpdateComboString(CurrentComboString);
|
||||||
|
RevertActionPoints();
|
||||||
|
UpdateActionPoints();
|
||||||
UpdateResourceBars();
|
UpdateResourceBars();
|
||||||
|
// ReuseActionPoint();
|
||||||
|
// if (CurrentComboString.Right(1) == "P")
|
||||||
|
// {
|
||||||
|
// ProbertiumResource += 1;
|
||||||
|
// }
|
||||||
|
// else if (CurrentComboString.Right(1) == "E")
|
||||||
|
// {
|
||||||
|
// EisResource += 1;
|
||||||
|
// }
|
||||||
|
// else if (CurrentComboString.Right(1) == "A")
|
||||||
|
// {
|
||||||
|
// AzosResource += 1;
|
||||||
|
// }
|
||||||
|
// else if (CurrentComboString.Right(1) == "I")
|
||||||
|
// {
|
||||||
|
// IroquoidResource += 1;
|
||||||
|
// }
|
||||||
|
// CurrentComboString.RemoveAt(CurrentComboString.Len() - 1);
|
||||||
|
// UpdateComboString(CurrentComboString);
|
||||||
|
// UpdateResourceBars();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ATurnBaseCombatV2::RunButtonOnClick()
|
void ATurnBaseCombatV2::RunButtonOnClick()
|
||||||
|
Loading…
Reference in New Issue
Block a user