Work on Ascension Backport
This commit is contained in:
+5
-129
@@ -738,13 +738,6 @@ detailsFramework.ValueMixin = {
|
||||
---@field GetTexCoord fun(self: table) : number, number, number, number
|
||||
---@field SetColor fun(self: table, ...)
|
||||
---@field GetColor fun(self: table) : number, number, number, number
|
||||
---@field SetMaskTexture fun(self: table, texture: string)
|
||||
---@field GetMaskTexture fun(self: table) : string
|
||||
---@field SetMaskTexCoord fun(self: table, ...)
|
||||
---@field GetMaskTexCoord fun(self: table) : number, number, number, number
|
||||
---@field SetMaskAtlas fun(self: table, atlasName: string)
|
||||
---@field GetMaskAtlas fun(self: table) : string
|
||||
---@field AddMaskTexture fun(self: table, texture: string)
|
||||
---@field SetBorderTexture fun(self: table, texture: string)
|
||||
---@field GetBorderTexture fun(self: table) : string
|
||||
---@field SetBorderColor fun(self: table, ...)
|
||||
@@ -775,7 +768,7 @@ detailsFramework.StatusBarFunctions = {
|
||||
end,
|
||||
|
||||
SetDesaturation = function(self, desaturationAmount)
|
||||
self.barTexture:SetDesaturation(desaturationAmount)
|
||||
self.barTexture:SetDesaturated(desaturationAmount > 0.5 and true or false)
|
||||
end,
|
||||
|
||||
IsDesaturated = function(self)
|
||||
@@ -817,136 +810,19 @@ detailsFramework.StatusBarFunctions = {
|
||||
return self:GetStatusBarColor()
|
||||
end,
|
||||
|
||||
SetMaskTexture = function(self, ...)
|
||||
if (not self:HasTextureMask()) then
|
||||
return
|
||||
end
|
||||
self.barTextureMask:SetTexture(...)
|
||||
end,
|
||||
|
||||
GetMaskTexture = function(self)
|
||||
if (not self:HasTextureMask()) then
|
||||
return
|
||||
end
|
||||
self.barTextureMask:GetTexture()
|
||||
end,
|
||||
|
||||
SetMaskAtlas = function(self, atlasName)
|
||||
if (not self:HasTextureMask()) then
|
||||
return
|
||||
end
|
||||
self.barTextureMask:SetAtlas(atlasName)
|
||||
end,
|
||||
|
||||
GetMaskAtlas = function(self)
|
||||
if (not self:HasTextureMask()) then
|
||||
return
|
||||
end
|
||||
self.barTextureMask:GetAtlas()
|
||||
end,
|
||||
|
||||
AddMaskTexture = function(self, object)
|
||||
if (not self:HasTextureMask()) then
|
||||
return
|
||||
end
|
||||
if (object.GetObjectType and object:GetObjectType() == "Texture") then
|
||||
object:AddMaskTexture(self.barTextureMask)
|
||||
else
|
||||
detailsFramework:Msg("Invalid 'Texture' to object:AddMaskTexture(Texture)", debugstack())
|
||||
end
|
||||
end,
|
||||
|
||||
CreateTextureMask = function(self)
|
||||
local barTexture = self:GetStatusBarTexture() or self.barTexture
|
||||
if (not barTexture) then
|
||||
detailsFramework:Msg("Object doesn't not have a statubar texture, create one and object:SetStatusBarTexture(textureObject)", debugstack())
|
||||
return
|
||||
end
|
||||
|
||||
if (self.barTextureMask) then
|
||||
return self.barTextureMask
|
||||
end
|
||||
|
||||
--statusbar texture mask
|
||||
self.barTextureMask = self:CreateMaskTexture(nil, "artwork")
|
||||
self.barTextureMask:SetAllPoints()
|
||||
self.barTextureMask:SetTexture([[Interface\CHATFRAME\CHATFRAMEBACKGROUND]])
|
||||
|
||||
--border texture
|
||||
self.barBorderTextureForMask = self:CreateTexture(nil, "overlay", nil, 7)
|
||||
self.barBorderTextureForMask:SetAllPoints()
|
||||
--self.barBorderTextureForMask:SetPoint("topleft", self, "topleft", -1, 1)
|
||||
--self.barBorderTextureForMask:SetPoint("bottomright", self, "bottomright", 1, -1)
|
||||
self.barBorderTextureForMask:Hide()
|
||||
|
||||
barTexture:AddMaskTexture(self.barTextureMask)
|
||||
|
||||
return self.barTextureMask
|
||||
end,
|
||||
|
||||
HasTextureMask = function(self)
|
||||
if (not self.barTextureMask) then
|
||||
detailsFramework:Msg("Object doesn't not have a texture mask, create one using object:CreateTextureMask()", debugstack())
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end,
|
||||
|
||||
SetBorderTexture = function(self, texture)
|
||||
if (not self:HasTextureMask()) then
|
||||
return
|
||||
end
|
||||
|
||||
texture = texture or ""
|
||||
|
||||
self.barBorderTextureForMask:SetTexture(texture)
|
||||
|
||||
if (texture == "") then
|
||||
self.barBorderTextureForMask:Hide()
|
||||
else
|
||||
self.barBorderTextureForMask:Show()
|
||||
end
|
||||
return
|
||||
end,
|
||||
|
||||
GetBorderTexture = function(self)
|
||||
if (not self:HasTextureMask()) then
|
||||
return
|
||||
end
|
||||
return self.barBorderTextureForMask:GetTexture()
|
||||
return
|
||||
end,
|
||||
|
||||
SetBorderColor = function(self, r, g, b, a)
|
||||
r, g, b, a = detailsFramework:ParseColors(r, g, b, a)
|
||||
|
||||
if (self.barBorderTextureForMask and self.barBorderTextureForMask:IsShown()) then
|
||||
self.barBorderTextureForMask:SetVertexColor(r, g, b, a)
|
||||
|
||||
--if there's a square border on the widget, remove its color
|
||||
if (self.border and self.border.UpdateSizes and self.border.SetVertexColor) then
|
||||
self.border:SetVertexColor(0, 0, 0, 0)
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if (self.border and self.border.UpdateSizes and self.border.SetVertexColor) then
|
||||
self.border:SetVertexColor(r, g, b, a)
|
||||
|
||||
--adjust the mask border texture ask well in case the user set the mask color texture before setting a texture on it
|
||||
if (self.barBorderTextureForMask) then
|
||||
self.barBorderTextureForMask:SetVertexColor(r, g, b, a)
|
||||
end
|
||||
return
|
||||
end
|
||||
return
|
||||
end,
|
||||
|
||||
GetBorderColor = function(self)
|
||||
if (self.barBorderTextureForMask and self.barBorderTextureForMask:IsShown()) then
|
||||
return self.barBorderTextureForMask:GetVertexColor()
|
||||
end
|
||||
|
||||
if (self.border and self.border.UpdateSizes and self.border.GetVertexColor) then
|
||||
return self.border:GetVertexColor()
|
||||
end
|
||||
return
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user