How to Use?
BPC_CurrencyManager
The provided component BPC_CurrencyManager is responsible for handling currency operations using the functions below:
TryIncreaseCurrency:
This function will try to increase target currency by the provided amount.
Will call the function “IncreaseCurrency” inside PDA_CurrencyBase, which does all the calculations for the operation.
TryDecreaseCurrency:
This function will try to decrease target currency by the provided amount.
Will call the function “DecreaseCurrency” inside PDA_CurrencyBase, which does all the calculations for the operation.
HasEnoughCurrency:
This pure function attempts to check if there is enough "Amount" of target "Currency".
Can be used for your custom in-game behaviour, such as when buying items.
GetActiveCurrencies:
This is a simple getter function that can be used to retrieve all “Active” currencies.
ActiveCurrencies[] are the currencies that you’ve added to W_MasterCurrency.
GetAllCurrenciesFromRegistry:
This is a simple getter function that can be used to retrieve ALL currencies.
GetCurrencyInfo & GetCurrencyValue:
These functions can be used to retrieve information about the target “Currency”.
TryResetCurrency & TryResetAllCurrencies:
These functions can be used to reset all currencies’ or a specific currency’s “CurrentValue” to 0.
SaveAllCurrencies & LoadAllCurrencies:
These functions can be used to save all currencies’ Current Values, utilising their GUID.
An example usage for these functions can be found inside /Demo/BP_Player.