Quantcast Garrison Follower Item Level API - WoWInterface
Thread Tools Display Modes
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,739
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) | TDMOG

"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
11-18-14, 11:43 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
Addon is finished and working.
http://www.wowinterface.com/download...owerItems.html
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
11-18-14, 02:45 PM   #3
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 759
Hey zork love the addon! Now that you have some XP with the Garrison UI I have a request for the Garrison Mission Tabel . I'd like to have it more informative. Currently all important informations are hidden untill you klick the mission or the info only shows up on mouseover in a tooltip making it hard to compare what missions are the best to do.

I have made a small mockup to show what it coud look like:


1. Display needed Followers for a mission as Icon with Number on it ( I have used the Battelnet Chat icon here)
2. Display Icons of Ability and mission Types without having to mouseover them
3. Make borders or a checkmark onto the icons that show up in red or green if you have a follower to counter this spell

(4. Optional on the left side: Show max possible sucessrate with the followers you have currently available - still not shure if possible)
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________

Last edited by Tonyleila : 11-18-14 at 02:48 PM.
  Reply With Quote
11-19-14, 03:34 AM   #4
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
Check this: http://www.mmo-champion.com/threads/...son-Mission-UI

Addon: http://wow.curseforge.com/addons/com...sions-a2a-zip/
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
11-19-14, 05:44 AM   #5
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 759

Thanks for the hint! Looks very promising!
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________
  Reply With Quote
11-19-14, 02:35 PM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,866
I've been looking into modifying the GarrisonUI myself. Making the list show more mission detail seems like a good idea I might start working on. Among the list Tonyleila suggested, I'd like to see the base exp on the list as well. I was looking into making the remaining time display for in progress missions more accurate and change it into a different format, but it seems that is given to us as the string you see on each button.

Currently, I'm trying to write code for the missions to automatically claim rewards and turn in. With none of the Garrison API documented yet, it's proven a challenge, but I'm making some headway into getting it working. It's bugged me since beta that they're forcing us to wait for animations to play through in order to do so.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 11-19-14 at 02:39 PM.
  Reply With Quote
11-19-14, 05:04 PM   #7
JDoubleU00
A Scalebane Royal Guard
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 437
Originally Posted by zork View Post
Good job! I like and I am using this now.
  Reply With Quote
11-20-14, 04:10 AM   #8
thebdc
A Murloc Raider
Join Date: Mar 2011
Posts: 5
Originally Posted by SDPhantom View Post
Currently, I'm trying to write code for the missions to automatically claim rewards and turn in. With none of the Garrison API documented yet, it's proven a challenge, but I'm making some headway into getting it working. It's bugged me since beta that they're forcing us to wait for animations to play through in order to do so.
I'm the author of the Compact Missions addon linked above, and that took me some time to figure out, too. So here's how it works:
  1. Get all completed missions with C_Garrison.GetCompleteMissions(). That returns a table of objects.
  2. For each entry in the table you have to call C_Garrison.MarkMissionComplete, with the missionID member of the object as the only parameter
  3. A event "GARRISON_MISSION_COMPLETE_RESPONSE" will be fired, which you have to handle. The only argument that comes with the event is the mission id
  4. When handling the above envent, you have to call C_Garrison.CanOpenMissionChest, with the mission id as the only parameter. It returns true if the bonus chest can be opened
  5. If you can open the bonus chest you have to call C_Garrison.MissionBonusRoll, again with the mission id as the only parameter. That will fire the "GARRISON_MISSION_BONUS_ROLL_COMPLETE" event. You don't have to do anything with that one
  Reply With Quote
11-20-14, 02:43 PM   #9
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,866
Originally Posted by thebdc View Post
I'm the author of the Compact Missions addon linked above, and that took me some time to figure out, too. So here's how it works:
  1. Get all completed missions with C_Garrison.GetCompleteMissions(). That returns a table of objects.
  2. For each entry in the table you have to call C_Garrison.MarkMissionComplete, with the missionID member of the object as the only parameter
  3. A event "GARRISON_MISSION_COMPLETE_RESPONSE" will be fired, which you have to handle. The only argument that comes with the event is the mission id
  4. When handling the above event, you have to call C_Garrison.CanOpenMissionChest, with the mission id as the only parameter. It returns true if the bonus chest can be opened
  5. If you can open the bonus chest you have to call C_Garrison.MissionBonusRoll, again with the mission id as the only parameter. That will fire the "GARRISON_MISSION_BONUS_ROLL_COMPLETE" event. You don't have to do anything with that one
I figured as much last night and got a few tests done. There are a few hiccups here and there which requires the code to be run multiple times to get everything done.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
11-24-14, 12:48 PM   #10
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 759
Currently MMOC shares this 2 great addons:
Master Plan (Looks 99% like my mockup )

Garrison Mission Manager (This is what I needed!)
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________
  Reply With Quote
11-24-14, 07:03 PM   #11
sezz
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 100
Originally Posted by thebdc View Post
A event "GARRISON_MISSION_COMPLETE_RESPONSE" will be fired, which you have to handle. The only argument that comes with the event is the mission id
It's now missionID, canComplete, succeeded - I don't know when they added the last two, but now I can finally output success/failure and rewards in chat.
  Reply With Quote

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

Thread Tools
Display Modes

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