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(isHealingItem == true)
|
||||
{
|
||||
if (Character->Health < 100)
|
||||
{
|
||||
Character->Health += 10;
|
||||
UE_LOG(LogTemp, Display, TEXT("Healed"));
|
||||
//delete itself
|
||||
Character->Inventory->RemoveItem(this);
|
||||
|
||||
}
|
||||
else if (Character->Health >= 100)
|
||||
{
|
||||
UE_LOG(LogTemp, Display, TEXT("Health is full"));
|
||||
}
|
||||
}
|
||||
if(isDamageBuffItem == true)
|
||||
{
|
||||
|
@ -24,6 +24,7 @@ void ATempCharacter::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
Health = 100;
|
||||
ThisCamera = Cast<UCameraComponent>(this->FindComponentByClass<UCameraComponent>());
|
||||
}
|
||||
|
||||
//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>())
|
||||
{
|
||||
UE_LOG(LogTemp, Display, TEXT("Hit Merchant"));
|
||||
auto ItemArray = OutHit.GetActor()->FindComponentByClass<UInventoryComponent>()->GetItem(0);
|
||||
if(GoldBalance >= ItemArray->ItemCostPrice)
|
||||
{
|
||||
@ -139,13 +141,13 @@ void ATempCharacter::LineTraceLogic()
|
||||
void ATempCharacter::InputDisabler()
|
||||
{
|
||||
UE_LOG(LogTemp, Display, TEXT("Disabling playermovement"));
|
||||
disableTab = true;
|
||||
//GetWorld()->GetFirstPlayerController()->InputComponent->RemoveActionBinding("Interact", IE_Pressed);
|
||||
GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(true);
|
||||
GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(true);
|
||||
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = true;
|
||||
GetWorld()->GetFirstPlayerController()->bEnableClickEvents = true;
|
||||
GetWorld()->GetFirstPlayerController()->bEnableMouseOverEvents = true;
|
||||
ThisCamera = Cast<UCameraComponent>(this->FindComponentByClass<UCameraComponent>());
|
||||
if (ThisCamera == nullptr)
|
||||
{
|
||||
return;
|
||||
@ -163,6 +165,7 @@ void ATempCharacter::InputDisabler()
|
||||
void ATempCharacter::InputEnabler()
|
||||
{
|
||||
UE_LOG(LogTemp, Display, TEXT("Enabling Inputs"));
|
||||
disableTab = true;
|
||||
GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(false);
|
||||
GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(false);
|
||||
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = false;
|
||||
@ -170,7 +173,6 @@ void ATempCharacter::InputEnabler()
|
||||
GetWorld()->GetFirstPlayerController()->bEnableMouseOverEvents = false;
|
||||
//GetWorld()->GetFirstPlayerController()->InputComponent->BindAction("Interact", IE_Pressed, this, &ATempCharacter::KeyPressed);
|
||||
TraceDistance = 300;
|
||||
ThisCamera = Cast<UCameraComponent>(this->FindComponentByClass<UCameraComponent>());
|
||||
if (ThisCamera == nullptr)
|
||||
{
|
||||
return;
|
||||
|
@ -78,4 +78,7 @@ public:
|
||||
|
||||
bool bShopKeeperText = false;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite)
|
||||
bool disableTab = false;
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user