diff ObjectiveStyle.lua @ 16:880828018bf4

ObjectiveEvents - trim down the number of events that fire full updates - begin the general outline for determining which trackers need to refresh - handlers for accepting and completing auto-popup quests ObjectiveFrame - correct variables for money reward calculation - make sure everythign is scaling to the font strings and that the font strings aren't being pinned by SetSize ObjectiveInfo - implementation of autoquest popups - discern between internal and client bonus objective indexes - acquire the correct data set from bonus objective query ObjectiveStyle - look for a style table under the previously interpreted set before deferring standard options - horizontal/vertical options in gradient - remove height-fixing for font strings
author Nenue
date Tue, 05 Apr 2016 00:39:12 -0400
parents ed642234f017
children c33497b116d6
line wrap: on
line diff
--- a/ObjectiveStyle.lua	Mon Apr 04 03:41:28 2016 -0400
+++ b/ObjectiveStyle.lua	Tue Apr 05 00:39:12 2016 -0400
@@ -85,7 +85,7 @@
         TextColor = {1, .9, .2, 1},
       },
       titlebg = {
-        Gradient = {MinColor = {0,0,0,0.25}, MaxColor = {0,0,0,.15}},
+        Gradient = {'VERTICAL', MinColor = {0,0,0,0.25}, MaxColor = {0,0,0,.15}},
       }
     }
   },
@@ -93,7 +93,7 @@
     Normal = {
       titlebg = {
         Indent = 2,
-        Gradient = { MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .14}},
+        Gradient = { 'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .14}},
       },
       title = {
         TextColor = {1,1,1,0.5},
@@ -106,7 +106,7 @@
         Spacing = textSpacing,
       },
       statusbg = {
-        Gradient = { MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .11}},
+        Gradient = { 'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .11}},
       }
     },
     Super = {
@@ -116,7 +116,7 @@
         Spacing = titleSpacing, BackgroundFullWidth = true
       },
       titlebg = {
-        Gradient = { MinColor = {0, .7, .6, .45}, MaxColor = {0, .7, .6, 0.23}},
+        Gradient = { 'HORIZONTAL', MinColor = {0, .7, .6, 0}, MaxColor = {0, .7, .6, 0.23}},
       },
       status = {
         TextColor = {1,1,1,1},
@@ -124,7 +124,7 @@
         Spacing = textSpacing,
       },
       statusbg = {
-        Gradient = { MinColor = {0, .7, .6, 0.40}, MaxColor = {0, .7, .6, 0.23} },
+        Gradient = { 'HORIZONTAL', MinColor = {0, .7, .6, 0}, MaxColor = {0, .7, .6, 0.23} },
       },
     },
     MouseDown = {
@@ -133,14 +133,14 @@
         Spacing = titleSpacing,
       },
       titlebg = {
-        Gradient = {          MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .4},        },
+        Gradient = {'HORIZONTAL',  MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .4},        },
       },
       status = {
         Font = {textFont, textSize, textOutline},
         Spacing = textSpacing,
       },
       statusbg = {
-        Gradient = {          MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .2},        },
+        Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .2},        },
       }
     },
     Complete = {
@@ -149,25 +149,46 @@
         Font = {titleFont, titleSize, titleOutline},        Spacing = titleSpacing,
       },
       titlebg = {
-        Gradient = {          MinColor = {0, 1, 0, 0.34},          MaxColor = {0, 1, 0, .17},        },
+        Gradient = {'HORIZONTAL', MinColor = {0, 1, 0, 0},          MaxColor = {0, 1, 0, 0.34},        },
       },
       status = {
         TextColor = {1,1,1,0.5},
         Font = {textFont, textSize, textOutline},        Spacing = textSpacing,
       },
       statusbg = {
-        Gradient = {          MinColor = {0, 1, 0, .25},          MaxColor = {0, 1, 0, 0.12},        },
+        Gradient = {'HORIZONTAL', MinColor = {0, 1, 0, 0},          MaxColor = {0, 1, 0, .25},        },
       }
     },
     Daily = {
       titlebg = {
-        Gradient = {          MinColor = {0, .4, 1, 0.34},          MaxColor = {0, 0.4, 1, .17},        },
+        Gradient = {'HORIZONTAL', MinColor = {0, .4, 1, 0.34},          MaxColor = {0, 0.4, 1, .17},        },
       },
       statusbg = {
-        Gradient = {          MinColor = {0, .4, 1, 0.25},          MaxColor = {0, 0.4, 1, .12},        },
+        Gradient = {'HORIZONTAL', MinColor = {0, .4, 1, 0.25},          MaxColor = {0, 0.4, 1, .12},        },
       },
     },
-    Cheev =  {
+    AutoQuest = {
+      Normal = {
+        titlebg = {
+          Indent = 2,
+          Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .14}},
+        },
+        title = {
+          TextColor = {1,1,1,1},
+          Font = {titleFont, titleSize, titleOutline},
+          Spacing = titleSpacing,
+        },
+        status = {
+          TextColor = {0,1,0,1},
+          Font = {textFont, textSize, textOutline},
+          Spacing = textSpacing,
+        },
+        statusbg = {
+          Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .11}},
+        }
+      },
+    },
+    Cheevs =  {
       Normal = {
 
         title = {
@@ -175,7 +196,7 @@
           Spacing = titleSpacing,
         },
         titlebg = {
-          Gradient = { MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}},
+          Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}},
 
         },
         status = {
@@ -183,7 +204,7 @@
           Spacing = textSpacing,
         },
         statusbg = {
-          Gradient = { MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}},
+          Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}},
         },
       },
       Complete = {
@@ -192,14 +213,14 @@
           Spacing = titleSpacing,
         },
         titlebg = {
-          Gradient = { MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}},
+          Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}},
         },
         status = {
           Font = {textFont, textSize, textOutline},
           Spacing = textSpacing,
         },
         statusbg = {
-          Gradient = { MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}},
+          Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}},
         },
       },
     }
