from retail

This commit is contained in:
NoM0Re
2025-01-07 16:12:17 +01:00
parent 74a1a856ac
commit 395d448066
14 changed files with 92 additions and 60 deletions
+4 -4
View File
@@ -1746,7 +1746,7 @@ local function EventHandler(frame, event, arg1, arg2, ...)
elseif event == "UNIT_PET" then elseif event == "UNIT_PET" then
local pet = WeakAuras.unitToPetUnit[arg1] local pet = WeakAuras.unitToPetUnit[arg1]
if pet then if pet then
ScanGroupUnit(time, matchDataChanged, nil, pet) ScanGroupUnit(time, matchDataChanged, "group", pet)
RecheckActiveForUnitType("group", pet, deactivatedTriggerInfos) RecheckActiveForUnitType("group", pet, deactivatedTriggerInfos)
if not UnitExistsFixed(pet) then if not UnitExistsFixed(pet) then
tinsert(unitsToRemove, pet) tinsert(unitsToRemove, pet)
@@ -2472,7 +2472,7 @@ function BuffTrigger.Add(data)
useAffected = unit == "group" and trigger.useAffected, useAffected = unit == "group" and trigger.useAffected,
isMulti = trigger.unit == "multi", isMulti = trigger.unit == "multi",
nameChecker = effectiveNameCheck and WeakAuras.ParseNameCheck(trigger.unitName), nameChecker = effectiveNameCheck and WeakAuras.ParseNameCheck(trigger.unitName),
includePets = trigger.use_includePets and trigger.includePets, includePets = trigger.use_includePets and trigger.includePets or nil,
npcId = effectiveNpcId npcId = effectiveNpcId
} }
triggerInfos[id] = triggerInfos[id] or {} triggerInfos[id] = triggerInfos[id] or {}
@@ -3353,7 +3353,7 @@ end
function BuffTrigger.GetTriggerDescription(data, triggernum, namestable) function BuffTrigger.GetTriggerDescription(data, triggernum, namestable)
local trigger = data.triggers[triggernum].trigger local trigger = data.triggers[triggernum].trigger
if trigger.auranames then if trigger.useName and trigger.auranames then
for index, name in pairs(trigger.auranames) do for index, name in pairs(trigger.auranames) do
local left = " " local left = " "
if(index == 1) then if(index == 1) then
@@ -3377,7 +3377,7 @@ function BuffTrigger.GetTriggerDescription(data, triggernum, namestable)
end end
end end
if trigger.auraspellids then if trigger.useExactSpellId and trigger.auraspellids then
for index, spellId in pairs(trigger.auraspellids) do for index, spellId in pairs(trigger.auraspellids) do
local left = " " local left = " "
if index == 1 then if index == 1 then
+1 -1
View File
@@ -321,7 +321,7 @@ local function CreateTestForCondition(uid, input, allConditionsTemplate, usedSta
-- If adding a new condition type, don't forget to adjust the validator in the options code -- If adding a new condition type, don't forget to adjust the validator in the options code
if (cType == "timer" and value) then if (cType == "timer" and value) then
recheckCode = " nextTime = state[" .. trigger .. "] and state[" .. trigger .. "]" .. string.format("[%q]", variable) .. " and (state[" .. trigger .. "]" .. string.format("[%q]", variable) .. " -" .. value .. ")\n"; recheckCode = " nextTime = state[" .. trigger .. "] and state[" .. trigger .. "]" .. string.format("[%q]", variable) .. " and (state[" .. trigger .. "]" .. string.format("[%q]", variable) .. " - " .. value .. ")\n";
recheckCode = recheckCode .. " if (nextTime and (not recheckTime or nextTime < recheckTime) and nextTime >= now) then\n" recheckCode = recheckCode .. " if (nextTime and (not recheckTime or nextTime < recheckTime) and nextTime >= now) then\n"
recheckCode = recheckCode .. " recheckTime = nextTime\n"; recheckCode = recheckCode .. " recheckTime = nextTime\n";
recheckCode = recheckCode .. " end\n" recheckCode = recheckCode .. " end\n"
+21 -21
View File
@@ -457,7 +457,7 @@ function Private.EndEvent(id, triggernum, force, state)
end end
end end
local function RunOverlayFuncs(event, state, id) local function RunOverlayFuncs(event, state, id, errorHandler)
state.additionalProgress = state.additionalProgress or {}; state.additionalProgress = state.additionalProgress or {};
local changed = false; local changed = false;
for i, overlayFunc in ipairs(event.overlayFuncs) do for i, overlayFunc in ipairs(event.overlayFuncs) do
@@ -465,7 +465,7 @@ local function RunOverlayFuncs(event, state, id)
local additionalProgress = state.additionalProgress[i]; local additionalProgress = state.additionalProgress[i];
local ok, a, b, c = pcall(overlayFunc, event.trigger, state); local ok, a, b, c = pcall(overlayFunc, event.trigger, state);
if (not ok) then if (not ok) then
Private.GetErrorHandlerId(id, L["Overlay %s"]:format(i)) (errorHandler or Private.GetErrorHandlerId(id, L["Overlay %s"]:format(i)))(a)
additionalProgress.min = nil; additionalProgress.min = nil;
additionalProgress.max = nil; additionalProgress.max = nil;
additionalProgress.direction = nil; additionalProgress.direction = nil;
@@ -522,7 +522,7 @@ local function callFunctionForActivateEvent(func, trigger, fallback, errorHandle
end end
end end
function Private.ActivateEvent(id, triggernum, data, state) function Private.ActivateEvent(id, triggernum, data, state, errorHandler)
local changed = state.changed or false; local changed = state.changed or false;
if (state.show ~= true) then if (state.show ~= true) then
state.show = true; state.show = true;
@@ -553,7 +553,7 @@ function Private.ActivateEvent(id, triggernum, data, state)
elseif (data.durationFunc) then elseif (data.durationFunc) then
local ok, arg1, arg2, arg3, inverse = pcall(data.durationFunc, data.trigger); local ok, arg1, arg2, arg3, inverse = pcall(data.durationFunc, data.trigger);
if not ok then if not ok then
Private.GetErrorHandlerId(id, L["Duration Function"]) (errorHandler or Private.GetErrorHandlerId(id, L["Duration Function"]))(arg1)
arg1 = 0; arg1 = 0;
arg2 = 0; arg2 = 0;
else else
@@ -619,10 +619,10 @@ function Private.ActivateEvent(id, triggernum, data, state)
end end
end end
local name = callFunctionForActivateEvent(data.nameFunc, data.trigger, state.name, Private.GetErrorHandlerId(id, L["Name Function"])) local name = callFunctionForActivateEvent(data.nameFunc, data.trigger, state.name, errorHandler or Private.GetErrorHandlerId(id, L["Name Function"]))
local icon = callFunctionForActivateEvent(data.iconFunc, data.trigger, state.icon, Private.GetErrorHandlerId(id, L["Icon Function"])) local icon = callFunctionForActivateEvent(data.iconFunc, data.trigger, state.icon, errorHandler or Private.GetErrorHandlerId(id, L["Icon Function"]))
local texture = callFunctionForActivateEvent(data.textureFunc, data.trigger, state.texture, Private.GetErrorHandlerId(id, L["Texture Function"])) local texture = callFunctionForActivateEvent(data.textureFunc, data.trigger, state.texture, errorHandler or Private.GetErrorHandlerId(id, L["Texture Function"]))
local stacks = callFunctionForActivateEvent(data.stacksFunc, data.trigger, state.stacks, Private.GetErrorHandlerId(id, L["Stacks Function"])) local stacks = callFunctionForActivateEvent(data.stacksFunc, data.trigger, state.stacks, errorHandler or Private.GetErrorHandlerId(id, L["Stacks Function"]))
if (state.name ~= name) then if (state.name ~= name) then
state.name = name; state.name = name;
@@ -642,7 +642,7 @@ function Private.ActivateEvent(id, triggernum, data, state)
end end
if (data.overlayFuncs) then if (data.overlayFuncs) then
RunOverlayFuncs(data, state, id); RunOverlayFuncs(data, state, id, errorHandler);
else else
state.additionalProgress = nil; state.additionalProgress = nil;
end end
@@ -735,7 +735,7 @@ local function RunTriggerFunc(allStates, data, id, triggernum, event, arg1, arg2
if not ok then if not ok then
errorHandler(returnValue) errorHandler(returnValue)
elseif (ok and returnValue) or optionsEvent then elseif (ok and returnValue) or optionsEvent then
if(Private.ActivateEvent(id, triggernum, data, state)) then if(Private.ActivateEvent(id, triggernum, data, state, (optionsEvent and data.ignoreOptionsEventErrors) and ignoreErrorHandler or nil)) then
updateTriggerState = true; updateTriggerState = true;
end end
else else
@@ -748,7 +748,7 @@ local function RunTriggerFunc(allStates, data, id, triggernum, event, arg1, arg2
elseif (ok and returnValue) or optionsEvent then elseif (ok and returnValue) or optionsEvent then
allStates[""] = allStates[""] or {}; allStates[""] = allStates[""] or {};
local state = allStates[""]; local state = allStates[""];
if(Private.ActivateEvent(id, triggernum, data, state)) then if(Private.ActivateEvent(id, triggernum, data, state, (optionsEvent and data.ignoreOptionsEventErrors) and ignoreErrorHandler or nil)) then
updateTriggerState = true; updateTriggerState = true;
end end
else else
@@ -756,6 +756,7 @@ local function RunTriggerFunc(allStates, data, id, triggernum, event, arg1, arg2
end end
end end
if (untriggerCheck and not optionsEvent) then if (untriggerCheck and not optionsEvent) then
errorHandler = (optionsEvent and data.ignoreOptionsEventErrors) and ignoreErrorHandler or Private.GetErrorHandlerId(id, L["Untrigger %s"]:format(triggernum))
if (data.statesParameter == "all") then if (data.statesParameter == "all") then
if data.untriggerFunc then if data.untriggerFunc then
local ok, returnValue = pcall(data.untriggerFunc, allStates, event, arg1, arg2, ...); local ok, returnValue = pcall(data.untriggerFunc, allStates, event, arg1, arg2, ...);
@@ -3271,6 +3272,7 @@ do
if not(tenchFrame) then if not(tenchFrame) then
tenchFrame = CreateFrame("Frame"); tenchFrame = CreateFrame("Frame");
tenchFrame:RegisterEvent("UNIT_INVENTORY_CHANGED"); tenchFrame:RegisterEvent("UNIT_INVENTORY_CHANGED");
tenchFrame:RegisterEvent("PLAYER_ENTERING_WORLD");
tenchTip = WeakAuras.GetHiddenTooltip(); tenchTip = WeakAuras.GetHiddenTooltip();
@@ -3323,11 +3325,9 @@ do
Private.StopProfileSystem("generictrigger"); Private.StopProfileSystem("generictrigger");
end end
tenchFrame:SetScript("OnEvent", function(self, event, arg1) tenchFrame:SetScript("OnEvent", function()
Private.StartProfileSystem("generictrigger"); Private.StartProfileSystem("generictrigger");
if (event == "UNIT_INVENTORY_CHANGED" and arg1 == "player") then timer:ScheduleTimer(tenchUpdate, 0.1);
timer:ScheduleTimer(tenchUpdate, 0.1);
end
Private.StopProfileSystem("generictrigger"); Private.StopProfileSystem("generictrigger");
end); end);
@@ -4094,9 +4094,9 @@ function GenericTrigger.CreateFallbackState(data, triggernum, state)
local event = events[data.id][triggernum]; local event = events[data.id][triggernum];
Private.ActivateAuraEnvironment(data.id, "", state); Private.ActivateAuraEnvironment(data.id, "", state);
local firstTrigger = data.triggers[1].trigger local trigger = data.triggers[triggernum].trigger
if (event.nameFunc) then if (event.nameFunc) then
local ok, name = pcall(event.nameFunc, firstTrigger); local ok, name = pcall(event.nameFunc, trigger);
if not ok then if not ok then
Private.GetErrorHandlerUid(data.uid, L["Name Function (fallback state)"]) Private.GetErrorHandlerUid(data.uid, L["Name Function (fallback state)"])
state.name = nil state.name = nil
@@ -4105,7 +4105,7 @@ function GenericTrigger.CreateFallbackState(data, triggernum, state)
end end
end end
if (event.iconFunc) then if (event.iconFunc) then
local ok, icon = pcall(event.iconFunc, firstTrigger); local ok, icon = pcall(event.iconFunc, trigger);
if not ok then if not ok then
Private.GetErrorHandlerUid(data.uid, L["Icon Function (fallback state)"]) Private.GetErrorHandlerUid(data.uid, L["Icon Function (fallback state)"])
state.icon = nil state.icon = nil
@@ -4115,7 +4115,7 @@ function GenericTrigger.CreateFallbackState(data, triggernum, state)
end end
if (event.textureFunc ) then if (event.textureFunc ) then
local ok, texture = pcall(event.textureFunc, firstTrigger); local ok, texture = pcall(event.textureFunc, trigger);
if not ok then if not ok then
Private.GetErrorHandlerUid(data.uid, L["Texture Function (fallback state)"]) Private.GetErrorHandlerUid(data.uid, L["Texture Function (fallback state)"])
state.texture = nil state.texture = nil
@@ -4125,7 +4125,7 @@ function GenericTrigger.CreateFallbackState(data, triggernum, state)
end end
if (event.stacksFunc) then if (event.stacksFunc) then
local ok, stacks = pcall(event.stacksFunc, firstTrigger); local ok, stacks = pcall(event.stacksFunc, trigger);
if not ok then if not ok then
Private.GetErrorHandlerUid(data.uid, L["Stacks Function (fallback state)"]) Private.GetErrorHandlerUid(data.uid, L["Stacks Function (fallback state)"])
state.stacks = nil state.stacks = nil
@@ -4135,7 +4135,7 @@ function GenericTrigger.CreateFallbackState(data, triggernum, state)
end end
if (event.durationFunc) then if (event.durationFunc) then
local ok, arg1, arg2, arg3, inverse = pcall(event.durationFunc, firstTrigger); local ok, arg1, arg2, arg3, inverse = pcall(event.durationFunc, trigger);
if not ok then if not ok then
Private.GetErrorHandlerUid(data.uid, L["Duration Function (fallback state)"]) Private.GetErrorHandlerUid(data.uid, L["Duration Function (fallback state)"])
state.progressType = "timed"; state.progressType = "timed";
+10
View File
@@ -4,6 +4,7 @@ local AddonName, Private = ...
local WeakAuras = WeakAuras local WeakAuras = WeakAuras
local L = WeakAuras.L local L = WeakAuras.L
local prettyPrint = WeakAuras.prettyPrint local prettyPrint = WeakAuras.prettyPrint
-- local LGF = LibStub("LibGetFrame-1.0")
local profileData = {} local profileData = {}
profileData.systems = {} profileData.systems = {}
@@ -335,6 +336,7 @@ function WeakAuras.StartProfile(startType)
Private.StopProfileSystem = StopProfileSystem Private.StopProfileSystem = StopProfileSystem
Private.StopProfileAura = StopProfileAura Private.StopProfileAura = StopProfileAura
Private.StopProfileUID = StopProfileUID Private.StopProfileUID = StopProfileUID
-- LGF.StartProfile()
end end
local function doNothing() local function doNothing()
@@ -357,6 +359,7 @@ function WeakAuras.StopProfile()
Private.StopProfileSystem = doNothing Private.StopProfileSystem = doNothing
Private.StopProfileAura = doNothing Private.StopProfileAura = doNothing
Private.StopProfileUID = doNothing Private.StopProfileUID = doNothing
-- LGF.StopProfile()
currentProfileState = nil currentProfileState = nil
RealTimeProfilingWindow:UnregisterAllEvents() RealTimeProfilingWindow:UnregisterAllEvents()
@@ -466,6 +469,13 @@ function WeakAuras.PrintProfile()
PrintOneProfile(popup, k, profileData.systems[k], profileData.systems.wa.elapsed) PrintOneProfile(popup, k, profileData.systems[k], profileData.systems.wa.elapsed)
end end
end end
-- popup:AddText("")
-- popup:AddText("|cff9900ffLibGetFrame:|r")
-- for id, map in pairs(LGF.GetProfileData()) do
-- PrintOneProfile(popup, id, map)
-- end
popup:Show() popup:Show()
end end
+2 -2
View File
@@ -770,7 +770,7 @@ local growers = {
local ok, ret = pcall(growFunc, newPositions, activeRegions) local ok, ret = pcall(growFunc, newPositions, activeRegions)
Private.ActivateAuraEnvironment() Private.ActivateAuraEnvironment()
if not ok then if not ok then
Private.GetErrorHandlerId(data.id, L["Custom Sort"]) Private.GetErrorHandlerId(data.id, L["Custom Grow"])
wipe(newPositions) wipe(newPositions)
end end
end end
@@ -833,7 +833,7 @@ local function modify(parent, region, data)
end end
function region:Resume() function region:Resume()
-- Allows group to reindex and reposition. -- Allows group to re-index and reposition.
-- TriggersSortUpdatedChildren and PositionChildren to happen -- TriggersSortUpdatedChildren and PositionChildren to happen
if self.suspended > 0 then if self.suspended > 0 then
self.suspended = self.suspended - 1 self.suspended = self.suspended - 1
+1 -1
View File
@@ -98,7 +98,7 @@ local function create(parent)
frame.background = background; frame.background = background;
background:SetAllPoints(frame); background:SetAllPoints(frame);
local foreground = frame:CreateTexture(nil, "ART"); local foreground = frame:CreateTexture(nil, "ARTWORK");
frame.foreground = foreground; frame.foreground = foreground;
foreground:SetAllPoints(frame); foreground:SetAllPoints(frame);
+5 -5
View File
@@ -434,14 +434,14 @@ end
local delayedImport = CreateFrame("FRAME") local delayedImport = CreateFrame("FRAME")
local function ImportNow(data, children, target, sender) local function ImportNow(data, children, target, sender, callbackFunc)
if InCombatLockdown() then if InCombatLockdown() then
WeakAuras.prettyPrint(L["Importing will start after combat ends."]) WeakAuras.prettyPrint(L["Importing will start after combat ends."])
delayedImport:RegisterEvent("PLAYER_REGEN_ENABLED") delayedImport:RegisterEvent("PLAYER_REGEN_ENABLED")
delayedImport:SetScript("OnEvent", function() delayedImport:SetScript("OnEvent", function()
delayedImport:UnregisterEvent("PLAYER_REGEN_ENABLED") delayedImport:UnregisterEvent("PLAYER_REGEN_ENABLED")
ImportNow(data, children, target, sender) ImportNow(data, children, target, sender, callbackFunc)
end) end)
return return
end end
@@ -450,11 +450,11 @@ local function ImportNow(data, children, target, sender)
if not WeakAuras.IsOptionsOpen() then if not WeakAuras.IsOptionsOpen() then
WeakAuras.OpenOptions() WeakAuras.OpenOptions()
end end
Private.OpenUpdate(data, children, target, sender) Private.OpenUpdate(data, children, target, sender, callbackFunc)
end end
end end
function WeakAuras.Import(inData, target) function WeakAuras.Import(inData, target, callbackFunc)
local data, children, version local data, children, version
if type(inData) == 'string' then if type(inData) == 'string' then
-- encoded data -- encoded data
@@ -508,7 +508,7 @@ function WeakAuras.Import(inData, target)
end end
tooltipLoading = nil; tooltipLoading = nil;
return ImportNow(data, children, target) return ImportNow(data, children, target, nil, callbackFunc)
end end
local function crossRealmSendCommMessage(prefix, text, target, queueName, callbackFn, callbackArg) local function crossRealmSendCommMessage(prefix, text, target, queueName, callbackFn, callbackArg)
+2 -2
View File
@@ -1691,7 +1691,7 @@ Private.texture_types["PowerAuras Separated"] = {
[PowerAurasPath.."Aura104"] = "Shield Center", [PowerAurasPath.."Aura104"] = "Shield Center",
[PowerAurasPath.."Aura105"] = "Shield Full", [PowerAurasPath.."Aura105"] = "Shield Full",
[PowerAurasPath.."Aura106"] = "Shield Top Right", [PowerAurasPath.."Aura106"] = "Shield Top Right",
[PowerAurasPath.."Aura107"] = "Shiled Top Left", [PowerAurasPath.."Aura107"] = "Shield Top Left",
[PowerAurasPath.."Aura108"] = "Shield Bottom Right", [PowerAurasPath.."Aura108"] = "Shield Bottom Right",
[PowerAurasPath.."Aura109"] = "Shield Bottom Left", [PowerAurasPath.."Aura109"] = "Shield Bottom Left",
[PowerAurasPath.."Aura121"] = "Vine Top Right Leaf", [PowerAurasPath.."Aura121"] = "Vine Top Right Leaf",
@@ -2330,7 +2330,7 @@ Private.bool_types = {
Private.update_categories = { Private.update_categories = {
{ {
name = "anchor", name = "anchor",
-- Note, these are special cased for child auras and considered arrangment -- Note, these are special cased for child auras and considered arrangement
fields = { fields = {
"xOffset", "xOffset",
"yOffset", "yOffset",
+3 -3
View File
@@ -31,7 +31,7 @@ LibStub("AceTimer-3.0"):Embed(WeakAurasTimers)
Private.watched_trigger_events = {} Private.watched_trigger_events = {}
-- The worlds simplest callback system. -- The worlds simplest callback system.
-- That supports 1:N, but no deregistration and breaks if registrating in a callback -- That supports 1:N, but no de-registration and breaks if registering in a callback
Private.callbacks = {} Private.callbacks = {}
Private.callbacks.events = {} Private.callbacks.events = {}
@@ -882,7 +882,7 @@ local function AddLegacyCompanionData()
end end
function Private.PostAddCompanion() function Private.PostAddCompanion()
-- add data from older verion of companion addons -- add data from older version of companion addons
AddLegacyCompanionData() AddLegacyCompanionData()
-- nag if updates -- nag if updates
local count = Private.CountWagoUpdates() local count = Private.CountWagoUpdates()
@@ -5418,7 +5418,7 @@ do
return coroutine.wrap(TraverseLeafs), data return coroutine.wrap(TraverseLeafs), data
end end
-- The root if it is a non-group, otherwise non-group childrens -- The root if it is a non-group, otherwise non-group children
function Private.TraverseLeafsOrAura(data) function Private.TraverseLeafsOrAura(data)
return coroutine.wrap(TraverseLeafsOrAura), data return coroutine.wrap(TraverseLeafsOrAura), data
end end
+24 -5
View File
@@ -677,8 +677,18 @@ typeControlAdders = {
bigStep = option.bigStep bigStep = option.bigStep
min = option.min min = option.min
max = option.max max = option.max
if max and min then local effectiveMin = softMin or min or 0
max = math.max(min, max) local effectiveMax = softMax or max or 100
if (effectiveMin > effectiveMax) then
-- This will cause a error inside the slider
-- Fix up either softMax or max, depending on which one is the effective one
if softMax then
softMax = effectiveMin
elseif max then
max = effectiveMin
else
softMax = effectiveMin
end
end end
step = option.step step = option.step
args[prefix .. "default"] = { args[prefix .. "default"] = {
@@ -967,7 +977,6 @@ typeControlAdders = {
end, end,
multiselect = function(options, args, data, order, prefix, i) multiselect = function(options, args, data, order, prefix, i)
local option = options[i] local option = options[i]
args[prefix .. "width"] = nil
local values = getValues(option) local values = getValues(option)
local defaultValues = {} local defaultValues = {}
for i, v in ipairs(values) do for i, v in ipairs(values) do
@@ -2234,8 +2243,18 @@ local function addUserModeOption(options, args, data, order, prefix, i)
userOption.bigStep = option.bigStep userOption.bigStep = option.bigStep
userOption.min = option.min userOption.min = option.min
userOption.max = option.max userOption.max = option.max
if userOption.max and userOption.min then local effectiveMin = userOption.softMin or userOption.min or 0
userOption.max = max(userOption.min, userOption.max) local effectiveMax = userOption.softMax or userOption.max or 100
if (effectiveMin > effectiveMax) then
-- This will cause a error inside the slider
-- Fix up either softMax or max, depending on which one is the effective one
if userOption.softMax then
userOption.softMax = effectiveMin
elseif userOption.max then
userOption.max = effectiveMin
else
userOption.softMax = effectiveMin
end
end end
userOption.step = option.step userOption.step = option.step
elseif optionType == "color" then elseif optionType == "color" then
@@ -1184,7 +1184,7 @@ function OptionsPrivate.CreateFrame()
tinsert(regionTypesSorted, regionType) tinsert(regionTypesSorted, regionType)
end end
-- Sort group + dynamic group first, then the others alphabeticaly -- Sort group + dynamic group first, then the others alphabetically
table.sort(regionTypesSorted, function(a, b) table.sort(regionTypesSorted, function(a, b)
if (a == "group") then if (a == "group") then
return true return true
@@ -624,7 +624,7 @@ local function ConstructTextEditor(frame)
editor.editBox:SetScript( editor.editBox:SetScript(
"OnEscapePressed", "OnEscapePressed",
function() function()
group:CancelClose() -- catch it so that escape doesn't default to losing focus (after which another escape would close config)
end end
) )
self.oldOnTextChanged = editor.editBox:GetScript("OnTextChanged") self.oldOnTextChanged = editor.editBox:GetScript("OnTextChanged")
+14 -11
View File
@@ -12,7 +12,7 @@ local function notEmptyString(str)
end end
local function addCode(codes, text, code, ...) local function addCode(codes, text, code, ...)
-- The 4th paramter is a "check" if the code is active -- The 4th parameter is a "check" if the code is active
-- The following line let's distinguish between addCode(a, b, c, nil) and addCode(a, b, c) -- The following line let's distinguish between addCode(a, b, c, nil) and addCode(a, b, c)
-- If the 4th parameter is nil, then we want to return -- If the 4th parameter is nil, then we want to return
if (select("#", ...) > 0) then if (select("#", ...) > 0) then
@@ -182,7 +182,7 @@ local function recurseUpdate(data, chunk)
end end
end end
local ignoredForDiffChecking -- Needs to be created lazyly local ignoredForDiffChecking -- Needs to be created lazily
local function RecurseDiff(ours, theirs) local function RecurseDiff(ours, theirs)
local diff, seen, same = {}, {}, true local diff, seen, same = {}, {}, true
for key, ourVal in pairs(ours) do for key, ourVal in pairs(ours) do
@@ -315,7 +315,7 @@ local function BuildUidMap(data, children, type)
idToUid[data.id] = data.uid idToUid[data.id] = data.uid
for i, child in ipairs(children) do for i, child in ipairs(children) do
if idToUid[child.id] then if idToUid[child.id] then
error("Diplicated id in import data") error("Duplicate id in import data: "..child.id)
end end
idToUid[child.id] = child.uid idToUid[child.id] = child.uid
end end
@@ -381,7 +381,7 @@ local function BuildUidMap(data, children, type)
self.idToUid[data.id] = data.uid self.idToUid[data.id] = data.uid
self.totalCount = self.totalCount + 1 self.totalCount = self.totalCount + 1
-- clean up children/sortHybird -- clean up children/sortHybrid
-- The Update code first inserts children before it inserts us -- The Update code first inserts children before it inserts us
-- But not every child might be inserted, since empty groups aren't inserted -- But not every child might be inserted, since empty groups aren't inserted
-- so clean that up here -- so clean that up here
@@ -1242,7 +1242,7 @@ local function AddAuraList(container, uidMap, list, expandText)
end end
local methods = { local methods = {
Open = function(self, data, children, target, sender) Open = function(self, data, children, target, sender, callbackFunc)
if(self.optionsWindow.window == "importexport") then if(self.optionsWindow.window == "importexport") then
self.optionsWindow.importexport:Close(); self.optionsWindow.importexport:Close();
elseif(self.optionsWindow.window == "texture") then elseif(self.optionsWindow.window == "texture") then
@@ -1264,6 +1264,7 @@ local methods = {
self.userChoices = { self.userChoices = {
} }
self.callbackFunc = callbackFunc
self:ReleaseChildren() self:ReleaseChildren()
self:AddBasicInformationWidgets(data, sender) self:AddBasicInformationWidgets(data, sender)
@@ -1513,7 +1514,7 @@ local methods = {
local onePhaseProgress = matchInfo.oldUidMap:GetTotalCount() + matchInfo.newUidMap:GetTotalCount() local onePhaseProgress = matchInfo.oldUidMap:GetTotalCount() + matchInfo.newUidMap:GetTotalCount()
local IncProgress = function() self:IncProgress() end local IncProgress = function() self:IncProgress() end
-- The progress is more for appereance than anything resembling real calculation -- The progress is more for appearances than anything resembling real calculation
-- The estimate for the total work is wonky, as is how the code compensates for that -- The estimate for the total work is wonky, as is how the code compensates for that
-- But then again, lying progress bar is a industry standard pratice -- But then again, lying progress bar is a industry standard pratice
self:InitializeProgress(onePhaseProgress * 26) self:InitializeProgress(onePhaseProgress * 26)
@@ -1543,7 +1544,7 @@ local methods = {
local GetPhase1Data -- Getting the right data is a bit tricky, and depends on the mode local GetPhase1Data -- Getting the right data is a bit tricky, and depends on the mode
local GetPhase2Data local GetPhase2Data
if userChoices.activeCategories.arrangement then if userChoices.activeCategories.arrangement then
-- new arragement -- new arrangement
structureUidMap = matchInfo.newUidMap structureUidMap = matchInfo.newUidMap
if not userChoices.activeCategories.oldchildren then if not userChoices.activeCategories.oldchildren then
-- Keep old children -- Keep old children
@@ -1641,8 +1642,7 @@ local methods = {
self.closeButton:Enable() self.closeButton:Enable()
OptionsPrivate.Private.callbacks:Fire("Import") OptionsPrivate.Private.callbacks:Fire("Import")
self:Close() self:Close(true, pendingPickData.id)
if pendingPickData then if pendingPickData then
OptionsPrivate.ClearPicks() OptionsPrivate.ClearPicks()
@@ -1942,9 +1942,12 @@ local methods = {
self.progress = self.total self.progress = self.total
self.progressBar:SetProgress(self.progress, self.total) self.progressBar:SetProgress(self.progress, self.total)
end, end,
Close = function(self) Close = function(self, success, id)
self.optionsWindow.window = "default"; self.optionsWindow.window = "default";
self.optionsWindow:UpdateFrameVisible() self.optionsWindow:UpdateFrameVisible()
if self.callbackFunc then
self.callbackFunc(success, id)
end
end, end,
AddBasicInformationWidgets = function(self, data, sender) AddBasicInformationWidgets = function(self, data, sender)
local title = AceGUI:Create("Label") local title = AceGUI:Create("Label")
@@ -2025,7 +2028,7 @@ local function ConstructUpdateFrame(frame)
importButton:SetText(L["Import"]) importButton:SetText(L["Import"])
local closeButton = CreateFrame("Button", nil, group.frame, "UIPanelButtonTemplate"); local closeButton = CreateFrame("Button", nil, group.frame, "UIPanelButtonTemplate");
closeButton:SetScript("OnClick", function() group:Close() end); closeButton:SetScript("OnClick", function() group:Close(false) end);
closeButton:SetPoint("BOTTOMRIGHT", -20, -24); closeButton:SetPoint("BOTTOMRIGHT", -20, -24);
closeButton:SetFrameLevel(closeButton:GetFrameLevel() + 1) closeButton:SetFrameLevel(closeButton:GetFrameLevel() + 1)
closeButton:SetHeight(20); closeButton:SetHeight(20);
+3 -3
View File
@@ -896,8 +896,8 @@ function OptionsPrivate.OpenDebugLog(text)
frame.debugLog:Open(text) frame.debugLog:Open(text)
end end
function OptionsPrivate.OpenUpdate(data, children, target, sender) function OptionsPrivate.OpenUpdate(data, children, target, sender, callbackFunc)
return frame.update:Open(data, children, target, sender) return frame.update:Open(data, children, target, sender, callbackFunc)
end end
function OptionsPrivate.ConvertDisplay(data, newType) function OptionsPrivate.ConvertDisplay(data, newType)
@@ -1931,7 +1931,7 @@ function OptionsPrivate.AddTextFormatOption(input, withHeader, get, addOption, h
headerOption = { headerOption = {
type = "execute", type = "execute",
control = "WeakAurasExpandSmall", control = "WeakAurasExpandSmall",
name = L["|cFFffcc00Format Options|r"], name = L["|cffffcc00Format Options|r"],
width = WeakAuras.doubleWidth, width = WeakAuras.doubleWidth,
func = function(info, button) func = function(info, button)
setHidden(not hidden()) setHidden(not hidden())