frozn / TipTac

WoW AddOn TipTac Reborn
GNU General Public License v3.0
108 stars 20 forks source link

feat: add target mount to tooltip #201

Closed mrchops1024 closed 1 year ago

mrchops1024 commented 1 year ago

This closes #138

Dairyman commented 1 year ago

Don't use MOUNT as singular noun, it translate to Aufsteigen in German and other languages. RAF_BENEFIT5 or PERKS_VENDOR_CATEGORY_MOUNT translates to Reittier. Or RENOWN_REWARD_MOUNT_NAME_FORMAT which is Reittier: %s / Mount: %s.

Source: GlobalStrings.lua

mrchops1024 commented 1 year ago

Don't use MOUNT as singular noun, it translate to Aufsteigen in German and other languages. RAF_BENEFIT5 or PERKS_VENDOR_CATEGORY_MOUNT translates to Reittier. Or RENOWN_REWARD_MOUNT_NAME_FORMAT which is Reittier: %s / Mount: %s.

Source: GlobalStrings.lua

I thought this might come up, as I don't have much experience in this area. I actually was using RENOWN_REWARD_MOUNT_NAME_FORMAT and changed my mind at the last minute. I'll revert that back and push the change. Thanks.

frozn commented 1 year ago

Thanks for the pull request! 👍

After merging your changes, I applied the following bunch of changes/additions:

  1. Instead of remembering the mount ids from spell ids we can use the function C_MountJournal.GetMountFromSpell(spellID) to get the mount id.
  2. Instead of looping manually over auras we can use AuraUtil.ForEachAura(unitID, filter, maxCount, func[, usePackedAura]).
  3. Added icon and speed of mount. To get the speed, we need to call C_TooltipInfo.GetUnitAura(unitID, index, filter) and parse the tooltip data.
  4. Added displaying of mount id if hovering over mount aura or spell.
  5. Added compatibility to WotLKC and Classic Era / Vanilla. This has been a pain, because the mentioned functions in 1.-3. doesn't exist in classic code. So I added the following functions to LibFroznFunctions: GetMountFromSpell() (fallback to pregenerated table), GetAuraDescription() (fallback to scanning tooltip), ForEachAura() (fallback to manual looping over auras). The localized string RENOWN_REWARD_MOUNT_NAME_FORMAT doesn't exist in classic, but there isn't a appropriate alternative. So I use the fixed string Mount: %s as a fallback.

This will be included in the next release. 🙂