@@ -221,11 +242,12 @@
 mod.regionStyles = {}
 mod.SetBlockStyle = function(frame, frameType, ...)
   -- var names intended to reflect argument order
-  print('|cFFFFFF00'..frame:GetName()..'|r')
+  print('|cFFFFFF00'..frame:GetName()..'|r', frameType, ...)
   --@debug@
   local c = mod.defaults.Normal
   local style_list = {... }
   local styleName = frameType .. '-' .. table.concat(style_list,'')
+  local previousClass = mod.Conf.Style[frameType]
 
   if not style_cache[styleName] then
     local style = {}
@@ -238,15 +260,21 @@
     local normal = mod.defaults.Style.Normal
     local root =  mod.defaults.Style[frameType] or normal
     for i, className in ipairs(style_list) do
-      local class = root[className] or normal[className] or root
-      if root[className] then
-
+      local class = normal
+      if previousClass and previousClass[className] then
+        class = previousClass[className]
+        print('  ChildClass |cFFFF0088'.. className .. '|r')
+      elseif root[className] then
+        class = root[className]
         print('  SubClass |cFF0088FF'.. className .. '|r')
       elseif normal[className] then
+        class = normal[className]
         print('  SubClass Normal.|cFFFF0088'..className..'|r')
       else
-        print('  SubClass Normal')
+        print('  SubClass not found '..className..'')
       end
+      previousClass = class
+
       for elementName, element in pairs(class) do
         if not elementName:match('^%u') then
           print('   scanning Element |cFF8800FF'.. elementName ..'|r')
@@ -263,7 +291,6 @@
         end
 
       end
-
     end
 
     for k, elements in pairs(mod.defaults.Style.Normal) do
@@ -277,7 +304,7 @@
     for k,v in pairs(style) do
       if type(v) == 'table' and not k:match('^%u') then
         for kk, vv in pairs(v) do
-        print('  |cFFFFFF00'..k..'|r.|cFF00FF00'..kk..'|r =', tostring(vv))
+        print('  |cFFFFFF00'..k..'|r.|cFF00FF00'..kk..'|r =', (type(vv) == 'table' and ('{'..table.concat(vv,', ')..'}') or tostring(vv)))
         end
       else
         print(' |cFFFFFFFF' .. k ..'|r =', tostring(v))
@@ -301,7 +328,7 @@
 
         for attributeName, value in pairs(styleset) do
           if mod.SetBlockAttribute[attributeName] then
-            print('  '..elementName..':'.. attributeName ..'(', value, ')')
+            print('  add function '..elementName..':'.. attributeName ..'(', (type(value) == 'table' and ('{'..table.concat(value,', ')..'}') or tostring(value)), ')')
 
 
             --mod.SetBlockAttribute[attributeName](region, value)
@@ -343,20 +370,26 @@
   frame.statusWidth = frame.width - normalSettings.status.Indent
   frame.titleWidth = frame.width - normalSettings.title.Indent
 
+  print((frame.status and frame.status:GetText()))
+  print((frame.status and frame.status:GetWidth()))
+  print(frame.status and frame.title:GetStringHeight())
+  print(frame.title and (frame.title:GetStringHeight() + (frame.title.spacing or 0)*2) or 0)
+  print(frame.status and frame.status:GetStringHeight())
+  print(frame.status and (frame.status:GetStringHeight() + (frame.status.spacing or 0)*2)  or 0)
   if frame.status then
     print('status  ', frame.statusHeight, normalSettings.status.Indent, 0, 'statusbg', frame.statusHeight)
+    frame.status:SetWidth(frame.width)
     frame.status:SetPoint('LEFT', frame, 'LEFT', normalSettings.status.Indent, 0)
-    frame.status:SetHeight(frame.statusHeight)
+    --frame.status:SetHeight(frame.statusHeight)
     if frame.statusbg then
-
-      frame.statusbg:SetHeight(frame.statusHeight + (frame.attachmentHeight or 0))
+      frame.statusbg:SetHeight(frame.statusHeight)
       frame.statusbg:SetWidth(frame.width)
     end
   end
   if frame.title then
     print('title  ',frame.titleHeight, normalSettings.title.Indent, 'titlebg',frame.titleHeight)
     frame.title:SetPoint('LEFT', frame, 'LEFT', normalSettings.title.Indent)
-    frame.title:SetHeight(frame.titleHeight)
+    frame.title:SetWidth(frame.width)
     if frame.titlebg then
       frame.titlebg:SetHeight(frame.titleHeight)
       frame.titlebg:SetWidth(frame.width)
@@ -443,7 +476,7 @@
 local print = B.print('Attribute')
 sb.Gradient = function(region, value)
   print('|cFF8844FFGradient|r', region:GetName(), unpack(value))
-  o = 'HORIZONTAL'
+  o = value[1]
   a1, a2, a3, a4 = unpack(value.MinColor)
   b1, b2, b3, b4 = unpack(value.MaxColor)
   region:SetVertexColor(1,1,1)