# TradeButton

`TradeButton` handles Inputs like Pointer Enter, Pointer Exit, or Click Events to the Shop UI & Shop. It allows the interaction between the Shop and the Player, and contains essential base classes for [`ShopButton` ](https://cowsinss-organization.gitbook.io/inventory-pro-add-on-documentation/content/03.-content/03.7-shop/shopbutton)& [`CraftButton`](https://cowsinss-organization.gitbook.io/inventory-pro-add-on-documentation/content/03.-content/03.1-crafting/craftingbutton).

***

* <mark style="color:purple;">iconImage:</mark> UI Image that displays the Icon of the Item to Trade.
* <mark style="color:purple;">actionButton:</mark> Button that performs the Trade Action
* <mark style="color:purple;">nameText:</mark> Text that displays the Name of the Item to Trade.
* <mark style="color:purple;">callToActionText:</mark> Text that displays the Call To Action: "Purchase", "Craft", etc...
* <mark style="color:purple;">amountInputField:</mark> Input Field that displays the current amount to trade
* <mark style="color:purple;">highlightedScaleMultiplier:</mark> When hovered, the TradeButton Scale changes. Being 1 = default scale, this defines the scale of the button when hovered.
* <mark style="color:purple;">scaleLerpSpeed:</mark> Defines how fast the Button scales from the default scale to the highlightedScale when hovered and viceversa.
* <mark style="color:purple;">lockedContainer:</mark> UI that is enabled when the object to trade is locked.
* <mark style="color:purple;">lockedText:</mark> Text that displays the reason why the object to trade is locked.
* <mark style="color:purple;">previousAmountButton:</mark> Buttons that handle amount decrease.
* <mark style="color:purple;">nextAmountButton:</mark> Buttons that handle amount increase.

***

### Getters | TradeButton.cs&#x20;

> <mark style="color:orange;">\_TradeHub</mark>
>
> Returns a Reference to the assigned TradeHub.

### Functions | TradeButton.cs

> <mark style="color:green;">PointerEnter() | Virtual Method, can be overrided</mark>
>
> Called when pointer enters the Button.

> <mark style="color:green;">PointerExit() | Virtual Method, can be overrided.</mark>
>
> Called when pointer exits the Button.

> <mark style="color:green;">AddItemToInventory(Item\_SO item, int amount) | Protected method</mark>
>
> Adds an Item\_So and the given amount to the Inventory ( Supports Weapon\_SOs, Bullets\_SOs & AttachmentIdentifier\_SOs )
