diff --git a/FollowerCache.lua b/FollowerCache.lua index 4a41532..8ee8723 100644 --- a/FollowerCache.lua +++ b/FollowerCache.lua @@ -20,13 +20,11 @@ local tostring=tostring local GetItemInfo=GetItemInfo local LE_FOLLOWER_TYPE_GARRISON_6_0=_G.LE_FOLLOWER_TYPE_GARRISON_6_0 local LE_FOLLOWER_TYPE_SHIPYARD_6_2=_G.LE_FOLLOWER_TYPE_SHIPYARD_6_2 -local LE_FOLLOWER_TYPE_GARRISON_7_0=_G.LE_FOLLOWER_TYPE_GARRISON_7_0 local maxrank=_G.GARRISON_FOLLOWER_MAX_UPGRADE_QUALITY[LE_FOLLOWER_TYPE_GARRISON_6_0]*1000+GARRISON_FOLLOWER_MAX_LEVEL -local maxrankoh=_G.GARRISON_FOLLOWER_MAX_UPGRADE_QUALITY[LE_FOLLOWER_TYPE_GARRISON_7_0]*1000+110 local module=addon:NewSubClass('FollowerCache') --#module local cache={} --#cache local followerTypes={} -local cacheTypes={LE_FOLLOWER_TYPE_GARRISON_6_0,LE_FOLLOWER_TYPE_SHIPYARD_6_2,LE_FOLLOWER_TYPE_GARRISON_7_0} +local cacheTypes={LE_FOLLOWER_TYPE_GARRISON_6_0,LE_FOLLOWER_TYPE_SHIPYARD_6_2} local EMPTY={} local GMCUsedFollowers={} local GMCUsedFollowersCount=0 @@ -50,12 +48,9 @@ print(event,...) self.caches[LE_FOLLOWER_TYPE_SHIPYARD_6_2]:OnEvent(event,...) elseif self.caches[LE_FOLLOWER_TYPE_GARRISON_6_0].cache[followerID].followerID then self.caches[LE_FOLLOWER_TYPE_GARRISON_6_0]:OnEvent(event,...) - elseif self.caches[LE_FOLLOWER_TYPE_GARRISON_7_0].cache[followerID].followerID then - self.caches[LE_FOLLOWER_TYPE_GARRISON_7_0]:OnEvent(event,...) else self.caches[LE_FOLLOWER_TYPE_GARRISON_6_0]:Wipe() self.caches[LE_FOLLOWER_TYPE_SHIPYARD_6_2]:Wipe() - self.caches[LE_FOLLOWER_TYPE_GARRISON_7_0]:Wipe() end end @@ -65,12 +60,6 @@ function cache:new(type) return rc end function cache:OnEvent(event,followerType,followerID) ---@debug@ - if followerType==LE_FOLLOWER_TYPE_GARRISON_7_0 and ns.ignoreHall then - return - end -print(event,followerType,followerID) ---@end-debug@ if event=="GARRISON_FOLLOWER_UPGRADED" or event=="GARRISON_FOLLOWER_XP_CHANGED" then if (self.cache[followerID]) then self.cache[followerID]['level']=G.GetFollowerLevel(followerID) @@ -154,9 +143,6 @@ function cache:AddExtraData(follower) follower.coloredname=C(follower.name,tostring(follower.quality)) follower.fullname=format("%3d %s",follower.rank,follower.coloredname) follower.maxed=follower.qLevel>=maxrank - if follower.followerTypeID==LE_FOLLOWER_TYPE_GARRISON_7_0 then - follower.maxed=follower.qLevel>=maxrankoh - end local weaponItemID, weaponItemLevel, armorItemID, armorItemLevel = G.GetFollowerItems(follower.followerID); follower.weaponItemID=weaponItemID follower.weaponItemLevel=weaponItemLevel @@ -241,15 +227,10 @@ function addon:GetAnyData(followerType,...) end if followerType== LE_FOLLOWER_TYPE_SHIPYARD_6_2 then return self:GetShipData(...) - elseif followerType== LE_FOLLOWER_TYPE_GARRISON_7_0 then - return self:GetHeroData(...) else return self:GetFollowerData(...) end end -function addon:GetHeroData(followerID,key,default) - return module.caches[LE_FOLLOWER_TYPE_GARRISON_7_0]:GetFollowerData(followerID,key,default) -end function addon:GetFollowerData(followerID,key,default) return module.caches[LE_FOLLOWER_TYPE_GARRISON_6_0]:GetFollowerData(followerID,key,default) end @@ -268,9 +249,6 @@ end function addon:GetShipsIterator(func) return module.caches[LE_FOLLOWER_TYPE_SHIPYARD_6_2]:GetFollowersIterator(func) end -function addon:GetHeroesIterator(func) - return module.caches[LE_FOLLOWER_TYPE_GARRISON_7_0]:GetFollowersIterator(func) -end function addon:GetAnyIterator(followerTypeID,func) return module.caches[followerTypeID]:GetFollowersIterator(func) end diff --git a/FollowerPage.lua b/FollowerPage.lua index 3547341..4b5f393 100644 --- a/FollowerPage.lua +++ b/FollowerPage.lua @@ -151,10 +151,9 @@ function module:ShowUpgradeButtons(force) end local followerID=gf.followerID local followerInfo = followerID and G.GetFollowerInfo(followerID); --- gf.ItemWeapon.itemLevel=674 --- gf.ItemArmor.itemLevel=674 - local overTheTop=(gf.ItemWeapon.itemLevel + gf.ItemArmor.itemLevel) >=(GARRISON_FOLLOWER_MAX_ITEM_LEVEL *2) - if (not overTheTop and followerInfo and followerInfo.isCollected and not followerInfo.status and followerInfo.level == GARRISON_FOLLOWER_MAX_LEVEL ) then + + local canUpgrade = followerInfo and followerInfo.isCollected and gf.ItemWeapon.itemLevel + gf.ItemArmor.itemLevel < GARRISON_FOLLOWER_MAX_ITEM_LEVEL * 2 + if canUpgrade and (not followerInfo.status or followerInfo.status == GARRISON_FOLLOWER_INACTIVE) and followerInfo.isMaxLevel then ClearOverrideBindings(gf) local binded={} local currentType="" @@ -249,6 +248,11 @@ function module:ShowUpgradeButtons(force) for i=used,#b do b[i]:Hide() end + -- fix Blizzard UI Bug + if followerInfo and not followerInfo.isCollected then + GarrisonFollowerPage_SetItem(gf.ItemWeapon) + GarrisonFollowerPage_SetItem(gf.ItemArmor) + end end function module:DelayedRefresh(delay) if GMF.FollowerTab:IsShown() then diff --git a/GarrisonCommander.lua b/GarrisonCommander.lua index 9b6348a..599ae66 100644 --- a/GarrisonCommander.lua +++ b/GarrisonCommander.lua @@ -29,10 +29,8 @@ local minHeight local addon=addon --#addon local LE_FOLLOWER_TYPE_GARRISON_6_0=_G.LE_FOLLOWER_TYPE_GARRISON_6_0 local LE_FOLLOWER_TYPE_SHIPYARD_6_2=_G.LE_FOLLOWER_TYPE_SHIPYARD_6_2 -local LE_FOLLOWER_TYPE_GARRISON_7_0=_G.LE_FOLLOWER_TYPE_GARRISON_7_0 local LE_GARRISON_TYPE_6_0=_G.LE_GARRISON_TYPE_6_0 local LE_GARRISON_TYPE_6_2=_G.LE_GARRISON_TYPE_6_2 -local LE_GARRISON_TYPE_7_0=_G.LE_GARRISON_TYPE_7_0 ns.bigscreen=true local tprint=print local backdrop = { @@ -97,7 +95,6 @@ local GARRISON_MISSION_PERCENT_CHANCE="%d%%"-- GARRISON_MISSION_PERCENT_CHANCE --local GARRISON_CURRENCY=GARRISON_CURRENCY --824 local LE_FOLLOWER_TYPE_GARRISON_6_0=LE_FOLLOWER_TYPE_GARRISON_6_0 local LE_FOLLOWER_TYPE_SHIPYARD_6_2=LE_FOLLOWER_TYPE_SHIPYARD_6_2 -local LE_FOLLOWER_TYPE_GARRISON_7_0=LE_FOLLOWER_TYPE_GARRISON_7_0 local GARRISON_FOLLOWER_MAX_UPGRADE_QUALITY=GARRISON_FOLLOWER_MAX_UPGRADE_QUALITY[LE_FOLLOWER_TYPE_GARRISON_6_0] --local GARRISON_FOLLOWER_MAX_LEVEL=GARRISON_FOLLOWER_MAX_LEVEL -- 100 @@ -388,14 +385,10 @@ function addon:OnInitialized() ns.custom={ [LE_FOLLOWER_TYPE_GARRISON_6_0]=addon, [LE_FOLLOWER_TYPE_SHIPYARD_6_2]=self:GetModule("ShipYard"), - --[LE_FOLLOWER_TYPE_GARRISON_7_0]=self:GetModule("OrderHall"), - --[LE_FOLLOWER_TYPE_GARRISON_8_0]=self:GetModule("BFA"), - } self:SafeRegisterEvent("GARRISON_MISSION_COMPLETE_RESPONSE") self:SafeRegisterEvent("GARRISON_MISSION_NPC_CLOSED") self:SafeRegisterEvent("GARRISON_MISSION_STARTED") - self:SafeRegisterEvent("ADDON_LOADED") self:SafeRegisterEvent("QUEST_TURNED_IN") for _,b in ipairs(GMF.MissionTab.MissionList.listScroll.buttons) do local scale=0.8 @@ -1177,7 +1170,7 @@ function addon:CreateHeader(module,MOVEPANEL,PIN) --@end-alpha@ -- Removing wood corner. I do it here to not derive an xml frame. This shoud play better with ui extensions GCF.CloseButton:Hide() - for _,f in pairs({GCF:GetRegions()}) do + for _,f in pairs({GCF.GarrCorners:GetRegions()}) do if (f:GetObjectType()=="Texture" and f:GetAtlas()=="Garr_WoodFrameCorner") then f:Hide() end end local main=module:GetMain() @@ -1296,10 +1289,11 @@ end function addon:RenderFollowerPageFollowerButton(frame,follower,showCounters) if not frame.GCWep then frame.GCWep=frame:CreateFontString(nil,"ARTWORK","GameFontHighlightSmall") - frame.GCWep:SetPoint("BOTTOMLEFT",frame.Name,"TOPLEFT",0,2) + frame.GCWep:SetPoint("LEFT",frame.ILevel,"RIGHT",5,0) frame.GCArm=frame:CreateFontString(nil,"ARTWORK","GameFontHighlightSmall") - frame.GCArm:SetPoint("TOPLEFT",frame.GCWep,"TOPRIGHT") + frame.GCArm:SetPoint("LEFT",frame.GCWep,"RIGHT",5,0) frame.GCXp=frame:CreateFontString(nil,"ARTWORK","GameFontHighlightSmall") + frame.GCXp:SetPoint("BOTTOMRIGHT",frame,"BOTTOMRIGHT",-5,5) end if not follower.isCollected or type(follower.followerID)=="number" or follower.isTroop then frame.GCXp:Hide() @@ -1317,7 +1311,7 @@ function addon:RenderFollowerPageFollowerButton(frame,follower,showCounters) frame.GCXp:Hide() end if self:GetToggle("ILV") then - if (follower.level >= GARRISON_FOLLOWER_MAX_LEVEL) then + if follower.isMaxLevel then local c1=ITEM_QUALITY_COLORS[self:GetAnyData(follower.followerTypeID,follower.followerID,"weaponQuality" ,1)] local c2=ITEM_QUALITY_COLORS[self:GetAnyData(follower.followerTypeID,follower.followerID,"armorQuality" ,1)] frame.GCWep:SetFormattedText("W:%3d",self:GetAnyData(follower.followerTypeID,follower.followerID,"weaponItemLevel",600)) @@ -1326,16 +1320,13 @@ function addon:RenderFollowerPageFollowerButton(frame,follower,showCounters) frame.GCArm:SetTextColor(c2.r,c2.g,c2.b) frame.GCWep:Show() frame.GCArm:Show() - frame.GCXp:SetPoint("LEFT",frame.GCArm,"RIGHT",2,0) else frame.GCWep:Hide() frame.GCArm:Hide() - frame.GCXp:SetPoint("LEFT",frame.Name,"LEFT",0,20) end else frame.GCWep:Hide() frame.GCArm:Hide() - frame.GCXp:SetPoint("LEFT",frame.Name,"LEFT",0,20) end end function addon:HookedGarrisonFollowerListButton_OnClick(frame,button) @@ -1349,8 +1340,8 @@ print("Click") end if (frame.info.isCollected) then self:ScheduleTimer("HookedGarrisonFollowerButton_UpdateCounters",0.2,GMF,frame,frame.info,false) - self:GetModule("FollowerPage"):ShowUpgradeButtons() end + self:GetModule("FollowerPage"):ShowUpgradeButtons() end -- Shamelessly stolen from Blizzard Code -- Appears when hovering on menaces in mission button @@ -1506,7 +1497,6 @@ do if (tContains(party.members,followerID)) then tinsert(partyIndex,missionID) end end table.sort(partyIndex,function(a,b) return parties[a].perc > parties[b].perc end) - local prog=1 for i=1,#partyIndex do local missionID=partyIndex[i] local party=parties[missionID] @@ -1514,11 +1504,10 @@ do if mission and party and #party.members >= G.GetMissionMaxFollowers(missionID) then local mb=AceGUI:Create("GMCMissionButton") mb:SetScale(0.6) - ml:PushChild(mb,missionID) mb:SetFullWidth(true) + ml:PushChild(mb,missionID) mb:SetMission(mission,party,false,"followers") mb:SetCallback("OnClick",MissionOnClick) - prog=prog+1 end end del(partyIndex) @@ -1665,7 +1654,7 @@ function addon:AddMenu() local menu,size if GMF.MissionTab:IsVisible() then self.currentmenu=GMF.MissionTab - menu,size=self:CreateOptionsLayer(MP and 'CKMP' or nil,'BIGSCREEN','MSORT','MAXRES','MAXRESCHANCE','IGM','IGP','NOFILL','USEFUL','NOTOOLTIP','MOVEPANEL','AUTOLOGOUT') + menu,size=self:CreateOptionsLayer(MP and 'CKMP' or nil,'BIGSCREEN','MSORT','MAXRES','MAXRESCHANCE','IGM','IGP','NOFILL','USEFUL','NOTOOLTIP','MOVEPANEL') elseif GMF.FollowerTab:IsVisible() then local missionlist=ns.bigscreen or self:GetBoolean("FOLLOWERMISSIONLIST") self.currentmenu=GMF.FollowerTab @@ -1678,7 +1667,7 @@ function addon:AddMenu() self:RenderFollowerPageMissionList(nil,GMF.FollowerTab.followerID) elseif GMF.MissionControlTab:IsVisible() then self.currentmenu=GMF.MissionControlTab - menu,size=self:CreateOptionsLayer('BIGSCREEN','GCMINLEVEL','GCMINUPGRADE','MINXPLEVEL','MINGOLD','GCSKIPRARE','GCSKIPEPIC','USEFUL','NOTOOLTIP','AUTOLOGOUT') + menu,size=self:CreateOptionsLayer('BIGSCREEN','GCMINLEVEL','GCMINUPGRADE','MINXPLEVEL','MINGOLD','GCSKIPRARE','GCSKIPEPIC','USEFUL','NOTOOLTIP') else self.currentmenu=nil menu,size=self:CreateOptionsLayer('BIGSCREEN') @@ -1758,7 +1747,6 @@ function addon:ScriptGarrisonMissionFrame_OnShow(...) self:Trigger("MSORT") self:Trigger("CKMP") if IsControlKeyDown() then - self:EnableAutoLogout() self:ScheduleTimer("RunQuick",0.1,true) end self:RawHook(GMFMissions,"UpdateMissions","OnUpdateMissions",true) @@ -1965,7 +1953,6 @@ local fakeframe={} local mainframes={ [LE_FOLLOWER_TYPE_GARRISON_6_0]="GarrisonMissionFrame", [LE_FOLLOWER_TYPE_SHIPYARD_6_2]="GarrisonShipyardFrame", - [LE_FOLLOWER_TYPE_GARRISON_7_0]="OrderHallMissionFrame", } function addon:FillMissionPage(missionInfo) @@ -1973,7 +1960,7 @@ function addon:FillMissionPage(missionInfo) if type(missionInfo)=="number" then missionInfo=self:GetMissionData(missionInfo) end if not missionInfo then return end local missionType=missionInfo.followerTypeID - if missionType==LE_FOLLOWER_TYPE_SHIPYARD_6_2 or missionType==LE_FOLLOWER_TYPE_GARRISON_7_0 then + if missionType==LE_FOLLOWER_TYPE_SHIPYARD_6_2 then if not missionInfo.canStart then return end end local main=_G[mainframes[missionType]] @@ -1981,9 +1968,6 @@ function addon:FillMissionPage(missionInfo) local missionpage=main:GetMissionPage() local stage=main.MissionTab.MissionPage.Stage local missionenv=stage.MissionInfo.MissionEnv - if missionType==LE_FOLLOWER_TYPE_GARRISON_7_0 then - missionenv=stage.MissionInfo.MissionTime - end if not stage.MissionSeen then if not stage.expires then stage.expires=stage:CreateFontString() @@ -2676,7 +2660,7 @@ function addon:AddRewardExtraTooltip(this,...) local _1,l,_3,_4,_5,_6,_7,_8,_9,t=GetItemInfo(k) local buy,source=self:GetMarketValue(l or k) if l then - tip:AddDoubleLine(format("|T%s:32|t %s %3.2f%%",t,l,c/total*100), + tip:AddDoubleLine(format("|T%s:16|t %s %3.2f%%",t,l,c/total*100), --tip:AddDoubleLine(format("link:%s %s",t,l), GetMoneyString(buy) .. ' ' .. source) else @@ -2737,20 +2721,16 @@ function addon:ScriptGarrisonMissionButton_OnEnter(this, button) GameTooltip:AddLine(GARRISON_MISSION_AVAILABILITY); GameTooltip:AddLine(this.info.offerTimeRemaining, 1, 1, 1); end - if not this.hall then - if (blacklist[this.info.missionID]) then - GameTooltip:AddDoubleLine(L["Blacklisted"],L["Right-Click to remove from blacklist"],1,0.125,0.125,C:Green()) - GameTooltip:AddLine(L["Blacklisted missions are ignored in Mission Control"]) - else - GameTooltip:AddDoubleLine(L["Not blacklisted"],L["Right-Click to blacklist"],0.125,1.0,0.125,C:Red()) - end + if (blacklist[this.info.missionID]) then + GameTooltip:AddDoubleLine(L["Blacklisted"],L["Right-Click to remove from blacklist"],1,0.125,0.125,C:Green()) + GameTooltip:AddLine(L["Blacklisted missions are ignored in Mission Control"]) + else + GameTooltip:AddDoubleLine(L["Not blacklisted"],L["Right-Click to blacklist"],0.125,1.0,0.125,C:Red()) end - addon:AddFollowersToTooltip(this.info.missionID,this.hall and LE_FOLLOWER_TYPE_GARRISON_7_0 or LE_FOLLOWER_TYPE_GARRISON_6_0) - if not this.hall then - if not C_Garrison.IsOnGarrisonMap() and not GMF:IsVisible() then - GameTooltip:AddLine(" "); - GameTooltip:AddLine(GARRISON_MISSION_TOOLTIP_RETURN_TO_START, nil, nil, nil, 1); - end + addon:AddFollowersToTooltip(this.info.missionID,LE_FOLLOWER_TYPE_GARRISON_6_0) + if not C_Garrison.IsOnGarrisonMap() and not GMF:IsVisible() then + GameTooltip:AddLine(" "); + GameTooltip:AddLine(GARRISON_MISSION_TOOLTIP_RETURN_TO_START, nil, nil, nil, 1); end end --@debug@ @@ -2814,8 +2794,6 @@ function addon:DrawSlimButton(source,frame,progressing,bigscreen) local numRewards=self:AddRewards(frame, mission.rewards, mission.numRewards); if mission.followerTypeID==LE_FOLLOWER_TYPE_GARRISON_6_0 then self:AddFollowersToButton(frame,mission,missionID,bigscreen,numRewards) - elseif mission.followerTypeID==LE_FOLLOWER_TYPE_GARRISON_7_0 then - self:AddFollowersToButton(frame,mission,missionID,false,numRewards) elseif mission.followerTypeID==LE_FOLLOWER_TYPE_SHIPYARD_6_2 then self:AddShipsToButton(frame,mission,missionID,bigscreen,numRewards) end @@ -3052,8 +3030,6 @@ function addon:AddShipsToButton(button,mission,missionID,bigscreen) local bg=CreateFrame("Button",nil,button,"GarrisonCommanderMissionButton") bg:SetPoint("RIGHT") bg.button=button - bg:SetScript("OnEnter",function(this) GarrisonMissionButton_OnEnter(this.button) end) - bg:SetScript("OnLeave",function() GameTooltip:FadeOut() end) bg:RegisterForClicks("AnyUp") bg:SetScript("OnClick",function(...) self:OnClick_GCMissionButton(...) end) button.gcPANEL=bg @@ -3069,8 +3045,6 @@ function addon:AddFollowersToButton(button,mission,missionID,bigscreen,numReward local bg=CreateFrame("Button",nil,button,"GarrisonCommanderMissionButton") bg:SetPoint("RIGHT") bg.button=button - bg:SetScript("OnEnter",function(this) pcall(GarrisonMissionButton_OnEnter,this.button) end) - bg:SetScript("OnLeave",function() GameTooltip:FadeOut() end) bg:RegisterForClicks("AnyUp") bg:SetScript("OnClick",function(...) self:OnClick_GCMissionButton(...) end) button.gcPANEL=bg diff --git a/GarrisonCommander.toc b/GarrisonCommander.toc index bcccc9f..6c3106f 100644 --- a/GarrisonCommander.toc +++ b/GarrisonCommander.toc @@ -47,7 +47,6 @@ FollowerRecruiting.lua BuildingPage.lua ShipYard.lua ShipControl.lua -OrderHall.lua quick.lua RelNotes.lua #@do-not-package@ diff --git a/GarrisonCommander.xml b/GarrisonCommander.xml index d455748..72adc49 100644 --- a/GarrisonCommander.xml +++ b/GarrisonCommander.xml @@ -426,7 +426,7 @@ <Scripts> <OnLeave function="GameTooltip_Hide"/> <OnClick> - PlaySound("igMainMenuOptionCheckBoxOn"); + PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON); local searchBox = GarrisonMissionFrameFollowers.SearchBox local searchString = searchBox:GetText(); if (searchString == self.name) then diff --git a/Init.lua b/Init.lua index e3cae0f..20b4b70 100644 --- a/Init.lua +++ b/Init.lua @@ -378,128 +378,3 @@ function ns.Configure() end setfenv(2, ENV) end -function addon:EventADDON_LOADED(event,AddOn) - if AddOn~="Blizzard_OrderHallUI" then return end - self:UnregisterEvent("ADDON_LOADED") - ns.GHF=_G.OrderHallMissionFrame - ns.GHFMissions=ns.GHF.MissionTab.MissionList - ENV.GHF=ns.GHF - ENV.GHFMissions=ns.GHFMissions - self:GetModule("OrderHall"):OnInitialize() -end --- Order Hall data -local fake={} -local data={ - Upgrades={ - 136412, - 137207, - 137208, - - }, - Xp={ - 141028 - }, - Equipment={ - 'Success Chance Increase', - 139816, - 139801, - 139802, - 140572, - 140571, - 140573, - 140581, - 140582, - 140583, - 'Mission Time Reduction', - 139813, - 139814, - 139799, - 'Combat Ally Bonus', - 139792, - 139808, - 139809, - 139795, - 139811, - 139812, - 'Troop Affinity', - 139875, - 139876, - 139877, - 139878, - 139835, - 139836, - 139837, - 139838, - 139863, - 139864, - 139865, - 139866, - 139847, - 139848, - 139849, - 139850, - 139843, - 139844, - 139845, - 139846, - 139859, - 139860, - 139861, - 139862, - 139867, - 139868, - 139869, - 139870, - 139871, - 139872, - 139873, - 139874, - 139831, - 139832, - 139833, - 139834, - 139839, - 139840, - 139841, - 139842, - 139855, - 139856, - 139857, - 139858, - 139851, - 139852, - 139853, - 139854, - 'Legendary Equipment', - 139830, - 139828, - 139829, - 139827, - 139825, - 139826, - 139821, - 139804, - 139819, - 139824, - 139823, - 139822, - 'Consumables', - 140749, - 139419, - 140760, - 139428, - 139177, - 139420, - 138883, - 139376, - 138418, - 138412, - 139670 - }, -} -function addon:GetData(key) - key=key or "none" - return data[key] or fake -end - - diff --git a/MatchMaker.lua b/MatchMaker.lua index 001b5ef..81430fb 100644 --- a/MatchMaker.lua +++ b/MatchMaker.lua @@ -25,7 +25,6 @@ local GARRISON_CURRENCY=GARRISON_CURRENCY local GARRISON_SHIP_OIL_CURRENCY=GARRISON_SHIP_OIL_CURRENCY local LE_FOLLOWER_TYPE_GARRISON_6_0=_G.LE_FOLLOWER_TYPE_GARRISON_6_0 -- 1 local LE_FOLLOWER_TYPE_SHIPYARD_6_2=_G.LE_FOLLOWER_TYPE_SHIPYARD_6_2 -- 2 -local LE_FOLLOWER_TYPE_GARRISON_7_0=_G.LE_FOLLOWER_TYPE_GARRISON_7_0 -- 4 local dbg local useCap=false local currentCap=100 @@ -220,7 +219,6 @@ local function MatchMaker(self,mission,party,includeBusy,onlyBest) local filterOut=filters[class] or filters.other filters.skipMaxed=self:GetBoolean("IGP") local followerType=mission.followerTypeID - local hallMission=followerType==LE_FOLLOWER_TYPE_GARRISON_7_0 if followerType==LE_FOLLOWER_TYPE_SHIPYARD_6_2 then filters.skipMaxed=false end @@ -238,11 +236,7 @@ local function MatchMaker(self,mission,party,includeBusy,onlyBest) if self:IsFollowerAvailableForMission(followerID,filters.skipBusy) then if P:AddFollower(followerID) then local score,chance=self:FollowerScore(mission,followerID) - if hallMission and self:GetHeroData(followerID,'isTroop') then - tinsert(troops,format("%s@%s@%s",score,followerID,self:GetAnyData(missionTypeID,followerID,'fullname'))) - else - tinsert(scores,format("%s@%s@%s",score,followerID,self:GetAnyData(missionTypeID,followerID,'fullname'))) - end + tinsert(scores,format("%s@%s@%s",score,followerID,self:GetAnyData(missionTypeID,followerID,'fullname'))) P:RemoveFollower(followerID) end end @@ -288,26 +282,7 @@ local function MatchMaker(self,mission,party,includeBusy,onlyBest) --@end-debug@ end if mission.numFollowers > 1 then - if missionTypeID== LE_FOLLOWER_TYPE_GARRISON_7_0 then - local nf=#scores - local nt=#troops - local total=#GHFMissions.availableMissions - local maxtroops=0 - if total==1 then - AddMoreFollowers(self,mission,scores) - AddMoreFollowers(self,mission,troops) - else - local mm=math.floor((nt+nt)/3) - if mm==1 then - maxtroops=0 - else - maxtroops=1 - end - AddMoreFollowers(self,mission,troops,false,maxtroops) - end - else - AddMoreFollowers(self,mission,scores) - end + AddMoreFollowers(self,mission,scores) end end if P:FreeSlots() > 0 then diff --git a/MissionCache.lua b/MissionCache.lua index bb5c2e6..9216dc3 100644 --- a/MissionCache.lua +++ b/MissionCache.lua @@ -14,7 +14,6 @@ local GARRISON_SHIP_OIL_CURRENCY=GARRISON_SHIP_OIL_CURRENCY local GARRISON_FOLLOWER_MAX_LEVEL=GARRISON_FOLLOWER_MAX_LEVEL local LE_FOLLOWER_TYPE_GARRISON_6_0=_G.LE_FOLLOWER_TYPE_GARRISON_6_0 local LE_FOLLOWER_TYPE_SHIPYARD_6_2=_G.LE_FOLLOWER_TYPE_SHIPYARD_6_2 -local LE_FOLLOWER_TYPE_GARRISON_7_0=_G.LE_FOLLOWER_TYPE_GARRISON_7_0 local GMF=GMF local GSF=GSF local GMFMissions=GMFMissions @@ -66,9 +65,9 @@ function module:OnInitialized() addon.AuctionPrices=true appraisers.ATR=Atr_GetAuctionBuyout end - if _G.TSMAPI then + if _G.TSMAPI_FOUR then addon.AuctionPrices=true - appraisers.TSM=function(itemlink) return TSMAPI:GetItemValue(itemlink,"DBMarket") end + appraisers.TSM=function(itemlink) return TSMAPI_FOUR.CustomPrice.GetItemPrice(itemlink,"DBMarket") end end if _G.TUJMarketInfo then addon.AuctionPrices=true @@ -122,12 +121,6 @@ function module:GetMission(id,noretry) elseif type=="p" then mission=GMFMissions.inProgressMissions[ix] if mission and mission.missionID==id then return mission end - elseif type=="ha" then - mission=GHFMissions.availableMissions[ix] - if mission and mission.missionID==id then return mission end - elseif type=="hp" then - mission=GHFMissions.inProgressMissions[ix] - if mission and mission.missionID==id then return mission end elseif type=="s" then mission=GSFMissions.missions[ix] if mission and mission.missionID==id then return mission end @@ -138,10 +131,6 @@ function module:GetMission(id,noretry) scan(GMFMissions.availableMissions,'a') scan(GMFMissions.inProgressMissions,'p') scan(GSFMissions.missions,'s') - if GHFMissions and not ns.ignoreHall then - scan(GHFMissions.availableMissions,'ha') - scan(GHFMissions.inProgressMissions,'hp') - end return self:GetMission(id,true) end function module:AddExtraData(mission) @@ -258,7 +247,7 @@ print("Iterator called, list is",list) end,list,0 end function module:OnAllGarrisonMissions(func,inProgress,missionType) - local m=(missionType and missionType==LE_FOLLOWER_TYPE_GARRISON_7_0) and GHFMissions or GMFMissions + local m=GMFMissions local list=inProgress and m.inProgressMissions or m.availableMissions if type(list)=='table' then local tmp=new() @@ -473,11 +462,6 @@ classes[LE_FOLLOWER_TYPE_SHIPYARD_6_2]={ newMissionType('itemLevel',L['Item Tokens'],'INV_Bracer_Cloth_Reputation_C_01',false,false,nil,0), newMissionType('other',L['Other rewards'],'INV_Box_02',false,false,nil,0), } -classes[LE_FOLLOWER_TYPE_GARRISON_7_0]={ - newMissionType('xp',L['Follower experience'],'XPBonus_icon',false,false,nil,0), - newMissionType('gold',BONUS_ROLL_REWARD_MONEY,'inv_misc_coin_01',false,false,nil,0), - newMissionType('other',L['Other rewards'],'INV_Box_02',false,false,nil,0), -} function addon:GetRewardClasses(followerType) followerType=followerType or LE_FOLLOWER_TYPE_GARRISON_6_0 return classes[followerType] diff --git a/MissionCompletion.lua b/MissionCompletion.lua index fa03197..25f80fc 100644 --- a/MissionCompletion.lua +++ b/MissionCompletion.lua @@ -5,16 +5,13 @@ local shipyard local _G=_G local GMF=GMF local GSF=GSF -local GHF=GHF local GMFMissions=GarrisonMissionFrameMissions local GSFMissions=GarrisonMissionFrameMissions -local GHFMissions=GarrisonMissionFrameMissions local GARRISON_CURRENCY=GARRISON_CURRENCY local GARRISON_SHIP_OIL_CURRENCY=_G.GARRISON_SHIP_OIL_CURRENCY local SEAL_CURRENCY=994 local LE_FOLLOWER_TYPE_GARRISON_6_0=_G.LE_FOLLOWER_TYPE_GARRISON_6_0 -- 1 local LE_FOLLOWER_TYPE_SHIPYARD_6_2=_G.LE_FOLLOWER_TYPE_SHIPYARD_6_2 -- 2 -local LE_FOLLOWER_TYPE_GARRISON_7_0=_G.LE_FOLLOWER_TYPE_GARRISON_7_0 -- 4 local pairs=pairs local format=format local strsplit=strsplit @@ -93,7 +90,6 @@ function module:MissionsCleanup() -- Re-enable "view" button fmissions.CompleteDialog.BorderFrame.ViewButton:SetEnabled(true) module:OpenLastTab() - if panel==GHF then return end f:UpdateMissions() f:CheckCompleteMissions() end @@ -120,11 +116,6 @@ function module:CloseReport() print "Garr close mission" --@end-debug@ GMF:CloseMissionComplete() - elseif GHF and GHF:IsVisible() then - --@debug@ - print "Hall close mission" - --@end-debug@ - GHF:CloseMissionComplete() end addon:OpenMissionsTab() addon:RefreshParties() diff --git a/MissionControl.lua b/MissionControl.lua index 059d6e4..432cb50 100644 --- a/MissionControl.lua +++ b/MissionControl.lua @@ -222,7 +222,7 @@ do timeElapsed=0.5 else local missionID=aMissions[currentMission] - GMC.list.widget:SetFormattedTitle("Processing mission %d of %d (%s)",currentMission,#aMissions,G.GetMissionName(missionID)) + GMC.list.widget:SetFormattedTitle(L["Processing mission %d of %d"], currentMission, #aMissions) local class=self:GetMissionData(missionID,"class") --print(C("Processing ","Red"),missionID,addon:GetMissionData(missionID,"name")) local minimumChance=0 @@ -248,8 +248,8 @@ do end party.missionID=missionID tinsert(GMC.list.Parties,party) - GMC.list.widget:PushChild(mb,missionID) mb:SetFullWidth(true) + GMC.list.widget:PushChild(mb,missionID) mb:SetMission(self:GetMissionData(missionID),party,false,"control") mb:Blacklist(blacklist[missionID]) mb:SetCallback("OnClick",leftclick) @@ -264,10 +264,11 @@ end function module:OnClick_Run(this,button) local GMC=GMF.MissionControlTab this:Disable() - --GMC.logoutButton:Disable() do local elapsed=0 local co=coroutine.wrap(self.RunMission) + GMC.list.widget:SetFormattedTitle(L["Sending..."]) + GMC.list.widget:SetTitleColor(C.Yellow()) self:Unhook(GMC.runButton,'OnUpdate') self:RawHookScript(GMC.runButton,'OnUpdate',function(this,ts) elapsed=elapsed+ts @@ -276,11 +277,8 @@ function module:OnClick_Run(this,button) local rc=co(self) if (not rc) then self:Unhook(GMC.runButton,'OnUpdate') - --GMC.logoutButton:Enable() - if not ns.quick and addon:GetBoolean("AUTOLOGOUT") then - addon:LogoutPopout(5) - end - addon:missionDone() + GMC.list.widget:SetTitle(READY) + GMC.list.widget:SetTitleColor(C.Green()) ns.quick=false end end @@ -302,13 +300,13 @@ function module:OnClick_Start(this,button) return end this:Disable() - GMC.list.widget:SetTitleColor(C.Green()) self:CreateMissionList(aMissions) wipe(GMCUsedFollowers) wipe(GMC.list.Parties) self:RefreshFollowerStatus() if (#aMissions>0) then GMC.list.widget:SetFormattedTitle(L["Processing mission %d of %d"],1,#aMissions) + GMC.list.widget:SetTitleColor(C.Yellow()) else GMC.list.widget:SetTitle("No mission matches your criteria") GMC.list.widget:SetTitleColor(C.Red()) @@ -787,7 +785,6 @@ function module:BuildFlags() addon:AddSlider("MINGOLD",50,1,1000,L["Minimum Gold Value"],L["Gold missions wich returns less than this amount are ignored"]) addon:AddToggle("GCSKIPEPIC",settings.skipEpic,L["Ignore epic for xp missions."],L["IF you have a Salvage Yard you probably dont want to have this one checked"]) addon:AddToggle("GCSKIPRARE",settings.skipRare,L["Ignore rare missions"],L["Rare missions will not be considered"]) - --addon:AddToggle("AUTOLOGOUT",false,L["Auto Logout"],L["Automatically logout after sending missions"]) addon:SetBoolean("AUTOLOGOUT",false) end function module:BuildDuration() @@ -871,16 +868,6 @@ function module:BuildMissionList() GMC.runButton:SetScript('OnClick',function(this,button) self:OnClick_Run(this,button) end) GMC.runButton:Disable() GMC.runButton:SetPoint('TOPRIGHT',-10,25) --- GMC.logoutButton=CreateFrame('BUTTON', nil,ml.widget.frame, 'GameMenuButtonTemplate') --- GMC.logoutButton:SetText(LOGOUT) --- GMC.logoutButton:SetWidth(ns.bigscreen and 148 or 90) --- GMC.logoutButton:SetScript("OnClick",function() --- GMF:Hide() --- module:Popup(LOGOUT) --- module:ScheduleTimer(Logout,0.5) --- end --- ) --- GMC.logoutButton:SetPoint('TOP',0,25) return ml end diff --git a/ShipControl.lua b/ShipControl.lua index c145788..8d644f1 100644 --- a/ShipControl.lua +++ b/ShipControl.lua @@ -264,7 +264,7 @@ do missionID=nextMissionID nextMissionID=OILRIG end - GMC.list.widget:SetFormattedTitle("Processing mission %d of %d (%s)",currentMission,#aMissions,G.GetMissionName(missionID)) + GMC.list.widget:SetFormattedTitle(L["Processing mission %d of %d"], currentMission, #aMissions) local class=self:GetMissionData(missionID,"class") --print(C("Processing ","Red"),missionID,addon:GetMissionData(missionID,"name")) local minimumChance=0 @@ -301,8 +301,8 @@ do end party.missionID=missionID tinsert(GMC.list.Parties,party) - GMC.list.widget:PushChild(mb,missionID) mb:SetFullWidth(true) + GMC.list.widget:PushChild(mb,missionID) mb:SetMission(self:GetMissionData(missionID),party,false,"control") mb:Blacklist(blacklist[missionID]) mb:SetCallback("OnClick",leftclick) @@ -317,10 +317,11 @@ end function module:OnClick_Run(this,button) local GMC=GSF.MissionControlTab this:Disable() - --GMC.logoutButton:Disable() do local elapsed=0 local co=coroutine.wrap(self.RunMission) + GMC.list.widget:SetFormattedTitle(L["Sending..."]) + GMC.list.widget:SetTitleColor(C.Yellow()) self:Unhook(GMC.runButton,'OnUpdate') self:RawHookScript(GMC.runButton,'OnUpdate',function(this,ts) elapsed=elapsed+ts @@ -329,11 +330,8 @@ function module:OnClick_Run(this,button) local rc=co(self) if (not rc) then self:Unhook(GMC.runButton,'OnUpdate') - --GMC.logoutButton:Enable() - if not ns.quick and addon:GetBoolean("SAUTOLOGOUT") then - addon:LogoutPopup(5) - end - addon:shipyardDone() + GMC.list.widget:SetTitle(READY) + GMC.list.widget:SetTitleColor(C.Green()) ns.quick=false end end @@ -355,13 +353,13 @@ function module:OnClick_Start(this,button) return end this:Disable() - GMC.list.widget:SetTitleColor(C.Green()) self:CreateMissionList(aMissions) wipe(GMCUsedFollowers) wipe(GMC.list.Parties) shipyard:RefreshFollowerStatus() if (#aMissions>0) then GMC.list.widget:SetFormattedTitle(L["Processing mission %d of %d"],1,#aMissions) + GMC.list.widget:SetTitleColor(C.Yellow()) else GMC.list.widget:SetTitle("No mission matches your criteria") GMC.list.widget:SetTitleColor(C.Red()) @@ -793,7 +791,7 @@ function module:BuildFlags() addon:AddSlider("SGCMINLEVEL",settings.minLevel,535,715,L["Item minimum level"],L['Minimum requested level for equipment rewards'],15) addon:AddToggle("SGCSKIPEPIC",settings.skipEpic,L["Ignore epic for xp missions."],L["IF you have a Salvage Yard you probably dont want to have this one checked"]) addon:AddToggle("SGCRIG",settings.rig,L["Oil Rig."],L["Always send Oil Rig: Pickup mission as last mission if available"]) - addon:AddToggle("SAUTOLOGOUT",false,L["Auto Logout"],L["Automatically logout after sending missions"]) + addon:SetBoolean("SAUTOLOGOUT",false) addon:Trigger('SGCMINLEVEL') addon:Trigger('SGCSKIPEPIC') @@ -879,16 +877,6 @@ function module:BuildMissionList() GMC.runButton:SetScript('OnClick',function(this,button) self:OnClick_Run(this,button) end) GMC.runButton:Disable() GMC.runButton:SetPoint('TOPRIGHT',-10,25) - --GMC.logoutButton=CreateFrame('BUTTON', nil,ml.widget.frame, 'GameMenuButtonTemplate') - --GMC.logoutButton:SetText(LOGOUT) - --GMC.logoutButton:SetWidth(ns.bigscreen and 148 or 90) - --GMC.logoutButton:SetScript("OnClick",function() - -- GSF:Hide() - -- module:Popup(LOGOUT) - -- module:ScheduleTimer(Logout,0.5) - -- end - --) - --GMC.logoutButton:SetPoint('TOP',0,25) return ml end diff --git a/ShipYard.lua b/ShipYard.lua index e667ae1..ff93390 100644 --- a/ShipYard.lua +++ b/ShipYard.lua @@ -172,7 +172,7 @@ function module:HookedGarrisonShipyardMap_SetupBonus(missionList,frame,mission) if mission.inProgress then return end i=i+1 addendum=CreateFrame("Frame",nil,frame) - addendum:SetPoint("TOPLEFT",frame,"TOPRIGHT",-10,-15) + addendum:SetPoint("TOP",frame,"BOTTOM",0,10) --@debug@ addendum:EnableMouse(true) addendum:SetScript("OnEnter",function(frame) module:TTDump(frame,mission) end) @@ -295,7 +295,7 @@ print("Doing one time initialization for",this:GetName(),...) tabMC:SetNormalTexture("Interface\\ICONS\\ACHIEVEMENT_GUILDPERK_WORKINGOVERTIME.blp") tabMC:SetScript("OnClick",function(this,...) module:OpenMissionControlTab() end) tabMC:Show() - tabMC:SetPoint('TOPLEFT',GSF,'TOPRIGHT',0,0) + tabMC:SetPoint('TOPLEFT',GCS,'TOPRIGHT',0,-60) local tabQ=CreateFrame("Button",nil,GSF,"SpellBookSkillLineTabTemplate") GSF.tabQ=tabQ tabQ.tooltip=L["Automatically process completed missions and schedules new ones."].."\n".. @@ -305,7 +305,7 @@ print("Doing one time initialization for",this:GetName(),...) tabQ:SetPushedTexture("Interface\\ICONS\\Ability_Rogue_Sprint.blp") tabQ:Show() tabQ:SetScript("OnClick",function(this,button) addon:RunQuick() end) - tabQ:SetPoint('TOPLEFT',GSF,'TOPRIGHT',0,-210) + tabQ:SetPoint('TOPLEFT',GCS,'TOPRIGHT',0,-210) GSF.FollowerStatusInfo=GSF.BorderFrame:CreateFontString(nil, "OVERLAY", "GameFontNormal") GSF.ResourceInfo=GSF.BorderFrame:CreateFontString(nil, "OVERLAY", "GameFontNormal") @@ -346,7 +346,6 @@ function module:ScriptGarrisonShipyardFrame_OnShow() self:RefreshCurrency() self:RefreshFollowerStatus() if IsControlKeyDown() then - self:EnableAutoLogout() self:ScheduleTimer("RunQuick",0.1,true) end end diff --git a/Widgets.lua b/Widgets.lua index e9f4274..48a1130 100644 --- a/Widgets.lua +++ b/Widgets.lua @@ -289,15 +289,12 @@ local function GMCLayer() self:ReleaseChildren() self.scroll=nil end - self.scroll=AceGUI:Create("ScrollFrame") - local scroll=self.scroll - self:AddChild(scroll) - scroll:SetLayout("List") -- probably? + local scroll = AceGUI:Create("ScrollFrame") + scroll:SetLayout("List") scroll:SetFullWidth(true) scroll:SetFullHeight(true) - scroll:SetPoint("TOPLEFT",self.title,"BOTTOMLEFT",0,0) - scroll:SetPoint("TOPRIGHT",self.title,"BOTTOMRIGHT",0,0) - scroll:SetPoint("BOTTOM",self.content,"BOTTOM",0,0) + self:AddChild(scroll) + self.scroll = scroll end ---@function [parent=#GMCLayer] local function Constructor() @@ -326,8 +323,9 @@ local function GMCLayer() local content = CreateFrame("Frame",nil,frame) widget.content = content content.obj = self - content:SetPoint("TOPLEFT",title,"BOTTOMLEFT") - content:SetPoint("BOTTOMRIGHT") + content:SetPoint("TOPLEFT",title,"BOTTOMLEFT",6,0) + content:SetPoint("TOPRIGHT",title,"BOTTOMRIGHT",-6,0) + content:SetPoint("BOTTOM",0,6) AceGUI:RegisterAsContainer(widget) return widget end diff --git a/quick.lua b/quick.lua index 8dbc2aa..3136083 100644 --- a/quick.lua +++ b/quick.lua @@ -5,15 +5,12 @@ local _G=_G local GMF=GMF local GSF=GSF local qm=addon:NewSubModule("Quick") --#qm -local missionDone -local shipyardDone local format=format local ipairs=ipairs local NavalDomination={ Alliance=39068, Horde=39246 } -local autologout=false local questid=NavalDomination[UnitFactionGroup("player")] function qm:OnInitialized() ns.step="none" @@ -22,12 +19,6 @@ local watchdog=0 local function HasShipTable() return ns.quests[39068] or ns.quests[39246] -- Naval Domination end -function addon:missionDone() - missionDone=true -end -function addon:shipyardDone() - shipyardDone=true -end -- backported from LibInit 41 function addon:Popup(msg,timeout,OnAccept,OnCancel,data,StopCasting) @@ -85,45 +76,11 @@ function addon:LogoutTimer(dialog,elapsed) text:SetFormattedText(StaticPopupDialogs[which].text, ceil(timeleft / 60), MINUTES); end end -function addon:LogoutPopup(timeout) - local msg='' - if addon:HasSalvageYard() then - local salvage=0 - local freeSlots=0 - for i=0,NUM_BAG_SLOTS do - freeSlots=freeSlots+(GetContainerNumFreeSlots(i) or 0) - end - for _,id in ipairs(ns.allSalvages) do - salvage=salvage+(GetItemCount(id) or 0) - end - if salvage > 5 then - timeout=timeout+5 - msg=format(L["You have %d items to salvage"],salvage) - if freeSlots < 5 then - msg=msg .. format(L[" and only %d free slots in your bags"],freeSlots) - end - msg=C(msg,'green').."\n" - local popup=addon:Popup(msg,timeout or 10, - function(dialog,data,data2) - StaticPopup_Hide("LIBINIT_POPUP") - end - ) - end - end -end function qm:RunQuick() local completeButton=GMF:IsVisible() and GarrisonCommanderQuickMissionComplete or GCQuickShipMissionCompletionButton local main=GMF:IsVisible() and GMF or GSF if not ns.quick then HideUIPanel(main) - if not G.HasShipyard() then - shipyardDone=true - end - if missionDone and shipyardDone then - addon:LogoutPopup(5) - else - autologout=false - end return end while not qm.Mission do @@ -149,9 +106,6 @@ function qm:RunQuick() end end -function addon:EnableAutoLogout() - autologout=true -end function addon:RunQuick(force) local main=GMF:IsVisible() and GMF or GSF if main.tabMC:GetChecked() then