Merge remote-tracking branch 'origin/merchant-system-v4' into dev
This commit is contained in:
commit
a16de31aa2
BIN
Content/Blueprints/Inventory_UI/WBP_ItemDisplay.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Inventory_UI/WBP_ItemDisplay.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Inventory_UI/WBP_PlayerInventory.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Inventory_UI/WBP_PlayerInventory.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Player/BP_MyTempCharacter.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Player/BP_MyTempCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
@ -17,12 +17,18 @@ void UEatableItems::Use(ATempCharacter* Character)
|
|||||||
if(Character)
|
if(Character)
|
||||||
{
|
{
|
||||||
if(isHealingItem == true)
|
if(isHealingItem == true)
|
||||||
|
{
|
||||||
|
if (Character->Health < 100)
|
||||||
{
|
{
|
||||||
Character->Health += 10;
|
Character->Health += 10;
|
||||||
UE_LOG(LogTemp, Display, TEXT("Healed"));
|
UE_LOG(LogTemp, Display, TEXT("Healed"));
|
||||||
//delete itself
|
//delete itself
|
||||||
Character->Inventory->RemoveItem(this);
|
Character->Inventory->RemoveItem(this);
|
||||||
|
}
|
||||||
|
else if (Character->Health >= 100)
|
||||||
|
{
|
||||||
|
UE_LOG(LogTemp, Display, TEXT("Health is full"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(isDamageBuffItem == true)
|
if(isDamageBuffItem == true)
|
||||||
{
|
{
|
||||||
|
@ -24,6 +24,7 @@ void ATempCharacter::BeginPlay()
|
|||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
Health = 100;
|
Health = 100;
|
||||||
|
ThisCamera = Cast<UCameraComponent>(this->FindComponentByClass<UCameraComponent>());
|
||||||
}
|
}
|
||||||
|
|
||||||
//Binds the input we made in the setup player component to the forward vector
|
//Binds the input we made in the setup player component to the forward vector
|
||||||
@ -85,6 +86,7 @@ void ATempCharacter::LineTraceLogic()
|
|||||||
}
|
}
|
||||||
if(OutHit.GetActor()->FindComponentByClass<UInventoryComponent>())
|
if(OutHit.GetActor()->FindComponentByClass<UInventoryComponent>())
|
||||||
{
|
{
|
||||||
|
UE_LOG(LogTemp, Display, TEXT("Hit Merchant"));
|
||||||
auto ItemArray = OutHit.GetActor()->FindComponentByClass<UInventoryComponent>()->GetItem(0);
|
auto ItemArray = OutHit.GetActor()->FindComponentByClass<UInventoryComponent>()->GetItem(0);
|
||||||
if(GoldBalance >= ItemArray->ItemCostPrice)
|
if(GoldBalance >= ItemArray->ItemCostPrice)
|
||||||
{
|
{
|
||||||
@ -139,13 +141,13 @@ void ATempCharacter::LineTraceLogic()
|
|||||||
void ATempCharacter::InputDisabler()
|
void ATempCharacter::InputDisabler()
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Display, TEXT("Disabling playermovement"));
|
UE_LOG(LogTemp, Display, TEXT("Disabling playermovement"));
|
||||||
|
disableTab = true;
|
||||||
//GetWorld()->GetFirstPlayerController()->InputComponent->RemoveActionBinding("Interact", IE_Pressed);
|
//GetWorld()->GetFirstPlayerController()->InputComponent->RemoveActionBinding("Interact", IE_Pressed);
|
||||||
GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(true);
|
GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(true);
|
||||||
GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(true);
|
GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(true);
|
||||||
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = true;
|
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = true;
|
||||||
GetWorld()->GetFirstPlayerController()->bEnableClickEvents = true;
|
GetWorld()->GetFirstPlayerController()->bEnableClickEvents = true;
|
||||||
GetWorld()->GetFirstPlayerController()->bEnableMouseOverEvents = true;
|
GetWorld()->GetFirstPlayerController()->bEnableMouseOverEvents = true;
|
||||||
ThisCamera = Cast<UCameraComponent>(this->FindComponentByClass<UCameraComponent>());
|
|
||||||
if (ThisCamera == nullptr)
|
if (ThisCamera == nullptr)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -163,6 +165,7 @@ void ATempCharacter::InputDisabler()
|
|||||||
void ATempCharacter::InputEnabler()
|
void ATempCharacter::InputEnabler()
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Display, TEXT("Enabling Inputs"));
|
UE_LOG(LogTemp, Display, TEXT("Enabling Inputs"));
|
||||||
|
disableTab = true;
|
||||||
GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(false);
|
GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(false);
|
||||||
GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(false);
|
GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(false);
|
||||||
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = false;
|
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = false;
|
||||||
@ -170,7 +173,6 @@ void ATempCharacter::InputEnabler()
|
|||||||
GetWorld()->GetFirstPlayerController()->bEnableMouseOverEvents = false;
|
GetWorld()->GetFirstPlayerController()->bEnableMouseOverEvents = false;
|
||||||
//GetWorld()->GetFirstPlayerController()->InputComponent->BindAction("Interact", IE_Pressed, this, &ATempCharacter::KeyPressed);
|
//GetWorld()->GetFirstPlayerController()->InputComponent->BindAction("Interact", IE_Pressed, this, &ATempCharacter::KeyPressed);
|
||||||
TraceDistance = 300;
|
TraceDistance = 300;
|
||||||
ThisCamera = Cast<UCameraComponent>(this->FindComponentByClass<UCameraComponent>());
|
|
||||||
if (ThisCamera == nullptr)
|
if (ThisCamera == nullptr)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -78,4 +78,7 @@ public:
|
|||||||
|
|
||||||
bool bShopKeeperText = false;
|
bool bShopKeeperText = false;
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadWrite)
|
||||||
|
bool disableTab = false;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user