diff --git a/Content/Blueprints/Inventory_UI/WBP_ItemDisplay.uasset b/Content/Blueprints/Inventory_UI/WBP_ItemDisplay.uasset index 3980322..708a5d3 100644 --- a/Content/Blueprints/Inventory_UI/WBP_ItemDisplay.uasset +++ b/Content/Blueprints/Inventory_UI/WBP_ItemDisplay.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:48426ed97184a867232380e93324520aeef1c39e773c7155c7caab764aa7f54a -size 86683 +oid sha256:1d2dacba46200972bd3ed39b2e006c6f815eed957e4cb57009fd850d3565dd6f +size 99076 diff --git a/Content/Blueprints/Inventory_UI/WBP_PlayerInventory.uasset b/Content/Blueprints/Inventory_UI/WBP_PlayerInventory.uasset index d2d7739..138ec00 100644 --- a/Content/Blueprints/Inventory_UI/WBP_PlayerInventory.uasset +++ b/Content/Blueprints/Inventory_UI/WBP_PlayerInventory.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4177a97bce273fa21e43e1d37185390f84f3055fe4af730ea21754e8f3715246 -size 108778 +oid sha256:6077e113d99db0e0e7e66e52dc856fe1cf0473f23377f7d00f4e9ca187069ee1 +size 111320 diff --git a/Content/Blueprints/Player/BP_MyTempCharacter.uasset b/Content/Blueprints/Player/BP_MyTempCharacter.uasset index d369a35..68f202b 100644 --- a/Content/Blueprints/Player/BP_MyTempCharacter.uasset +++ b/Content/Blueprints/Player/BP_MyTempCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0954984bc9728f0b7488017e75a199b474190a8b9ff5412cc7869aece4c93b46 -size 54779 +oid sha256:df9e97f92efc6e557cb50693743a5db37bb9b97703afeccf8d1452b5886931ea +size 66442 diff --git a/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp b/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp index cc2c535..ceae474 100644 --- a/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp +++ b/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp @@ -18,11 +18,17 @@ void UEatableItems::Use(ATempCharacter* Character) { if(isHealingItem == true) { - Character->Health += 10; - UE_LOG(LogTemp, Display, TEXT("Healed")); - //delete itself - Character->Inventory->RemoveItem(this); - + 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) { diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp index b17f9db..1062d20 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp @@ -24,6 +24,7 @@ void ATempCharacter::BeginPlay() { Super::BeginPlay(); Health = 100; + ThisCamera = Cast(this->FindComponentByClass()); } //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()) { + UE_LOG(LogTemp, Display, TEXT("Hit Merchant")); auto ItemArray = OutHit.GetActor()->FindComponentByClass()->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(this->FindComponentByClass()); 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(this->FindComponentByClass()); if (ThisCamera == nullptr) { return; diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h index 928b8df..510587b 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h @@ -77,5 +77,8 @@ public: void BuyItem(); bool bShopKeeperText = false; + + UPROPERTY(BlueprintReadWrite) + bool disableTab = false; };