diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 423d54b..5c6588a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,11 @@ ==GarrisonCommander helps you when choosing the right follower for the right mission== +* 2.3.5 +** Feature: 6.1.0 Compatibility +** Feature: largely improved MatchMaker +** Feature: largely improved MissionControl +** Feature: Mission list in follower page is scrolling and has now no limit +** Feature: Mission Completion has an hopefully nicer new interface +** Fix: inactive followers are ignored even when "Ignore unavailable" is unchecked * 2.3.0 ** Feature: Mission autocompletion. ** Feature: Matchmaker slightly improved diff --git a/Debug.lua b/Debug.lua index b8c6587..278391e 100644 --- a/Debug.lua +++ b/Debug.lua @@ -90,9 +90,9 @@ function addon:GetScroller(title,type,h,w) return scroll end function addon:AddRow(obj,text,...) ---[===[@debug@ +--@debug@ assert(obj) ---@end-debug@]===] +--@end-debug@ if (obj) then local l=AceGUI:Create("Label") l:SetText(text) diff --git a/GarrisonCommander-Broker/GarrisonCommander-Broker.toc b/GarrisonCommander-Broker/GarrisonCommander-Broker.toc index ebce0f9..32b5f0a 100644 --- a/GarrisonCommander-Broker/GarrisonCommander-Broker.toc +++ b/GarrisonCommander-Broker/GarrisonCommander-Broker.toc @@ -1,4 +1,4 @@ -## Interface: 60000 +## Interface: 60100 ## Title: GarrisonCommander-Broker ## Notes: Data-Broker for GarrisonCommander ## Notes-itIT: Data-Broker per GarrisonCommander diff --git a/GarrisonCommander-Broker/ldb.lua b/GarrisonCommander-Broker/ldb.lua index 824735a..704e820 100644 --- a/GarrisonCommander-Broker/ldb.lua +++ b/GarrisonCommander-Broker/ldb.lua @@ -1,8 +1,8 @@ local me, ns = ... if (not LibStub:GetLibrary("LibDataBroker-1.1",true)) then - --[===[@debug@ + --@debug@ print("Missing libdatabroker") - --@end-debug@]===] + --@end-debug@ return end if (LibDebug) then LibDebug() end @@ -21,6 +21,7 @@ local NONE=NONE local DONE=DONE local format=format local table=table +local math=math function addon:ldbCleanup() local now=time() for i=1,#self.db.realm.missions do @@ -44,12 +45,12 @@ function addon:ldbUpdate() if t>now then local duration=t-now local duration=duration < 60 and duration or math.floor(duration/60)*60 - dataobj.text=format("Next mission on |cff20ff20%s|r in %s (%d completed)",pc,SecondsToTime(duration),completed) + dataobj.text=format("Next mission on |cff20ff20%s|r in %s (|cff20ff20%d|r completed)",pc,SecondsToTime(duration),completed) return end completed=completed+1 end - dataobj.text=NONE + dataobj.text=format("Next mission %s (|cff20ff20%d|r completed)",NONE,completed) end function addon:GARRISON_MISSION_STARTED(event,missionID) local duration=select(2,G.GetPartyMissionInfo(missionID)) or 0 @@ -72,7 +73,7 @@ dataobj=LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject(me, { icon = "Interface\\ICONS\\ACHIEVEMENT_GUILDPERK_WORKINGOVERTIME" }) function dataobj:OnTooltipShow() - self:AddLine("Mission awaiting") + self:AddLine(L["Mission awaiting"]) local db=addon.db.realm.missions local now=time() for i=1,#db do @@ -103,8 +104,8 @@ end function dataobj:OnLeave() GameTooltip:Hide() end ---[===[@debug@ +--@debug@ _G.GACDB=addon ---@end-debug@]===] +--@end-debug@ --function dataobj:OnClick(button) --end diff --git a/GarrisonCommander.lua b/GarrisonCommander.lua index 09a1795..4a6bf34 100644 --- a/GarrisonCommander.lua +++ b/GarrisonCommander.lua @@ -364,11 +364,11 @@ function addon.Garrison_SortMissions_Original(missionsList) end function addon:OnInitialized() ---[===[@debug@ +--@debug@ ns.xprint("OnInitialized") self.evdebug=CreateFrame("Frame") self.evdebug:SetScript("OnEvent",function(...) return print('|cffff2020event|r',...) end) ---@end-debug@]===] +--@end-debug@ --parties=self:GetParty() for _,b in ipairs(GMFMissionsListScrollFrame.buttons) do local scale=0.8 @@ -406,12 +406,13 @@ function addon:OnInitialized() self:AddSlider("MINPERC",50,0,100,L["Minimun chance success under which ignore missions"],nil,5) self:AddToggle("ILV",true,L["Show weapon/armor level"],L["When checked, show on each follower button weapon and armor level for maxed followers"]) --self:AddPrivateAction("ShowMissionControl",L["Mission control"],L["You can choose some criteria and have GC autosumbit missions for you"]) ---[===[@debug@ +--@debug@ self:AddLabel("Developers options") self:AddToggle("DBG",false, "Enable Debug") self:AddToggle("TRC",false, "Enable Trace") ---@end-debug@]===] +--@end-debug@ self:Trigger("MSORT") + LoadAddOn("GarrisonCommander-Broker") return true end function addon:CheckMP() @@ -561,17 +562,22 @@ function addon:HookedGarrisonMissionButton_AddThreatsToTooltip(missionID) return self:RenderTooltip(missionID) end function addon:AddFollowersToTooltip(missionID) - local f=GarrisonMissionListTooltipThreatsFrame + --local f=GarrisonMissionListTooltipThreatsFrame -- Adding All available followers local party=self:GetParty(missionID) local members=party.members local partystring=strjoin("|",tostringall(unpack(members))) GameTooltip:AddLine(L["Other useful followers"]) for followerID,_ in pairs(G.GetFollowersTraitsForMission(missionID)) do - GameTooltip:AddDoubleLine(self:GetFollowerData(followerID,'fullname','none'),self:GetFollowerStatus(followerID,true,true)) + if not tContains(members,followerID) and G.GetFollowerBiasForMission(missionID,followerID) > -0.1 then + GameTooltip:AddDoubleLine(self:GetFollowerData(followerID,'fullname','none'),self:GetFollowerStatus(followerID,true,true)) + end end + GameTooltip:AddLine("---------------------------------------") for followerID,_ in pairs(G.GetBuffedFollowersForMission(missionID)) do - GameTooltip:AddDoubleLine(self:GetFollowerData(followerID,'fullname','none'),self:GetFollowerStatus(followerID,true,true)) + if not tContains(members,followerID) and G.GetFollowerBiasForMission(missionID,followerID) > -0.1 then + GameTooltip:AddDoubleLine(self:GetFollowerData(followerID,'fullname','none'),self:GetFollowerStatus(followerID,true,true)) + end end local perc=self:GetParty(missionID,'perc') local q=self:GetDifficultyColor(perc) @@ -736,15 +742,15 @@ end -- Fires after GarrisonMissionFrame OnShow. Pretty useless function addon:EventGARRISON_MISSION_NPC_OPENED(event,...) ---[===[@debug@ +--@debug@ ns.xprint(event,...) ---@end-debug@]===] +--@end-debug@ if (GCF) then GCF:Show() end end function addon:EventGARRISON_MISSION_NPC_CLOSED(event,...) ---[===[@debug@ +--@debug@ ns.xprint(event,...) ---@end-debug@]===] +--@end-debug@ if (GCF) then self:RemoveMenu() GCF:Hide() @@ -769,9 +775,9 @@ end -- After this events fires also GARRISON_MISSION_LIST_UPDATE and GARRISON_FOLLOWER_LIST_UPDATE function addon:EventGARRISON_MISSION_STARTED(event,missionID,...) ---[===[@debug@ +--@debug@ ns.xprint(event,missionID,...) ---@end-debug@]===] +--@end-debug@ -- running={ -- ["*"]={ -- followers={}, @@ -813,19 +819,19 @@ end -- function addon:EventGARRISON_MISSION_FINISHED(event,missionID,...) ---[===[@debug@ +--@debug@ ns.xprint(event,missionID,...) ns.xdump(G.GetPartyMissionInfo(missionID)) ---@end-debug@]===] +--@end-debug@ end function addon:EventGARRISON_FOLLOWER_LIST_UPDATE(event) --We need to update all followers, maybe this could be done in an onupdate handle end function addon:EventGARRISON_MISSION_BONUS_ROLL_LOOT(event,missionID,completed,success) ---[===[@debug@ +--@debug@ ns.xprint('evt',event,missionID,completed,success) ---@end-debug@]===] +--@end-debug@ self:RefreshFollowerStatus() end --- @@ -840,9 +846,9 @@ end --GARRISON_MISSION_BONUS_ROLL_LOOY missionID nil -- function addon:EventGARRISON_MISSION_COMPLETE_RESPONSE(event,missionID,completed,rewards) ---[===[@debug@ +--@debug@ ns.xprint('evt',event,missionID,completed,rewards) ---@end-debug@]===] +--@end-debug@ dbcache.history[missionID][time()]={result=100,success=rewards} dbcache.seen[missionID]=nil dbcache.running[missionID]=nil @@ -889,7 +895,7 @@ function addon:Clock() GarrisonMissionFrameMissionsListScrollFrame:Show() GarrisonMissionFrameMissionsListScrollFrame:SetParent(GMFMissions) end ---[===[@debug@ +--@debug@ for k,d in pairs(coroutines) do local co=coroutines[k] if (not co.func) then @@ -904,7 +910,7 @@ function addon:Clock() co.paused=co.func(self) end end ---@end-debug@]===] +--@end-debug@ end function addon:ActivateButton(button,OnClick,Tooltiptext,persistent) button:SetScript("OnClick",function(...) self[OnClick](self,...) end ) @@ -1521,9 +1527,9 @@ function addon:Options() end function addon:ScriptTrace(hook,frame,...) ---[===[@debug@ +--@debug@ ns.xprint("Triggered " .. C(hook,"red").." script on",C(frame,"Azure"),...) ---@end-debug@]===] +--@end-debug@ end function addon:IsProgressMissionPage() return GMF:IsShown() and GMF.MissionTab and GMF.MissionTab.MissionList.showInProgress @@ -1872,10 +1878,10 @@ do for z = 1,#partyIndex do local missionID=partyIndex[z] if not(tonumber(missionID)) then - --[===[@debug@ + --@debug@ ns.xprint("missionid not a number",missionID) self:Dump("partyIndex table",partyIndex) - --@end-debug@]===] + --@end-debug@ perc=-1 --(lowering perc to ignore this mission end @@ -1940,9 +1946,9 @@ end --Initial one time setup function addon:SetUp(...) self:FollowerCacheInit() ---[===[@debug@ +--@debug@ ns.dprint("Setup") ---@end-debug@]===] +--@end-debug@ --@alpha@ if (not db.alfa.v220) then self:Popup(L["You are using an Alpha version of Garrison Commander. Please post bugs on Curse if you find them"],10) @@ -1998,10 +2004,10 @@ function addon:AddMenu() local menu,size=self:CreateOptionsLayer(MP and 'CKMP' or nil,'BIGSCREEN','MOVEPANEL','IGM','IGP','NOFILL','MSORT') --self:AddOptionToOptionsLayer(GCF.Menu,'MSORT') --self:AddOptionToOptionsLayer(GCF.Menu,'ShowMissionControl') ---[===[@debug@ +--@debug@ self:AddOptionToOptionsLayer(menu,'DBG') self:AddOptionToOptionsLayer(menu,'TRC') ---@end-debug@]===] +--@end-debug@ local frame=menu.frame frame:Show() frame:SetParent(GCF) @@ -2031,9 +2037,9 @@ end -- This method is called every time garrison mission panel is open because -- when it closes, I remove most of used hooks function addon:StartUp(...) ---[===[@debug@ +--@debug@ ns.dprint("Startup") ---@end-debug@]===] +--@end-debug@ self:GrowPanel() self:Unhook(GMF,"OnShow") if (self:GetBoolean("PIN")) then @@ -2099,29 +2105,29 @@ function addon:PermanentEvents() end function addon:checkMethod(method,hook) if (type(self[method])=="function") then ---[===[@debug@ +--@debug@ --ns.xprint("Hooking ",hook,"to self:" .. method) ---@end-debug@]===] +--@end-debug@ return true ---[===[@debug@ +--@debug@ else --ns.xprint("Hooking ",hook,"to print") ---@end-debug@]===] +--@end-debug@ end end function addon:SafeRegisterEvent(event) ---[===[@debug@ +--@debug@ if not self.evdebug:IsEventRegistered(event) then self.evdebug:RegisterEvent(event) end ---@end-debug@]===] +--@end-debug@ local method="Event"..event if (self:checkMethod(method,event)) then return self:RegisterEvent(event,method) ---[===[@debug@ +--@debug@ else return self:RegisterEvent(event,ns.xprint) ---@end-debug@]===] +--@end-debug@ end end function addon:SafeSecureHook(tobehooked,method) @@ -2129,13 +2135,13 @@ function addon:SafeSecureHook(tobehooked,method) method=method or "Hooked"..tobehooked if (self:checkMethod(method,tobehooked)) then return self:SecureHook(tobehooked,method) ---[===[@debug@ +--@debug@ else do local hooked=tobehooked return self:SecureHook(tobehooked,function(...) ns.xprint(hooked,...) end) end ---@end-debug@]===] +--@end-debug@ end end function addon:SafeHookScript(frame,hook,method,postHook) @@ -2176,9 +2182,9 @@ function addon:CleanUp() GarrisonFollowerTooltip.fs:Hide() end --collectgarbage("collect") ---[===[@debug@ +--@debug@ ns.xprint("Cleaning up") ---@end-debug@]===] +--@end-debug@ end function addon:EventGARRISON_FOLLOWER_XP_CHANGED(event,followerID,iLevel,xp,level,quality) local i=followersCacheIndex[followerID] @@ -2252,9 +2258,9 @@ function addon:FillMissionPage(missionInfo) if( IsControlKeyDown()) then ns.xprint("Shift key, ignoring mission prefill") return end if (self:GetBoolean("NOFILL")) then return end local missionID=missionInfo.missionID ---[===[@debug@ +--@debug@ ns.xprint("UpdateMissionPage for",missionID,missionInfo.name,missionInfo.numFollowers) ---@end-debug@]===] +--@end-debug@ self:holdEvents() GarrisonMissionPage_ClearParty() local party=self:GetParty(missionID) @@ -2266,9 +2272,9 @@ function addon:FillMissionPage(missionInfo) local status=G.GetFollowerStatus(followerID) if (false and status) then if status == GARRISON_FOLLOWER_IN_PARTY then -- Left from a previous assignment? ---[===[@debug@ +--@debug@ ns.xprint(followerID,self:GetFollowerData(followerID,"name"),"was already on mission") ---@end-debug@]===] +--@end-debug@ self:RemoveFromAllMissions(followerID) GarrisonMissionPage_AddFollower(followerID) else @@ -2590,9 +2596,9 @@ function addon:OnClick_GarrisonMissionButton(tab,button) return end if (type(tab.info)~="table") then return end ---[===[@debug@ +--@debug@ ns.xprint("Clicked GarrisonMissionButton") ---@end-debug@]===] +--@end-debug@ if (tab.fromFollowerPage) then if (#tab.info.followers>0) then return @@ -2626,9 +2632,9 @@ local function override(blizfunc) orig[blizfunc]=_G[blizfunc] _G[blizfunc]=over[blizfunc] end ---[===[@debug@ +--@debug@ print("Overriding ",blizfunc) ---@end-debug@]===] +--@end-debug@ end function over.StolenGarrisonMissionPageFollowerFrame_OnEnter(self) if not self.info then @@ -2880,21 +2886,6 @@ function over.GarrisonMissionPageFollowerFrame_OnEnter(self) ); end function over.GarrisonMissionButton_OnEnter(self, button) - if ns.toc < 60100 then ---[===[@non-debug@ - return orig.GarrisonMissionButton_OnEnter(self,button) ---@end-non-debug@]===] - addon:RenderTooltip(self.info.missionID) ---[===[@debug@ - orig.GarrisonMissionButton_OnEnter(self,button) - GameTooltip:AddDoubleLine("MissionID",self.info.missionID) - GameTooltip:AddDoubleLine("xp",addon:GetMissionData(self.info.missionID,'xp')) - GameTooltip:AddDoubleLine("xpBonus",addon:GetMissionData(self.info.missionID,'xpBonus')) - - GameTooltip:Show() - return ---@end-debug@]===] - end if (self.info == nil) then return; end @@ -2902,7 +2893,11 @@ function over.GarrisonMissionButton_OnEnter(self, button) GameTooltip:SetOwner(self, "ANCHOR_CURSOR_RIGHT"); if(self.info.inProgress) then - GarrisonMissionButton_SetInProgressTooltip(self.info); + if ns.toc < 60100 then + orig.GarrisonMissionButton_OnEnter(self,button) + else + GarrisonMissionButton_SetInProgressTooltip(self.info) + end else GameTooltip:SetText(self.info.name); GameTooltip:AddLine(string.format(GARRISON_MISSION_TOOLTIP_NUM_REQUIRED_FOLLOWERS, self.info.numFollowers), 1, 1, 1); @@ -2919,11 +2914,13 @@ function over.GarrisonMissionButton_OnEnter(self, button) addon:AddFollowersToTooltip(self.info.missionID) GameTooltip:Show() end ---@debu@ +--@debug@ GameTooltip:AddDoubleLine("MissionID",self.info.missionID) ---@end-debug@]===] +--@end-debug@ GameTooltip:Show(); - GarrisonMissionFrame.MissionTab.MissionList.newMissionIDs[self.info.missionID] = nil; + if ns.toc >=60100 then + GarrisonMissionFrame.MissionTab.MissionList.newMissionIDs[self.info.missionID] = nil + end --GarrisonMissionList_Update(); end ---@function @@ -3046,7 +3043,7 @@ function addon:AddStandardDataToButton(page,button,mission,missionID,bigscreen) local n=mission.numRewards local w=button:GetWidth()-175 -- 655 for standard 830 button if button:GetWidth()<1000 then n=n+mission.numFollowers end - --print(w,button.Title:GetWidth() + button.Summary:GetWidth() + 8,n,w - n * 65) + ns.xprint(format("%d %d %d %d",w,button.Title:GetWidth() + button.Summary:GetWidth() + 8,n,w - n * 65)) if ( button.Title:GetWidth() + button.Summary:GetWidth() + 8 < w - n * 65 ) then button.Title:SetPoint("LEFT", 165, 0); button.Summary:ClearAllPoints(); @@ -3061,7 +3058,7 @@ function addon:AddStandardDataToButton(page,button,mission,missionID,bigscreen) end if ns.toc < 60100 then function GarrisonMissionButton_CheckTooltipThreat() - --print("checktooltip placeholder") + print("checktooltip placeholder") end end function addon:AddThreatsToButton(button,mission,missionID,bigscreen) diff --git a/GarrisonCommander.toc b/GarrisonCommander.toc index 3e2ddae..f44d57f 100644 --- a/GarrisonCommander.toc +++ b/GarrisonCommander.toc @@ -1,4 +1,4 @@ -## Interface: 60000 +## Interface: 60100 ## Title: 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 diff --git a/Init.lua b/Init.lua index 99cb6d9..4b952fb 100644 --- a/Init.lua +++ b/Init.lua @@ -10,9 +10,9 @@ local format=format local GetTime=GetTime local strjoin=strjoin local tostringall=tostringall ---[===[@debug@ +--@debug@ LoadAddOn("Blizzard_DebugTools") ---@end-debug@]===] +--@end-debug@ ns.addon=LibStub("LibInit"):NewAddon(me,'AceHook-3.0','AceTimer-3.0','AceEvent-3.0','AceBucket-3.0') local chatframe=ns.addon:GetChatFrame("aDebug") local function pd(...) @@ -31,28 +31,28 @@ ns.trace=ns.addon:Wrap("Trace") ns.xprint=function() end ns.xdump=function() end ns.xtrace=function() end ---[===[@debug@ +--@debug@ --ns.xprint=function(...) pd("|cffff9900DBG|r",...) end --ns.xdump=function(d,t) pp("|cffff9900DMP|r",t) DevTools_Dump(d) end --ns.xtrace=ns.trace ---@end-debug@]===] +--@end-debug@ do - --[===[@debug@ + --@debug@ local newcount, delcount,createdcount,cached = 0,0,0 - --@end-debug@]===] + --@end-debug@ local pool = setmetatable({},{__mode="k"}) function ns.new() - --[===[@debug@ + --@debug@ newcount = newcount + 1 - --@end-debug@]===] + --@end-debug@ local t = next(pool) if t then pool[t] = nil return t else - --[===[@debug@ + --@debug@ createdcount = createdcount + 1 - --@end-debug@]===] + --@end-debug@ return {} end end @@ -64,13 +64,13 @@ do return c end function ns.del(t) - --[===[@debug@ + --@debug@ delcount = delcount + 1 - --@end-debug@]===] + --@end-debug@ wipe(t) pool[t] = true end - --[===[@debug@ + --@debug@ function cached() local n = 0 for k in pairs(pool) do @@ -84,7 +84,7 @@ do ns.print("Released:",delcount) ns.print("Cached:",cached()) end - --@end-debug@]===] + --@end-debug@ end local stacklevel=0 diff --git a/MissionCompletion.lua b/MissionCompletion.lua index 5cb7821..c8be305 100644 --- a/MissionCompletion.lua +++ b/MissionCompletion.lua @@ -67,13 +67,14 @@ function addon:GenerateMissionCompleteList(title) l:SetFullWidth(true) obj:AddChild(l) if (obj.scrollbar and obj.scrollbar:IsShown()) then + obj:SetScroll(80) obj.scrollbar.ScrollDownButton:Click() end end function m:AddFollower(followerID,xp,levelup) local follower=addon:GetFollowerData(followerID) - if follower.maxed then + if follower.maxed and not levelup then return self:AddRow(format("%s is already at maximum xp",addon:GetFollowerData(followerID,'fullname'))) end local quality=G.GetFollowerQuality(followerID) or follower.quality @@ -82,7 +83,7 @@ function addon:GenerateMissionCompleteList(title) PlaySound("UI_Garrison_CommandTable_Follower_LevelUp"); end return self:AddRow(format("%s gained %d xp%s%s",addon:GetFollowerData(followerID,'fullname',true),xp, - levelup and " *** Level Up ***." or ".", + levelup and " |cffffed1a*** Level Up ***|r ." or ".", format(" %d to go.",addon:GetFollowerData(followerID,'levelXP')-addon:GetFollowerData(followerID,'xp')))) end function m:AddIconText(icon,text,qt) @@ -99,6 +100,7 @@ function addon:GenerateMissionCompleteList(title) l:SetFullWidth(true) obj:AddChild(l) if (obj.scrollbar and obj.scrollbar:IsShown()) then + obj:SetScroll(80) obj.scrollbar.ScrollDownButton:Click() end return l @@ -221,9 +223,9 @@ do function addon:MissionAutoComplete(event,ID,arg1,arg2,arg3,arg4) -- C_Garrison.MarkMissionComplete Mark mission as complete and prepare it for bonus roll, da chiamare solo in caso di successo -- C_Garrison.MissionBonusRoll - --[===[@debug@ + --@debug@ print("evt",event,ID,arg1,arg2,agr3) - --@end-debug@]===] + --@end-debug@ if self['Event'..event] then self['Event'..event](self,event,ID,arg1,arg2,arg3,arg4) end @@ -248,7 +250,11 @@ do return -- GET_ITEM_INFO_RECEIVED: itemID elseif (event=="GARRISON_MISSION_BONUS_ROLL_LOOT") then - rewards.items[format("%d:%s",currentMission.missionID,ID)]=1 + if (currentMissission) then + rewards.items[format("%d:%s",currentMission.missionID,ID)]=1 + else + rewards.items[format("%d:%s",0,ID)]=1 + end return -- GARRISON_MISSION_COMPLETE_RESPONSE: missionID, requestCompleted, succeeded elseif (event=="GARRISON_MISSION_COMPLETE_RESPONSE") then @@ -301,7 +307,7 @@ do end currentMission.state=step else - report:AddRow(DONE) + report:AddRow(L[" Final Report "]) startTimer(0.3,"LOOT") end end @@ -317,7 +323,8 @@ do end if success then for k,v in pairs(currentMission.rewards) do - print("Reward",k,v) + print("Reward") + DevTools_Dump(v) v.quantity=v.quantity or 0 v.multiplier=v.multiplier or 1 v.golds=v.golds or 1 @@ -331,15 +338,19 @@ do rewards.currencies[v.currencyID].qt=rewards.currencies[v.currencyID].qt+v.quantity end elseif v.itemID then + GetItemInfo(v.itemID) -- Triggering the cache rewards.items[format("%d:%s",currentMission.missionID,v.itemID)]=1 end end end + DevTools_Dump(rewards) end function addon:MissionsPrintResults(success) stopTimer() self:FollowerCacheInit() - self:Dump("Ended Mission",rewards) +--@debug@ + --self:Dump("Ended Mission",rewards) +--@end-debug@ for k,v in pairs(rewards.currencies) do if k == 0 then -- Money reward diff --git a/MissionControl.lua b/MissionControl.lua index 804a92d..419c11c 100644 --- a/MissionControl.lua +++ b/MissionControl.lua @@ -23,9 +23,9 @@ local GMCUsedFollowers={} local wipe=wipe local pairs=pairs local tinsert=tinsert ---[===[@debug@ +--@debug@ if LibDebug then LibDebug() end ---@end-debug@]===] +--@end-debug@ local dbg function addon:GMCBusy(followerID) return GMCUsedFollowers[followerID] @@ -78,23 +78,6 @@ function addon:GMCCreateMissionList(workList) return addon:GetMissionData(i1,'level') > addon:GetMissionData(i2,'level') end table.sort(workList,msort) - --[===[@debug@ - ns.xprint("Sorted list") - local x=new() - for i=1,#workList do - local mission=self:GetMissionData(workList[i]) - local t=mission.name - for i=1,#GMC.settings.itemPrio do - local criterium=GMC.settings.itemPrio[i] - t=t..format(" %s: %d",criterium,mission[criterium]) - end - tinsert(x,t .. " Success" .. tostring(parties[mission.missionID].perc)) - end - local scroll=self:GetScroller("Sorted missions",nil,600,600) - self:cutePrint(scroll,x) - del(x) - --@end-debug@]===] - end --- This routine can be called both as coroutin and as a standard one -- In standard version, delay between group building and submitting is done via a self schedule diff --git a/PartyCache.lua b/PartyCache.lua index e3c4305..dbb3590 100644 --- a/PartyCache.lua +++ b/PartyCache.lua @@ -86,12 +86,12 @@ function party:AddFollower(followerID) if (rc and code) then tinsert(members,followerID) return true ---[===[@debug@ +--@debug@ else ns.xprint("Unable to add",followerID, G.GetFollowerName(followerID),"to",ID,code,self:IsIn(followerID),G.GetFollowerStatus(followerID)) ns.xprint(members[1],members[2],members[3]) ns.xprint(debugstack(1,6,0)) ---@end-debug@]===] +--@end-debug@ end end end @@ -100,9 +100,9 @@ function party:RemoveFollower(followerID) if (followerID==members[i]) then tremove(members,i) local rc,code=pcall(G.RemoveFollowerFromMission,ID,followerID) ---[===[@debug@ +--@debug@ if (not rc) then trace("Unable to remove", G.GetFollowerName(members[i]),"from",ID,code) end ---@end-debug@]===] +--@end-debug@ return true end end end @@ -162,9 +162,9 @@ function party:Close(desttable) for i=1,3 do if (members[i]) then local rc,code=pcall(G.RemoveFollowerFromMission,ID,members[i]) ---[===[@debug@ +--@debug@ if (not rc) then ns.xtrace("Unable to pop", G.GetFollowerName(members[i])," from ",ID,code) end ---@end-debug@]===] +--@end-debug@ else break diff --git a/libs/LibDeformat-3.0/LibDeformat-3.0.lua b/libs/LibDeformat-3.0/LibDeformat-3.0.lua index 6580517..f4bcb52 100644 --- a/libs/LibDeformat-3.0/LibDeformat-3.0.lua +++ b/libs/LibDeformat-3.0/LibDeformat-3.0.lua @@ -211,7 +211,7 @@ function LibDeformat.Deformat(text, pattern) return get_deformat_function(pattern)(text) end ---[===[@debug@ +--@debug@ function LibDeformat.Test() local function tuple(success, ...) if success then @@ -267,6 +267,6 @@ function LibDeformat.Test() test("Hello, friend", "Cost: $%d", nil) print("LibDeformat-3.0: Tests completed.") end ---@end-debug@]===] +--@end-debug@ setmetatable(LibDeformat, { __call = function(self, ...) return self.Deformat(...) end }) \ No newline at end of file