WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Garrison Follower Item Level API (https://www.wowinterface.com/forums/showthread.php?t=50499)

zork 11-18-14 05:22 AM

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)

zork 11-18-14 11:43 AM

Addon is finished and working.
http://www.wowinterface.com/download...owerItems.html

Tonyleila 11-18-14 02:45 PM

Hey zork love the addon! Now that you have some XP with the Garrison UI I have a request for the Garrison Mission Tabel :p. 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)

zork 11-19-14 03:34 AM

Check this: http://www.mmo-champion.com/threads/...son-Mission-UI

Addon: http://wow.curseforge.com/addons/com...sions-a2a-zip/

Tonyleila 11-19-14 05:44 AM


Thanks for the hint! Looks very promising!

SDPhantom 11-19-14 02:35 PM

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.

JDoubleU00 11-19-14 05:04 PM

Quote:

Originally Posted by zork (Post 300629)

Good job! I like and I am using this now.

thebdc 11-20-14 04:10 AM

Quote:

Originally Posted by SDPhantom (Post 300723)
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

SDPhantom 11-20-14 02:43 PM

Quote:

Originally Posted by thebdc (Post 300775)
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.

Tonyleila 11-24-14 12:48 PM

Currently MMOC shares this 2 great addons:
Master Plan (Looks 99% like my mockup :D)

Garrison Mission Manager (This is what I needed!)

sezz 11-24-14 07:03 PM

Quote:

Originally Posted by thebdc (Post 300775)
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.


All times are GMT -6. The time now is 12:23 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI