beta
This commit is contained in:
+20
-50
@@ -16,16 +16,17 @@ local last_update = GetTime();
|
|||||||
local function UpdateAnimations()
|
local function UpdateAnimations()
|
||||||
WeakAuras.StartProfileSystem("animations");
|
WeakAuras.StartProfileSystem("animations");
|
||||||
local errorHandler = WeakAuras.IsOptionsOpen() and noopErrorHandler or geterrorhandler()
|
local errorHandler = WeakAuras.IsOptionsOpen() and noopErrorHandler or geterrorhandler()
|
||||||
for groupId, groupRegion in pairs(pending_controls) do
|
for groupUid, groupRegion in pairs(pending_controls) do
|
||||||
pending_controls[groupId] = nil;
|
pending_controls[groupUid] = nil;
|
||||||
groupRegion:DoPositionChildren();
|
groupRegion:DoPositionChildren();
|
||||||
end
|
end
|
||||||
|
|
||||||
local time = GetTime();
|
local time = GetTime();
|
||||||
local elapsed = time - last_update;
|
local elapsed = time - last_update;
|
||||||
last_update = time;
|
last_update = time;
|
||||||
local num = 0;
|
local num = 0;
|
||||||
for id, anim in pairs(animations) do
|
for key, anim in pairs(animations) do
|
||||||
WeakAuras.StartProfileAura(anim.name);
|
WeakAuras.StartProfileUID(anim.auraUID);
|
||||||
num = num + 1;
|
num = num + 1;
|
||||||
local finished = false;
|
local finished = false;
|
||||||
if(anim.duration_type == "seconds") then
|
if(anim.duration_type == "seconds") then
|
||||||
@@ -70,7 +71,7 @@ local function UpdateAnimations()
|
|||||||
end
|
end
|
||||||
local progress = anim.inverse and (1 - anim.progress) or anim.progress;
|
local progress = anim.inverse and (1 - anim.progress) or anim.progress;
|
||||||
progress = anim.easeFunc(progress, anim.easeStrength or 3)
|
progress = anim.easeFunc(progress, anim.easeStrength or 3)
|
||||||
WeakAuras.ActivateAuraEnvironment(anim.name, anim.cloneId, anim.region.state, anim.region.states);
|
WeakAuras.ActivateAuraEnvironment(anim.region)
|
||||||
if(anim.translateFunc) then
|
if(anim.translateFunc) then
|
||||||
if (anim.region.SetOffsetAnim) then
|
if (anim.region.SetOffsetAnim) then
|
||||||
local ok, x, y = pcall(anim.translateFunc, progress, 0, 0, anim.dX, anim.dY);
|
local ok, x, y = pcall(anim.translateFunc, progress, 0, 0, anim.dX, anim.dY);
|
||||||
@@ -163,40 +164,29 @@ local function UpdateAnimations()
|
|||||||
if(anim.region.ColorAnim) then
|
if(anim.region.ColorAnim) then
|
||||||
anim.region:ColorAnim(nil);
|
anim.region:ColorAnim(nil);
|
||||||
end
|
end
|
||||||
animations[id] = nil;
|
animations[key] = nil;
|
||||||
end
|
end
|
||||||
|
|
||||||
if(anim.loop) then
|
if(anim.loop) then
|
||||||
WeakAuras.Animate(anim.namespace, anim.data, anim.type, anim.anim, anim.region, anim.inverse, anim.onFinished, anim.loop, anim.cloneId);
|
WeakAuras.Animate(anim.namespace, anim.auraUID, anim.type, anim.anim, anim.region, anim.inverse, anim.onFinished, anim.loop, anim.region.cloneId);
|
||||||
elseif(anim.onFinished) then
|
elseif(anim.onFinished) then
|
||||||
anim.onFinished();
|
anim.onFinished();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
WeakAuras.StopProfileAura(anim.name);
|
WeakAuras.StopProfileUID(anim.auraUID);
|
||||||
end
|
end
|
||||||
-- XXX: I tried to have animations only update if there are actually animation data to animate upon.
|
|
||||||
-- This caused all start animations to break, and I couldn't figure out why.
|
|
||||||
-- May revisit at a later time.
|
|
||||||
--[[
|
|
||||||
if(num == 0) then
|
|
||||||
WeakAuras.debug("Animation stopped", 3);
|
|
||||||
frame:SetScript("OnUpdate", nil);
|
|
||||||
updatingAnimations = nil;
|
|
||||||
updatingAnimations = nil;
|
|
||||||
end
|
|
||||||
]]--
|
|
||||||
|
|
||||||
WeakAuras.StopProfileSystem("animations");
|
WeakAuras.StopProfileSystem("animations");
|
||||||
end
|
end
|
||||||
|
|
||||||
function Private.RegisterGroupForPositioning(id, region)
|
function Private.RegisterGroupForPositioning(uid, region)
|
||||||
pending_controls[id] = region
|
pending_controls[uid] = region
|
||||||
updatingAnimations = true
|
updatingAnimations = true
|
||||||
frame:SetScript("OnUpdate", UpdateAnimations)
|
frame:SetScript("OnUpdate", UpdateAnimations)
|
||||||
end
|
end
|
||||||
|
|
||||||
function WeakAuras.Animate(namespace, data, type, anim, region, inverse, onFinished, loop, cloneId)
|
function WeakAuras.Animate(namespace, uid, type, anim, region, inverse, onFinished, loop, cloneId)
|
||||||
local id = data.id;
|
local auraDisplayName = WeakAuras.UIDtoID(uid)
|
||||||
local key = tostring(region);
|
local key = tostring(region);
|
||||||
local valid;
|
local valid;
|
||||||
if(anim and anim.type == "custom" and (anim.use_translate or anim.use_alpha or (anim.use_scale and region.Scale) or (anim.use_rotate and region.Rotate) or (anim.use_color and region.Color))) then
|
if(anim and anim.type == "custom" and (anim.use_translate or anim.use_alpha or (anim.use_scale and region.Scale) or (anim.use_rotate and region.Rotate) or (anim.use_color and region.Color))) then
|
||||||
@@ -251,7 +241,7 @@ function WeakAuras.Animate(namespace, data, type, anim, region, inverse, onFinis
|
|||||||
anim.translateFunc = anim_function_strings[anim.translateType]
|
anim.translateFunc = anim_function_strings[anim.translateType]
|
||||||
end
|
end
|
||||||
if (anim.translateFunc) then
|
if (anim.translateFunc) then
|
||||||
translateFunc = WeakAuras.LoadFunction("return " .. anim.translateFunc, id, "translate animation");
|
translateFunc = WeakAuras.LoadFunction("return " .. anim.translateFunc, auraDisplayName, "translate animation");
|
||||||
else
|
else
|
||||||
if (region.SetOffsetAnim) then
|
if (region.SetOffsetAnim) then
|
||||||
region:SetOffsetAnim(0, 0);
|
region:SetOffsetAnim(0, 0);
|
||||||
@@ -272,7 +262,7 @@ function WeakAuras.Animate(namespace, data, type, anim, region, inverse, onFinis
|
|||||||
anim.alphaFunc = anim_function_strings[anim.alphaType]
|
anim.alphaFunc = anim_function_strings[anim.alphaType]
|
||||||
end
|
end
|
||||||
if (anim.alphaFunc) then
|
if (anim.alphaFunc) then
|
||||||
alphaFunc = WeakAuras.LoadFunction("return " .. anim.alphaFunc, id, "alpha animation");
|
alphaFunc = WeakAuras.LoadFunction("return " .. anim.alphaFunc, auraDisplayName, "alpha animation");
|
||||||
else
|
else
|
||||||
if (region.SetAnimAlpha) then
|
if (region.SetAnimAlpha) then
|
||||||
region:SetAnimAlpha(nil);
|
region:SetAnimAlpha(nil);
|
||||||
@@ -293,7 +283,7 @@ function WeakAuras.Animate(namespace, data, type, anim, region, inverse, onFinis
|
|||||||
anim.scaleFunc = anim_function_strings[anim.scaleType]
|
anim.scaleFunc = anim_function_strings[anim.scaleType]
|
||||||
end
|
end
|
||||||
if (anim.scaleFunc) then
|
if (anim.scaleFunc) then
|
||||||
scaleFunc = WeakAuras.LoadFunction("return " .. anim.scaleFunc, id, "scale animation");
|
scaleFunc = WeakAuras.LoadFunction("return " .. anim.scaleFunc, auraDisplayName, "scale animation");
|
||||||
else
|
else
|
||||||
region:Scale(1, 1);
|
region:Scale(1, 1);
|
||||||
end
|
end
|
||||||
@@ -306,7 +296,7 @@ function WeakAuras.Animate(namespace, data, type, anim, region, inverse, onFinis
|
|||||||
anim.rotateFunc = anim_function_strings[anim.rotateType]
|
anim.rotateFunc = anim_function_strings[anim.rotateType]
|
||||||
end
|
end
|
||||||
if (anim.rotateFunc) then
|
if (anim.rotateFunc) then
|
||||||
rotateFunc = WeakAuras.LoadFunction("return " .. anim.rotateFunc, id, "rotate animation");
|
rotateFunc = WeakAuras.LoadFunction("return " .. anim.rotateFunc, auraDisplayName, "rotate animation");
|
||||||
else
|
else
|
||||||
region:Rotate(startRotation);
|
region:Rotate(startRotation);
|
||||||
end
|
end
|
||||||
@@ -319,7 +309,7 @@ function WeakAuras.Animate(namespace, data, type, anim, region, inverse, onFinis
|
|||||||
anim.colorFunc = anim_function_strings[anim.colorType]
|
anim.colorFunc = anim_function_strings[anim.colorType]
|
||||||
end
|
end
|
||||||
if (anim.colorFunc) then
|
if (anim.colorFunc) then
|
||||||
colorFunc = WeakAuras.LoadFunction("return " .. anim.colorFunc, id, "color animation");
|
colorFunc = WeakAuras.LoadFunction("return " .. anim.colorFunc, auraDisplayName, "color animation");
|
||||||
else
|
else
|
||||||
region:ColorAnim(nil);
|
region:ColorAnim(nil);
|
||||||
end
|
end
|
||||||
@@ -331,7 +321,7 @@ function WeakAuras.Animate(namespace, data, type, anim, region, inverse, onFinis
|
|||||||
duration = WeakAuras.ParseNumber(anim.duration) or 0;
|
duration = WeakAuras.ParseNumber(anim.duration) or 0;
|
||||||
progress = 0;
|
progress = 0;
|
||||||
if(namespace == "display" and type == "main" and not onFinished and not anim.duration_type == "relative") then
|
if(namespace == "display" and type == "main" and not onFinished and not anim.duration_type == "relative") then
|
||||||
local data = WeakAuras.GetData(id);
|
local data = WeakAuras.GetDataByUID(uid);
|
||||||
if(data and data.parent) then
|
if(data and data.parent) then
|
||||||
local parentRegion = WeakAuras.regions[data.parent].region;
|
local parentRegion = WeakAuras.regions[data.parent].region;
|
||||||
if(parentRegion and parentRegion.controlledRegions) then
|
if(parentRegion and parentRegion.controlledRegions) then
|
||||||
@@ -385,11 +375,9 @@ function WeakAuras.Animate(namespace, data, type, anim, region, inverse, onFinis
|
|||||||
animation.type = type
|
animation.type = type
|
||||||
animation.loop = loop
|
animation.loop = loop
|
||||||
animation.onFinished = onFinished
|
animation.onFinished = onFinished
|
||||||
animation.name = id
|
|
||||||
animation.cloneId = cloneId or ""
|
|
||||||
animation.namespace = namespace;
|
animation.namespace = namespace;
|
||||||
animation.data = data;
|
|
||||||
animation.anim = anim;
|
animation.anim = anim;
|
||||||
|
animation.auraUID = uid
|
||||||
|
|
||||||
if not(updatingAnimations) then
|
if not(updatingAnimations) then
|
||||||
frame:SetScript("OnUpdate", UpdateAnimations);
|
frame:SetScript("OnUpdate", UpdateAnimations);
|
||||||
@@ -406,16 +394,6 @@ function WeakAuras.Animate(namespace, data, type, anim, region, inverse, onFinis
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function WeakAuras.IsAnimating(region)
|
|
||||||
local key = tostring(region);
|
|
||||||
local anim = animations[key];
|
|
||||||
if(anim) then
|
|
||||||
return anim.type;
|
|
||||||
else
|
|
||||||
return nil;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function WeakAuras.CancelAnimation(region, resetPos, resetAlpha, resetScale, resetRotation, resetColor, doOnFinished)
|
function WeakAuras.CancelAnimation(region, resetPos, resetAlpha, resetScale, resetRotation, resetColor, doOnFinished)
|
||||||
local key = tostring(region);
|
local key = tostring(region);
|
||||||
local anim = animations[key];
|
local anim = animations[key];
|
||||||
@@ -460,11 +438,3 @@ function WeakAuras.CancelAnimation(region, resetPos, resetAlpha, resetScale, res
|
|||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Private.RenameAnimations(oldid, newid)
|
|
||||||
for key, animation in pairs(animations) do
|
|
||||||
if animation.name == oldid then
|
|
||||||
animation.name = newid;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|||||||
@@ -192,6 +192,10 @@ function WeakAuras.ClearAuraEnvironment(id)
|
|||||||
environment_initialized[id] = nil;
|
environment_initialized[id] = nil;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function WeakAuras.ActivateAuraEnvironmentForRegion(region, onlyConfig)
|
||||||
|
WeakAuras.ActivateAuraEnvironment(region.id, region.cloneId, region.state, region.states, onlyConfig)
|
||||||
|
end
|
||||||
|
|
||||||
function WeakAuras.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfig)
|
function WeakAuras.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfig)
|
||||||
local data = WeakAuras.GetData(id)
|
local data = WeakAuras.GetData(id)
|
||||||
local region = WeakAuras.GetRegion(id, cloneId)
|
local region = WeakAuras.GetRegion(id, cloneId)
|
||||||
|
|||||||
+26
-14
@@ -158,7 +158,7 @@ local function CreateTestForCondition(uid, input, allConditionsTemplate, usedSta
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if (trigger and variable and value) then
|
if (trigger and variable) then
|
||||||
usedStates[trigger] = true;
|
usedStates[trigger] = true;
|
||||||
|
|
||||||
local conditionTemplate = allConditionsTemplate[trigger] and allConditionsTemplate[trigger][variable];
|
local conditionTemplate = allConditionsTemplate[trigger] and allConditionsTemplate[trigger][variable];
|
||||||
@@ -203,27 +203,29 @@ local function CreateTestForCondition(uid, input, allConditionsTemplate, usedSta
|
|||||||
uid, testFunctionNumber, trigger);
|
uid, testFunctionNumber, trigger);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif (cType == "number" and op) then
|
elseif cType == "alwaystrue" then
|
||||||
|
check = "true"
|
||||||
|
elseif (cType == "number" and value and op) then
|
||||||
local v = tonumber(value)
|
local v = tonumber(value)
|
||||||
if (v) then
|
if (v) then
|
||||||
check = stateCheck .. stateVariableCheck .. "state[" .. trigger .. "]." .. variable .. op .. v;
|
check = stateCheck .. stateVariableCheck .. "state[" .. trigger .. "]." .. variable .. op .. v;
|
||||||
end
|
end
|
||||||
elseif (cType == "timer" and op) then
|
elseif (cType == "timer" and value and op) then
|
||||||
if (op == "==") then
|
if (op == "==") then
|
||||||
check = stateCheck .. stateVariableCheck .. "abs(state[" .. trigger .. "]." ..variable .. "- now -" .. value .. ") < 0.05";
|
check = stateCheck .. stateVariableCheck .. "abs(state[" .. trigger .. "]." ..variable .. "- now -" .. value .. ") < 0.05";
|
||||||
else
|
else
|
||||||
check = stateCheck .. stateVariableCheck .. "state[" .. trigger .. "]." .. variable .. "- now" .. op .. value;
|
check = stateCheck .. stateVariableCheck .. "state[" .. trigger .. "]." .. variable .. "- now" .. op .. value;
|
||||||
end
|
end
|
||||||
elseif (cType == "select" and op) then
|
elseif (cType == "select" and value and op) then
|
||||||
if (tonumber(value)) then
|
if (tonumber(value)) then
|
||||||
check = stateCheck .. stateVariableCheck .. "state[" .. trigger .. "]." .. variable .. op .. tonumber(value);
|
check = stateCheck .. stateVariableCheck .. "state[" .. trigger .. "]." .. variable .. op .. tonumber(value);
|
||||||
else
|
else
|
||||||
check = stateCheck .. stateVariableCheck .. "state[" .. trigger .. "]." .. variable .. op .. "'" .. value .. "'";
|
check = stateCheck .. stateVariableCheck .. "state[" .. trigger .. "]." .. variable .. op .. "'" .. value .. "'";
|
||||||
end
|
end
|
||||||
elseif (cType == "bool") then
|
elseif (cType == "bool" and value) then
|
||||||
local rightSide = value == 0 and "false" or "true";
|
local rightSide = value == 0 and "false" or "true";
|
||||||
check = stateCheck .. stateVariableCheck .. "state[" .. trigger .. "]." .. variable .. "==" .. rightSide
|
check = stateCheck .. stateVariableCheck .. "state[" .. trigger .. "]." .. variable .. "==" .. rightSide
|
||||||
elseif (cType == "string") then
|
elseif (cType == "string" and value) then
|
||||||
if(op == "==") then
|
if(op == "==") then
|
||||||
check = stateCheck .. stateVariableCheck .. "state[" .. trigger .. "]." .. variable .. " == [[" .. value .. "]]";
|
check = stateCheck .. stateVariableCheck .. "state[" .. trigger .. "]." .. variable .. " == [[" .. value .. "]]";
|
||||||
elseif (op == "find('%s')") then
|
elseif (op == "find('%s')") then
|
||||||
@@ -244,14 +246,19 @@ local function CreateTestForCondition(uid, input, allConditionsTemplate, usedSta
|
|||||||
return check, recheckCode;
|
return check, recheckCode;
|
||||||
end
|
end
|
||||||
|
|
||||||
local function CreateCheckCondition(uid, ret, condition, conditionNumber, allConditionsTemplate, debug)
|
local function CreateCheckCondition(uid, ret, condition, conditionNumber, allConditionsTemplate, nextIsLinked, debug)
|
||||||
local usedStates = {};
|
local usedStates = {};
|
||||||
local check, recheckCode = CreateTestForCondition(uid, condition.check, allConditionsTemplate, usedStates);
|
local check, recheckCode = CreateTestForCondition(uid, condition.check, allConditionsTemplate, usedStates);
|
||||||
if (check) then
|
if (check) then
|
||||||
ret = ret .. " state = region.states\n"
|
if condition.linked and conditionNumber > 1 then
|
||||||
ret = ret .. " if (" .. check .. ") then\n";
|
ret = ret .. " elseif (" .. check .. ") then\n";
|
||||||
ret = ret .. " newActiveConditions[" .. conditionNumber .. "] = true;\n";
|
else
|
||||||
ret = ret .. " end\n";
|
ret = ret .. " if (" .. check .. ") then\n";
|
||||||
|
end
|
||||||
|
ret = ret .. " newActiveConditions[" .. conditionNumber .. "] = true;\n";
|
||||||
|
if not nextIsLinked then
|
||||||
|
ret = ret .. " end\n";
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if (recheckCode) then
|
if (recheckCode) then
|
||||||
ret = ret .. recheckCode;
|
ret = ret .. recheckCode;
|
||||||
@@ -474,6 +481,10 @@ local globalConditions =
|
|||||||
["customcheck"] = {
|
["customcheck"] = {
|
||||||
display = L["Custom Check"],
|
display = L["Custom Check"],
|
||||||
type = "customcheck"
|
type = "customcheck"
|
||||||
|
},
|
||||||
|
["alwaystrue"] = {
|
||||||
|
display = L["Always True"],
|
||||||
|
type = "alwaystrue"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,6 +511,7 @@ local function ConstructConditionFunction(data)
|
|||||||
if (debug) then ret = ret .. " print('check conditions for:', region.id, region.cloneId)\n"; end
|
if (debug) then ret = ret .. " print('check conditions for:', region.id, region.cloneId)\n"; end
|
||||||
ret = ret .. " local id = region.id\n";
|
ret = ret .. " local id = region.id\n";
|
||||||
ret = ret .. " local cloneId = region.cloneId or ''\n";
|
ret = ret .. " local cloneId = region.cloneId or ''\n";
|
||||||
|
ret = ret .. " local state = region.states\n"
|
||||||
ret = ret .. " local activatedConditions = WeakAuras.GetActiveConditions(id, cloneId)\n";
|
ret = ret .. " local activatedConditions = WeakAuras.GetActiveConditions(id, cloneId)\n";
|
||||||
ret = ret .. " wipe(newActiveConditions)\n";
|
ret = ret .. " wipe(newActiveConditions)\n";
|
||||||
ret = ret .. " local recheckTime;\n"
|
ret = ret .. " local recheckTime;\n"
|
||||||
@@ -507,11 +519,12 @@ local function ConstructConditionFunction(data)
|
|||||||
|
|
||||||
local normalConditionCount = data.conditions and #data.conditions;
|
local normalConditionCount = data.conditions and #data.conditions;
|
||||||
-- First Loop gather which conditions are active
|
-- First Loop gather which conditions are active
|
||||||
ret = ret .. " if (not hideRegion) then\n"
|
ret = ret .. " if (not hideRegion) then\n"
|
||||||
if (data.conditions) then
|
if (data.conditions) then
|
||||||
WeakAuras.conditionHelpers[data.uid] = nil
|
WeakAuras.conditionHelpers[data.uid] = nil
|
||||||
for conditionNumber, condition in ipairs(data.conditions) do
|
for conditionNumber, condition in ipairs(data.conditions) do
|
||||||
ret = CreateCheckCondition(data.uid, ret, condition, conditionNumber, allConditionsTemplate, debug)
|
local nextIsLinked = data.conditions[conditionNumber + 1] and data.conditions[conditionNumber + 1].linked
|
||||||
|
ret = CreateCheckCondition(data.uid, ret, condition, conditionNumber, allConditionsTemplate, nextIsLinked, debug)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
ret = ret .. " end\n";
|
ret = ret .. " end\n";
|
||||||
@@ -574,7 +587,6 @@ function Private.LoadConditionFunction(data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Private.RunConditions(region, id, hideRegion)
|
function Private.RunConditions(region, id, hideRegion)
|
||||||
-- TODO rename show
|
|
||||||
if (checkConditions[id]) then
|
if (checkConditions[id]) then
|
||||||
checkConditions[id](region, hideRegion);
|
checkConditions[id](region, hideRegion);
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -55,6 +55,12 @@ end
|
|||||||
function WeakAuras.StopProfileAura()
|
function WeakAuras.StopProfileAura()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function WeakAuras.StartProfileUID()
|
||||||
|
end
|
||||||
|
|
||||||
|
function WeakAuras.StopProfileUID()
|
||||||
|
end
|
||||||
|
|
||||||
-- If WeakAuras shuts down due to being installed on the wrong target, keep the bindings from erroring
|
-- If WeakAuras shuts down due to being installed on the wrong target, keep the bindings from erroring
|
||||||
function WeakAuras.StartProfile()
|
function WeakAuras.StartProfile()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -272,6 +272,14 @@ local function StopProfileAura(id)
|
|||||||
StopProfiling(profileData.auras, id)
|
StopProfiling(profileData.auras, id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function StartProfileUID(uid)
|
||||||
|
StartProfiling(profileData.auras, WeakAuras.UIDtoID(uid))
|
||||||
|
end
|
||||||
|
|
||||||
|
local function StopProfileUID(uid)
|
||||||
|
StopProfiling(profileData.auras, WeakAuras.UIDtoID(uid))
|
||||||
|
end
|
||||||
|
|
||||||
function WeakAuras.ProfileRenameAura(oldid, id)
|
function WeakAuras.ProfileRenameAura(oldid, id)
|
||||||
profileData.auras[id] = profileData.auras[id]
|
profileData.auras[id] = profileData.auras[id]
|
||||||
profileData.auras[oldid] = nil
|
profileData.auras[oldid] = nil
|
||||||
@@ -324,8 +332,10 @@ function WeakAuras.StartProfile(startType)
|
|||||||
|
|
||||||
WeakAuras.StartProfileSystem = StartProfileSystem
|
WeakAuras.StartProfileSystem = StartProfileSystem
|
||||||
WeakAuras.StartProfileAura = StartProfileAura
|
WeakAuras.StartProfileAura = StartProfileAura
|
||||||
|
WeakAuras.StartProfileUID = StartProfileUID
|
||||||
WeakAuras.StopProfileSystem = StopProfileSystem
|
WeakAuras.StopProfileSystem = StopProfileSystem
|
||||||
WeakAuras.StopProfileAura = StopProfileAura
|
WeakAuras.StopProfileAura = StopProfileAura
|
||||||
|
WeakAuras.StopProfileUID = StopProfileUID
|
||||||
end
|
end
|
||||||
|
|
||||||
local function doNothing()
|
local function doNothing()
|
||||||
@@ -344,8 +354,10 @@ function WeakAuras.StopProfile()
|
|||||||
|
|
||||||
WeakAuras.StartProfileSystem = doNothing
|
WeakAuras.StartProfileSystem = doNothing
|
||||||
WeakAuras.StartProfileAura = doNothing
|
WeakAuras.StartProfileAura = doNothing
|
||||||
|
WeakAuras.StartProfileUID = doNothing
|
||||||
WeakAuras.StopProfileSystem = doNothing
|
WeakAuras.StopProfileSystem = doNothing
|
||||||
WeakAuras.StopProfileAura = doNothing
|
WeakAuras.StopProfileAura = doNothing
|
||||||
|
WeakAuras.StopProfileUID = doNothing
|
||||||
|
|
||||||
currentProfileState = nil
|
currentProfileState = nil
|
||||||
RealTimeProfilingWindow:UnregisterAllEvents()
|
RealTimeProfilingWindow:UnregisterAllEvents()
|
||||||
|
|||||||
@@ -1025,7 +1025,7 @@ local function modify(parent, region, data)
|
|||||||
self.needToPosition = false
|
self.needToPosition = false
|
||||||
if #self.sortedChildren > 0 then
|
if #self.sortedChildren > 0 then
|
||||||
if animate then
|
if animate then
|
||||||
Private.RegisterGroupForPositioning(data.id, self)
|
Private.RegisterGroupForPositioning(data.uid, self)
|
||||||
else
|
else
|
||||||
self:DoPositionChildren()
|
self:DoPositionChildren()
|
||||||
end
|
end
|
||||||
@@ -1044,7 +1044,10 @@ local function modify(parent, region, data)
|
|||||||
type(pos[2]) == "number" and pos[2] or 0,
|
type(pos[2]) == "number" and pos[2] or 0,
|
||||||
type(pos[3]) ~= "boolean" and true or pos[3]
|
type(pos[3]) ~= "boolean" and true or pos[3]
|
||||||
|
|
||||||
local controlPoint = regionData.controlPoint
|
local controlPoint = type(regionData) == "table" and regionData.controlPoint
|
||||||
|
if not controlPoint then
|
||||||
|
break
|
||||||
|
end
|
||||||
controlPoint:ClearAnchorPoint()
|
controlPoint:ClearAnchorPoint()
|
||||||
controlPoint:SetAnchorPoint(
|
controlPoint:SetAnchorPoint(
|
||||||
data.selfPoint,
|
data.selfPoint,
|
||||||
@@ -1134,7 +1137,7 @@ local function modify(parent, region, data)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
-- update animated expand & collapse for this child
|
-- update animated expand & collapse for this child
|
||||||
WeakAuras.Animate("controlPoint", data, "controlPoint", anim, regionData.controlPoint, true)
|
WeakAuras.Animate("controlPoint", data.uid, "controlPoint", anim, regionData.controlPoint, true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
regionData.xOffset = x
|
regionData.xOffset = x
|
||||||
|
|||||||
@@ -265,10 +265,7 @@ end
|
|||||||
local function RunCode(self, func)
|
local function RunCode(self, func)
|
||||||
if func and not WeakAuras.IsOptionsOpen() then
|
if func and not WeakAuras.IsOptionsOpen() then
|
||||||
WeakAuras.ActivateAuraEnvironment(self.id, self.cloneId, self.state, self.states);
|
WeakAuras.ActivateAuraEnvironment(self.id, self.cloneId, self.state, self.states);
|
||||||
local ok, ret = pcall(func);
|
xpcall(func, geterrorhandler());
|
||||||
if not ok then
|
|
||||||
geterrorhandler()(ret)
|
|
||||||
end
|
|
||||||
WeakAuras.ActivateAuraEnvironment(nil);
|
WeakAuras.ActivateAuraEnvironment(nil);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -716,7 +713,7 @@ function WeakAuras.regionPrototype.AddExpandFunction(data, region, cloneId, pare
|
|||||||
local inGroup = parentRegionType == "group";
|
local inGroup = parentRegionType == "group";
|
||||||
|
|
||||||
local startMainAnimation = function()
|
local startMainAnimation = function()
|
||||||
WeakAuras.Animate("display", data, "main", data.animation.main, region, false, nil, true, cloneId);
|
WeakAuras.Animate("display", data.uid, "main", data.animation.main, region, false, nil, true, cloneId);
|
||||||
end
|
end
|
||||||
|
|
||||||
function region:OptionsClosed()
|
function region:OptionsClosed()
|
||||||
@@ -772,7 +769,7 @@ function WeakAuras.regionPrototype.AddExpandFunction(data, region, cloneId, pare
|
|||||||
region:SetScript("OnUpdate", nil)
|
region:SetScript("OnUpdate", nil)
|
||||||
|
|
||||||
WeakAuras.PerformActions(data, "finish", region);
|
WeakAuras.PerformActions(data, "finish", region);
|
||||||
if (not WeakAuras.Animate("display", data, "finish", data.animation.finish, region, false, hideRegion, nil, cloneId)) then
|
if (not WeakAuras.Animate("display", data.uid, "finish", data.animation.finish, region, false, hideRegion, nil, cloneId)) then
|
||||||
hideRegion();
|
hideRegion();
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -797,7 +794,7 @@ function WeakAuras.regionPrototype.AddExpandFunction(data, region, cloneId, pare
|
|||||||
WeakAuras.ApplyFrameLevel(region)
|
WeakAuras.ApplyFrameLevel(region)
|
||||||
region:Show();
|
region:Show();
|
||||||
WeakAuras.PerformActions(data, "start", region);
|
WeakAuras.PerformActions(data, "start", region);
|
||||||
if not(WeakAuras.Animate("display", data, "start", data.animation.start, region, true, startMainAnimation, nil, cloneId)) then
|
if not(WeakAuras.Animate("display", data.uid, "start", data.animation.start, region, true, startMainAnimation, nil, cloneId)) then
|
||||||
startMainAnimation();
|
startMainAnimation();
|
||||||
end
|
end
|
||||||
parent:ActivateChild(data.id, cloneId);
|
parent:ActivateChild(data.id, cloneId);
|
||||||
@@ -814,7 +811,7 @@ function WeakAuras.regionPrototype.AddExpandFunction(data, region, cloneId, pare
|
|||||||
region:SetScript("OnUpdate", nil)
|
region:SetScript("OnUpdate", nil)
|
||||||
|
|
||||||
WeakAuras.PerformActions(data, "finish", region);
|
WeakAuras.PerformActions(data, "finish", region);
|
||||||
if (not WeakAuras.Animate("display", data, "finish", data.animation.finish, region, false, hideRegion, nil, cloneId)) then
|
if (not WeakAuras.Animate("display", data.uid, "finish", data.animation.finish, region, false, hideRegion, nil, cloneId)) then
|
||||||
hideRegion();
|
hideRegion();
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -851,7 +848,7 @@ function WeakAuras.regionPrototype.AddExpandFunction(data, region, cloneId, pare
|
|||||||
WeakAuras.ApplyFrameLevel(region)
|
WeakAuras.ApplyFrameLevel(region)
|
||||||
region:Show();
|
region:Show();
|
||||||
WeakAuras.PerformActions(data, "start", region);
|
WeakAuras.PerformActions(data, "start", region);
|
||||||
if not(WeakAuras.Animate("display", data, "start", data.animation.start, region, true, startMainAnimation, nil, cloneId)) then
|
if not(WeakAuras.Animate("display", data.uid, "start", data.animation.start, region, true, startMainAnimation, nil, cloneId)) then
|
||||||
startMainAnimation();
|
startMainAnimation();
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1498,6 +1498,10 @@ function WeakAuras.GetDataByUID(uid)
|
|||||||
return WeakAuras.GetData(UIDtoID[uid])
|
return WeakAuras.GetData(UIDtoID[uid])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function WeakAuras.UIDtoID(uid)
|
||||||
|
return UIDtoID[uid]
|
||||||
|
end
|
||||||
|
|
||||||
function WeakAuras.Delete(data)
|
function WeakAuras.Delete(data)
|
||||||
local id = data.id;
|
local id = data.id;
|
||||||
if(data.parent) then
|
if(data.parent) then
|
||||||
@@ -1665,8 +1669,6 @@ function WeakAuras.Rename(data, newid)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Private.RenameAnimations(oldid, newid)
|
|
||||||
|
|
||||||
if (WeakAuras.mouseFrame) then
|
if (WeakAuras.mouseFrame) then
|
||||||
WeakAuras.mouseFrame:rename(oldid, newid);
|
WeakAuras.mouseFrame:rename(oldid, newid);
|
||||||
end
|
end
|
||||||
@@ -2647,7 +2649,7 @@ function WeakAuras.SetRegion(data, cloneId)
|
|||||||
clonePool[regionType] = clonePool[regionType] or {};
|
clonePool[regionType] = clonePool[regionType] or {};
|
||||||
end
|
end
|
||||||
if(anim_cancelled) then
|
if(anim_cancelled) then
|
||||||
WeakAuras.Animate("display", data, "main", data.animation.main, region, false, nil, true, cloneId);
|
WeakAuras.Animate("display", data.uid, "main", data.animation.main, region, false, nil, true, cloneId);
|
||||||
end
|
end
|
||||||
return region;
|
return region;
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ This file was forked from AceGUIContainer-TreeGroup.lua version 41
|
|||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
if not WeakAuras.IsCorrectVersion() then return end
|
if not WeakAuras.IsCorrectVersion() then return end
|
||||||
|
|
||||||
local Type, Version = "WeakAurasTreeGroup", 1
|
local Type, Version = "WeakAurasTreeGroup", 2
|
||||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||||
|
|
||||||
@@ -636,7 +636,7 @@ local PaneBackdrop = {
|
|||||||
local DraggerBackdrop = {
|
local DraggerBackdrop = {
|
||||||
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
|
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
|
||||||
edgeFile = nil,
|
edgeFile = nil,
|
||||||
tile = true, tileSize = 16, edgeSize = 0,
|
tile = true, tileSize = 16,
|
||||||
insets = { left = 3, right = 3, top = 7, bottom = 7 }
|
insets = { left = 3, right = 3, top = 7, bottom = 7 }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -649,9 +649,7 @@ local function Constructor()
|
|||||||
treeframe:SetPoint("BOTTOMLEFT")
|
treeframe:SetPoint("BOTTOMLEFT")
|
||||||
treeframe:SetWidth(DEFAULT_TREE_WIDTH)
|
treeframe:SetWidth(DEFAULT_TREE_WIDTH)
|
||||||
treeframe:EnableMouseWheel(true)
|
treeframe:EnableMouseWheel(true)
|
||||||
treeframe:SetBackdrop(PaneBackdrop)
|
|
||||||
treeframe:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
|
|
||||||
treeframe:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
|
||||||
treeframe:SetResizable(true)
|
treeframe:SetResizable(true)
|
||||||
treeframe:SetMinResize(100, 1)
|
treeframe:SetMinResize(100, 1)
|
||||||
treeframe:SetMaxResize(400, 1600)
|
treeframe:SetMaxResize(400, 1600)
|
||||||
@@ -659,6 +657,12 @@ local function Constructor()
|
|||||||
treeframe:SetScript("OnSizeChanged", Tree_OnSizeChanged)
|
treeframe:SetScript("OnSizeChanged", Tree_OnSizeChanged)
|
||||||
treeframe:SetScript("OnMouseWheel", Tree_OnMouseWheel)
|
treeframe:SetScript("OnMouseWheel", Tree_OnMouseWheel)
|
||||||
|
|
||||||
|
local treeframeBG = CreateFrame("Frame", nil, treeframe, BackdropTemplateMixin and "BackdropTemplate")
|
||||||
|
treeframeBG:SetBackdrop(PaneBackdrop)
|
||||||
|
treeframeBG:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
|
||||||
|
treeframeBG:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
||||||
|
treeframeBG:SetAllPoints(treeframe)
|
||||||
|
|
||||||
local dragger = CreateFrame("Button", nil, treeframe)
|
local dragger = CreateFrame("Button", nil, treeframe)
|
||||||
dragger:SetWidth(8)
|
dragger:SetWidth(8)
|
||||||
dragger:SetPoint("TOP", treeframe, "TOPRIGHT")
|
dragger:SetPoint("TOP", treeframe, "TOPRIGHT")
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ local ignoreForCopyingDisplay = {
|
|||||||
semver = true,
|
semver = true,
|
||||||
version = true,
|
version = true,
|
||||||
internalVersion = true,
|
internalVersion = true,
|
||||||
tocbuild = true
|
tocversion = true
|
||||||
}
|
}
|
||||||
|
|
||||||
local function copyAuraPart(source, destination, part)
|
local function copyAuraPart(source, destination, part)
|
||||||
@@ -422,26 +422,26 @@ local function GetAction(target, area, source)
|
|||||||
Actions["Group"](_source)
|
Actions["Group"](_source)
|
||||||
end,
|
end,
|
||||||
Icons["Ungroup"]
|
Icons["Ungroup"]
|
||||||
else -- area == "BOTTOM"
|
else -- area == "BOTTOM"
|
||||||
if source.data.parent == target.data.id then
|
if source.data.parent == target.data.id then
|
||||||
return Actions["Move"], Icons["Move"]
|
return Actions["Move"], Icons["Move"]
|
||||||
else
|
else
|
||||||
return function(_source, _target)
|
return function(_source, _target)
|
||||||
Actions["Ungroup"](_source)
|
Actions["Ungroup"](_source)
|
||||||
Actions["Group"](_source, _target.data.id)
|
Actions["Group"](_source, _target.data.id)
|
||||||
end,
|
end,
|
||||||
Icons["Group"]
|
Icons["Group"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else -- not target.data.parent and not source.data.parent
|
else -- not target.data.parent and not source.data.parent
|
||||||
if target:IsGroup() and area == "BOTTOM" then
|
if target:IsGroup() and area == "BOTTOM" then
|
||||||
return function(_source, _target)
|
return function(_source, _target)
|
||||||
Actions["Group"](_source, _target.data.id)
|
Actions["Group"](_source, _target.data.id)
|
||||||
end,
|
end,
|
||||||
Icons["Group"]
|
Icons["Group"]
|
||||||
else
|
else
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -692,8 +692,8 @@ local methods = {
|
|||||||
WeakAuras.SortDisplayButtons();
|
WeakAuras.SortDisplayButtons();
|
||||||
local updata = {duration = 0.15, type = "custom", use_translate = true, x = 0, y = -32};
|
local updata = {duration = 0.15, type = "custom", use_translate = true, x = 0, y = -32};
|
||||||
local downdata = {duration = 0.15, type = "custom", use_translate = true, x = 0, y = 32};
|
local downdata = {duration = 0.15, type = "custom", use_translate = true, x = 0, y = 32};
|
||||||
WeakAuras.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index-1]), "main", updata, self.frame, true, function() WeakAuras.SortDisplayButtons() end);
|
WeakAuras.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index-1]).uid, "main", updata, self.frame, true, function() WeakAuras.SortDisplayButtons() end);
|
||||||
WeakAuras.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index]), "main", downdata, otherbutton.frame, true, function() WeakAuras.SortDisplayButtons() end);
|
WeakAuras.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index]).uid, "main", downdata, otherbutton.frame, true, function() WeakAuras.SortDisplayButtons() end);
|
||||||
WeakAuras.UpdateDisplayButton(parentData);
|
WeakAuras.UpdateDisplayButton(parentData);
|
||||||
WeakAuras.FillOptions()
|
WeakAuras.FillOptions()
|
||||||
end
|
end
|
||||||
@@ -731,8 +731,8 @@ local methods = {
|
|||||||
WeakAuras.SortDisplayButtons()
|
WeakAuras.SortDisplayButtons()
|
||||||
local updata = {duration = 0.15, type = "custom", use_translate = true, x = 0, y = -32};
|
local updata = {duration = 0.15, type = "custom", use_translate = true, x = 0, y = -32};
|
||||||
local downdata = {duration = 0.15, type = "custom", use_translate = true, x = 0, y = 32};
|
local downdata = {duration = 0.15, type = "custom", use_translate = true, x = 0, y = 32};
|
||||||
WeakAuras.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index+1]), "main", downdata, self.frame, true, function() WeakAuras.SortDisplayButtons() end);
|
WeakAuras.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index+1]).uid, "main", downdata, self.frame, true, function() WeakAuras.SortDisplayButtons() end);
|
||||||
WeakAuras.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index]), "main", updata, otherbutton.frame, true, function() WeakAuras.SortDisplayButtons() end);
|
WeakAuras.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index]).uid, "main", updata, otherbutton.frame, true, function() WeakAuras.SortDisplayButtons() end);
|
||||||
WeakAuras.UpdateDisplayButton(parentData);
|
WeakAuras.UpdateDisplayButton(parentData);
|
||||||
WeakAuras.FillOptions()
|
WeakAuras.FillOptions()
|
||||||
end
|
end
|
||||||
@@ -805,7 +805,6 @@ local methods = {
|
|||||||
if (WeakAuras.IsImporting()) then return end;
|
if (WeakAuras.IsImporting()) then return end;
|
||||||
local oldid = data.id;
|
local oldid = data.id;
|
||||||
if not(newid == oldid) then
|
if not(newid == oldid) then
|
||||||
|
|
||||||
WeakAuras.Rename(data, newid);
|
WeakAuras.Rename(data, newid);
|
||||||
WeakAuras.HandleRename(data, oldid, newid)
|
WeakAuras.HandleRename(data, oldid, newid)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -84,11 +84,11 @@ function WeakAuras.GetAnimationOptions(data)
|
|||||||
data.animation = data.animation or {};
|
data.animation = data.animation or {};
|
||||||
data.animation[field] = data.animation[field] or {};
|
data.animation[field] = data.animation[field] or {};
|
||||||
data.animation[field][value] = v;
|
data.animation[field][value] = v;
|
||||||
if(field == "main" and not WeakAuras.IsAnimating("display", id)) then
|
if(field == "main") then
|
||||||
WeakAuras.Animate("display", data, "main", data.animation.main, WeakAuras.regions[id].region, false, nil, true);
|
WeakAuras.Animate("display", data.uid, "main", data.animation.main, WeakAuras.regions[id].region, false, nil, true);
|
||||||
if(WeakAuras.clones[id]) then
|
if(WeakAuras.clones[id]) then
|
||||||
for cloneId, cloneRegion in pairs(WeakAuras.clones[id]) do
|
for cloneId, cloneRegion in pairs(WeakAuras.clones[id]) do
|
||||||
WeakAuras.Animate("display", data, "main", data.animation.main, cloneRegion, false, nil, true, cloneId);
|
WeakAuras.Animate("display", data.uid, "main", data.animation.main, cloneRegion, false, nil, true, cloneId);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -843,12 +843,10 @@ function WeakAuras.GetAnimationOptions(data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
local function extraSetFunction()
|
local function extraSetFunction()
|
||||||
if(not WeakAuras.IsAnimating("display", id)) then
|
WeakAuras.Animate("display", data.uid, "main", data.animation.main, WeakAuras.regions[id].region, false, nil, true);
|
||||||
WeakAuras.Animate("display", data, "main", data.animation.main, WeakAuras.regions[id].region, false, nil, true);
|
if(WeakAuras.clones[id]) then
|
||||||
if(WeakAuras.clones[id]) then
|
for cloneId, cloneRegion in pairs(WeakAuras.clones[id]) do
|
||||||
for cloneId, cloneRegion in pairs(WeakAuras.clones[id]) do
|
WeakAuras.Animate("display", data.uid, "main", data.animation.main, cloneRegion, false, nil, true, cloneId);
|
||||||
WeakAuras.Animate("display", data, "main", data.animation.main, cloneRegion, false, nil, true, cloneId);
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -100,6 +100,8 @@ local function valueToString(a, propertytype)
|
|||||||
elseif (propertytype == "chat" or propertytype == "sound" or propertytype == "customcode"
|
elseif (propertytype == "chat" or propertytype == "sound" or propertytype == "customcode"
|
||||||
or propertytype == "glowexternal" or propertytype == "customcheck") then
|
or propertytype == "glowexternal" or propertytype == "customcheck") then
|
||||||
return tostring(a);
|
return tostring(a);
|
||||||
|
elseif (propertytype == "alwaystrue") then
|
||||||
|
return ""
|
||||||
elseif (propertytype == "bool") then
|
elseif (propertytype == "bool") then
|
||||||
return (a == 1 or a == true) and L["True"] or L["False"];
|
return (a == 1 or a == true) and L["True"] or L["False"];
|
||||||
end
|
end
|
||||||
@@ -689,9 +691,6 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
|
|||||||
name = blueIfNoValue2(data, conditions[i].changes[j], "value", "message", L["Message"], L["Message"]),
|
name = blueIfNoValue2(data, conditions[i].changes[j], "value", "message", L["Message"], L["Message"]),
|
||||||
desc = descMessage,
|
desc = descMessage,
|
||||||
order = order,
|
order = order,
|
||||||
get = function()
|
|
||||||
return type(conditions[i].changes[j].value) == "table" and conditions[i].changes[j].value.message;
|
|
||||||
end,
|
|
||||||
get = message_getter,
|
get = message_getter,
|
||||||
set = setValueComplex("message", true)
|
set = setValueComplex("message", true)
|
||||||
}
|
}
|
||||||
@@ -1274,10 +1273,15 @@ local function addControlsForIfLine(args, order, data, conditionVariable, condit
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
local isLinked = conditions[i].linked and i > 1
|
||||||
if (needsTriggerName) then
|
if (needsTriggerName) then
|
||||||
optionsName = optionsName .. string.format(L["If Trigger %s"], check.trigger);
|
if isLinked then
|
||||||
|
optionsName = optionsName .. string.format(L["Else If Trigger %s"], check.trigger);
|
||||||
|
else
|
||||||
|
optionsName = optionsName .. string.format(L["If Trigger %s"], check.trigger);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
optionsName = optionsName .. L["If"];
|
optionsName = optionsName .. (isLinked and L["Else If"] or L["If"])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1648,9 +1652,11 @@ local function addControlsForIfLine(args, order, data, conditionVariable, condit
|
|||||||
set = setValue
|
set = setValue
|
||||||
}
|
}
|
||||||
order = order + 1;
|
order = order + 1;
|
||||||
|
elseif currentConditionTemplate.type == "alwaystrue" then
|
||||||
|
order = addSpace(args, order)
|
||||||
elseif currentConditionTemplate.type == "customcheck" then
|
elseif currentConditionTemplate.type == "customcheck" then
|
||||||
args["condition" .. i .. tostring(path) .. "_op"] = {
|
args["condition" .. i .. tostring(path) .. "_op"] = {
|
||||||
name = blueIfNoValue(data, conditions[i].check, "op", L["Events"], L["Events"]),
|
name = blueIfNoValue(data, conditions[i].check, "op", L["Additional Events"], L["Additional Events"]),
|
||||||
desc = descIfNoValue(data, conditions[i].check, "op", currentConditionTemplate.type) or "",
|
desc = descIfNoValue(data, conditions[i].check, "op", currentConditionTemplate.type) or "",
|
||||||
type = "input",
|
type = "input",
|
||||||
width = WeakAuras.doubleWidth,
|
width = WeakAuras.doubleWidth,
|
||||||
@@ -1751,6 +1757,12 @@ local function addControlsForIfLine(args, order, data, conditionVariable, condit
|
|||||||
return order;
|
return order;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function fixUpLinkedInFirstCondition(conditions)
|
||||||
|
if conditions[1] and conditions[1].linked then
|
||||||
|
conditions[1].linked = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function addControlsForCondition(args, order, data, conditionVariable, conditions, i, conditionTemplates, conditionTemplateWithoutCombinations, allProperties)
|
local function addControlsForCondition(args, order, data, conditionVariable, conditions, i, conditionTemplates, conditionTemplateWithoutCombinations, allProperties)
|
||||||
if (not conditions[i].check) then
|
if (not conditions[i].check) then
|
||||||
return;
|
return;
|
||||||
@@ -1774,7 +1786,6 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
|
|||||||
name = L["Condition %i"]:format(i),
|
name = L["Condition %i"]:format(i),
|
||||||
order = order,
|
order = order,
|
||||||
width = WeakAuras.doubleWidth - 0.45,
|
width = WeakAuras.doubleWidth - 0.45,
|
||||||
--fontSize = "large",
|
|
||||||
func = function()
|
func = function()
|
||||||
if data.controlledChildren then
|
if data.controlledChildren then
|
||||||
for id, reference in pairs(conditions[i].check.references) do
|
for id, reference in pairs(conditions[i].check.references) do
|
||||||
@@ -1819,6 +1830,7 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
|
|||||||
local tmp = auraData[conditionVariable][reference.conditionIndex];
|
local tmp = auraData[conditionVariable][reference.conditionIndex];
|
||||||
tremove(auraData[conditionVariable], reference.conditionIndex);
|
tremove(auraData[conditionVariable], reference.conditionIndex);
|
||||||
tinsert(auraData[conditionVariable], reference.conditionIndex - 1, tmp);
|
tinsert(auraData[conditionVariable], reference.conditionIndex - 1, tmp);
|
||||||
|
fixUpLinkedInFirstCondition(auraData[conditionVariable])
|
||||||
WeakAuras.Add(auraData);
|
WeakAuras.Add(auraData);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1828,6 +1840,7 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
|
|||||||
local tmp = conditions[i];
|
local tmp = conditions[i];
|
||||||
tremove(conditions, i);
|
tremove(conditions, i);
|
||||||
tinsert(conditions, i - 1, tmp);
|
tinsert(conditions, i - 1, tmp);
|
||||||
|
fixUpLinkedInFirstCondition(conditions)
|
||||||
WeakAuras.Add(data);
|
WeakAuras.Add(data);
|
||||||
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
||||||
end
|
end
|
||||||
@@ -1868,6 +1881,7 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
|
|||||||
local tmp = auraData[conditionVariable][reference.conditionIndex];
|
local tmp = auraData[conditionVariable][reference.conditionIndex];
|
||||||
tremove(auraData[conditionVariable], reference.conditionIndex);
|
tremove(auraData[conditionVariable], reference.conditionIndex);
|
||||||
tinsert(auraData[conditionVariable], reference.conditionIndex + 1, tmp);
|
tinsert(auraData[conditionVariable], reference.conditionIndex + 1, tmp);
|
||||||
|
fixUpLinkedInFirstCondition(auraData[conditionVariable])
|
||||||
WeakAuras.Add(auraData);
|
WeakAuras.Add(auraData);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1878,6 +1892,7 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
|
|||||||
local tmp = conditions[i];
|
local tmp = conditions[i];
|
||||||
tremove(conditions, i);
|
tremove(conditions, i);
|
||||||
tinsert(conditions, i + 1, tmp);
|
tinsert(conditions, i + 1, tmp);
|
||||||
|
fixUpLinkedInFirstCondition(conditions)
|
||||||
WeakAuras.Add(data);
|
WeakAuras.Add(data);
|
||||||
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
||||||
return;
|
return;
|
||||||
@@ -1901,12 +1916,14 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
|
|||||||
for id, reference in pairs(conditions[i].check.references) do
|
for id, reference in pairs(conditions[i].check.references) do
|
||||||
local auraData = WeakAuras.GetData(id);
|
local auraData = WeakAuras.GetData(id);
|
||||||
tremove(auraData[conditionVariable], reference.conditionIndex);
|
tremove(auraData[conditionVariable], reference.conditionIndex);
|
||||||
|
fixUpLinkedInFirstCondition(auraData[conditionVariable])
|
||||||
WeakAuras.Add(auraData);
|
WeakAuras.Add(auraData);
|
||||||
end
|
end
|
||||||
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
||||||
return;
|
return;
|
||||||
else
|
else
|
||||||
tremove(conditions, i);
|
tremove(conditions, i);
|
||||||
|
fixUpLinkedInFirstCondition(conditions)
|
||||||
WeakAuras.Add(data);
|
WeakAuras.Add(data);
|
||||||
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
||||||
return;
|
return;
|
||||||
@@ -1963,7 +1980,56 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
order = order + 1;
|
order = order + 1;
|
||||||
order = addSpace(args, order);
|
|
||||||
|
local showElseIf = false
|
||||||
|
local isLinked = false
|
||||||
|
|
||||||
|
if (data.controlledChildren) then
|
||||||
|
for id, reference in pairs(conditions[i].check.references) do
|
||||||
|
if reference.conditionIndex > 1 then
|
||||||
|
local auradata = WeakAuras.GetData(id);
|
||||||
|
isLinked = auradata[conditionVariable][reference.conditionIndex].linked
|
||||||
|
showElseIf = true
|
||||||
|
break;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if i > 1 then
|
||||||
|
showElseIf = true
|
||||||
|
isLinked = conditions[i].linked
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if showElseIf then
|
||||||
|
args["condition" .. i .. "_else"] = {
|
||||||
|
type = "toggle",
|
||||||
|
width = WeakAuras.normalWidth,
|
||||||
|
name = L["Else If"],
|
||||||
|
order = order,
|
||||||
|
get = function()
|
||||||
|
return isLinked
|
||||||
|
end,
|
||||||
|
set = function()
|
||||||
|
if (data.controlledChildren) then
|
||||||
|
for id, reference in pairs(conditions[i].check.references) do
|
||||||
|
local auradata = WeakAuras.GetData(id);
|
||||||
|
if reference.conditionIndex > 1 then
|
||||||
|
auradata[conditionVariable][reference.conditionIndex].linked = not isLinked
|
||||||
|
WeakAuras.Add(auradata);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
||||||
|
else
|
||||||
|
conditions[i].linked = not isLinked
|
||||||
|
WeakAuras.Add(data);
|
||||||
|
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
order = order + 1;
|
||||||
|
else
|
||||||
|
order = addSpace(args, order)
|
||||||
|
end
|
||||||
|
|
||||||
return order;
|
return order;
|
||||||
end
|
end
|
||||||
@@ -2213,6 +2279,8 @@ local function compareSubChecks(a, b, allConditionTemplates)
|
|||||||
if (a[i].value ~= b[i].value) then
|
if (a[i].value ~= b[i].value) then
|
||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
|
elseif (type == "alwaystrue") then
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2226,7 +2294,8 @@ local function findMatchingCondition(all, needle, start, allConditionTemplates)
|
|||||||
return nil;
|
return nil;
|
||||||
end
|
end
|
||||||
|
|
||||||
if (condition.check.trigger == needle.check.trigger and condition.check.variable == needle.check.variable) then
|
if (condition.check.trigger == needle.check.trigger and condition.check.variable == needle.check.variable
|
||||||
|
and condition.linked == needle.linked) then
|
||||||
if condition.check.variable == "customcheck" then
|
if condition.check.variable == "customcheck" then
|
||||||
-- Be a bit more strict for custom checks, there's little benefit in merging them
|
-- Be a bit more strict for custom checks, there's little benefit in merging them
|
||||||
if condition.check.op == needle.check.op and condition.check.value == needle.check.value then
|
if condition.check.op == needle.check.op and condition.check.value == needle.check.value then
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ function WeakAuras.StartFrameChooser(data, path)
|
|||||||
|
|
||||||
if(focus ~= oldFocus) then
|
if(focus ~= oldFocus) then
|
||||||
if(focusName) then
|
if(focusName) then
|
||||||
|
frameChooserBox:ClearAllPoints();
|
||||||
frameChooserBox:SetPoint("bottomleft", focus, "bottomleft", -4, -4);
|
frameChooserBox:SetPoint("bottomleft", focus, "bottomleft", -4, -4);
|
||||||
frameChooserBox:SetPoint("topright", focus, "topright", 4, 4);
|
frameChooserBox:SetPoint("topright", focus, "topright", 4, 4);
|
||||||
frameChooserBox:Show();
|
frameChooserBox:Show();
|
||||||
|
|||||||
@@ -616,7 +616,7 @@ local function ConstructMoverSizer(parent)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
WeakAuras.FillOptions()
|
WeakAuras.FillOptions()
|
||||||
WeakAuras.Animate("display", data, "main", data.animation.main, WeakAuras.regions[data.id].region, false, nil, true)
|
WeakAuras.Animate("display", data.uid, "main", data.animation.main, WeakAuras.regions[data.id].region, false, nil, true)
|
||||||
-- hide alignment lines
|
-- hide alignment lines
|
||||||
frame.lineY:Hide()
|
frame.lineY:Hide()
|
||||||
frame.lineX:Hide()
|
frame.lineX:Hide()
|
||||||
@@ -736,7 +736,7 @@ local function ConstructMoverSizer(parent)
|
|||||||
frame.text:Hide()
|
frame.text:Hide()
|
||||||
frame:SetScript("OnUpdate", nil)
|
frame:SetScript("OnUpdate", nil)
|
||||||
WeakAuras.FillOptions()
|
WeakAuras.FillOptions()
|
||||||
WeakAuras.Animate("display", data, "main", data.animation.main, WeakAuras.regions[data.id].region, false, nil, true)
|
WeakAuras.Animate("display", data.uid, "main", data.animation.main, WeakAuras.regions[data.id].region, false, nil, true)
|
||||||
-- hide alignment lines
|
-- hide alignment lines
|
||||||
frame.lineY:Hide()
|
frame.lineY:Hide()
|
||||||
frame.lineX:Hide()
|
frame.lineX:Hide()
|
||||||
|
|||||||
@@ -275,10 +275,25 @@ function WeakAuras.AddTriggerMetaFunctions(options, data, triggernum)
|
|||||||
end,
|
end,
|
||||||
func = function()
|
func = function()
|
||||||
if #data.triggers > 1 then
|
if #data.triggers > 1 then
|
||||||
tremove(data.triggers, triggernum)
|
StaticPopupDialogs["WEAKAURAS_CONFIRM_TRIGGER_DELETE"] = {
|
||||||
DeleteConditionsForTrigger(data, triggernum);
|
text = L["You are about to delete a trigger. |cFFFF0000This cannot be undone!|r Would you like to continue?"],
|
||||||
WeakAuras.Add(data)
|
button1 = L["Delete"],
|
||||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
button2 = L["Cancel"],
|
||||||
|
OnAccept = function()
|
||||||
|
tremove(data.triggers, triggernum)
|
||||||
|
DeleteConditionsForTrigger(data, triggernum)
|
||||||
|
WeakAuras.Add(data)
|
||||||
|
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||||
|
WeakAuras.FillOptions()
|
||||||
|
end,
|
||||||
|
OnCancel = function()
|
||||||
|
-- no-op
|
||||||
|
end,
|
||||||
|
showAlert = 1,
|
||||||
|
whileDead = 1,
|
||||||
|
preferredindex = STATICPOPUP_NUMDIALOGS,
|
||||||
|
}
|
||||||
|
StaticPopup_Show("WEAKAURAS_CONFIRM_TRIGGER_DELETE")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1218,7 +1218,7 @@ function WeakAuras.DropIndicator()
|
|||||||
indicator:SetHeight(4)
|
indicator:SetHeight(4)
|
||||||
indicator:SetFrameStrata("FULLSCREEN")
|
indicator:SetFrameStrata("FULLSCREEN")
|
||||||
|
|
||||||
local texture = indicator:CreateTexture(nil, "HIGHLIGHT")
|
local texture = indicator:CreateTexture(nil, "ARTWORK")
|
||||||
texture:SetBlendMode("ADD")
|
texture:SetBlendMode("ADD")
|
||||||
texture:SetAllPoints(indicator)
|
texture:SetAllPoints(indicator)
|
||||||
texture:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight")
|
texture:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight")
|
||||||
|
|||||||
Reference in New Issue
Block a user