from retail

This commit is contained in:
NoM0Re
2025-01-09 17:17:53 +01:00
parent 55709443ae
commit aee89075c9
8 changed files with 67 additions and 45 deletions
+11 -2
View File
@@ -450,7 +450,8 @@ local FakeWeakAurasMixin = {
Private.AuraWarnings.UpdateWarning(current_uid, "FakeWeakAurasGetData", "warning",
L["This aura calls GetData a lot, which is a slow function."])
end
return CopyTable(WeakAuras.GetData(id))
local data = WeakAuras.GetData(id)
return data and CopyTable(data) or nil
end,
clones = MakeDeprecated(Private.clones, "clones",
L["Using WeakAuras.clones is deprecated. Use WeakAuras.GetRegion(id, cloneId) instead."]),
@@ -561,13 +562,21 @@ function env_getglobal_builtin(k)
return exec_env_builtin[k]
end
local function firstLine(string)
local lineBreak = string:find('\n', 1, true)
if lineBreak then
return string:sub(1, lineBreak - 1)
end
return string
end
local function CreateFunctionCache(exec_env)
local cache = {}
cache.Load = function(self, string)
if self[string] then
return self[string]
else
local loadedFunction, errorString = loadstring(string)
local loadedFunction, errorString = loadstring(string, firstLine(string))
if errorString then
print(errorString)
else
+7 -2
View File
@@ -3059,7 +3059,7 @@ do
if event == "BigWigs_Message" then
WeakAuras.ScanEvents("BigWigs_Message", ...)
elseif event == "BigWigs_StartBar" then
local addon, spellId, text, duration, icon = ...
local addon, spellId, text, duration, icon, isCD = ...
local now = GetTime()
local expirationTime = now + duration
@@ -3072,6 +3072,7 @@ do
bar.duration = duration
bar.expirationTime = expirationTime
bar.icon = icon
bar.isCooldown = isCD or false
local BWColorModule = BigWigs:GetPlugin("Colors")
bar.bwBarColor = BWColorModule:GetColorTable("barColor", addon, spellId)
bar.bwTextColor = BWColorModule:GetColorTable("barText", addon, spellId)
@@ -3152,9 +3153,10 @@ do
if extendTimer ~= 0 then
state.autoHide = true
end
state.isCooldown = bar.isCooldown
end
function Private.ExecEnv.BigWigsTimerMatches(id, message, operator, spellId, emphasized, count, cast)
function Private.ExecEnv.BigWigsTimerMatches(id, message, operator, spellId, emphasized, count, cast, cooldown)
if not bars[id] then
return false
end
@@ -3188,6 +3190,9 @@ do
if cast ~= nil and v.cast ~= cast then
return false
end
if cooldown ~= nil and v.isCooldown ~= cooldown then
return false
end
return true
end
+16 -13
View File
@@ -4181,6 +4181,7 @@ Private.event_prototypes = {
local triggerEmphasized = %s
local triggerCount = %q
local triggerCast = %s
local triggerIsCooldown = %s
local cloneId = useClone and id or ""
local state = states[cloneId]
@@ -4206,7 +4207,7 @@ Private.event_prototypes = {
if useClone then
if event == "BigWigs_StartBar" then
if Private.ExecEnv.BigWigsTimerMatches(id, triggerText, triggerTextOperator, triggerSpellId, triggerEmphasized, triggerCount, triggerCast) then
if Private.ExecEnv.BigWigsTimerMatches(id, triggerText, triggerTextOperator, triggerSpellId, triggerEmphasized, triggerCount, triggerCast, triggerIsCooldown) then
local bar = WeakAuras.GetBigWigsTimerById(id)
if bar then
copyOrSchedule(bar, cloneId)
@@ -4273,6 +4274,7 @@ Private.event_prototypes = {
trigger.use_emphasized == nil and "nil" or trigger.use_emphasized and "true" or "false",
trigger.use_count and trigger.count or "",
trigger.use_cast == nil and "nil" or trigger.use_cast and "true" or "false",
trigger.use_isCooldown == nil and "nil" or trigger.use_isCooldown and "true" or "false",
trigger.remaining_operator or "<"
)
end,
@@ -4326,6 +4328,15 @@ Private.event_prototypes = {
init = "false",
conditionType = "bool"
},
{
name = "isCooldown",
display = L["Cooldown"],
desc = L["Cooldown bars show time before an ability is ready to be use, BigWigs prefix them with '~'"],
type = "tristate",
test = "true",
init = "false",
conditionType = "bool"
},
{
name = "cloneId",
display = L["Clone per Event"],
@@ -5553,20 +5564,12 @@ Private.event_prototypes = {
}
},
nameFunc = function(trigger)
if not trigger.use_inverse then
local name = GetItemInfo(trigger.itemName);
return name;
else
return nil;
end
local name = GetItemInfo(trigger.itemName);
return name;
end,
iconFunc = function(trigger)
if not trigger.use_inverse then
local _, _, _, _, _, _, _, _, _, icon = GetItemInfo(trigger.itemName or 0);
return icon;
else
return nil;
end
local icon = select(10, GetItemInfo(trigger.itemName or 0));
return icon;
end,
hasItemID = true,
automaticrequired = true
+1 -1
View File
@@ -338,7 +338,7 @@ local barPrototype = {
local width = additionalBar.width or 0;
local offset = additionalBar.offset or 0;
if (width ~= 0) then
if (width ~= 0 and valueWidth ~= 0) then
if (forwardDirection) then
startProgress = self.value + offset / valueWidth;
endProgress = self.value + (width + offset) / valueWidth;
-18
View File
@@ -132,24 +132,6 @@ local function modify(parent, region, parentData, data, first)
region:SetParent(parent)
local text = region.text;
-- Legacy members in icon
-- Can we remove them with 9.0 ?
if parentData.regionType == "icon" then
if not parent.stacks then
parent.stacks = text
elseif not parent.text2 then
parent.text2 = text
end
elseif parentData.regionType == "aurabar" then
if not parent.timer then
parent.timer = text
elseif not parent.text then
parent.text = text
elseif not parent.stacks then
parent.stacks = text
end
end
local fontPath = SharedMedia:Fetch("font", data.text_font);
text:SetFont(fontPath, data.text_fontSize < 33 and data.text_fontSize or 33, data.text_fontType);
if not text:GetFont() then -- Font invalid, set the font but keep the setting
+12 -7
View File
@@ -302,19 +302,24 @@ function StringToTable(inString, fromChat)
end
if not decoded then
return "Error decoding."
return L["Error decoding."]
end
local decompressed, errorMsg = nil, "unknown compression method"
local decompressed
if encodeVersion > 0 then
decompressed = LibDeflate:DecompressDeflate(decoded)
if not(decompressed) then
return L["Error decompressing"]
end
else
decompressed, errorMsg = Compresser:Decompress(decoded)
end
if not(decompressed) then
return "Error decompressing: " .. errorMsg
-- We ignore the error message, since it's more likely not a weakaura.
decompressed = Compresser:Decompress(decoded)
if not(decompressed) then
return L["Error decompressing. This doesn't look like a WeakAuras import."]
end
end
local success, deserialized
if encodeVersion < 2 then
success, deserialized = Serializer:Deserialize(decompressed)
@@ -322,7 +327,7 @@ function StringToTable(inString, fromChat)
success, deserialized = LibSerialize:Deserialize(decompressed)
end
if not(success) then
return "Error deserializing "..deserialized
return L["Error deserializing"]
end
return deserialized
end
+7
View File
@@ -2567,6 +2567,7 @@ function Private.ClearSounds(uid)
end
function WeakAuras.PreAdd(data)
if not data then return end
-- Readd what Compress removed before version 8
if (not data.internalVersion or data.internalVersion < 7) then
Private.validate(data, oldDataStub)
@@ -3886,6 +3887,12 @@ local function startStopTimers(id, cloneId, triggernum, state)
if (state.show ~= false and state.show ~= nil) then
state.show = false;
state.changed = true;
-- if the trigger has updated then check to see if it is flagged for WatchedTrigger and send to queue if it is
if Private.watched_trigger_events[id] and Private.watched_trigger_events[id][triggernum] then
Private.AddToWatchedTriggerDelay(id, triggernum)
end
Private.UpdatedTriggerState(id);
end
end,
+13 -2
View File
@@ -855,6 +855,17 @@ local function BuildUidMap(data, children, type)
self.rootParent = parentId
end
uidMap.Dump = function(self, uid)
if uid == nil then
uid = self:GetRootUID()
end
print(self:GetIdFor(uid))
local children = self:GetChildren(uid)
for i, childUid in ipairs(children) do
uidMap:Dump(childUid)
end
end
return uidMap, uidMap.root
end
@@ -1545,9 +1556,9 @@ local methods = {
self:SetMinimumProgress(2 * onePhaseProgress)
local removeNewGroups = matchInfo.activeCategories.arrangement and not userChoices.activeCategories.arrangement
if userChoices.activeCategories.newchildren or removeNewGroups then
if not userChoices.activeCategories.newchildren or removeNewGroups then
self:RemoveUnmatchedNew(matchInfo.newUidMap, matchInfo.newUidMap:GetRootUID(), matchInfo.oldUidMap,
userChoices.activeCategories.newchildren,
not userChoices.activeCategories.newchildren,
removeNewGroups)
end
self:SetMinimumProgress(3 * onePhaseProgress)