From 8cd6b4ae2e6ba5f5021a0016d48cfe59ac660c09 Mon Sep 17 00:00:00 2001 From: Alar of Daggerspine Date: Tue, 18 Nov 2014 09:37:23 +0100 Subject: [PATCH] Initial commit Signed-off-by: Alar of Daggerspine --- .gitignore | 2 ++ .pkgmeta | 18 ++++++++++ CHANGELOG.txt | 9 +++++ GarrisonCommander.lua | 87 +++++++++++++++++++++++++++++++++++++++++++++++++ GarrisonCommander.toc | 29 +++++++++++++++++ GarrisonCommander.xml | 27 +++++++++++++++ RelNotes.lua | 23 +++++++++++++ embeds.xml | 17 ++++++++++ localization.lua | 55 +++++++++++++++++++++++++++++++ 9 files changed, 267 insertions(+) create mode 100644 .gitignore create mode 100755 .pkgmeta create mode 100644 CHANGELOG.txt create mode 100644 GarrisonCommander.lua create mode 100644 GarrisonCommander.toc create mode 100644 GarrisonCommander.xml create mode 100644 RelNotes.lua create mode 100644 embeds.xml create mode 100644 localization.lua diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..139597f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + + diff --git a/.pkgmeta b/.pkgmeta new file mode 100755 index 0000000..8d337a7 --- /dev/null +++ b/.pkgmeta @@ -0,0 +1,18 @@ +package-as: GarrisonCommander +enable-nolib-creation: no + +externals: + libs/AlarShared-3.0: + url: git://git.curseforge.net/wow/alar-art-remover/mainline.git/libs/AlarShared-3.0 + libs/Ace3: + url: svn://svn.wowace.com/wow/ace3/mainline/trunk + tag: latest + +manual-changelog: + filename: CHANGELOG.txt + markup-type: creole + + +ignore: +- .buildpath +- .project \ No newline at end of file diff --git a/CHANGELOG.txt b/CHANGELOG.txt new file mode 100644 index 0000000..6b8f5ec --- /dev/null +++ b/CHANGELOG.txt @@ -0,0 +1,9 @@ += GarrisonCommander helps you when choosing the right follower for the right mission = +== Description == +GarrisonCommander adds to mission tooltips the following informations: +* base success chance +* list of follower that have the necessary counters for the mission, with their status (on mission, available etc) + +== Future plans == +# Showing information in an overlay on mission buttons to have all needed information for all missions at a glance +# Mission assign optimizer: I think I could also propone the best assignment to maximise your chances of success diff --git a/GarrisonCommander.lua b/GarrisonCommander.lua new file mode 100644 index 0000000..75de59d --- /dev/null +++ b/GarrisonCommander.lua @@ -0,0 +1,87 @@ +local __FILE__=tostring(debugstack(1,2,0):match("(.*):1:")) -- MUST BE LINE 1 +local toc=select(4,GetBuildInfo()) +local me, ns = ... +local pp=print +if (LibDebug) then LibDebug() end +local L=LibStub("AceLocale-3.0"):GetLocale(me,true) +local C=LibStub("AlarCrayon-3.0"):GetColorTable() +local addon=LibStub("AlarLoader-3.0")(__FILE__,me,ns):CreateAddon(me,true) --#Addon +local print=ns.print or print +local debug=ns.debug or print +--@debug@ +ns.debugEnable('on') +--@end-debug@ +----------------------------------------------------------------- +local followerIndexes +local followers +function addon:dump(...) + print("dump",...) +end +function addon:TooltipAdder(missionID) +--@debug@ + GameTooltip:AddLine("ID:" .. tostring(missionID)) +--@end-debug@ + local _,_,_,perc=C_Garrison.GetPartyMissionInfo(missionID) + local difficulty='impossible' + if (perc > 99) then + difficulty='trivial' + elseif(perc >64) then + difficulty='standard' + elseif (perc >49) then + difficulty='difficult' + elseif(perc>34) then + difficulty='verydifficult' + end + local q=QuestDifficultyColors[difficulty] + GameTooltip:AddLine(format(GARRISON_MISSION_PERCENT_CHANCE,perc),q.r,q.g,q.b) + GameTooltip:AddLine(GARRISON_FOLLOWER_CAN_COUNTER) + local buffed=self:NewTable() + for id,d in pairs(C_Garrison.GetBuffedFollowersForMission(missionID)) do + buffed[id]=true + end + local followerList=GarrisonMissionFrameFollowers.followersList + for j=1,#followerList do + local index=followerList[j] + local follower=followers[index] + if (not follower.garrFollowerID) then return end + local b=buffed[follower.followerID] + if (b) then + if (follower.status) then + GameTooltip:AddDoubleLine(follower.name, follower.status or AVAILABLE,1,1,0,1,0,0) + else + GameTooltip:AddDoubleLine(follower.name, follower.status or AVAILABLE,1,1,0,0,1,0) + end + end + end + self:DelTable(buffed) +end +function addon:FillFollowersList() + if (GarrisonFollowerList_UpdateFollowers) then + GarrisonFollowerList_UpdateFollowers(GarrisonMissionFrame.FollowerList) + end +end +function addon:CacheFollowers() + followers=C_Garrison.GetFollowers() +end + +function addon:OnInitialized() + self:FillFollowersList() + self:CacheFollowers() +end +function addon:OnDisabled() + self:UnhookAll() +end +local hooks={ + "GarrisonMissionList_Update", + "GarrisonMissionButton_OnEnter", + "GarrisonFollowerList_OnShow", +} +function addon:OnEnabled() + + for _,f in pairs(hooks) do + self[f]=function(...) debug(f,...) end + self:SecureHook(f,f) + end + self:SecureHook("GarrisonMissionButton_AddThreatsToTooltip","TooltipAdder") + self:SecureHook("GarrisonFollowerList_UpdateFollowers","CacheFollowers") +end diff --git a/GarrisonCommander.toc b/GarrisonCommander.toc new file mode 100644 index 0000000..623a977 --- /dev/null +++ b/GarrisonCommander.toc @@ -0,0 +1,29 @@ +## Interface: 60000 +## Title: Alar:GarrisonCommander +## Notes: Helps you when choosing the right follower for the right mission +## Notes-itIT: Ti aiuta a scegliere il giusto seguace per la giusta missione +## Author: Alar of Daggerspine +## Version: @project-version@ @project-abbreviated-hash@ +## X-Version: 1.0.0 +## X-Revision: @project-abbreviated-hash@ +## eMail: alar@aspide.it +## URL: http://wow.aspide.it +## RequiredDeps: Blizzard_GarrisonUI +## OptionalDeps: AlarArtRemover +## DefaultState: Enabled +## LoadOnDemand: 1 +## LoadWith: Blizzard_GarrisonUI +## SavedVariables: dbGAC +## X-ID: GAC +## X-Database:dbGAC +## X-Category: Garrison +## X-ID: MRF +## X-Database: dbMRF +## X-License: GPL v3 +## X-eMail: alar@aspide.it +## X-Date: @project-date-iso@ +## X-Embeds: +embeds.xml +localization.lua +GarrisonCommander.xml +RelNotes.lua diff --git a/GarrisonCommander.xml b/GarrisonCommander.xml new file mode 100644 index 0000000..0ead230 --- /dev/null +++ b/GarrisonCommander.xml @@ -0,0 +1,27 @@ + + +