Thread Tools Display Modes
Prev Previous Post   Next Post Next
11-18-14, 05:22 AM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Garrison Follower Item Level API

Has anyone worked with garrison followers already?

Is it possible to generate a tooltip/info window in the follower overview that generates the follower items and itemlevel?

API: http://wowprogramming.com/docs/api

The following functions sound interesting
  • C_Garrison.GetFollowerInfo
  • C_Garrison.GetFollowerItemLevelAverage
  • C_Garrison.GetFollowerItems
It would be super helpful if one could enhance the follower view by that information.



Useful files seem to be:

https://github.com/tekkub/wow-ui-sou...werTooltip.lua
https://github.com/tekkub/wow-ui-sou...werTooltip.xml
https://github.com/tekkub/wow-ui-sou...werTooltip.lua
https://github.com/tekkub/wow-ui-sou...werTooltip.xml
https://github.com/tekkub/wow-ui-sou...ard_GarrisonUI

That button on the minimap seems to link to:
https://github.com/tekkub/wow-ui-sou...andingPage.lua
https://github.com/tekkub/wow-ui-sou...gPage.xml#L573

Hmm...

There are frames for itemArmor, itemWeapon and itemAverageLevel already.
https://github.com/tekkub/wow-ui-sou...gPage.xml#L797

Interesting...actually the info should be there. Here is the condition that will show items for a given follower.

https://github.com/tekkub/wow-ui-sou...lates.lua#L787

GarrisonFollowerPage_SetItem generates the items and shows the frame if items are found.

https://github.com/tekkub/wow-ui-sou...lates.lua#L595

Hmm.

So the info should be there right? Maybe sth on the condition is odd preventing it from firing properly.

Hmm yeah. Actually there is. The condition checks for landing page. And the item level is not displayed if isLandingPage is true.

But what other follower lists do we have?

Hmmm....

I'm curious what this might do

lua Code:
  1. local function AfterGarrisonFollowerPage_ShowFollower(self,followerID)
  2.   print(followerID)
  3.   local followerInfo = C_Garrison.GetFollowerInfo(followerID)
  4.   local weaponItemID, weaponItemLevel, armorItemID, armorItemLevel = C_Garrison.GetFollowerItems(followerInfo.followerID)
  5.   print(weaponItemID, weaponItemLevel, armorItemID, armorItemLevel)
  6.   GarrisonFollowerPage_SetItem(self.ItemWeapon, weaponItemID, weaponItemLevel)
  7.   GarrisonFollowerPage_SetItem(self.ItemArmor, armorItemID, armorItemLevel)
  8.   self.ItemAverageLevel.Level:SetText(ITEM_LEVEL_ABBR.." ".. followerInfo.iLevel)
  9.   self.ItemAverageLevel.Level:Show()
  10. end
  11.  
  12. hooksecurefunc("GarrisonFollowerPage_ShowFollower",AfterGarrisonFollowerPage_ShowFollower)
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 11-18-14 at 06:56 AM.
  Reply With Quote
 

WoWInterface » Developer Discussions » General Authoring Discussion » Garrison Follower Item Level API


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off