diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c332268..c20bb53 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,11 +1,14 @@ *GarrisonCommander helps you when choosing the right follower for the right mission* +* *2.6.8* +Fix: Works even if a certain addon is loaded + * *2.6.7* Feature: Shipyard mission autofill!! See the success chance in map and have your fleet automagically setup Fix: Consolidate broker colours for buttons, Now, red, always means ypu need to check it * *2.6.6* -Feature: Quick mission completion enabled for shipyard +Feature: Quick mission completion enabled for shipyard\ Feature: In Ship missions mission expire time added Fix: Sometimes interacting with shipyard raised a protection issue Change: I could not verify if "Improved logistic" actuall works so I removed that check from Broker. Cache size will be 500 or 1000 diff --git a/GarrisonCommander.toc b/GarrisonCommander.toc index 5c61c95..bf0b685 100644 --- a/GarrisonCommander.toc +++ b/GarrisonCommander.toc @@ -13,7 +13,7 @@ ## Notes-zhCN: 發送所有的追隨者與點擊多任務 ## Author: Alar of Daggerspine ## Version: @project-version@ 6.2.0 -## X-Version: 2.6.6 +## X-Version: 2.6.8 ## X-Revision: @project-abbreviated-hash@ ## eMail: alar@aspide.it ## URL: http://wow.aspide.it diff --git a/ShipYard.lua b/ShipYard.lua index 908c264..37f599d 100644 --- a/ShipYard.lua +++ b/ShipYard.lua @@ -20,8 +20,16 @@ function sprint(nome,this,...) print(nome,this:GetName(),...) end function module:OnInitialize() - self:SafeSecureHook("GarrisonFollowerButton_UpdateCounters") - self:SafeSecureHook(GSF,"OnClickMission","HookedGSF_OnClickMission") + if IsAddOnLoaded("MasterPlanA") then + -- less efficient, but survive MasterPlan + self:SafeSecureHook("GarrisonFollowerButton_UpdateCounters") + self:SafeSecureHook("GarrisonShipyardMapMission_SetTooltip") + else + self:SafeSecureHook(GSF,"OnClickMission","HookedGSF_OnClickMission") +--@debug@ + self:SafeSecureHook("GarrisonShipyardMapMission_SetTooltip") +--@end-debug@ + end local ref=GSFMissions.CompleteDialog.BorderFrame.ViewButton print(ref) local bt = CreateFrame('BUTTON','GCQuickShipMissionCompletionButton', ref, 'UIPanelButtonTemplate') @@ -30,9 +38,6 @@ function module:OnInitialize() bt:SetText(L["Garrison Comander Quick Mission Completion"]) bt:SetPoint("CENTER",0,-50) addon:ActivateButton(bt,"MissionComplete",L["Complete all missions without confirmation"]) ---@debug@ - print("ShipYard Loaded") - self:SafeSecureHook("GarrisonShipyardMapMission_SetTooltip") self:SafeSecureHook("GarrisonShipyardMap_UpdateMissions") self:SafeSecureHook("GarrisonShipyardMap_SetupBonus") self:SafeHookScript(GSF,"OnShow","Setup",true) @@ -76,7 +81,17 @@ function module:HookedGarrisonShipyardMap_SetupBonus(missionList,frame,mission) --addendum.duration:SetText(mission.duration) end function module:HookedGarrisonShipyardMap_UpdateMissions() - local self = GarrisonShipyardFrame.MissionTab.MissionList + local list = GSF.MissionTab.MissionList + for i=1,#list.missions do + local frame = list.missionFrames[i] + if not self:IsHooked(frame,"PostClick") then + self:SafeHookScript(frame,"PostClick","HookedMapButtonOnClick",true) + end + end + +end +function module:HookedMapButtonOnClick(this) + self:FillMissionPage(this.info) end function module:HookedGSF_OnClickMission(this,missionInfo) self:FillMissionPage(missionInfo) @@ -113,13 +128,25 @@ function module:OnShow() end function module:HookedGarrisonShipyardMapMission_SetTooltip(info,inProgress) local tooltipFrame = GarrisonShipyardMapMissionTooltip; - tooltipFrame:SetHeight(tooltipFrame:GetHeight()+20) + local extra=10 + if (not tooltipFrame.msg) then + tooltipFrame.msg=tooltipFrame:CreateFontString(nil,"OVERLAY","GameFontHighlightSmall") + tooltipFrame.msg:SetPoint("BOTTOMLEFT",10,extra) + end + tooltipFrame.msg:Show() + tooltipFrame.msg:SetText("Left click to let GC autofill mission"); + tooltipFrame.msg:SetTextColor(C:Yellow()); + extra=extra+10 +--@debug@ if (not tooltipFrame.dbg) then tooltipFrame.dbg=tooltipFrame:CreateFontString(nil,"OVERLAY","GameFontHighlightSmall") - tooltipFrame.dbg:SetPoint("BOTTOMLEFT",10,10) + tooltipFrame.dbg:SetPoint("BOTTOMLEFT",10,extra) end tooltipFrame.dbg:Show() tooltipFrame.dbg:SetFormattedText("Mission ID: %d" ,info.missionID); + extra=extra+20 +--@end-debug + tooltipFrame:SetHeight(tooltipFrame:GetHeight()+extra) end function module:OpenLastTab()