from retail
This commit is contained in:
@@ -4635,6 +4635,7 @@ WeakAuras.event_prototypes = {
|
|||||||
{
|
{
|
||||||
name = "aggro",
|
name = "aggro",
|
||||||
display = L["Aggro"],
|
display = L["Aggro"],
|
||||||
|
type = "tristate",
|
||||||
store = true,
|
store = true,
|
||||||
conditionType = "bool",
|
conditionType = "bool",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1101,18 +1101,17 @@ local function modify(parent, region, data)
|
|||||||
region.tooltipFrame:EnableMouse(false);
|
region.tooltipFrame:EnableMouse(false);
|
||||||
end
|
end
|
||||||
|
|
||||||
function region:Update()
|
function region:UpdateMinMax()
|
||||||
local state = region.state
|
local state = region.state
|
||||||
|
local min
|
||||||
local max
|
local max
|
||||||
if state.progressType == "timed" then
|
if state.progressType == "timed" then
|
||||||
local expirationTime = state.expirationTime and state.expirationTime > 0 and state.expirationTime or math.huge;
|
|
||||||
local duration = state.duration or 0
|
local duration = state.duration or 0
|
||||||
|
|
||||||
if region.adjustedMinRelPercent then
|
if region.adjustedMinRelPercent then
|
||||||
region.adjustedMinRel = region.adjustedMinRelPercent * duration
|
region.adjustedMinRel = region.adjustedMinRelPercent * duration
|
||||||
end
|
end
|
||||||
|
|
||||||
local adjustMin = region.adjustedMin or region.adjustedMinRel or 0;
|
min = region.adjustedMin or region.adjustedMinRel or 0;
|
||||||
|
|
||||||
if duration == 0 then
|
if duration == 0 then
|
||||||
max = 0
|
max = 0
|
||||||
@@ -1124,20 +1123,13 @@ local function modify(parent, region, data)
|
|||||||
else
|
else
|
||||||
max = duration
|
max = duration
|
||||||
end
|
end
|
||||||
|
|
||||||
region:SetTime(max - adjustMin, expirationTime - adjustMin, state.inverse);
|
|
||||||
if not region.TimerTick then
|
|
||||||
region.TimerTick = TimerTick
|
|
||||||
region:UpdateRegionHasTimerTick()
|
|
||||||
end
|
|
||||||
elseif state.progressType == "static" then
|
elseif state.progressType == "static" then
|
||||||
local value = state.value or 0;
|
|
||||||
local total = state.total or 0;
|
local total = state.total or 0;
|
||||||
|
|
||||||
if region.adjustedMinRelPercent then
|
if region.adjustedMinRelPercent then
|
||||||
region.adjustedMinRel = region.adjustedMinRelPercent * total
|
region.adjustedMinRel = region.adjustedMinRelPercent * total
|
||||||
end
|
end
|
||||||
local adjustMin = region.adjustedMin or region.adjustedMinRel or 0;
|
min = region.adjustedMin or region.adjustedMinRel or 0;
|
||||||
|
|
||||||
if region.adjustedMax then
|
if region.adjustedMax then
|
||||||
max = region.adjustedMax
|
max = region.adjustedMax
|
||||||
elseif region.adjustedMaxRelPercent then
|
elseif region.adjustedMaxRelPercent then
|
||||||
@@ -1146,7 +1138,31 @@ local function modify(parent, region, data)
|
|||||||
else
|
else
|
||||||
max = total
|
max = total
|
||||||
end
|
end
|
||||||
region:SetValue(value - adjustMin, max - adjustMin);
|
end
|
||||||
|
region.currentMin, region.currentMax = min, max
|
||||||
|
end
|
||||||
|
|
||||||
|
function region:GetMinMax()
|
||||||
|
return region.currentMin or 0, region.currentMax or 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function region:Update()
|
||||||
|
local state = region.state
|
||||||
|
region:UpdateMinMax()
|
||||||
|
if state.progressType == "timed" then
|
||||||
|
local expirationTime = state.expirationTime and state.expirationTime > 0 and state.expirationTime or math.huge;
|
||||||
|
local duration = state.duration or 0
|
||||||
|
|
||||||
|
region:SetTime(region.currentMax - region.currentMin, expirationTime - region.currentMin, state.inverse);
|
||||||
|
if not region.TimerTick then
|
||||||
|
region.TimerTick = TimerTick
|
||||||
|
region:UpdateRegionHasTimerTick()
|
||||||
|
end
|
||||||
|
elseif state.progressType == "static" then
|
||||||
|
local value = state.value or 0;
|
||||||
|
local total = state.total or 0;
|
||||||
|
|
||||||
|
region:SetValue(value - region.currentMin, region.currentMax - region.currentMin);
|
||||||
if region.TimerTick then
|
if region.TimerTick then
|
||||||
region.TimerTick = nil
|
region.TimerTick = nil
|
||||||
region:UpdateRegionHasTimerTick()
|
region:UpdateRegionHasTimerTick()
|
||||||
@@ -1173,9 +1189,8 @@ local function modify(parent, region, data)
|
|||||||
icon:SetDesaturated(data.desaturate);
|
icon:SetDesaturated(data.desaturate);
|
||||||
|
|
||||||
local duration = state.duration or 0
|
local duration = state.duration or 0
|
||||||
local min = region.adjustMin or 0
|
|
||||||
local effectiveInverse = (state.inverse and not region.inverseDirection) or (not state.inverse and region.inverseDirection);
|
local effectiveInverse = (state.inverse and not region.inverseDirection) or (not state.inverse and region.inverseDirection);
|
||||||
region.bar:SetAdditionalBars(state.additionalProgress, region.overlays, min, max, effectiveInverse, region.overlayclip);
|
region.bar:SetAdditionalBars(state.additionalProgress, region.overlays, region.currentMin, region.currentMax, effectiveInverse, region.overlayclip);
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Scale update function
|
-- Scale update function
|
||||||
|
|||||||
@@ -525,10 +525,18 @@ function WeakAuras.regionPrototype.modify(parent, region, data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not parent or parent.regionType ~= "dynamicgroup" then
|
if not parent or parent.regionType ~= "dynamicgroup" then
|
||||||
if not (
|
if
|
||||||
data.anchorFrameType == "CUSTOM"
|
-- Don't anchor single Auras that with custom anchoring,
|
||||||
or data.anchorFrameType == "UNITFRAME"
|
-- these will be anchored in expand
|
||||||
) then
|
not (
|
||||||
|
data.anchorFrameType == "CUSTOM"
|
||||||
|
or data.anchorFrameType == "UNITFRAME"
|
||||||
|
)
|
||||||
|
-- Group Auras that will never be expanded, so those need
|
||||||
|
-- to be always anchored here
|
||||||
|
or data.regionType == "dynamicgroup"
|
||||||
|
or data.regionType == "group"
|
||||||
|
then
|
||||||
WeakAuras.AnchorFrame(data, region, parent);
|
WeakAuras.AnchorFrame(data, region, parent);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ if not WeakAuras.IsCorrectVersion() then return end
|
|||||||
local SharedMedia = LibStub("LibSharedMedia-3.0");
|
local SharedMedia = LibStub("LibSharedMedia-3.0");
|
||||||
local L = WeakAuras.L;
|
local L = WeakAuras.L;
|
||||||
|
|
||||||
|
local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ceil(GetScreenHeight() / 20) * 20
|
||||||
|
|
||||||
local defaultFont = WeakAuras.defaultFont
|
local defaultFont = WeakAuras.defaultFont
|
||||||
local defaultFontSize = WeakAuras.defaultFontSize
|
local defaultFontSize = WeakAuras.defaultFontSize
|
||||||
|
|
||||||
@@ -80,7 +82,23 @@ local properties = {
|
|||||||
softMax = 72,
|
softMax = 72,
|
||||||
step = 1,
|
step = 1,
|
||||||
default = 12
|
default = 12
|
||||||
}
|
},
|
||||||
|
text_anchorXOffset = {
|
||||||
|
display = L["X-Offset"],
|
||||||
|
setter = "SetXOffset",
|
||||||
|
type = "number",
|
||||||
|
softMin = (-1 * screenWidth),
|
||||||
|
softMax = screenWidth,
|
||||||
|
bigStep = 10,
|
||||||
|
},
|
||||||
|
text_anchorYOffset = {
|
||||||
|
display = L["Y-Offset"],
|
||||||
|
setter = "SetYOffset",
|
||||||
|
type = "number",
|
||||||
|
softMin = (-1 * screenHeight),
|
||||||
|
softMax = screenHeight,
|
||||||
|
bigStep = 10,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -258,7 +276,7 @@ local function modify(parent, region, parentData, data, first)
|
|||||||
if text:GetFont() then
|
if text:GetFont() then
|
||||||
text:SetText(WeakAuras.ReplaceRaidMarkerSymbols(textStr))
|
text:SetText(WeakAuras.ReplaceRaidMarkerSymbols(textStr))
|
||||||
end
|
end
|
||||||
region:UpdateAnchor()
|
region:UpdateAnchorOnTextChange()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -342,7 +360,7 @@ local function modify(parent, region, parentData, data, first)
|
|||||||
local fontPath = SharedMedia:Fetch("font", data.text_font);
|
local fontPath = SharedMedia:Fetch("font", data.text_font);
|
||||||
region.text:SetFont(fontPath, size, data.text_fontType);
|
region.text:SetFont(fontPath, size, data.text_fontType);
|
||||||
region.text:SetTextHeight(size)
|
region.text:SetTextHeight(size)
|
||||||
region:UpdateAnchor();
|
region:UpdateAnchorOnTextChange();
|
||||||
end
|
end
|
||||||
|
|
||||||
function region:SetVisible(visible)
|
function region:SetVisible(visible)
|
||||||
@@ -380,18 +398,39 @@ local function modify(parent, region, parentData, data, first)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
region.text_anchorXOffset = data.text_anchorXOffset
|
||||||
|
region.text_anchorYOffset = data.text_anchorYOffset
|
||||||
|
|
||||||
local textDegrees = data.rotateText == "LEFT" and 90 or data.rotateText == "RIGHT" and -90 or 0;
|
local textDegrees = data.rotateText == "LEFT" and 90 or data.rotateText == "RIGHT" and -90 or 0;
|
||||||
local xo, yo = getRotateOffset(text, textDegrees, selfPoint)
|
|
||||||
parent:AnchorSubRegion(text, "point", selfPoint, data.text_anchorPoint, (data.text_anchorXOffset or 0) + xo, (data.text_anchorYOffset or 0) + yo)
|
region.UpdateAnchor = function(self)
|
||||||
|
local xo, yo = getRotateOffset(text, textDegrees, selfPoint)
|
||||||
|
parent:AnchorSubRegion(text, "point", selfPoint, data.text_anchorPoint, (self.text_anchorXOffset or 0) + xo, (self.text_anchorYOffset or 0) + yo)
|
||||||
|
end
|
||||||
|
|
||||||
|
region:UpdateAnchor()
|
||||||
animRotate(text, textDegrees, selfPoint)
|
animRotate(text, textDegrees, selfPoint)
|
||||||
|
|
||||||
if textDegrees == 0 then
|
if textDegrees == 0 then
|
||||||
region.UpdateAnchor = function() end
|
region.UpdateAnchorOnTextChange = function() end
|
||||||
else
|
else
|
||||||
region.UpdateAnchor = function(self)
|
region.UpdateAnchorOnTextChange = region.UpdateAnchor
|
||||||
local xo, yo = getRotateOffset(self.text, textDegrees, selfPoint)
|
end
|
||||||
parent:AnchorSubRegion(self.text, "point", selfPoint, data.text_anchorPoint, (data.text_anchorXOffset or 0) + xo, (data.text_anchorYOffset or 0) + yo)
|
|
||||||
|
region.SetXOffset = function(self, xOffset)
|
||||||
|
if self.text_anchorXOffset == xOffset then
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
self.text_anchorXOffset = xOffset
|
||||||
|
self:UpdateAnchor()
|
||||||
|
end
|
||||||
|
|
||||||
|
region.SetYOffset = function(self, yOffset)
|
||||||
|
if self.text_anchorYOffset == yOffset then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self.text_anchorYOffset = yOffset
|
||||||
|
self:UpdateAnchor()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -181,61 +181,37 @@ local funcs = {
|
|||||||
local offset, offsetx, offsety = self.tick_placement, 0, 0
|
local offset, offsetx, offsety = self.tick_placement, 0, 0
|
||||||
local width = self.parentMajorSize
|
local width = self.parentMajorSize
|
||||||
|
|
||||||
local hide = false
|
local minValue, maxValue = self.parent:GetMinMax()
|
||||||
if self.tick_placement_mode == "AtValue" then
|
local valueRange = maxValue - minValue
|
||||||
local percent = self.trigger_total and self.trigger_total ~= 0 and self.tick_placement / self.trigger_total
|
|
||||||
|
|
||||||
if not self.trigger_total or percent and percent < 0 or percent > 1 then
|
local tick_placement
|
||||||
hide = true
|
if self.tick_placement_mode == "AtValue" then
|
||||||
offset = 0
|
tick_placement = self.tick_placement
|
||||||
else
|
|
||||||
offset = percent * width
|
|
||||||
end
|
|
||||||
elseif self.tick_placement_mode == "AtMissingValue" then
|
elseif self.tick_placement_mode == "AtMissingValue" then
|
||||||
local percent = self.trigger_total and self.trigger_total ~= 0 and 1 - (self.tick_placement / self.trigger_total)
|
tick_placement = self.trigger_total and self.trigger_total - self.tick_placement
|
||||||
if not self.trigger_total or percent and percent < 0 or percent > 1 then
|
|
||||||
hide = true
|
|
||||||
offset = 0
|
|
||||||
else
|
|
||||||
offset = percent * width
|
|
||||||
end
|
|
||||||
elseif self.tick_placement_mode == "AtPercent" then
|
elseif self.tick_placement_mode == "AtPercent" then
|
||||||
if self.tick_placement >= 0 and self.tick_placement <= 100 then
|
if self.tick_placement >= 0 and self.tick_placement <= 100 and self.trigger_total then
|
||||||
offset = (self.tick_placement / 100) * width
|
tick_placement = self.tick_placement * self.trigger_total / 100
|
||||||
else
|
|
||||||
hide = true
|
|
||||||
offset = 0
|
|
||||||
end
|
end
|
||||||
elseif self.tick_placement_mode == "ValueOffset" then
|
elseif self.tick_placement_mode == "ValueOffset" then
|
||||||
if self.trigger_total and self.trigger_total ~= 0 then
|
if self.trigger_total and self.trigger_total ~= 0 then
|
||||||
local atValue
|
|
||||||
if self.state.progressType == "timed" then
|
if self.state.progressType == "timed" then
|
||||||
atValue = self.state.expirationTime - GetTime() + self.tick_placement
|
tick_placement = self.state.expirationTime - GetTime() + self.tick_placement
|
||||||
else
|
else
|
||||||
atValue = self.state.value + self.tick_placement
|
tick_placement = self.state.value + self.tick_placement
|
||||||
end
|
end
|
||||||
|
|
||||||
local percent = atValue / self.trigger_total
|
|
||||||
if not self.trigger_total or percent < 0 or percent > 1 then
|
|
||||||
hide = true
|
|
||||||
offset = 0
|
|
||||||
else
|
|
||||||
offset = percent * width
|
|
||||||
end
|
|
||||||
else
|
|
||||||
hide = true
|
|
||||||
offset = 0
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if hide then
|
local percent = valueRange ~= 0 and tick_placement and (tick_placement - minValue) / valueRange
|
||||||
|
if not percent or (percent and percent < 0 or percent > 1) then
|
||||||
self.texture:Hide()
|
self.texture:Hide()
|
||||||
|
offset = 0
|
||||||
else
|
else
|
||||||
self.texture:Show()
|
self.texture:Show()
|
||||||
|
offset = percent * width
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local inverse = self.inverse
|
local inverse = self.inverse
|
||||||
if self.trigger_inverse then
|
if self.trigger_inverse then
|
||||||
inverse = not inverse
|
inverse = not inverse
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ local function removeFuncs(intable, removeFunc)
|
|||||||
intable[i] = nil;
|
intable[i] = nil;
|
||||||
elseif (i == "func" and removeFunc) then
|
elseif (i == "func" and removeFunc) then
|
||||||
intable[i] = nil
|
intable[i] = nil
|
||||||
elseif(type(v) == "table" and i ~= "values") then
|
elseif(type(v) == "table" and i ~= "values" and i ~= "extraFunctions") then
|
||||||
removeFuncs(v, removeFunc)
|
removeFuncs(v, removeFunc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1233,8 +1233,8 @@ local function AddCodeOption(args, data, name, prefix, url, order, hiddenFunc, p
|
|||||||
extraFunctions = extraFunctions or {};
|
extraFunctions = extraFunctions or {};
|
||||||
tinsert(extraFunctions, 1, {
|
tinsert(extraFunctions, 1, {
|
||||||
buttonLabel = L["Expand"],
|
buttonLabel = L["Expand"],
|
||||||
func = function()
|
func = function(info)
|
||||||
WeakAuras.OpenTextEditor(data, path, encloseInFunction, multipath, reloadOptions, setOnParent, url)
|
WeakAuras.OpenTextEditor(WeakAuras.GetPickedDisplay(), path, encloseInFunction, multipath, reloadOptions, setOnParent, url)
|
||||||
end
|
end
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -760,7 +760,7 @@ function WeakAuras.CreateFrame()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if (type(self.pickedDisplay) == "string" and self.pickedDisplay == id)
|
if (type(self.pickedDisplay) == "string" and self.pickedDisplay == id)
|
||||||
or (type(self.pickedDisplay == "table") and id == tempGroup.id)
|
or (type(self.pickedDisplay) == "table" and id == tempGroup.id)
|
||||||
then
|
then
|
||||||
frame:UpdateOptions()
|
frame:UpdateOptions()
|
||||||
end
|
end
|
||||||
@@ -1184,6 +1184,13 @@ function WeakAuras.CreateFrame()
|
|||||||
self:FillOptions()
|
self:FillOptions()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
frame.GetPickedDisplay = function(self)
|
||||||
|
if type(self.pickedDisplay) == "string" then
|
||||||
|
return WeakAuras.GetData(self.pickedDisplay)
|
||||||
|
end
|
||||||
|
return self.pickedDisplay
|
||||||
|
end
|
||||||
|
|
||||||
frame:SetClampedToScreen(true)
|
frame:SetClampedToScreen(true)
|
||||||
local w, h = frame:GetSize()
|
local w, h = frame:GetSize()
|
||||||
local left, right, top, bottom = w/2,-w/2, 0, h-25
|
local left, right, top, bottom = w/2,-w/2, 0, h-25
|
||||||
|
|||||||
@@ -727,6 +727,10 @@ function WeakAuras.EnsureOptions(data, subOption)
|
|||||||
return frame:EnsureOptions(data, subOption)
|
return frame:EnsureOptions(data, subOption)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function WeakAuras.GetPickedDisplay()
|
||||||
|
return frame:GetPickedDisplay()
|
||||||
|
end
|
||||||
|
|
||||||
function WeakAuras.GetSpellTooltipText(id)
|
function WeakAuras.GetSpellTooltipText(id)
|
||||||
local tooltip = WeakAuras.GetHiddenTooltip();
|
local tooltip = WeakAuras.GetHiddenTooltip();
|
||||||
tooltip:SetSpellByID(id);
|
tooltip:SetSpellByID(id);
|
||||||
|
|||||||
Reference in New Issue
Block a user