Mercurial > wow > buffalo2
diff ObjectiveStyle.lua @ 13:9455693fc290
Init
- recall XML display state on reload
ObjectiveFrame
- quest coloring by relative level
- quest coloring by daily/weekly/complete status
- remember starting scroll value between reload
- limit anchor points to edges for regions affected by style attributes
ObjectiveInfo
- AutoQuest outline definitions
- Pull Quest title and tag data in addition to WatchInfo
ObjectiveStyle
- ensure consistent style table
- hardcode certain attributes for sanity
XML
- ensure consistent naming conventions for heading and content elements
- ensure hardcore anchors are based on edges
- expansion of file structure to deal with complexities of dynamic widgets and style caching
ObjectiveUI
- determine primary style by block handler when restoring original style
- moved framescript to 'ObjectiveWidgets' lua
author | Nenue |
---|---|
date | Sat, 02 Apr 2016 17:46:52 -0400 |
parents | fb80e365bab3 |
children | ed642234f017 |
line wrap: on
line diff
--- a/ObjectiveStyle.lua Sat Apr 02 05:01:54 2016 -0400 +++ b/ObjectiveStyle.lua Sat Apr 02 17:46:52 2016 -0400 @@ -11,12 +11,13 @@ local titleSize, textSize = 15, 15 local titleOutline, textOutline = "OUTLINE", "OUTLINE" local titleSpacing, textSpacing = 4, 3 -local textIndent = 5 +local unpack, type, pairs, tconcat = unpack, type, pairs, table.concat local wrapperMaxWidth, wrapperMaxHeight = 280, 490 -- these are the hard bounds, actual *Height variables are changed local wrapperHeadFont, wrapperHeadSize, wrapperHeadOutline = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 16, 'NONE' local headerFont, headerSize, headerHeight = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 18, 24 local headerOutline, headerColor, headerSpacing = 'OUTLINE', {1,1,1,1}, 2 + mod.defaults.ObjectiveWrapper = { ObjectiveTrackerFloat = {'BOTTOM', 'RIGHT'}, ObjectiveTrackerParent = 'DebuffButton', @@ -24,7 +25,18 @@ ObjectiveWrapperParent = '', } mod.defaults.Style = { - FontBank = { + Format = { + Frame = { + Width = 270, + }, + title = { + Indent = 0 + }, + status = { + Indent = 5 + } + }, + FontBank = { ['Normal'] = _G.VeneerCriteriaFontNormal, ['Progress'] = _G.VeneerCriteriaFontProgress, ['Complete'] = _G.VeneerCriteriaFontComplete, @@ -106,14 +118,12 @@ }, titlebg = { Gradient = { MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .4}, }, - BackgroundFullWidth = true, }, status = { Font = {textFont, textSize, textOutline}, Spacing = textSpacing, }, statusbg = { - BackgroundFullWidth = true, Gradient = { MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .2}, }, } }, @@ -123,16 +133,22 @@ }, titlebg = { Gradient = { MinColor = {0, 1, 0, 0.34}, MaxColor = {0, 1, 0, .17}, }, - BackgroundFullWidth = true }, status = { Font = {textFont, textSize, textOutline}, Spacing = textSpacing, }, statusbg = { Gradient = { MinColor = {0, 1, 0, .25}, MaxColor = {0, 1, 0, 0.12}, }, - BackgroundFullWidth = true } }, + Daily = { + titlebg = { + Gradient = { 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}, }, + }, + }, Cheev = { Normal = { @@ -303,27 +319,18 @@ end style_cache_func[styleName](frame) - - --print("Generated func = function()\n",code, "\nend") - --local cache_func[styleName] = loadstring(code) - - -- todo: remove hardcode and rely on attribute handler - if frame.status then - frame.status:SetWidth(270) - end - if frame.title then - frame.title:SetWidth(270) - end - - + --- Hardcoding the sizing vars for sanity + local normalSettings = mod.defaults.Style.Format frame.titleHeight = frame.title and (frame.title:GetStringHeight() + frame.title.spacing*2) or 0 frame.statusHeight = frame.status and (frame.status:GetStringHeight() + frame.status.spacing*2 + frame.attachmentHeight) or 0 frame.height = frame.titleHeight + frame.statusHeight - frame.width = 270 - + frame.width = normalSettings.Frame.Width + frame.statusWidth = frame.width - normalSettings.status.Indent + frame.titleWidth = frame.width - normalSettings.title.Indent if frame.status then - print('status ', frame.statusHeight) + print('status ', frame.statusHeight, normalSettings.status.Indent, 0) + frame.status:SetPoint('LEFT', frame, 'LEFT', normalSettings.status.Indent, 0) frame.status:SetHeight(frame.statusHeight) if frame.statusbg then @@ -333,7 +340,8 @@ end end if frame.title then - print('title ',frame.titleHeight) + print('title ',frame.titleHeight, normalSettings.title.Indent) + frame.title:SetPoint('LEFT', frame, 'LEFT', normalSettings.title.Indent) frame.title:SetHeight(frame.titleHeight) if frame.titlebg then print('titlebg',frame.titleHeight)