- Battle for Dazaralor update.

- Fixed rogue spec icons.
- Some visual improvements.
- Framework update.
This commit is contained in:
Tercioo
2019-01-20 00:22:22 -02:00
parent b198c62489
commit 0c486a24a2
32 changed files with 3069 additions and 248 deletions
+12
View File
@@ -876,6 +876,9 @@ local ButtonMetaFunctions = _G [DF.GlobalWidgetControlNames ["button"]]
local x, y = GetCursorPosition()
x = _math_floor (x)
y = _math_floor (y)
button.mouse_down = button.mouse_down or 0 --avoid issues when the button was pressed while disabled and release when enabled
if (
(x == button.x and y == button.y) or
(button.mouse_down+0.5 > GetTime() and button:IsMouseOver())
@@ -892,6 +895,15 @@ local ButtonMetaFunctions = _G [DF.GlobalWidgetControlNames ["button"]]
function ButtonMetaFunctions:SetTemplate (template)
if (type (template) == "string") then
template = DF:GetTemplate ("button", template)
end
if (not template) then
DF:Error ("template not found")
return
end
if (template.width) then
self:SetWidth (template.width)
end
+12 -9
View File
@@ -1652,9 +1652,9 @@ function DF:CreateCoolTip()
if (CoolTip.Type == 2) then --> with bars
if (CoolTip.OptionsTable.MinWidth) then
local w = frame1.w + 34
frame1:SetWidth (math.max (w, CoolTip.OptionsTable.MinWidth))
PixelUtil.SetWidth (frame1, math.max (w, CoolTip.OptionsTable.MinWidth))
else
frame1:SetWidth (frame1.w + 34)
PixelUtil.SetWidth (frame1, frame1.w + 34)
end
else
--> width stability check
@@ -1666,22 +1666,24 @@ function DF:CreateCoolTip()
end
if (CoolTip.OptionsTable.MinWidth) then
frame1:SetWidth (math.max (width, CoolTip.OptionsTable.MinWidth))
PixelUtil.SetWidth (frame1, math.max (width, CoolTip.OptionsTable.MinWidth))
else
frame1:SetWidth (width)
PixelUtil.SetWidth (frame1, width)
end
end
end
if (CoolTip.OptionsTable.FixedHeight) then
frame1:SetHeight (CoolTip.OptionsTable.FixedHeight)
PixelUtil.SetHeight (frame1, CoolTip.OptionsTable.FixedHeight)
else
if (CoolTip.OptionsTable.AlignAsBlizzTooltip) then
frame1:SetHeight ( ((temp-10) * -1) + (CoolTip.OptionsTable.AlignAsBlizzTooltipFrameHeightOffset or 0))
PixelUtil.SetHeight (frame1, ((temp-10) * -1) + (CoolTip.OptionsTable.AlignAsBlizzTooltipFrameHeightOffset or 0))
elseif (CoolTip.OptionsTable.IgnoreButtonAutoHeight) then
frame1:SetHeight ( (temp+spacing) * -1)
PixelUtil.SetHeight (frame1, (temp+spacing) * -1)
else
frame1:SetHeight ( _math_max ( (frame1.hHeight * CoolTip.Indexes) + 8 + ((CoolTip.OptionsTable.ButtonsYMod or 0)*-1), 22 ))
PixelUtil.SetHeight (frame1, _math_max ( (frame1.hHeight * CoolTip.Indexes) + 8 + ((CoolTip.OptionsTable.ButtonsYMod or 0)*-1), 22 ))
end
end
@@ -1922,7 +1924,8 @@ function DF:CreateCoolTip()
local anchor = CoolTip.OptionsTable.Anchor or CoolTip.Host
frame1:SetPoint (CoolTip.OptionsTable.MyAnchor, anchor, CoolTip.OptionsTable.RelativeAnchor, 0 + moveX + CoolTip.OptionsTable.WidthAnchorMod, 10 + CoolTip.OptionsTable.HeightAnchorMod + moveY)
--frame1:SetPoint (CoolTip.OptionsTable.MyAnchor, anchor, CoolTip.OptionsTable.RelativeAnchor, 0 + moveX + CoolTip.OptionsTable.WidthAnchorMod, 10 + CoolTip.OptionsTable.HeightAnchorMod + moveY)
PixelUtil.SetPoint (frame1, CoolTip.OptionsTable.MyAnchor, anchor, CoolTip.OptionsTable.RelativeAnchor, 0 + moveX + CoolTip.OptionsTable.WidthAnchorMod, 10 + CoolTip.OptionsTable.HeightAnchorMod + moveY)
if (not x_mod) then
--> check if cooltip is out of screen bounds
+147 -63
View File
@@ -1,5 +1,5 @@
local dversion = 126
local dversion = 131
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
@@ -391,6 +391,17 @@ function DF:SetFontColor (fontString, r, g, b, a)
fontString:SetTextColor (r, g, b, a)
end
function DF:SetFontShadow (fontString, r, g, b, a, x, y)
r, g, b, a = DF:ParseColors (r, g, b, a)
fontString:SetShadowColor (r, g, b, a)
local offSetX, offSetY = fontString:GetShadowOffset()
x = x or offSetX
y = y or offSetY
fontString:SetShadowOffset (x, y)
end
function DF:AddClassColorToText (text, class)
if (type (class) ~= "string") then
return DF:RemoveRealName (text)
@@ -705,6 +716,33 @@ end
return true
end
local colorTableMixin = {
GetColor = function (self)
return self.r, self.g, self.b, self.a
end,
SetColor = function (self, r, g, b, a)
r, g, b, a = DF:ParseColors (r, g, b, a)
self.r = r or self.r
self.g = g or self.g
self.b = b or self.b
self.a = a or self.a
end,
IsColorTable = true,
}
function DF:CreateColorTable (r, g, b, a)
local t = {
r = r or 1,
g = g or 1,
b = b or 1,
a = a or 1,
}
DF:Mixin (t, colorTableMixin)
return t
end
function DF:IsHtmlColor (color)
return DF.alias_text_colors [color]
@@ -713,8 +751,12 @@ end
local tn = tonumber
function DF:ParseColors (_arg1, _arg2, _arg3, _arg4)
if (_type (_arg1) == "table") then
if (not _arg1[1] and _arg1.r) then
if (_arg1.IsColorTable) then
return _arg1:GetColor()
elseif (not _arg1[1] and _arg1.r) then
_arg1, _arg2, _arg3, _arg4 = _arg1.r, _arg1.g, _arg1.b, _arg1.a
else
_arg1, _arg2, _arg3, _arg4 = _unpack (_arg1)
end
@@ -869,7 +911,7 @@ end
end
if (value_change_hook) then
slider:SetHook ("OnValueChanged", value_change_hook)
slider:SetHook ("OnValueChange", value_change_hook)
end
--> hook list
@@ -1483,6 +1525,10 @@ function DF:SetHook (hookType, func)
end
end
function DF:Error (errortext)
print ("|cFFFF2222Details! Framework Error|r:", errortext, self.GetName and self:GetName(), self.WidgetType, debugstack (2, 3, 0))
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> members
@@ -2116,16 +2162,16 @@ function DF:CreateBorder (parent, alpha1, alpha2, alpha3)
parent.SetLayerVisibility = SetLayerVisibility
local border1 = parent:CreateTexture (nil, "background")
border1:SetPoint ("topleft", parent, "topleft", -1, 1)
border1:SetPoint ("bottomleft", parent, "bottomleft", -1, -1)
PixelUtil.SetPoint (border1, "topleft", parent, "topleft", -1, 1)
PixelUtil.SetPoint (border1, "bottomleft", parent, "bottomleft", -1, -1)
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
local border2 = parent:CreateTexture (nil, "background")
border2:SetPoint ("topleft", parent, "topleft", -2, 2)
border2:SetPoint ("bottomleft", parent, "bottomleft", -2, -2)
PixelUtil.SetPoint (border2, "topleft", parent, "topleft", -2, 2)
PixelUtil.SetPoint (border2, "bottomleft", parent, "bottomleft", -2, -2)
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
local border3 = parent:CreateTexture (nil, "background")
border3:SetPoint ("topleft", parent, "topleft", -3, 3)
border3:SetPoint ("bottomleft", parent, "bottomleft", -3, -3)
PixelUtil.SetPoint (border3, "topleft", parent, "topleft", -3, 3)
PixelUtil.SetPoint (border3, "bottomleft", parent, "bottomleft", -3, -3)
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
tinsert (parent.Borders.Layer1, border1)
@@ -2133,16 +2179,16 @@ function DF:CreateBorder (parent, alpha1, alpha2, alpha3)
tinsert (parent.Borders.Layer3, border3)
local border1 = parent:CreateTexture (nil, "background")
border1:SetPoint ("topleft", parent, "topleft", 0, 1)
border1:SetPoint ("topright", parent, "topright", 1, 1)
PixelUtil.SetPoint (border1, "topleft", parent, "topleft", 0, 1)
PixelUtil.SetPoint (border1, "topright", parent, "topright", 1, 1)
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
local border2 = parent:CreateTexture (nil, "background")
border2:SetPoint ("topleft", parent, "topleft", -1, 2)
border2:SetPoint ("topright", parent, "topright", 2, 2)
PixelUtil.SetPoint (border2, "topleft", parent, "topleft", -1, 2)
PixelUtil.SetPoint (border2, "topright", parent, "topright", 2, 2)
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
local border3 = parent:CreateTexture (nil, "background")
border3:SetPoint ("topleft", parent, "topleft", -2, 3)
border3:SetPoint ("topright", parent, "topright", 3, 3)
PixelUtil.SetPoint (border3, "topleft", parent, "topleft", -2, 3)
PixelUtil.SetPoint (border3, "topright", parent, "topright", 3, 3)
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
tinsert (parent.Borders.Layer1, border1)
@@ -2150,16 +2196,16 @@ function DF:CreateBorder (parent, alpha1, alpha2, alpha3)
tinsert (parent.Borders.Layer3, border3)
local border1 = parent:CreateTexture (nil, "background")
border1:SetPoint ("topright", parent, "topright", 1, 0)
border1:SetPoint ("bottomright", parent, "bottomright", 1, -1)
PixelUtil.SetPoint (border1, "topright", parent, "topright", 1, 0)
PixelUtil.SetPoint (border1, "bottomright", parent, "bottomright", 1, -1)
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
local border2 = parent:CreateTexture (nil, "background")
border2:SetPoint ("topright", parent, "topright", 2, 1)
border2:SetPoint ("bottomright", parent, "bottomright", 2, -2)
PixelUtil.SetPoint (border2, "topright", parent, "topright", 2, 1)
PixelUtil.SetPoint (border2, "bottomright", parent, "bottomright", 2, -2)
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
local border3 = parent:CreateTexture (nil, "background")
border3:SetPoint ("topright", parent, "topright", 3, 2)
border3:SetPoint ("bottomright", parent, "bottomright", 3, -3)
PixelUtil.SetPoint (border3, "topright", parent, "topright", 3, 2)
PixelUtil.SetPoint (border3, "bottomright", parent, "bottomright", 3, -3)
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
tinsert (parent.Borders.Layer1, border1)
@@ -2167,16 +2213,16 @@ function DF:CreateBorder (parent, alpha1, alpha2, alpha3)
tinsert (parent.Borders.Layer3, border3)
local border1 = parent:CreateTexture (nil, "background")
border1:SetPoint ("bottomleft", parent, "bottomleft", 0, -1)
border1:SetPoint ("bottomright", parent, "bottomright", 0, -1)
PixelUtil.SetPoint (border1, "bottomleft", parent, "bottomleft", 0, -1)
PixelUtil.SetPoint (border1, "bottomright", parent, "bottomright", 0, -1)
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
local border2 = parent:CreateTexture (nil, "background")
border2:SetPoint ("bottomleft", parent, "bottomleft", -1, -2)
border2:SetPoint ("bottomright", parent, "bottomright", 1, -2)
PixelUtil.SetPoint (border2, "bottomleft", parent, "bottomleft", -1, -2)
PixelUtil.SetPoint (border2, "bottomright", parent, "bottomright", 1, -2)
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
local border3 = parent:CreateTexture (nil, "background")
border3:SetPoint ("bottomleft", parent, "bottomleft", -2, -3)
border3:SetPoint ("bottomright", parent, "bottomright", 2, -3)
PixelUtil.SetPoint (border3, "bottomleft", parent, "bottomleft", -2, -3)
PixelUtil.SetPoint (border3, "bottomright", parent, "bottomright", 2, -3)
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
tinsert (parent.Borders.Layer1, border1)
@@ -2185,6 +2231,9 @@ function DF:CreateBorder (parent, alpha1, alpha2, alpha3)
end
function DF:CreateBorderSolid (parent, size)
end
function DF:CreateBorderWithSpread (parent, alpha1, alpha2, alpha3, size, spread)
@@ -2201,24 +2250,28 @@ function DF:CreateBorderWithSpread (parent, alpha1, alpha2, alpha3, size, spread
parent.SetBorderColor = SetBorderColor
parent.SetLayerVisibility = SetLayerVisibility
size = size or 1
local minPixels = 1
local spread = 0
--left
local border1 = parent:CreateTexture (nil, "background")
border1:SetPoint ("topleft", parent, "topleft", -1 + spread, 1 + (-spread))
border1:SetPoint ("bottomleft", parent, "bottomleft", -1 + spread, -1 + spread)
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
border1:SetWidth (size)
PixelUtil.SetPoint (border1, "topleft", parent, "topleft", -1 + spread, 1 + (-spread), 0, 0)
PixelUtil.SetPoint (border1, "bottomleft", parent, "bottomleft", -1 + spread, -1 + spread, 0, 0)
PixelUtil.SetWidth (border1, size, minPixels)
local border2 = parent:CreateTexture (nil, "background")
border2:SetPoint ("topleft", parent, "topleft", -2 + spread, 2 + (-spread))
border2:SetPoint ("bottomleft", parent, "bottomleft", -2 + spread, -2 + spread)
PixelUtil.SetPoint (border2, "topleft", parent, "topleft", -2 + spread, 2 + (-spread))
PixelUtil.SetPoint (border2, "bottomleft", parent, "bottomleft", -2 + spread, -2 + spread)
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
border2:SetWidth (size)
PixelUtil.SetWidth (border2, size, minPixels)
local border3 = parent:CreateTexture (nil, "background")
border3:SetPoint ("topleft", parent, "topleft", -3 + spread, 3 + (-spread))
border3:SetPoint ("bottomleft", parent, "bottomleft", -3 + spread, -3 + spread)
PixelUtil.SetPoint (border3, "topleft", parent, "topleft", -3 + spread, 3 + (-spread))
PixelUtil.SetPoint (border3, "bottomleft", parent, "bottomleft", -3 + spread, -3 + spread)
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
border3:SetWidth (size)
PixelUtil.SetWidth (border3, size, minPixels)
tinsert (parent.Borders.Layer1, border1)
tinsert (parent.Borders.Layer2, border2)
@@ -2226,22 +2279,22 @@ function DF:CreateBorderWithSpread (parent, alpha1, alpha2, alpha3, size, spread
--top
local border1 = parent:CreateTexture (nil, "background")
border1:SetPoint ("topleft", parent, "topleft", 0 + spread, 1 + (-spread))
border1:SetPoint ("topright", parent, "topright", 1 + (-spread), 1 + (-spread))
PixelUtil.SetPoint (border1, "topleft", parent, "topleft", 0 + spread, 1 + (-spread))
PixelUtil.SetPoint (border1, "topright", parent, "topright", 1 + (-spread), 1 + (-spread))
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
border1:SetHeight (size)
PixelUtil.SetHeight (border1, size, minPixels)
local border2 = parent:CreateTexture (nil, "background")
border2:SetPoint ("topleft", parent, "topleft", -1 + spread, 2 + (-spread))
border2:SetPoint ("topright", parent, "topright", 2 + (-spread), 2 + (-spread))
PixelUtil.SetPoint (border2, "topleft", parent, "topleft", -1 + spread, 2 + (-spread))
PixelUtil.SetPoint (border2, "topright", parent, "topright", 2 + (-spread), 2 + (-spread))
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
border2:SetHeight (size)
PixelUtil.SetHeight (border2, size, minPixels)
local border3 = parent:CreateTexture (nil, "background")
border3:SetPoint ("topleft", parent, "topleft", -2 + spread, 3 + (-spread))
border3:SetPoint ("topright", parent, "topright", 3 + (-spread), 3 + (-spread))
PixelUtil.SetPoint (border3, "topleft", parent, "topleft", -2 + spread, 3 + (-spread))
PixelUtil.SetPoint (border3, "topright", parent, "topright", 3 + (-spread), 3 + (-spread))
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
border3:SetHeight (size)
PixelUtil.SetHeight (border3, size, minPixels)
tinsert (parent.Borders.Layer1, border1)
tinsert (parent.Borders.Layer2, border2)
@@ -2249,44 +2302,44 @@ function DF:CreateBorderWithSpread (parent, alpha1, alpha2, alpha3, size, spread
--right
local border1 = parent:CreateTexture (nil, "background")
border1:SetPoint ("topright", parent, "topright", 1 + (-spread), 0 + (-spread))
border1:SetPoint ("bottomright", parent, "bottomright", 1 + (-spread), -1 + spread)
PixelUtil.SetPoint (border1, "topright", parent, "topright", 1 + (-spread), 0 + (-spread))
PixelUtil.SetPoint (border1, "bottomright", parent, "bottomright", 1 + (-spread), -1 + spread)
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
border1:SetWidth (size)
PixelUtil.SetWidth (border1, size, minPixels)
local border2 = parent:CreateTexture (nil, "background")
border2:SetPoint ("topright", parent, "topright", 2 + (-spread), 1 + (-spread))
border2:SetPoint ("bottomright", parent, "bottomright", 2 + (-spread), -2 + spread)
PixelUtil.SetPoint (border2, "topright", parent, "topright", 2 + (-spread), 1 + (-spread))
PixelUtil.SetPoint (border2, "bottomright", parent, "bottomright", 2 + (-spread), -2 + spread)
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
border2:SetWidth (size)
PixelUtil.SetWidth (border2, size, minPixels)
local border3 = parent:CreateTexture (nil, "background")
border3:SetPoint ("topright", parent, "topright", 3 + (-spread), 2 + (-spread))
border3:SetPoint ("bottomright", parent, "bottomright", 3 + (-spread), -3 + spread)
PixelUtil.SetPoint (border3, "topright", parent, "topright", 3 + (-spread), 2 + (-spread))
PixelUtil.SetPoint (border3, "bottomright", parent, "bottomright", 3 + (-spread), -3 + spread)
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
border3:SetWidth (size)
PixelUtil.SetWidth (border3, size, minPixels)
tinsert (parent.Borders.Layer1, border1)
tinsert (parent.Borders.Layer2, border2)
tinsert (parent.Borders.Layer3, border3)
local border1 = parent:CreateTexture (nil, "background")
border1:SetPoint ("bottomleft", parent, "bottomleft", 0 + spread, -1 + spread)
border1:SetPoint ("bottomright", parent, "bottomright", 0 + (-spread), -1 + spread)
PixelUtil.SetPoint (border1, "bottomleft", parent, "bottomleft", 0 + spread, -1 + spread)
PixelUtil.SetPoint (border1, "bottomright", parent, "bottomright", 0 + (-spread), -1 + spread)
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
border1:SetHeight (size)
PixelUtil.SetHeight (border1, size, minPixels)
local border2 = parent:CreateTexture (nil, "background")
border2:SetPoint ("bottomleft", parent, "bottomleft", -1 + spread, -2 + spread)
border2:SetPoint ("bottomright", parent, "bottomright", 1 + (-spread), -2 + spread)
PixelUtil.SetPoint (border2, "bottomleft", parent, "bottomleft", -1 + spread, -2 + spread)
PixelUtil.SetPoint (border2, "bottomright", parent, "bottomright", 1 + (-spread), -2 + spread)
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
border2:SetHeight (size)
PixelUtil.SetHeight (border2, size, minPixels)
local border3 = parent:CreateTexture (nil, "background")
border3:SetPoint ("bottomleft", parent, "bottomleft", -2 + spread, -3 + spread)
border3:SetPoint ("bottomright", parent, "bottomright", 2 + (-spread), -3 + spread)
PixelUtil.SetPoint (border3, "bottomleft", parent, "bottomleft", -2 + spread, -3 + spread)
PixelUtil.SetPoint (border3, "bottomright", parent, "bottomright", 2 + (-spread), -3 + spread)
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
border3:SetHeight (size)
PixelUtil.SetHeight (border3, size, minPixels)
tinsert (parent.Borders.Layer1, border1)
tinsert (parent.Borders.Layer2, border2)
@@ -2712,5 +2765,36 @@ function DF:GetCLEncounterIDs()
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> debug
DF.DebugMixin = {
debug = true,
CheckPoint = function (self, checkPointName, ...)
print (self:GetName(), checkPointName, ...)
end,
CheckVisibilityState = function (self, widget)
self = widget or self
local width, height = self:GetSize()
width = floor (width)
height = floor (height)
local numPoints = self:GetNumPoints()
print ("shown:", self:IsShown(), "visible:", self:IsVisible(), "alpha:", self:GetAlpha(), "size:", width, height, "points:", numPoints)
end,
CheckStack = function (self)
local stack = debugstack()
Details:Dump (stack)
end,
}
--doo elsee
--was doing double loops due to not enought height
+2237 -48
View File
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -729,6 +729,8 @@ local DFSliderMetaFunctions = _G [DF.GlobalWidgetControlNames ["slider"]]
table_remove (slider.MyObject.previous_value, 4)
local capsule = slider.MyObject
--some plugins registered OnValueChanged and others with OnValueChange
local kill = capsule:RunHooksForWidget ("OnValueChanged", slider, capsule.FixedValue, amt, capsule)
if (kill) then
return
@@ -736,7 +738,7 @@ local DFSliderMetaFunctions = _G [DF.GlobalWidgetControlNames ["slider"]]
local kill = capsule:RunHooksForWidget ("OnValueChange", slider, capsule.FixedValue, amt, capsule)
if (kill) then
return
end
end
if (slider.MyObject.OnValueChanged) then
slider.MyObject.OnValueChanged (slider, slider.MyObject.FixedValue, amt)
@@ -752,6 +754,7 @@ local DFSliderMetaFunctions = _G [DF.GlobalWidgetControlNames ["slider"]]
slider.amt:SetText (math.floor (amt))
end
slider.MyObject.ivalue = amt
end
------------------------------------------------------------------------------------------------------------