changeset 76:83b3cdaae6a5

refactor into addons
author Nenue
date Sat, 27 Aug 2016 10:45:05 -0400
parents d9d16e67725c
children 51f248dc0276
files .hgsub Modules/PaperDoll.lua Options.lua Veneer.lua Veneer.toc
diffstat 4 files changed, 12 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/Modules/PaperDoll.lua	Sat Aug 27 07:09:54 2016 -0400
+++ b/Modules/PaperDoll.lua	Sat Aug 27 10:45:05 2016 -0400
@@ -116,28 +116,22 @@
   end
 end
 
+local UpdateNext = function(frame)
+
+  plugin.next(function()
+    print('updating', frame:GetName())
+    UpdateVeneer(frame:GetParent(), frame)
+  end)
+end
+
+
 local UpdateAll = function()
   for index, frame in pairs(vnslot) do
     if frame:IsVisible() then
       print('forcing', index, frame:GetName())
-      tinsert(pendingSlots, frame)
+      UpdateNext(frame)
     end
   end
-  plugin.ticker()
-end
-
-local UpdateNext = function()
-
-  local frame = tremove(pendingSlots)
-  if frame and frame:IsVisible() then
-    print('updating', frame:GetName())
-    UpdateVeneer(frame:GetParent(), frame)
-  else
-
-    ticker:Cancel()
-    ticker = nil
-  end
-
 end
 
 
@@ -177,15 +171,9 @@
     tinsert(pendingSlots, frame)
   end
 
-  plugin.ticker()
 end
 
 
-plugin.ticker = function()
-  if (not ticker) and #pendingSlots >= 1 then
-    ticker = C_Timer.NewTicker(0, UpdateNext)
-  end
-end
 
 
 plugin.event = function(self, event, ...)
--- a/Options.lua	Sat Aug 27 07:09:54 2016 -0400
+++ b/Options.lua	Sat Aug 27 10:45:05 2016 -0400
@@ -1,8 +1,7 @@
 
-local vn, print = LibStub("LibKraken").register(Veneer, "Options")
 local plugin = CreateFrame('Frame', 'VeneerOptions', UIParent, 'TooltipBorderedFrameTemplate')
-vn.wrap(plugin)
 
+local vn, print = LibStub("LibKraken").register(Veneer, plugin)
 
 local fields = {}
 local templateTypes = {
--- a/Veneer.lua	Sat Aug 27 07:09:54 2016 -0400
+++ b/Veneer.lua	Sat Aug 27 10:45:05 2016 -0400
@@ -170,11 +170,6 @@
 end
 
 
-vn.wrap = function(module)
-  vn.modules = vn.modules or {}
-  tinsert(vn.modules, module)
-end
-
 SLASH_VENEER1 = "/veneer"
 SLASH_VENEER2 = "/vn"
 
--- a/Veneer.toc	Sat Aug 27 07:09:54 2016 -0400
+++ b/Veneer.toc	Sat Aug 27 10:45:05 2016 -0400
@@ -7,7 +7,7 @@
 ## X-Category: Interface Enhancements
 ## DefaultState: Enabled
 ## LoadOnDemand: 0
-## OptionalDeps: Devian
+## OptionalDeps: LibKraken, Devian
 
 Veneer.xml
 Options.lua