from retail

This commit is contained in:
NoM0Re
2025-01-17 18:59:10 +01:00
parent 89a247addb
commit efdbb3c46d
10 changed files with 107 additions and 28 deletions
+3 -3
View File
@@ -1,11 +1,11 @@
<Bindings> <Bindings>
<Binding name="WEAKAURASTOGGLE" header="WEAKAURAS" Category="ADDONS"> <Binding name="WEAKAURASTOGGLE" Category="BINDING_HEADER_WEAKAURAS">
WeakAuras.OpenOptions() WeakAuras.OpenOptions()
</Binding> </Binding>
<Binding name="WEAKAURASPROFILINGTOGGLE" Category="ADDONS"> <Binding name="WEAKAURASPROFILINGTOGGLE" Category="BINDING_HEADER_WEAKAURAS">
WeakAuras.RealTimeProfilingWindow:Toggle() WeakAuras.RealTimeProfilingWindow:Toggle()
</Binding> </Binding>
<Binding name="WEAKAURASPRINTPROFILING" Category="ADDONS"> <Binding name="WEAKAURASPRINTPROFILING" Category="BINDING_HEADER_WEAKAURAS">
WeakAuras.PrintProfile() WeakAuras.PrintProfile()
</Binding> </Binding>
</Bindings> </Bindings>
+9 -3
View File
@@ -2381,9 +2381,11 @@ do
if (showgcd) then if (showgcd) then
if ((gcdStart or 0) + (gcdDuration or 0) > startTime + duration) then if ((gcdStart or 0) + (gcdDuration or 0) > startTime + duration) then
if startTime == 0 then
gcdCooldown = true
end
startTime = gcdStart; startTime = gcdStart;
duration = gcdDuration; duration = gcdDuration;
gcdCooldown = true;
end end
end end
@@ -2403,9 +2405,11 @@ do
end end
if (showgcd) then if (showgcd) then
if ((gcdStart or 0) + (gcdDuration or 0) > startTime + duration) then if ((gcdStart or 0) + (gcdDuration or 0) > startTime + duration) then
if startTime == 0 then
gcdCooldown = true
end
startTime = gcdStart; startTime = gcdStart;
duration = gcdDuration; duration = gcdDuration;
gcdCooldown = true;
end end
end end
return startTime, duration, enabled, gcdCooldown; return startTime, duration, enabled, gcdCooldown;
@@ -2437,9 +2441,11 @@ do
if (showgcd) then if (showgcd) then
if ((gcdStart or 0) + (gcdDuration or 0) > startTime + duration) then if ((gcdStart or 0) + (gcdDuration or 0) > startTime + duration) then
if startTime == 0 then
gcdCooldown = true
end
startTime = gcdStart; startTime = gcdStart;
duration = gcdDuration; duration = gcdDuration;
gcdCooldown = true;
end end
end end
return startTime, duration, enabled, gcdCooldown; return startTime, duration, enabled, gcdCooldown;
+7 -6
View File
@@ -1256,15 +1256,16 @@ function Private.Modernize(data)
end end
end end
local function migrateToTable(tab, field)
local value = tab[field]
if value ~= nil and type(value) ~= "table" then
tab[field] = { value }
end
end
if data.internalVersion < 67 or data.internalVersion > WeakAuras.InternalVersion() then if data.internalVersion < 67 or data.internalVersion > WeakAuras.InternalVersion() then
local castMigrationNeeded = data.internalVersion < 67 local castMigrationNeeded = data.internalVersion < 67
data.internalVersion = WeakAuras.InternalVersion() data.internalVersion = WeakAuras.InternalVersion()
local function migrateToTable(tab, field)
local value = tab[field]
if value ~= nil and type(value) ~= "table" then
tab[field] = { value }
end
end
do do
local trigger_migration = { local trigger_migration = {
+13 -2
View File
@@ -1040,6 +1040,17 @@ Private.load_prototype = {
events = {"PARTY_MEMBERS_CHANGED", "RAID_ROSTER_UPDATE"}, events = {"PARTY_MEMBERS_CHANGED", "RAID_ROSTER_UPDATE"},
optional = true, optional = true,
}, },
{
name = "groupSize",
display = L["Group Size"],
type = "number",
init = "arg",
events = {"PARTY_MEMBERS_CHANGED", "RAID_ROSTER_UPDATE"},
multiEntry = {
operator = "and",
limit = 2
},
},
{ {
name = "group_leader", name = "group_leader",
display = WeakAuras.newFeatureString .. L["Group Leader/Assist"], display = WeakAuras.newFeatureString .. L["Group Leader/Assist"],
@@ -3098,7 +3109,7 @@ Private.event_prototypes = {
force_events = "SPELL_COOLDOWN_FORCE", force_events = "SPELL_COOLDOWN_FORCE",
name = L["Cooldown/Charges/Count"], name = L["Cooldown/Charges/Count"],
loadFunc = function(trigger) loadFunc = function(trigger)
trigger.spellName = trigger.spellName or 0; trigger.spellName = type(trigger.spellName) ~= "table" and trigger.spellName or 0;
local spellName; local spellName;
if (trigger.use_exact_spellName) then if (trigger.use_exact_spellName) then
spellName = trigger.spellName; spellName = trigger.spellName;
@@ -3111,7 +3122,7 @@ Private.event_prototypes = {
end end
end, end,
init = function(trigger) init = function(trigger)
trigger.spellName = trigger.spellName or 0; trigger.spellName = type(trigger.spellName) ~= "table" and trigger.spellName or 0;
local spellName; local spellName;
if (trigger.use_exact_spellName) then if (trigger.use_exact_spellName) then
spellName = trigger.spellName; spellName = trigger.spellName;
+22 -3
View File
@@ -28,6 +28,7 @@ local default = {
yOffset = 0, yOffset = 0,
radius = 200, radius = 200,
rotation = 0, rotation = 0,
stepAngle = 15,
fullCircle = true, fullCircle = true,
arcLength = 360, arcLength = 360,
constantFactor = "RADIUS", constantFactor = "RADIUS",
@@ -719,6 +720,7 @@ local growers = {
local constantFactor = data.constantFactor local constantFactor = data.constantFactor
local space = data.space or 0 local space = data.space or 0
local radius = data.radius or 0 local radius = data.radius or 0
local stepAngle = (data.stepAngle or 0) * math.pi / 180
local limit = data.useLimit and data.limit or math.huge local limit = data.useLimit and data.limit or math.huge
local sAngle = (data.rotation or 0) * math.pi / 180 local sAngle = (data.rotation or 0) * math.pi / 180
local arc = (data.fullCircle and 360 or data.arcLength or 0) * math.pi / 180 local arc = (data.fullCircle and 360 or data.arcLength or 0) * math.pi / 180
@@ -736,7 +738,7 @@ local growers = {
for frame, regionDatas in pairs(frames) do for frame, regionDatas in pairs(frames) do
local numVisible = min(limit, #regionDatas) local numVisible = min(limit, #regionDatas)
local r local r
if constantFactor == "RADIUS" then if constantFactor == "RADIUS" or constantFactor == "ANGLE" then
r = radius r = radius
else else
if numVisible <= 1 then if numVisible <= 1 then
@@ -749,6 +751,8 @@ local growers = {
local dAngle local dAngle
if numVisible == 1 then if numVisible == 1 then
dAngle = 0 dAngle = 0
elseif constantFactor == "ANGLE" then
dAngle = stepAngle
elseif not data.fullCircle then elseif not data.fullCircle then
dAngle = arc / (numVisible - 1) dAngle = arc / (numVisible - 1)
else else
@@ -770,6 +774,7 @@ local growers = {
local constantFactor = data.constantFactor local constantFactor = data.constantFactor
local space = data.space or 0 local space = data.space or 0
local radius = data.radius or 0 local radius = data.radius or 0
local stepAngle = (data.stepAngle or 0) * math.pi / 180
local limit = data.useLimit and data.limit or math.huge local limit = data.useLimit and data.limit or math.huge
local sAngle = (data.rotation or 0) * math.pi / 180 local sAngle = (data.rotation or 0) * math.pi / 180
local arc = (data.fullCircle and 360 or data.arcLength or 0) * math.pi / 180 local arc = (data.fullCircle and 360 or data.arcLength or 0) * math.pi / 180
@@ -787,7 +792,7 @@ local growers = {
for frame, regionDatas in pairs(frames) do for frame, regionDatas in pairs(frames) do
local numVisible = min(limit, #regionDatas) local numVisible = min(limit, #regionDatas)
local r local r
if constantFactor == "RADIUS" then if constantFactor == "RADIUS" or constantFactor == "ANGLE" then
r = radius r = radius
else else
if numVisible <= 1 then if numVisible <= 1 then
@@ -800,6 +805,8 @@ local growers = {
local dAngle local dAngle
if numVisible == 1 then if numVisible == 1 then
dAngle = 0 dAngle = 0
elseif constantFactor == "ANGLE" then
dAngle = -stepAngle
elseif not data.fullCircle then elseif not data.fullCircle then
dAngle = arc / (1 - numVisible) dAngle = arc / (1 - numVisible)
else else
@@ -1374,7 +1381,19 @@ local function modify(parent, region, data)
or data.anchorFrameType == "MOUSE") or data.anchorFrameType == "MOUSE")
)) ))
then then
controlPoint:SetParent(frame == "" and self.relativeTo or frame) local parent
if frame == "" then
parent = self.relativeTo
else
if type(frame) == "string" then
parent = _G[frame]
else
parent = frame
end
end
if parent and parent.IsObjectType and parent:IsObjectType("Frame") then
controlPoint:SetParent(parent)
end
else else
controlPoint:SetParent(self) controlPoint:SetParent(self)
end end
+6
View File
@@ -81,6 +81,12 @@ local function modify(parent, region, data)
local text = region.text; local text = region.text;
local fontPath = SharedMedia:Fetch("font", data.font); local fontPath = SharedMedia:Fetch("font", data.font);
if not text:GetFont() and fontPath then -- workaround font not loading correctly
local objectName = "WeakAuras-Font-" .. data.font
local fontObject = _G[objectName] or CreateFont(objectName)
fontObject:SetFont(fontPath, data.fontSize < 33 and data.fontSize or 33, data.outline)
text:SetFontObject(fontObject)
end
text:SetFont(fontPath, data.fontSize < 33 and data.fontSize or 33, data.outline); text:SetFont(fontPath, data.fontSize < 33 and data.fontSize or 33, data.outline);
if not text:GetFont() then -- Font invalid, set the font but keep the setting if not text:GetFont() then -- Font invalid, set the font but keep the setting
text:SetFont(STANDARD_TEXT_FONT, data.fontSize <= 33 and data.fontSize or 33, data.outline); text:SetFont(STANDARD_TEXT_FONT, data.fontSize <= 33 and data.fontSize or 33, data.outline);
+6
View File
@@ -139,6 +139,12 @@ local function modify(parent, region, parentData, data, first)
local fontPath = SharedMedia:Fetch("font", data.text_font); local fontPath = SharedMedia:Fetch("font", data.text_font);
text:SetFont(fontPath, data.text_fontSize < 33 and data.text_fontSize or 33, data.text_fontType); text:SetFont(fontPath, data.text_fontSize < 33 and data.text_fontSize or 33, data.text_fontType);
if not text:GetFont() and fontPath then -- workaround font not loading correctly
local objectName = "WeakAuras-Font-" .. data.text_font
local fontObject = _G[objectName] or CreateFont(objectName)
fontObject:SetFont(fontPath, data.text_fontSize < 33 and data.text_fontSize or 33, data.text_fontType)
text:SetFontObject(fontObject)
end
if not text:GetFont() then -- Font invalid, set the font but keep the setting if not text:GetFont() then -- Font invalid, set the font but keep the setting
text:SetFont(STANDARD_TEXT_FONT, data.text_fontSize < 33 and data.text_fontSize or 33, data.text_fontType); text:SetFont(STANDARD_TEXT_FONT, data.text_fontSize < 33 and data.text_fontSize or 33, data.text_fontType);
end end
+1
View File
@@ -32,6 +32,7 @@ if WeakAuras.isAwesomeEnabled() then
end end
Private.circular_group_constant_factor_types = { Private.circular_group_constant_factor_types = {
ANGLE = L["Angle and Radius"],
RADIUS = L["Radius"], RADIUS = L["Radius"],
SPACING = L["Spacing"] SPACING = L["Spacing"]
} }
+4 -3
View File
@@ -1,6 +1,6 @@
local AddonName, Private = ... local AddonName, Private = ...
local internalVersion = 68 local internalVersion = 69
-- Lua APIs -- Lua APIs
local insert = table.insert local insert = table.insert
@@ -1404,6 +1404,7 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...)
local size, difficulty, instanceType = GetInstanceTypeAndSize() local size, difficulty, instanceType = GetInstanceTypeAndSize()
local group = Private.ExecEnv.GroupType() local group = Private.ExecEnv.GroupType()
local groupSize = GetNumGroupMembers()
local changed = 0; local changed = 0;
local shouldBeLoaded, couldBeLoaded; local shouldBeLoaded, couldBeLoaded;
@@ -1416,8 +1417,8 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...)
if (data and not data.controlledChildren) then if (data and not data.controlledChildren) then
local loadFunc = loadFuncs[id]; local loadFunc = loadFuncs[id];
local loadOpt = loadFuncsForOptions[id]; local loadOpt = loadFuncsForOptions[id];
shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, pvp, vehicle, vehicleUi, player, realm, class, race, faction, playerLevel, raidRole, group, raidMemberType, zone, zoneId, subzone, size, difficulty); shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, pvp, vehicle, vehicleUi, player, realm, class, race, faction, playerLevel, raidRole, group, groupSize, raidMemberType, zone, zoneId, subzone, size, difficulty);
couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, pvp, vehicle, vehicleUi, player, realm, class, race, faction, playerLevel, raidRole, group, raidMemberType, zone, zoneId, subzone, size, difficulty); couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, pvp, vehicle, vehicleUi, player, realm, class, race, faction, playerLevel, raidRole, group, groupSize, raidMemberType, zone, zoneId, subzone, size, difficulty);
if(shouldBeLoaded and not loaded[id]) then if(shouldBeLoaded and not loaded[id]) then
changed = changed + 1; changed = changed + 1;
@@ -263,7 +263,7 @@ local function createOptions(id, data)
name = L["Constant Factor"], name = L["Constant Factor"],
order = 4, order = 4,
values = OptionsPrivate.Private.circular_group_constant_factor_types, values = OptionsPrivate.Private.circular_group_constant_factor_types,
hidden = function() return data.grow ~= "CIRCLE" and data.grow ~= "COUNTERCIRCLE" end hidden = function() return not(data.grow == "CIRCLE" or data.grow == "COUNTERCIRCLE") end
}, },
rotation = { rotation = {
type = "range", type = "range",
@@ -274,14 +274,31 @@ local function createOptions(id, data)
min = 0, min = 0,
max = 360, max = 360,
bigStep = 3, bigStep = 3,
hidden = function() return data.grow ~= "CIRCLE" and data.grow ~= "COUNTERCIRCLE" end hidden = function() return not(data.grow == "CIRCLE" or data.grow == "COUNTERCIRCLE") end
}, },
fullCircle = { fullCircle = {
type = "toggle", type = "toggle",
width = WeakAuras.normalWidth, width = WeakAuras.normalWidth,
name = L["Full Circle"], name = L["Full Circle"],
order = 7, order = 7,
hidden = function() return data.grow ~= "CIRCLE" and data.grow ~= "COUNTERCIRCLE" end hidden = function()
return not(
(data.grow == "CIRCLE" or data.grow == "COUNTERCIRCLE")
and (data.constantFactor == "RADIUS" or data.constantFactor == "SPACING"))
end
},
stepAngle = {
type = "range",
control = "WeakAurasSpinBox",
width = WeakAuras.normalWidth,
name = L["Angle Between Auras"],
order = 12,
min = 0,
max = 180,
bigStep = 1,
hidden = function()
return not((data.grow == "CIRCLE" or data.grow == "COUNTERCIRCLE") and data.constantFactor == "ANGLE")
end
}, },
arcLength = { arcLength = {
type = "range", type = "range",
@@ -293,7 +310,11 @@ local function createOptions(id, data)
max = 360, max = 360,
bigStep = 3, bigStep = 3,
disabled = function() return data.fullCircle end, disabled = function() return data.fullCircle end,
hidden = function() return data.grow ~= "CIRCLE" and data.grow ~= "COUNTERCIRCLE" end hidden = function()
return not(
(data.grow == "CIRCLE" or data.grow == "COUNTERCIRCLE")
and (data.constantFactor == "RADIUS" or data.constantFactor == "SPACING"))
end
}, },
radius = { radius = {
type = "range", type = "range",
@@ -304,7 +325,11 @@ local function createOptions(id, data)
softMin = 0, softMin = 0,
softMax = 500, softMax = 500,
bigStep = 1, bigStep = 1,
hidden = function() return data.grow == "CUSTOM" or not((data.grow == "CIRCLE" or data.grow == "COUNTERCIRCLE") and data.constantFactor == "RADIUS") end hidden = function()
return not(
(data.grow == "CIRCLE" or data.grow == "COUNTERCIRCLE")
and (data.constantFactor == "RADIUS" or data.constantFactor == "ANGLE"))
end
}, },
-- grid grow options -- grid grow options
gridType = { gridType = {
@@ -372,9 +397,12 @@ local function createOptions(id, data)
softMax = 300, softMax = 300,
bigStep = 1, bigStep = 1,
hidden = function() hidden = function()
return data.grow == "CUSTOM" return not(
or data.grow == "GRID" data.grow == "LEFT" or data.grow == "RIGHT"
or ((data.grow == "CIRCLE" or data.grow == "COUNTERCIRCLE") and data.constantFactor == "RADIUS") or data.grow == "UP" or data.grow == "DOWN"
or data.grow == "HORIZONTAL" or data.grow == "VERTICAL"
or ((data.grow == "CIRCLE" or data.grow == "COUNTERCIRCLE")
and (data.constantFactor == "SPACING")))
end end
}, },
stagger = { stagger = {