Skip to content

Commit

Permalink
Make the Options show text
Browse files Browse the repository at this point in the history
  • Loading branch information
InfusOnWoW committed Dec 28, 2018
1 parent 7c5dcbc commit 51802c9
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
2 changes: 0 additions & 2 deletions WeakAuras/RegionTypes/Texture.lua
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,6 @@ local function modify(parent, region, data)
region.Rotate = nil;
region.GetRotation = nil;
end


end

WeakAuras.RegisterRegionType("texture", create, modify, default, GetProperties);
21 changes: 16 additions & 5 deletions WeakAuras/WeakAuras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4597,14 +4597,18 @@ local function startStopTimers(id, cloneId, triggernum, state)
end
end

function WeakAuras.UpdateRegion(region)
region:Update();

for index, subRegion in ipairs(region.subRegions) do
subRegion:Update()
end
end

local function ApplyStateToRegion(id, region, state)

if region.Update then
region:Update();

for index, subRegion in ipairs(region.subRegions) do
subRegion:Update()
end
WeakAuras.UpdateRegion(region)
else
-- TODO remove old SetDurationInfo+SetName+SetIcon+SetStacks code path
if(region.SetDurationInfo) then
Expand Down Expand Up @@ -4847,6 +4851,9 @@ function WeakAuras.ContainsPlaceHolders(textStr, toCheck)
end

function WeakAuras.RunCustomTextFunc(region, customFunc)
if not customFunc then
return nil
end
local state = region.state
WeakAuras.ActivateAuraEnvironment(region.id, region.cloneId, region.state, region.states);
local progress = WeakAuras.dynamic_texts.p.func(state, region)
Expand Down Expand Up @@ -4984,6 +4991,10 @@ local function ValueForSymbol(symbol, region, customFunc, regionState, regionSta
end

function WeakAuras.ReplacePlaceHolders(textStr, region, customFunc)
if WeakAuras.IsOptionsOpen() then
return textStr
end

local regionValues = region.values;
local regionState = region.state;
local regionStates = region.states;
Expand Down
28 changes: 25 additions & 3 deletions WeakAurasOptions/WeakAurasOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,7 @@ function WeakAuras.IsOptionsOpen()
end
end

-- TODO Legacy code remove
function WeakAuras.DoConfigUpdate()
local function GiveDynamicInfo(id, region, data, cloneNum)
if(WeakAuras.CanHaveDuration(data) == "timed") then
Expand Down Expand Up @@ -1598,6 +1599,22 @@ function WeakAuras.LockUpdateInfo()
WeakAuras.DoConfigUpdate();
end
end);

for id, region in pairs(WeakAuras.regions) do
local data = db.displays[id];
if(data) then
if region.Update then
WeakAuras.UpdateRegion(region)
end
if(WeakAuras.clones[id]) then
for cloneNum, cloneRegion in pairs(WeakAuras.clones[id]) do
if cloneRegion.Update then
WeakAuras.UpdateRegion(cloneRegion)
end
end
end
end
end
end

function WeakAuras.UnlockUpdateInfo()
Expand All @@ -1614,20 +1631,25 @@ function WeakAuras.UnlockUpdateInfo()
local data = db.displays[id];
if(data) then
RestoreAlpha(region.region);
if(region.SetDurationInfo) then
if region.Update then
WeakAuras.UpdateRegion(region)
elseif(region.SetDurationInfo) then
-- TODO legady code to be removed
region.region:SetDurationInfo(0, math.huge);
end
if(WeakAuras.clones[id]) then
for cloneNum, cloneRegion in pairs(WeakAuras.clones[id]) do
RestoreAlpha(cloneRegion);
if(region.SetDurationInfo) then
if cloneRegion.Update then
WeakAuras.UpdateRegion(cloneRegion)
elseif(region.SetDurationInfo) then
-- TODO Legacy code to be removed
cloneRegion:SetDurationInfo(0, math.huge);
end
end
end
end
end

end

function WeakAuras.SetIconNames(data)
Expand Down

0 comments on commit 51802c9

Please sign in to comment.