from retail

This commit is contained in:
NoM0Re
2025-01-26 21:24:18 +01:00
parent 1793d7ac19
commit f9bf9c3c16
25 changed files with 1467 additions and 500 deletions
+15 -15
View File
@@ -22,7 +22,7 @@ local default = function(parentType)
text_justify = "CENTER",
text_selfPoint = "AUTO",
text_anchorPoint = "CENTER",
anchor_point = "CENTER",
anchorXOffset = 0,
anchorYOffset = 0,
@@ -46,7 +46,7 @@ local default = function(parentType)
text_justify = "CENTER",
text_selfPoint = "AUTO",
text_anchorPoint = parentType == "aurabar" and "INNER_RIGHT" or "BOTTOMLEFT",
anchor_point = parentType == "aurabar" and "INNER_RIGHT" or "BOTTOMLEFT",
anchorXOffset = 0,
anchorYOffset = 0,
@@ -256,7 +256,7 @@ local function modify(parent, region, parentData, data, first)
if text:GetFont() then
text:SetText(WeakAuras.ReplaceRaidMarkerSymbols(textStr))
end
region:UpdateAnchor()
region:Anchor()
end
end
@@ -340,7 +340,7 @@ local function modify(parent, region, parentData, data, first)
region.text:SetFont(fontPath, size < 33 and size or 33, data.text_fontType);
end
region.text:SetTextHeight(size)
region:UpdateAnchor();
region:Anchor();
end
function region:SetVisible(visible)
@@ -367,7 +367,7 @@ local function modify(parent, region, parentData, data, first)
local selfPoint = data.text_selfPoint
if selfPoint == "AUTO" then
if parentData.regionType == "icon" then
local anchorPoint = data.text_anchorPoint or "CENTER"
local anchorPoint = data.anchor_point or "CENTER"
if anchorPoint:sub(1, 6) == "INNER_" then
selfPoint = anchorPoint:sub(7)
elseif anchorPoint:sub(1, 6) == "OUTER_" then
@@ -377,7 +377,7 @@ local function modify(parent, region, parentData, data, first)
selfPoint = "CENTER"
end
elseif parentData.regionType == "aurabar" then
selfPoint = data.text_anchorPoint or "CENTER"
selfPoint = data.anchor_point or "CENTER"
if selfPoint:sub(1, 5) == "ICON_" then
selfPoint = selfPoint:sub(6)
elseif selfPoint:sub(1, 6) == "INNER_" then
@@ -385,15 +385,16 @@ local function modify(parent, region, parentData, data, first)
end
selfPoint = Private.point_types[selfPoint] and selfPoint or "CENTER"
else
selfPoint = Private.inverse_point_types[data.text_anchorPoint or "CENTER"] or "CENTER"
selfPoint = Private.inverse_point_types[data.anchor_point or "CENTER"] or "CENTER"
end
end
region.text_anchorXOffset = data.text_anchorXOffset
region.text_anchorYOffset = data.text_anchorYOffset
region.UpdateAnchor = function(self)
parent:AnchorSubRegion(text, "point", selfPoint, data.text_anchorPoint, self.text_anchorXOffset or 0, self.text_anchorYOffset or 0)
region.Anchor = function(self)
parent:AnchorSubRegion(text, "point", data.anchor_point, selfPoint,
self.text_anchorXOffset or 0, self.text_anchorYOffset or 0)
end
region.SetXOffset = function(self, xOffset)
@@ -401,7 +402,7 @@ local function modify(parent, region, parentData, data, first)
return
end
self.text_anchorXOffset = xOffset
self:UpdateAnchor()
self:Anchor()
end
region.SetYOffset = function(self, yOffset)
@@ -409,12 +410,11 @@ local function modify(parent, region, parentData, data, first)
return
end
self.text_anchorYOffset = yOffset
self:UpdateAnchor()
self:Anchor()
end
region:Color(data.text_color[1], data.text_color[2], data.text_color[3], data.text_color[4]);
region:SetVisible(data.text_visible)
region:UpdateAnchor()
end
local function addDefaultsForNewAura(data)
@@ -430,7 +430,7 @@ local function addDefaultsForNewAura(data)
text_visible = true,
text_selfPoint = "AUTO",
text_anchorPoint = "INNER_LEFT",
anchor_point = "INNER_LEFT",
anchorXOffset = 0,
anchorYOffset = 0,
@@ -450,7 +450,7 @@ local function addDefaultsForNewAura(data)
text_visible = true,
text_selfPoint = "AUTO",
text_anchorPoint = "INNER_RIGHT",
anchor_point = "INNER_RIGHT",
anchorXOffset = 0,
anchorYOffset = 0,
@@ -470,7 +470,7 @@ local function addDefaultsForNewAura(data)
text_visible = true,
text_selfPoint = "AUTO",
text_anchorPoint = "INNER_BOTTOMRIGHT",
anchor_point = "INNER_BOTTOMRIGHT",
anchorXOffset = 0,
anchorYOffset = 0,