Skip to content

Available Calls

direwolf420 edited this page Aug 1, 2023 · 21 revisions

Here are all currently available and newly added calls.

Technical breakdown/listing can be found on the main mod's repo. Change to the 1.3 branch if needed.

Any changes to existing calls will be documented here.

Documentation and call wrappers here (possibly indated if on 1.3 tml, navigate to branches, swap to tags, and pick the latest version if you need to)

Version 1.4.0:

Updated ClickerCompat

  • Additions/Changes
    • Changes are breaking due to tml 1.4.4 being a breaking update aswell
    • Added SetSFXButtonDefaults, used for setting the properties of an SFX Button in SetDefaults
    • Added RegisterSFXButton, used for registering an SFX Button with a PlaySound callback
    • Added IsSFXButton, used for checking if an item is an SFX Button
    • Added GetSFXButton, used for retrieving the PlaySound callback of an SFX Button
    • Added GetAllSFXButtonStacks, used for retrieving all currently active "SFX Button stacks
    • Added AddSFXButtonStack, used for manually adding to the given SFX Button's stack
    • SetAccessory/GetAccessory: Moved GoldenTicket to SetAccessoryItem/GetAccessoryItem
    • RegisterClickEffect: Changed parameters - string displayName, string description gone, replaced with object[] nameArgs = null, object[] descriptionArgs = null which are bound on load. Text is autoloaded like before (you will see them appear in the localization file now), new args allow for formatting
    • GetClickEffectAsDict: Changed types of the object values: DisplayName and Description are changed from string to LocalizedText
    • Localization:
      • Your clicker tooltips should look like this: Tooltip: "{$Mods.ClickerClass.Common.Tooltips.Clicker}"
      • ClickEffect text is now automatically populated

Version 1.3.3:

Updated ClickerCompat

  • Additions/Changes
    • Added optional parameter preHardMode to RegisterClickEffect, indicating if the registered clicker effect is obtainable in Pre-Hardmode. Used in Clicker Class for the Burning Super Death Clicker.

Version 1.3.2.6:

Updated ClickerCompat

  • Clicker Class Changes

    • Auto-reuse was reworked - clickers will never auto-reuse unless you use the new API calls. Revisit them if your mod added auto-reuse to clickers.
  • Additions/Changes

    • Added SetAccessoryType, allowing accessories to control if they belong to an archetype so that they won't be able to be equipped alongside eachother
    • Added SetAutoReuseEffect, allowing clickers to get auto-reused with customized speed, optional hotkey and clicker effect proc disabling.
    • SetAccessory/GetAccessory: Removed "HandCream" and "IcePack" as options
      • Has not been made backwards compatible, due to internal changes in Clicker Class, aswell as encouraging use of the new API
      • Fetching the status of enabled auto reuse effects is not possible. Let us know if you have a valid use case for it if you need it back

Version 1.3.2.4:

Updated ClickerCompat

  • Fixes
    • Fixed ClickerCompat.GetClickerPerSecond, now returns float

Version 1.3.2:

Updated ClickerCompat

  • IMPORTANT

    • Make sure to use the position for ClickEffects instead of Main.MouseWorld for compatibility with new accessories.
  • Additions/Changes

    • Added more options for accessory/armor set calls to mirror new content

Version 1.3:

Updated ClickerCompat

  • 1.4 Update!

    • Now works with the associated tml release for Terraria 1.4 content
    • Obsolete/Outdated calls from 1.3 are no longer supported in 1.4
  • ClickerCompat changes

    • No more manually calling Load and Unload
  • Additions/Changes

    • Added more options for accessory/armor set calls to mirror new content
    • Added GetAccessoryItem/SetAccessoryItem for accessories that cause projectile spawning (for proper tracking of IProjectileSource)
    • Added SetClickerProjectileDefaults, IsClickerWeaponProj, and RegisterClickerWeaponProjectile
    • Color value of the GetClickEffectAsDict return is now Func<Color>
    • Action value of the GetClickEffectAsDict return now has ProjectileSource_Item_WithAmmo as it's second parameter
    • RegisterClickEffect now has a Func<Color> overload
    • Action parameter of RegisterClickEffect now has ProjectileSource_Item_WithAmmo as it's second parameter
    • GetAccessory/SetAccessory changes:
      • EnchantedLED2now available
      • Cookie now changed to CookieVisual and CookieVisual2 for one of the two possible visuals for cookies. Use in conjunction with GetAccessoryItem/SetAccessoryItem+ Cookie

Updated ClickerClassExampleMod:

  • Please revisit the examples again to see how the new calls are used and which new calls are now mandatory

Version 1.2.6:

Updated ClickerCompat

  • Fixes

    • Fixed some outdated calls not being handled properly
  • Additions/Changes

    • GetAccessory/SetAccessory now accepts "GoldenTicket" and "PortableParticleAccelerator"
    • Added SetDisplayMoneyGenerated

Version 1.2.4:

Updated ClickerCompat

  • Fixes

    • Fixed several SetPlayerStat stat limits: clickerCrit, clickerDamage, clickerBonus, clickerBonusPercent and clickerRadius
  • Additions/Changes

    • RegisterClickEffect accepts null for display name and description, useful if you wish to also use .lang for your mod
    • GetClickEffectAsDict changed "InternalName" representation, added "Mod" and "UniqueName" keys

Version 1.2.2:

Updated ClickerCompat

  • Fixes

    • Fixed GetPlayerStat->clickAmountTotal call not working at all, now also requires an effect name as a parameter
  • Removals/Changes

    • Reminder that all of these are still backwards compatible, you don't HAVE to update your mod immediately
    • SetAmount is deleted
    • SetEffect is obsolete
    • GetAccessory/SetAccessory->ChocolateChip/StickyKeychain is obsolete
  • Additions/Changes

    • Added borderTexture parameter for RegisterClickerWeapon
    • Added GetPathToBorderTexture
    • Added RegisterClickEffect, IsClickEffect, AddEffect, GetAllEffectNames, GetClickEffectAsDict, EnableClickEffect and HasClickEffect
    • Added GetPlayerStat->clickerPerSecond

Updated ClickerClassExampleMod:

  • Added an advanced clicker weapon, with a custom outline, adding a custom effect which uses a custom clicker projectile
    • Revisit the weapon clicker guide on the wiki for updated instructions

Version 1.2.1:

Updated ClickerCompat

  • Fixed ClickerCompat.GetClickAmount() and ClickerCompat.GetClickerAmountTotal() returning float instead of int (API Breaking, update your mod if you were using that previously)

  • Added Get and Set calls for accessory effects, and Get calls for armor sets:

    GetArmorSet options: Motherboard, Overclock, Precursor, Mice

    GetAccesory options: ChocolateChip, EnchantedLED, HandCream, StickyKeychain, GlassOfMilk, Cookie, ClickingGlove, AncientClickingGlove, RegalClickingGlove

    SetAccessory options: ChocolateChip, EnchantedLED, EnchantedLED2, HandCream, StickyKeychain, GlassOfMilk, Cookie, Cookie2, ClickingGlove, AncientClickingGlove, RegalClickingGlove

Version 1.2:

Initial release calls

Versions before 1.2:

No calls