changeset 11:fb80e365bab3

ObjectiveStyle & ObjectiveFrame - abstract aesthetic details away from ObjectiveFrame - revise SetBlockStyle into a more general algorithm for every frame - implement caching of resolved attribute combinations - use loadstring functions to store resolved attributes and call upon those when, for example, a MouseUp leads a tracker block to restore its original style (removes a lot of very small fps dipping)
author Nenue
date Sat, 02 Apr 2016 03:23:12 -0400
parents f03c75f63566
children 8238cddaddb1
files ObjectiveStyle.lua
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ObjectiveStyle.lua	Sat Apr 02 03:19:25 2016 -0400
+++ b/ObjectiveStyle.lua	Sat Apr 02 03:23:12 2016 -0400
@@ -259,8 +259,8 @@
     local code =
         "return function (frame)\n"..
         "  local func = Veneer.ObjectiveTracker.SetBlockAttribute\n"..
-        "  local cache = Veneer.ObjectiveTracker.BlockStyleCache" ..
-        "  print('CacheFunc', '|cFFFFFF00SET|r "..styleName.." |cFFFFFF00ON|r', frame:GetName()) "
+        "  local cache = Veneer.ObjectiveTracker.BlockStyleCache"
+            --.. "  print('CacheFunc', '|cFFFFFF00SET|r "..styleName.." |cFFFFFF00ON|r', frame:GetName()) "
 
     for elementName, styleset in pairs(style) do
         code = code ..
@@ -272,8 +272,9 @@
 
 
             --mod.SetBlockAttribute[attributeName](region, value)
-            code = code .. "\n    print('CacheFunc', '  applying', '|cFF00FFFF" .. attributeName .. "|r to', '|cFF0088FF"..elementName.."|r', cache['"..styleName.."']['"..elementName.."']['".. attributeName .."'])" ..
-                "\n\n    func['" .. attributeName .. "'](frame['"..elementName.."'],"..
+            code = code
+                --.. "\n    print('CacheFunc', '  applying', '|cFF00FFFF" .. attributeName .. "|r to', '|cFF0088FF"..elementName.."|r', cache['"..styleName.."']['"..elementName.."']['".. attributeName .."'])"
+                .. "\n\n    func['" .. attributeName .. "'](frame['"..elementName.."'],"..
                 " cache['"..styleName.."']['"..elementName.."']['".. attributeName .."'])"
 
             --- Set any frame.blah variables used in Updates
@@ -289,7 +290,7 @@
         end
         code = code ..
             "\n  else"..
-            "\n    print('CacheFunc', '  |cFFFF4400missing', frame:GetName()..'."..elementName.."')"..
+            --"\n    print('CacheFunc', '  |cFFFF4400missing', frame:GetName()..'."..elementName.."')"..
             "\n  end"
     end
     code = code .. "\nend"