tModLoader v2024.03
A mod to make and play Terraria mods
CustomCurrencyManager Class Reference

Static Public Member Functions

static bool BuyItem (Player player, long price, int currencyIndex)
 
static bool CanAfford (Player player, long price, int currencyIndex=-1)
 
static void DrawSavings (SpriteBatch sb, int currencyIndex, float shopx, float shopy, bool horizontal=false)
 
static void GetPrices (Item item, out long calcForSelling, out long calcForBuying)
 
static void GetPriceText (int currencyIndex, string[] lines, ref int currentLine, long price)
 
static void Initialize ()
 
static bool IsCustomCurrency (Item item)
 
static bool PayCurrency (Player player, long price, int currencyIndex=-1)
 
static int RegisterCurrency (CustomCurrencySystem collection)
 
static bool TryGetCurrencySystem (int id, out CustomCurrencySystem system)
 Attempts to retrieve a CustomCurrencySystem object with the specified id from the _currencies dictionary. More...
 

Member Function Documentation

◆ TryGetCurrencySystem()

static bool CustomCurrencyManager.TryGetCurrencySystem ( int  id,
out CustomCurrencySystem  system 
)
static

Attempts to retrieve a CustomCurrencySystem object with the specified id from the _currencies dictionary.

Parameters
idThe id of the currency system to retrieve.
systemWhen this method returns, contains the retrieved CustomCurrencySystem object, or null if the retrieval failed.
Returns
true if the retrieval was successful; otherwise, false.