from retail

This commit is contained in:
NoM0Re
2025-01-22 18:56:11 +01:00
parent 674ea9fe1e
commit 8dcb62ec81
6 changed files with 29 additions and 32 deletions
+1 -1
View File
@@ -328,7 +328,7 @@ function Private.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfig)
local childData = WeakAuras.GetData(childID)
if childData then
if not environment_initialized[childID] then
Private.ActivateAuraEnvironment(childID)
Private.ActivateAuraEnvironment(childID, nil, nil, nil, true)
Private.ActivateAuraEnvironment()
end
current_aura_env.child_envs[dataIndex] = aura_environments[childID]
+2 -2
View File
@@ -4655,14 +4655,14 @@ Private.event_prototypes = {
},
{
name = "icon",
init = "GetItemIcon(itemName)",
init = "GetItemIcon(itemName or '')",
hidden = true,
store = true,
test = "true"
},
{
name = "name",
init = "itemName",
init = "itemName and itemName ~= '' and GetItemIcon(itemName) or itemName",
hidden = true,
store = true,
test = "true"
+3 -3
View File
@@ -453,16 +453,16 @@ local function modify(parent, region, data)
end
function region:SetInverse(inverse)
if region.inverse == inverse then
if region.inverseDirection == inverse then
return
end
region.inverse = inverse
region.inverseDirection = inverse
region:UpdateEffectiveInverse()
end
function region:UpdateEffectiveInverse()
-- If cooldown.inverse == false then effectiveReverse = not inverse
-- If cooldown.inverse == true then effectiveReverse = inverse
local effectiveReverse = not region.inverse == not cooldown.inverse
local effectiveReverse = not region.inverseDirection == not cooldown.inverse
cooldown:SetReverse(effectiveReverse)
if (cooldown.expirationTime and cooldown.duration and cooldown:IsShown()) then
-- WORKAROUND SetReverse not applying until next frame
@@ -903,6 +903,11 @@ local function modify(parent, region, data)
else
region:SetValueOnTexture(progress);
end
if self.FrameTick then
self.FrameTick = nil
self.subRegionEvents:RemoveSubscriber("FrameTick", region)
end
end
if region.useSmoothProgress then
+4 -1
View File
@@ -428,8 +428,11 @@ local function UpdateProgressFromState(self, minMaxConfig, state, progressSource
else
adjustMin = 0
end
local max
if minMaxConfig.adjustedMax then
if duration == 0 then
max = 0
elseif minMaxConfig.adjustedMax then
max = minMaxConfig.adjustedMax
elseif minMaxConfig.adjustedMaxRelPercent then
max = minMaxConfig.adjustedMaxRelPercent * duration
+14 -25
View File
@@ -2592,7 +2592,14 @@ function WeakAuras.PreAdd(data)
Private.validate(data, oldDataStub2)
end
local default = data.regionType and Private.regionTypes[data.regionType] and Private.regionTypes[data.regionType].default
local ok = pcall(Private.Modernize, data)
if not ok then
Private.GetErrorHandlerId(data.id, L["Modernize"])
end
local default = data.regionType and
Private.regionTypes[data.regionType] and
Private.regionTypes[data.regionType].default
if default then
Private.validate(data, default)
end
@@ -2602,7 +2609,6 @@ function WeakAuras.PreAdd(data)
regionValidate(data)
end
Private.Modernize(data);
Private.validate(data, Private.data_stub);
if data.subRegions then
for _, subRegionData in ipairs(data.subRegions) do
@@ -2915,40 +2921,19 @@ local function EnsureRegion(id)
Private.regions[id] = Private.regions[id] or {}
-- The region doesn't yet exist
-- But we must also ensure that our parents exists
-- and as an additional wrinkle, for dynamic groups, all children must exist!
-- and we have to call ReloadControlledChildren at the end
-- So we go up the list of parents and collect auras that must be created
-- If we find a parent already exists, we can stop
-- And dynamic groups require creating all children, thus we don't need
-- to care which path we came to them
local aurasToCreate = {}
local dynamicGroups = {}
creatingRegions = true
while(id) do
local data = WeakAuras.GetData(id)
if (data.regionType == "dynamicgroup") then
wipe(aurasToCreate)
tinsert(aurasToCreate, data.id)
tinsert(dynamicGroups, data.id)
else
tinsert(aurasToCreate, data.id)
end
tinsert(aurasToCreate, data.id)
id = data.parent
end
for _, toCreateId in ipairs_reverse(aurasToCreate) do
local data = WeakAuras.GetData(toCreateId)
Private.SetRegion(data)
if (data.regionType == "dynamicgroup") then
for child in Private.TraverseAllChildren(data) do
Private.SetRegion(child)
end
end
end
creatingRegions = false
for _, dynamicGroupId in ipairs_reverse(dynamicGroups) do
local dgRegion = Private.regions[dynamicGroupId].region
dgRegion:ReloadControlledChildren()
end
end
return Private.regions[id] and Private.regions[id].region
@@ -4059,6 +4044,10 @@ local function startStopTimers(id, cloneId, triggernum, state)
stopAutoHideTimer(id, triggernum, cloneId)
return
else
if state.expirationTime == nil and type(state.duration) == "number" then
-- Set the expiration time, because users rely on that, even though it's wrong to do
state.expirationTime = GetTime() + state.duration
end
expirationTime = state.expirationTime
end
elseif type(state.autoHide) == "number" then