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
+24 -1
View File
@@ -443,6 +443,28 @@ local funcs = {
end
self.use_texture = use
self:UpdateTexture()
end,
AnchorSubRegion = function(self, subRegion, anchorType, anchorPoint, subRegionPoint, anchorXOffset, anchorYOffset)
subRegion:ClearAllPoints()
if anchorType == "point" then
local xOffset = anchorXOffset or 0
local yOffset = anchorYOffset or 0
subRegionPoint = Private.point_types[subRegionPoint] and subRegionPoint or "CENTER"
local tickIndex = tonumber(anchorPoint:sub(6))
local anchorTo = tickIndex and self.ticks[tickIndex] or nil
if anchorTo then
subRegion:SetPoint(subRegionPoint, anchorTo, "CENTER", xOffset, yOffset)
end
else
local tickIndex = tonumber(anchorPoint:sub(10))
local anchorTo = tickIndex and self.ticks[tickIndex] or nil
local xOffset = anchorXOffset or 0
local yOffset = anchorYOffset or 0
if anchorTo then
subRegion:SetPoint("BOTTOMLEFT", anchorTo, "BOTTOMLEFT", -xOffset, -yOffset)
subRegion:SetPoint("TOPRIGHT", anchorTo, "TOPRIGHT", xOffset, yOffset)
end
end
end
}
@@ -483,7 +505,7 @@ local function modify(parent, region, parentData, data, first)
if region.ticks[i] == nil then
local texture = region:CreateTexture()
texture:SetDrawLayer("ARTWORK", 3)
texture:SetAllPoints(region)
texture:SetAllPoints()
region.ticks[i] = texture
end
end
@@ -520,6 +542,7 @@ local function modify(parent, region, parentData, data, first)
region:SetTickRotation(data.tick_rotation)
region:SetTickMirror(data.tick_mirror)
region:UpdateTickPlacement()
region:UpdateTickSize()
parent.subRegionEvents:AddSubscriber("Update", region)