From 49074821fe2fc6e4220448955fb8d12bac176d66 Mon Sep 17 00:00:00 2001 From: Alar of Daggerspine Date: Thu, 2 Apr 2015 03:04:51 +0200 Subject: [PATCH] Forces broker to update labels on daily reset Signed-off-by: Alar of Daggerspine --- Debug.lua | 55 ++++++++++++++++++++++++++++++++++++++ GarrisonCommander-Broker/ldb.lua | 3 +++ 2 files changed, 58 insertions(+) diff --git a/Debug.lua b/Debug.lua index 278391e..aefdeda 100644 --- a/Debug.lua +++ b/Debug.lua @@ -1,6 +1,61 @@ if true then return end --@do-not-package@ local me, ns = ... +if (me=="doc") then + local mt={ + keys=setmetatable({},{__index=function(t,k) rawset(t,k,{}) return t[k] end }), + __metatable=true + + } + function mt:__index(k) + + if k=="n" then + return #mt.keys[self] + end + return rawget(self,k) + end + function mt:__len() + return #mt.keys[self] + end + function mt:__newindex(k,v) + local keys=mt.keys[self] + local pos=#keys+1 + print("Inserting",k) + for i,x in ipairs(keys) do + if x>k then + pos=i + break; + end + end + table.insert(keys,pos,k) + print("Inserted",k,"at",pos) + rawset(self,k,v) + end + function a() + return function(unsorted,i) + i=i+1 + local k=mt.keys[unsorted][i] + if k then return i,k end + end,self,0 + end + function mt:__call() + do + local current=0 + return function(unsorted,i) + current=current+1 + local k=mt.keys[unsorted][current] + if k then return k,self[k] end + end,self,0 + end +end + local my=setmetatable({},mt) + my.pippo=3 + my.pluto=4 + my.andrea=2 + my.zanzi=1 + for k,v in my() do print(k,v) end + return +end local addon=ns.addon --#addon local L=ns.L local D=ns.D diff --git a/GarrisonCommander-Broker/ldb.lua b/GarrisonCommander-Broker/ldb.lua index 4729401..619ac83 100644 --- a/GarrisonCommander-Broker/ldb.lua +++ b/GarrisonCommander-Broker/ldb.lua @@ -155,6 +155,9 @@ function addon:CheckDateReset() --@debug@ if (today~=oldToday) then self:Popup(format("o:%s y:%s t:%s r:%s [w:%s m:%s d:%s y:%s] ",oldToday,yesterday,today,reset,CalendarGetDate())) + dataobj:Update() + farmobj:Update() + workobj:Update() end --@end-debug@ end -- 1.7.9.5