- 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
+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