from retail
This commit is contained in:
@@ -9,8 +9,6 @@ local anim_function_strings = Private.anim_function_strings;
|
|||||||
|
|
||||||
local function noopErrorHandler() end
|
local function noopErrorHandler() end
|
||||||
|
|
||||||
local frame = Private.frames["WeakAuras Main Frame"]
|
|
||||||
|
|
||||||
local function RunAnimation(key, anim, elapsed, time)
|
local function RunAnimation(key, anim, elapsed, time)
|
||||||
Private.StartProfileUID(anim.auraUID)
|
Private.StartProfileUID(anim.auraUID)
|
||||||
local finished = false
|
local finished = false
|
||||||
@@ -178,6 +176,9 @@ end
|
|||||||
local updatingAnimations;
|
local updatingAnimations;
|
||||||
local last_update = GetTime();
|
local last_update = GetTime();
|
||||||
local function UpdateAnimations()
|
local function UpdateAnimations()
|
||||||
|
if not updatingAnimations then
|
||||||
|
return
|
||||||
|
end
|
||||||
Private.StartProfileSystem("animations");
|
Private.StartProfileSystem("animations");
|
||||||
|
|
||||||
for groupUid, groupRegion in pairs(pending_controls) do
|
for groupUid, groupRegion in pairs(pending_controls) do
|
||||||
@@ -196,12 +197,15 @@ local function UpdateAnimations()
|
|||||||
Private.StopProfileSystem("animations");
|
Private.StopProfileSystem("animations");
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local frame = CreateFrame("Frame")
|
||||||
|
Private.frames["WeakAuras Animation Frame"] = frame
|
||||||
|
frame:SetScript("OnUpdate", UpdateAnimations)
|
||||||
|
|
||||||
function Private.RegisterGroupForPositioning(uid, region)
|
function Private.RegisterGroupForPositioning(uid, region)
|
||||||
pending_controls[uid] = region
|
pending_controls[uid] = region
|
||||||
if not updatingAnimations then
|
if not updatingAnimations then
|
||||||
updatingAnimations = true
|
updatingAnimations = true
|
||||||
last_update = GetTime()
|
last_update = GetTime()
|
||||||
frame:SetScript("OnUpdate", UpdateAnimations)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -399,11 +403,9 @@ function Private.Animate(namespace, uid, type, anim, region, inverse, onFinished
|
|||||||
animation.auraUID = uid
|
animation.auraUID = uid
|
||||||
|
|
||||||
if not(updatingAnimations) then
|
if not(updatingAnimations) then
|
||||||
frame:SetScript("OnUpdate", UpdateAnimations);
|
|
||||||
last_update = GetTime()
|
last_update = GetTime()
|
||||||
updatingAnimations = true;
|
updatingAnimations = true;
|
||||||
end
|
end
|
||||||
RunAnimation(key, animation, 0, GetTime())
|
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
if(animations[key]) then
|
if(animations[key]) then
|
||||||
|
|||||||
+31
-18
@@ -150,7 +150,7 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if self.nextExpire then
|
if self.nextExpire then
|
||||||
self.recheckTimer = timer:ScheduleTimer(self.RecheckTimers, self.nextExpire - now, self)
|
self.recheckTimer = timer:ScheduleTimerFixed(self.RecheckTimers, self.nextExpire - now, self)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@@ -214,11 +214,11 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
WeakAuras.ScanEvents("BossMod_TimerStart", timerId)
|
WeakAuras.ScanEvents("BossMod_TimerStart", timerId)
|
||||||
end
|
end
|
||||||
if self.nextExpire == nil then
|
if self.nextExpire == nil then
|
||||||
self.recheckTimer = timer:ScheduleTimer(self.RecheckTimers, expirationTime - now, self)
|
self.recheckTimer = timer:ScheduleTimerFixed(self.RecheckTimers, expirationTime - now, self)
|
||||||
self.nextExpire = expirationTime
|
self.nextExpire = expirationTime
|
||||||
elseif expirationTime < self.nextExpire then
|
elseif expirationTime < self.nextExpire then
|
||||||
timer:CancelTimer(self.recheckTimer)
|
timer:CancelTimer(self.recheckTimer)
|
||||||
self.recheckTimer = timer:ScheduleTimer(self.RecheckTimers, expirationTime - now, self)
|
self.recheckTimer = timer:ScheduleTimerFixed(self.RecheckTimers, expirationTime - now, self)
|
||||||
self.nextExpire = expirationTime
|
self.nextExpire = expirationTime
|
||||||
end
|
end
|
||||||
elseif event == "DBM_TimerStop" then
|
elseif event == "DBM_TimerStop" then
|
||||||
@@ -261,11 +261,11 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
WeakAuras.ScanEvents("BossMod_TimerResume", timerId)
|
WeakAuras.ScanEvents("BossMod_TimerResume", timerId)
|
||||||
end
|
end
|
||||||
if self.nextExpire == nil then
|
if self.nextExpire == nil then
|
||||||
self.recheckTimer = timer:ScheduleTimer(self.RecheckTimers, bar.expirationTime - GetTime(), self)
|
self.recheckTimer = timer:ScheduleTimerFixed(self.RecheckTimers, bar.expirationTime - GetTime(), self)
|
||||||
self.nextExpire = bar.expirationTime
|
self.nextExpire = bar.expirationTime
|
||||||
elseif bar.expirationTime < self.nextExpire then
|
elseif bar.expirationTime < self.nextExpire then
|
||||||
timer:CancelTimer(self.recheckTimer)
|
timer:CancelTimer(self.recheckTimer)
|
||||||
self.recheckTimer = timer:ScheduleTimer(self.RecheckTimers, bar.expirationTime - GetTime(), self)
|
self.recheckTimer = timer:ScheduleTimerFixed(self.RecheckTimers, bar.expirationTime - GetTime(), self)
|
||||||
self.nextExpire = bar.expirationTime
|
self.nextExpire = bar.expirationTime
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -278,11 +278,11 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
bar.duration = duration
|
bar.duration = duration
|
||||||
bar.expirationTime = expirationTime
|
bar.expirationTime = expirationTime
|
||||||
if self.nextExpire == nil then
|
if self.nextExpire == nil then
|
||||||
self.recheckTimer = timer:ScheduleTimer(self.RecheckTimers, bar.expirationTime - now, self)
|
self.recheckTimer = timer:ScheduleTimerFixed(self.RecheckTimers, bar.expirationTime - now, self)
|
||||||
self.nextExpire = expirationTime
|
self.nextExpire = expirationTime
|
||||||
elseif self.nextExpire == nil or expirationTime < self.nextExpire then
|
elseif self.nextExpire == nil or expirationTime < self.nextExpire then
|
||||||
timer:CancelTimer(self.recheckTimer)
|
timer:CancelTimer(self.recheckTimer)
|
||||||
self.recheckTimer = timer:ScheduleTimer(self.RecheckTimers, bar.expirationTime - now, self)
|
self.recheckTimer = timer:ScheduleTimerFixed(self.RecheckTimers, bar.expirationTime - now, self)
|
||||||
self.nextExpire = expirationTime
|
self.nextExpire = expirationTime
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -290,6 +290,16 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
if self.isGeneric then
|
if self.isGeneric then
|
||||||
WeakAuras.ScanEvents("BossMod_TimerUpdate", timerId)
|
WeakAuras.ScanEvents("BossMod_TimerUpdate", timerId)
|
||||||
end
|
end
|
||||||
|
elseif event == "DBM_TimerUpdateIcon" then
|
||||||
|
local timerId, icon = ...
|
||||||
|
local bar = self.bars[timerId]
|
||||||
|
if bar then
|
||||||
|
bar.icon = icon
|
||||||
|
end
|
||||||
|
WeakAuras.ScanEvents("DBM_TimerUpdateIcon", timerId)
|
||||||
|
if self.isGeneric then
|
||||||
|
WeakAuras.ScanEvents("BossMod_TimerUpdateIcon", timerId)
|
||||||
|
end
|
||||||
elseif event == "DBM_SetStage" or event == "DBM_Pull" or event == "DBM_Wipe" or event == "DBM_Kill" then
|
elseif event == "DBM_SetStage" or event == "DBM_Pull" or event == "DBM_Wipe" or event == "DBM_Kill" then
|
||||||
WeakAuras.ScanEvents("DBM_SetStage")
|
WeakAuras.ScanEvents("DBM_SetStage")
|
||||||
if self.isGeneric then
|
if self.isGeneric then
|
||||||
@@ -314,6 +324,7 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
self:RegisterCallback("DBM_TimerPause")
|
self:RegisterCallback("DBM_TimerPause")
|
||||||
self:RegisterCallback("DBM_TimerResume")
|
self:RegisterCallback("DBM_TimerResume")
|
||||||
self:RegisterCallback("DBM_TimerUpdate")
|
self:RegisterCallback("DBM_TimerUpdate")
|
||||||
|
self:RegisterCallback("DBM_TimerUpdateIcon")
|
||||||
end,
|
end,
|
||||||
|
|
||||||
RegisterMessage = function(self)
|
RegisterMessage = function(self)
|
||||||
@@ -338,7 +349,7 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
|
|
||||||
ScheduleCheck = function(self, fireTime)
|
ScheduleCheck = function(self, fireTime)
|
||||||
if not self.scheduled_scans[fireTime] then
|
if not self.scheduled_scans[fireTime] then
|
||||||
self.scheduled_scans[fireTime] = timer:ScheduleTimer(self.DoScan, fireTime - GetTime(), self, fireTime)
|
self.scheduled_scans[fireTime] = timer:ScheduleTimerFixed(self.DoScan, fireTime - GetTime(), self, fireTime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
@@ -443,7 +454,8 @@ Private.event_prototypes["DBM Timer"] = {
|
|||||||
type = "addons",
|
type = "addons",
|
||||||
events = {},
|
events = {},
|
||||||
internal_events = {
|
internal_events = {
|
||||||
"DBM_TimerStart", "DBM_TimerStop", "DBM_TimerUpdate", "DBM_TimerForce", "DBM_TimerResume", "DBM_TimerPause"
|
"DBM_TimerStart", "DBM_TimerStop", "DBM_TimerUpdate", "DBM_TimerForce", "DBM_TimerResume", "DBM_TimerPause",
|
||||||
|
"DBM_TimerUpdateIcon"
|
||||||
},
|
},
|
||||||
force_events = "DBM_TimerForce",
|
force_events = "DBM_TimerForce",
|
||||||
name = L["DBM Timer"],
|
name = L["DBM Timer"],
|
||||||
@@ -530,7 +542,7 @@ Private.event_prototypes["DBM Timer"] = {
|
|||||||
state.changed = true
|
state.changed = true
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
elseif event == "DBM_TimerUpdate" then
|
elseif event == "DBM_TimerUpdate" or event == "DBM_TimerUpdateIcon" then
|
||||||
local changed
|
local changed
|
||||||
for timerId, bar in pairs(Private.ExecEnv.BossMods.DBM:GetAllTimers()) do
|
for timerId, bar in pairs(Private.ExecEnv.BossMods.DBM:GetAllTimers()) do
|
||||||
if Private.ExecEnv.BossMods.DBM:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerId, triggerDbmType) then
|
if Private.ExecEnv.BossMods.DBM:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerId, triggerDbmType) then
|
||||||
@@ -806,7 +818,7 @@ Private.ExecEnv.BossMods.BigWigs = {
|
|||||||
end
|
end
|
||||||
|
|
||||||
if self.nextExpire then
|
if self.nextExpire then
|
||||||
self.recheckTimer = timer:ScheduleTimer(self.RecheckTimers, self.nextExpire - now, self)
|
self.recheckTimer = timer:ScheduleTimerFixed(self.RecheckTimers, self.nextExpire - now, self)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@@ -846,11 +858,11 @@ Private.ExecEnv.BossMods.BigWigs = {
|
|||||||
WeakAuras.ScanEvents("BossMod_TimerStart", text)
|
WeakAuras.ScanEvents("BossMod_TimerStart", text)
|
||||||
end
|
end
|
||||||
if self.nextExpire == nil then
|
if self.nextExpire == nil then
|
||||||
self.recheckTimer = timer:ScheduleTimer(self.RecheckTimers, expirationTime - now, self)
|
self.recheckTimer = timer:ScheduleTimerFixed(self.RecheckTimers, expirationTime - now, self)
|
||||||
self.nextExpire = expirationTime
|
self.nextExpire = expirationTime
|
||||||
elseif expirationTime < self.nextExpire then
|
elseif expirationTime < self.nextExpire then
|
||||||
timer:CancelTimer(self.recheckTimer)
|
timer:CancelTimer(self.recheckTimer)
|
||||||
self.recheckTimer = timer:ScheduleTimer(self.RecheckTimers, expirationTime - now, self)
|
self.recheckTimer = timer:ScheduleTimerFixed(self.RecheckTimers, expirationTime - now, self)
|
||||||
self.nextExpire = expirationTime
|
self.nextExpire = expirationTime
|
||||||
end
|
end
|
||||||
elseif event == "BigWigs_StopBar" then
|
elseif event == "BigWigs_StopBar" then
|
||||||
@@ -892,10 +904,10 @@ Private.ExecEnv.BossMods.BigWigs = {
|
|||||||
WeakAuras.ScanEvents("BossMod_TimerResume", text)
|
WeakAuras.ScanEvents("BossMod_TimerResume", text)
|
||||||
end
|
end
|
||||||
if self.nextExpire == nil then
|
if self.nextExpire == nil then
|
||||||
self.recheckTimer = timer:ScheduleTimer(self.RecheckTimers, bar.expirationTime - GetTime(), self)
|
self.recheckTimer = timer:ScheduleTimerFixed(self.RecheckTimers, bar.expirationTime - GetTime(), self)
|
||||||
elseif bar.expirationTime < self.nextExpire then
|
elseif bar.expirationTime < self.nextExpire then
|
||||||
timer:CancelTimer(self.recheckTimer)
|
timer:CancelTimer(self.recheckTimer)
|
||||||
self.recheckTimer = timer:ScheduleTimer(self.RecheckTimers, bar.expirationTime - GetTime(), self)
|
self.recheckTimer = timer:ScheduleTimerFixed(self.RecheckTimers, bar.expirationTime - GetTime(), self)
|
||||||
self.nextExpire = bar.expirationTime
|
self.nextExpire = bar.expirationTime
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -982,7 +994,7 @@ Private.ExecEnv.BossMods.BigWigs = {
|
|||||||
|
|
||||||
ScheduleCheck = function(self, fireTime)
|
ScheduleCheck = function(self, fireTime)
|
||||||
if not self.scheduled_scans[fireTime] then
|
if not self.scheduled_scans[fireTime] then
|
||||||
self.scheduled_scans[fireTime] = timer:ScheduleTimer(self.DoScan, fireTime - GetTime(), self, fireTime)
|
self.scheduled_scans[fireTime] = timer:ScheduleTimerFixed(self.DoScan, fireTime - GetTime(), self, fireTime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
@@ -1478,7 +1490,8 @@ Private.event_prototypes["Boss Mod Timer"] = {
|
|||||||
type = "addons",
|
type = "addons",
|
||||||
events = {},
|
events = {},
|
||||||
internal_events = {
|
internal_events = {
|
||||||
"BossMod_TimerStart", "BossMod_TimerStop", "BossMod_TimerUpdate", "BossMod_TimerForce", "BossMod_TimerResume", "BossMod_TimerPause"
|
"BossMod_TimerStart", "BossMod_TimerStop", "BossMod_TimerUpdate", "BossMod_TimerForce", "BossMod_TimerResume",
|
||||||
|
"BossMod_TimerPause", "BossMod_TimerUpdateIcon"
|
||||||
},
|
},
|
||||||
force_events = "BossMod_TimerForce",
|
force_events = "BossMod_TimerForce",
|
||||||
name = L["Boss Mod Timer"],
|
name = L["Boss Mod Timer"],
|
||||||
@@ -1566,7 +1579,7 @@ Private.event_prototypes["Boss Mod Timer"] = {
|
|||||||
state.changed = true
|
state.changed = true
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
elseif event == "BossMod_TimerUpdate" then
|
elseif event == "BossMod_TimerUpdate" or event == "BossMod_TimerUpdateIcon" then
|
||||||
local changed
|
local changed
|
||||||
for timerId, bar in pairs(Private.ExecEnv.BossMods.Generic:GetAllTimers()) do
|
for timerId, bar in pairs(Private.ExecEnv.BossMods.Generic:GetAllTimers()) do
|
||||||
if Private.ExecEnv.BossMods.Generic:TimerMatchesGeneric(timerId, triggerText, triggerTextOperator, triggerSpellId, counter) then
|
if Private.ExecEnv.BossMods.Generic:TimerMatchesGeneric(timerId, triggerText, triggerTextOperator, triggerSpellId, counter) then
|
||||||
|
|||||||
@@ -1015,7 +1015,7 @@ local function ProgressType(data, triggernum)
|
|||||||
elseif (trigger.customDuration and trigger.customDuration ~= "") then
|
elseif (trigger.customDuration and trigger.customDuration ~= "") then
|
||||||
return "timed";
|
return "timed";
|
||||||
elseif (trigger.custom_type == "stateupdate") then
|
elseif (trigger.custom_type == "stateupdate") then
|
||||||
return "timed";
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
@@ -3101,6 +3101,7 @@ end
|
|||||||
do
|
do
|
||||||
local mh = GetInventorySlotInfo("MainHandSlot")
|
local mh = GetInventorySlotInfo("MainHandSlot")
|
||||||
local oh = GetInventorySlotInfo("SecondaryHandSlot")
|
local oh = GetInventorySlotInfo("SecondaryHandSlot")
|
||||||
|
local rw = GetInventorySlotInfo("RangedSlot")
|
||||||
|
|
||||||
local mh_name, mh_shortenedName, mh_exp, mh_dur, mh_charges;
|
local mh_name, mh_shortenedName, mh_exp, mh_dur, mh_charges;
|
||||||
local mh_icon = GetInventoryItemTexture("player", mh);
|
local mh_icon = GetInventoryItemTexture("player", mh);
|
||||||
@@ -3108,6 +3109,9 @@ do
|
|||||||
local oh_name, oh_shortenedName, oh_exp, oh_dur, oh_charges;
|
local oh_name, oh_shortenedName, oh_exp, oh_dur, oh_charges;
|
||||||
local oh_icon = GetInventoryItemTexture("player", oh);
|
local oh_icon = GetInventoryItemTexture("player", oh);
|
||||||
|
|
||||||
|
local rw_name, rw_shortenedName, rw_exp, rw_dur, rw_charges;
|
||||||
|
local rw_icon = GetInventoryItemTexture("player", rw) or "Interface\\Icons\\INV_Misc_QuestionMark"
|
||||||
|
|
||||||
local tenchFrame = nil
|
local tenchFrame = nil
|
||||||
Private.frames["Temporary Enchant Handler"] = tenchFrame;
|
Private.frames["Temporary Enchant Handler"] = tenchFrame;
|
||||||
local tenchTip;
|
local tenchTip;
|
||||||
@@ -3140,11 +3144,12 @@ do
|
|||||||
|
|
||||||
local function tenchUpdate()
|
local function tenchUpdate()
|
||||||
Private.StartProfileSystem("generictrigger");
|
Private.StartProfileSystem("generictrigger");
|
||||||
local _, mh_rem, oh_rem
|
local _, mh_rem, oh_rem, rw_rem, re_charges
|
||||||
_, mh_rem, mh_charges, _, oh_rem, oh_charges = GetWeaponEnchantInfo();
|
_, mh_rem, mh_charges, _, oh_rem, oh_charges, _, rw_rem, rw_charges = GetWeaponEnchantInfo();
|
||||||
local time = GetTime();
|
local time = GetTime();
|
||||||
local mh_exp_new = mh_rem and (time + (mh_rem / 1000));
|
local mh_exp_new = mh_rem and (time + (mh_rem / 1000));
|
||||||
local oh_exp_new = oh_rem and (time + (oh_rem / 1000));
|
local oh_exp_new = oh_rem and (time + (oh_rem / 1000));
|
||||||
|
local rw_exp_new = rw_rem and (time + (rw_rem / 1000));
|
||||||
if(math.abs((mh_exp or 0) - (mh_exp_new or 0)) > 1) then
|
if(math.abs((mh_exp or 0) - (mh_exp_new or 0)) > 1) then
|
||||||
mh_exp = mh_exp_new;
|
mh_exp = mh_exp_new;
|
||||||
mh_dur = mh_rem and mh_rem / 1000;
|
mh_dur = mh_rem and mh_rem / 1000;
|
||||||
@@ -3165,6 +3170,16 @@ do
|
|||||||
end
|
end
|
||||||
oh_icon = GetInventoryItemTexture("player", oh)
|
oh_icon = GetInventoryItemTexture("player", oh)
|
||||||
end
|
end
|
||||||
|
if(math.abs((rw_exp or 0) - (rw_exp_new or 0)) > 1) then
|
||||||
|
rw_exp = rw_exp_new;
|
||||||
|
rw_dur = rw_rem and rw_rem / 1000;
|
||||||
|
if rw_exp then
|
||||||
|
rw_name, rw_shortenedName = getTenchName(rw)
|
||||||
|
else
|
||||||
|
rw_name, rw_shortenedName = "None", "None"
|
||||||
|
end
|
||||||
|
rw_icon = GetInventoryItemTexture("player", rw)
|
||||||
|
end
|
||||||
WeakAuras.ScanEvents("TENCH_UPDATE");
|
WeakAuras.ScanEvents("TENCH_UPDATE");
|
||||||
Private.StopProfileSystem("generictrigger");
|
Private.StopProfileSystem("generictrigger");
|
||||||
end
|
end
|
||||||
@@ -3186,6 +3201,10 @@ do
|
|||||||
function WeakAuras.GetOHTenchInfo()
|
function WeakAuras.GetOHTenchInfo()
|
||||||
return oh_exp, oh_dur, oh_name, oh_shortenedName, oh_icon, oh_charges;
|
return oh_exp, oh_dur, oh_name, oh_shortenedName, oh_icon, oh_charges;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function WeakAuras.GetRangeTenchInfo()
|
||||||
|
return rw_exp, rw_dur, rw_name, rw_shortenedName, rw_icon, rw_charges;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Pets
|
-- Pets
|
||||||
@@ -3742,7 +3761,7 @@ function GenericTrigger.GetAdditionalProperties(data, triggernum)
|
|||||||
enable = v.enable
|
enable = v.enable
|
||||||
end
|
end
|
||||||
|
|
||||||
if (enable and v.store and v.name and v.display) then
|
if (enable and v.store and v.name and v.display and v.conditionType ~= "bool") then
|
||||||
found = true;
|
found = true;
|
||||||
additional = additional .. "|cFFFFCC00%".. triggernum .. "." .. v.name .. "|r - " .. v.display .. "\n";
|
additional = additional .. "|cFFFFCC00%".. triggernum .. "." .. v.name .. "|r - " .. v.display .. "\n";
|
||||||
end
|
end
|
||||||
|
|||||||
+14
-2
@@ -1469,7 +1469,7 @@ function Private.Modernize(data)
|
|||||||
migrateToTable(data.load, "itemequiped")
|
migrateToTable(data.load, "itemequiped")
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[if data.internalVersion < 71 then
|
if data.internalVersion < 71 then
|
||||||
if data.regionType == 'icon' or data.regionType == 'aurabar'
|
if data.regionType == 'icon' or data.regionType == 'aurabar'
|
||||||
or data.regionType == 'progresstexture'
|
or data.regionType == 'progresstexture'
|
||||||
or data.regionType == 'stopmotion'
|
or data.regionType == 'stopmotion'
|
||||||
@@ -1490,7 +1490,19 @@ function Private.Modernize(data)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end]]
|
end
|
||||||
|
|
||||||
|
if data.internalVersion < 73 then
|
||||||
|
if data.conditions then
|
||||||
|
for conditionIndex, condition in ipairs(data.conditions) do
|
||||||
|
for changeIndex, change in ipairs(condition.changes) do
|
||||||
|
if type(change.property) == "string" then
|
||||||
|
change.property = string.gsub(change.property, "(sub.%d.tick_placement)(%d)", "%1s.%2")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
data.internalVersion = max(data.internalVersion or 0, WeakAuras.InternalVersion())
|
data.internalVersion = max(data.internalVersion or 0, WeakAuras.InternalVersion())
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4794,7 +4794,9 @@ Private.event_prototypes = {
|
|||||||
|
|
||||||
if triggerWeaponType == "main" then
|
if triggerWeaponType == "main" then
|
||||||
expirationTime, duration, name, shortenedName, icon, stacks = WeakAuras.GetMHTenchInfo()
|
expirationTime, duration, name, shortenedName, icon, stacks = WeakAuras.GetMHTenchInfo()
|
||||||
else
|
elseif triggerWeaponType == "off" then
|
||||||
|
expirationTime, duration, name, shortenedName, icon, stacks = WeakAuras.GetOHTenchInfo()
|
||||||
|
elseif triggerWeaponType == "ranged" then
|
||||||
expirationTime, duration, name, shortenedName, icon, stacks = WeakAuras.GetOHTenchInfo()
|
expirationTime, duration, name, shortenedName, icon, stacks = WeakAuras.GetOHTenchInfo()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -4820,10 +4822,10 @@ Private.event_prototypes = {
|
|||||||
|
|
||||||
return ret:format(trigger.weapon or "main",
|
return ret:format(trigger.weapon or "main",
|
||||||
trigger.use_enchant and trigger.enchant or "",
|
trigger.use_enchant and trigger.enchant or "",
|
||||||
showOnActive and trigger.use_stack and tonumber(trigger.stack or 0) or "nil",
|
showOnActive and trigger.use_stacks and tonumber(trigger.stacks or 0) or "nil",
|
||||||
showOnActive and trigger.use_remaining and tonumber(trigger.remaining or 0) or "nil",
|
showOnActive and trigger.use_remaining and tonumber(trigger.remaining or 0) or "nil",
|
||||||
trigger.showOn or "showOnActive",
|
trigger.showOn or "showOnActive",
|
||||||
trigger.stack_operator or "<",
|
trigger.stacks_operator or "<",
|
||||||
trigger.remaining_operator or "<")
|
trigger.remaining_operator or "<")
|
||||||
end,
|
end,
|
||||||
args = {
|
args = {
|
||||||
@@ -4847,6 +4849,7 @@ Private.event_prototypes = {
|
|||||||
name = "stacks",
|
name = "stacks",
|
||||||
display = L["Stack Count"],
|
display = L["Stack Count"],
|
||||||
type = "number",
|
type = "number",
|
||||||
|
conditionType = "number",
|
||||||
test = "true",
|
test = "true",
|
||||||
store = true
|
store = true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1125,7 +1125,12 @@ local function modify(parent, region, data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Update texture settings
|
-- Update texture settings
|
||||||
local texturePath = SharedMedia:Fetch("statusbar", data.texture) or "";
|
local texturePath
|
||||||
|
if data.textureSource == "Picker" then
|
||||||
|
texturePath = data.textureInput or ""
|
||||||
|
else
|
||||||
|
texturePath = SharedMedia:Fetch("statusbar", data.texture) or "";
|
||||||
|
end
|
||||||
bar:SetStatusBarTexture(texturePath);
|
bar:SetStatusBarTexture(texturePath);
|
||||||
bar:SetBackgroundColor(data.backgroundColor[1], data.backgroundColor[2], data.backgroundColor[3], data.backgroundColor[4]);
|
bar:SetBackgroundColor(data.backgroundColor[1], data.backgroundColor[2], data.backgroundColor[3], data.backgroundColor[4]);
|
||||||
-- Update spark settings
|
-- Update spark settings
|
||||||
|
|||||||
@@ -631,6 +631,7 @@ local function modify(parent, region, data)
|
|||||||
region.UpdateTime = nil
|
region.UpdateTime = nil
|
||||||
|
|
||||||
function region:Update()
|
function region:Update()
|
||||||
|
region:UpdateProgress()
|
||||||
region:UpdateIcon()
|
region:UpdateIcon()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -476,13 +476,14 @@ local function FrameTick(self)
|
|||||||
if (duration ~= 0) then
|
if (duration ~= 0) then
|
||||||
local remaining = expirationTime - GetTime();
|
local remaining = expirationTime - GetTime();
|
||||||
progress = remaining / duration;
|
progress = remaining / duration;
|
||||||
local inversed = (not inverse and self.inverseDirection) or (inverse and not self.inverseDirection);
|
local inversed = not inverse ~= not self.inverseDirection
|
||||||
if(inversed) then
|
if(inversed) then
|
||||||
progress = 1 - progress;
|
progress = 1 - progress;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
progress = progress > 0.0001 and progress or 0.0001;
|
progress = progress > 0.0001 and progress or 0.0001;
|
||||||
|
|
||||||
if (self.useSmoothProgress) then
|
if (self.useSmoothProgress) then
|
||||||
self.smoothProgress:SetSmoothedValue(progress);
|
self.smoothProgress:SetSmoothedValue(progress);
|
||||||
else
|
else
|
||||||
@@ -861,12 +862,13 @@ local function modify(parent, region, data)
|
|||||||
|
|
||||||
region:Color(data.foregroundColor[1], data.foregroundColor[2], data.foregroundColor[3], data.foregroundColor[4]);
|
region:Color(data.foregroundColor[1], data.foregroundColor[2], data.foregroundColor[3], data.foregroundColor[4]);
|
||||||
|
|
||||||
|
|
||||||
function region:UpdateTime()
|
function region:UpdateTime()
|
||||||
local progress = 1;
|
local progress = 1;
|
||||||
if (self.duration ~= 0) then
|
if (self.duration ~= 0) then
|
||||||
local remaining = self.expirationTime - GetTime()
|
local remaining = self.expirationTime - GetTime()
|
||||||
progress = remaining / self.duration
|
progress = remaining / self.duration
|
||||||
local inversed = self.inverse ~= region.inverseDirection
|
local inversed = not self.inverse ~= not region.inverseDirection
|
||||||
if(inversed) then
|
if(inversed) then
|
||||||
progress = 1 - progress;
|
progress = 1 - progress;
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -379,8 +379,10 @@ local function UpdateProgressFromState(self, minMaxConfig, state, progressSource
|
|||||||
local pausedProperty = progressSource[6]
|
local pausedProperty = progressSource[6]
|
||||||
local remainingProperty = progressSource[7]
|
local remainingProperty = progressSource[7]
|
||||||
if progressType == "number" then
|
if progressType == "number" then
|
||||||
local value = state[property] or 0
|
local value = state[property]
|
||||||
local total = totalProperty and state[totalProperty] or 0
|
if type(value) ~= "number" then value = 0 end
|
||||||
|
local total = totalProperty and state[totalProperty]
|
||||||
|
if type(total) ~= "number" then total = 0 end
|
||||||
-- We don't care about inverse or paused
|
-- We don't care about inverse or paused
|
||||||
local adjustMin
|
local adjustMin
|
||||||
if minMaxConfig.adjustedMin then
|
if minMaxConfig.adjustedMin then
|
||||||
@@ -415,9 +417,12 @@ local function UpdateProgressFromState(self, minMaxConfig, state, progressSource
|
|||||||
local remaining
|
local remaining
|
||||||
if paused then
|
if paused then
|
||||||
remaining = remainingProperty and state[remainingProperty]
|
remaining = remainingProperty and state[remainingProperty]
|
||||||
expirationTime = GetTime() + (remaining or 0)
|
expirationTime = GetTime() + (type(remaining) == "number" and remaining or 0)
|
||||||
else
|
else
|
||||||
expirationTime = state[property] or math.huge
|
expirationTime = state[property]
|
||||||
|
if type(expirationTime) ~= "number" then
|
||||||
|
expirationTime = math.huge
|
||||||
|
end
|
||||||
end
|
end
|
||||||
local duration = totalProperty and state[totalProperty] or 0
|
local duration = totalProperty and state[totalProperty] or 0
|
||||||
local adjustMin
|
local adjustMin
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ local function modify(parent, region, data)
|
|||||||
if region.state.texture then
|
if region.state.texture then
|
||||||
region.texture:SetTexture(region.state.texture);
|
region.texture:SetTexture(region.state.texture);
|
||||||
end
|
end
|
||||||
|
region:UpdateProgress()
|
||||||
end
|
end
|
||||||
|
|
||||||
function region:Color(r, g, b, a)
|
function region:Color(r, g, b, a)
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ local function GetProperties(parentData, data)
|
|||||||
local result = CopyTable(properties)
|
local result = CopyTable(properties)
|
||||||
for i in ipairs(data.tick_placements) do
|
for i in ipairs(data.tick_placements) do
|
||||||
|
|
||||||
result["tick_placement" .. i] = {
|
result["tick_placements." .. i] = {
|
||||||
display = #data.tick_placements > 1 and L["Placement %i"]:format(i) or L["Placement"],
|
display = #data.tick_placements > 1 and L["Placement %i"]:format(i) or L["Placement"],
|
||||||
setter = "SetTickPlacementAt",
|
setter = "SetTickPlacementAt",
|
||||||
type = "number",
|
type = "number",
|
||||||
@@ -286,8 +286,8 @@ local funcs = {
|
|||||||
else
|
else
|
||||||
tick_placement = self.progressData[i].expirationTime - GetTime() + self.tick_placements[i]
|
tick_placement = self.progressData[i].expirationTime - GetTime() + self.tick_placements[i]
|
||||||
end
|
end
|
||||||
elseif self.progressType == "static" then
|
elseif self.progressData[i].progressType == "static" then
|
||||||
tick_placement = self.progressData[i].value + self.progressData[i].tick_placements[i]
|
tick_placement = self.progressData[i].value + self.tick_placements[i]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -537,8 +537,9 @@ end
|
|||||||
|
|
||||||
local function crossRealmSendCommMessage(prefix, text, target, queueName, callbackFn, callbackArg)
|
local function crossRealmSendCommMessage(prefix, text, target, queueName, callbackFn, callbackArg)
|
||||||
local chattype = "WHISPER"
|
local chattype = "WHISPER"
|
||||||
--[[
|
--[[if target and not UnitIsSameServer(target) then
|
||||||
if target then
|
-- WORKAROUND https://github.com/Stanzilla/WoWUIBugs/issues/535, and use RAID/PARTY comms for connected realms
|
||||||
|
if target and (UnitRealmRelationship(target) or 0) ~= 1 then
|
||||||
if UnitInRaid(target) then
|
if UnitInRaid(target) then
|
||||||
chattype = "RAID"
|
chattype = "RAID"
|
||||||
text = ("§§%s:%s"):format(target, text)
|
text = ("§§%s:%s"):format(target, text)
|
||||||
@@ -546,8 +547,7 @@ local function crossRealmSendCommMessage(prefix, text, target, queueName, callba
|
|||||||
chattype = "PARTY"
|
chattype = "PARTY"
|
||||||
text = ("§§%s:%s"):format(target, text)
|
text = ("§§%s:%s"):format(target, text)
|
||||||
end
|
end
|
||||||
end
|
end]]
|
||||||
]]
|
|
||||||
Comm:SendCommMessage(prefix, text, chattype, target, queueName, callbackFn, callbackArg)
|
Comm:SendCommMessage(prefix, text, chattype, target, queueName, callbackFn, callbackArg)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -25,7 +25,8 @@ Private.glow_action_types = {
|
|||||||
|
|
||||||
Private.glow_frame_types = {
|
Private.glow_frame_types = {
|
||||||
UNITFRAME = L["Unit Frame"],
|
UNITFRAME = L["Unit Frame"],
|
||||||
FRAMESELECTOR = L["Frame Selector"]
|
FRAMESELECTOR = L["Frame Selector"],
|
||||||
|
PARENTFRAME = L["Parent Frame"]
|
||||||
}
|
}
|
||||||
if WeakAuras.isAwesomeEnabled() then
|
if WeakAuras.isAwesomeEnabled() then
|
||||||
Private.glow_frame_types.NAMEPLATE = L["Nameplate"]
|
Private.glow_frame_types.NAMEPLATE = L["Nameplate"]
|
||||||
@@ -159,7 +160,7 @@ Private.format_types = {
|
|||||||
none = {
|
none = {
|
||||||
display = L["None"],
|
display = L["None"],
|
||||||
AddOptions = function() end,
|
AddOptions = function() end,
|
||||||
CreateFormatter = function() end
|
CreateFormatter = function() return nil end
|
||||||
},
|
},
|
||||||
string = {
|
string = {
|
||||||
display = L["String"],
|
display = L["String"],
|
||||||
@@ -1849,7 +1850,8 @@ Private.string_operator_types = {
|
|||||||
|
|
||||||
Private.weapon_types = {
|
Private.weapon_types = {
|
||||||
["main"] = MAINHANDSLOT,
|
["main"] = MAINHANDSLOT,
|
||||||
["off"] = SECONDARYHANDSLOT
|
["off"] = SECONDARYHANDSLOT,
|
||||||
|
["ranged"] = RANGEDSLOT,
|
||||||
}
|
}
|
||||||
|
|
||||||
Private.swing_types = {
|
Private.swing_types = {
|
||||||
|
|||||||
+19
-22
@@ -1,6 +1,6 @@
|
|||||||
local AddonName, Private = ...
|
local AddonName, Private = ...
|
||||||
|
|
||||||
local internalVersion = 71
|
local internalVersion = 73
|
||||||
|
|
||||||
-- Lua APIs
|
-- Lua APIs
|
||||||
local insert = table.insert
|
local insert = table.insert
|
||||||
@@ -1353,7 +1353,7 @@ local function GetInstanceTypeAndSize()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function WeakAuras.InstanceType()
|
function WeakAuras.InstanceType()
|
||||||
return GetInstanceTypeAndSize(), nil
|
return (GetInstanceTypeAndSize())
|
||||||
end
|
end
|
||||||
|
|
||||||
function WeakAuras.InstanceDifficulty()
|
function WeakAuras.InstanceDifficulty()
|
||||||
@@ -2143,22 +2143,6 @@ local function loadOrder(tbl, idtable)
|
|||||||
if(data.parent) then
|
if(data.parent) then
|
||||||
if(idtable[data.parent]) then
|
if(idtable[data.parent]) then
|
||||||
if depends[data.parent] then
|
if depends[data.parent] then
|
||||||
-- There was an unfortunate bug in update.lua in 2022 that resulted
|
|
||||||
-- in auras having a circular dependencies
|
|
||||||
-- Fix one of the two known cases here
|
|
||||||
-- We can probably remove this code in 2023 again
|
|
||||||
for d in pairs(depends) do
|
|
||||||
local uid = idtable[d].uid
|
|
||||||
if uid == "fjtz3A6LwBW" then -- Fojji - Deathknight UI, need to fixup a lot
|
|
||||||
local cycleRoot = d
|
|
||||||
idtable[cycleRoot].parent = nil
|
|
||||||
for d in pairs(depends) do
|
|
||||||
tDeleteItem(idtable[d].controlledChildren, cycleRoot)
|
|
||||||
end
|
|
||||||
return loadOrder(tbl, idtable)
|
|
||||||
end
|
|
||||||
coroutine.yield()
|
|
||||||
end
|
|
||||||
error("Circular dependency in Private.AddMany between "..table.concat(depends, ", "));
|
error("Circular dependency in Private.AddMany between "..table.concat(depends, ", "));
|
||||||
else
|
else
|
||||||
if not(loaded[data.parent]) then
|
if not(loaded[data.parent]) then
|
||||||
@@ -2187,6 +2171,7 @@ local function loadOrder(tbl, idtable)
|
|||||||
return order
|
return order
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local pAdd
|
||||||
function Private.AddMany(tbl, takeSnapshots)
|
function Private.AddMany(tbl, takeSnapshots)
|
||||||
local idtable = {};
|
local idtable = {};
|
||||||
local anchorTargets = {}
|
local anchorTargets = {}
|
||||||
@@ -2222,7 +2207,7 @@ function Private.AddMany(tbl, takeSnapshots)
|
|||||||
else
|
else
|
||||||
local ok = pcall(WeakAuras.PreAdd, data)
|
local ok = pcall(WeakAuras.PreAdd, data)
|
||||||
if not ok then
|
if not ok then
|
||||||
geterrorhandler()
|
Private.GetErrorHandlerUid(data.uid, "PreAdd")
|
||||||
prettyPrint(L["Unable to modernize aura '%s'. This is probably due to corrupt data or a bad migration, please report this to the WeakAuras team."]:format(data.id))
|
prettyPrint(L["Unable to modernize aura '%s'. This is probably due to corrupt data or a bad migration, please report this to the WeakAuras team."]:format(data.id))
|
||||||
if data.regionType == "dynamicgroup" or data.regionType == "group" then
|
if data.regionType == "dynamicgroup" or data.regionType == "group" then
|
||||||
prettyPrint(L["All children of this aura will also not be loaded, to minimize the chance of further corruption."])
|
prettyPrint(L["All children of this aura will also not be loaded, to minimize the chance of further corruption."])
|
||||||
@@ -2237,9 +2222,17 @@ function Private.AddMany(tbl, takeSnapshots)
|
|||||||
|
|
||||||
for _, data in ipairs(order) do
|
for _, data in ipairs(order) do
|
||||||
if not bads[data.id] then
|
if not bads[data.id] then
|
||||||
WeakAuras.Add(data)
|
if data.parent and bads[data.parent] then
|
||||||
coroutine.yield()
|
bads[data.id] = true
|
||||||
|
else
|
||||||
|
local ok = pcall(pAdd, data)
|
||||||
|
if not ok then
|
||||||
|
Private.GetErrorHandlerUid(data.uid, "pAdd")
|
||||||
|
bads[data.id] = true
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
coroutine.yield()
|
||||||
end
|
end
|
||||||
|
|
||||||
for id in pairs(anchorTargets) do
|
for id in pairs(anchorTargets) do
|
||||||
@@ -2637,7 +2630,7 @@ function WeakAuras.PreAdd(data)
|
|||||||
data.expanded = nil
|
data.expanded = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local function pAdd(data, simpleChange)
|
function pAdd(data, simpleChange)
|
||||||
local id = data.id;
|
local id = data.id;
|
||||||
if not(id) then
|
if not(id) then
|
||||||
error("Improper arguments to WeakAuras.Add - id not defined");
|
error("Improper arguments to WeakAuras.Add - id not defined");
|
||||||
@@ -3182,6 +3175,7 @@ function Private.HandleGlowAction(actions, region)
|
|||||||
and region.state.unit
|
and region.state.unit
|
||||||
)
|
)
|
||||||
or (actions.glow_frame_type == "FRAMESELECTOR" and actions.glow_frame)
|
or (actions.glow_frame_type == "FRAMESELECTOR" and actions.glow_frame)
|
||||||
|
or (actions.glow_frame_type == "PARENTFRAME" and region:GetParent())
|
||||||
)
|
)
|
||||||
then
|
then
|
||||||
local glow_frame, should_glow_frame
|
local glow_frame, should_glow_frame
|
||||||
@@ -3206,6 +3200,9 @@ function Private.HandleGlowAction(actions, region)
|
|||||||
if not(WeakAuras.isAwesomeEnabled()) then return end
|
if not(WeakAuras.isAwesomeEnabled()) then return end
|
||||||
glow_frame = WeakAuras.GetNamePlateForUnit(region.state.unit)
|
glow_frame = WeakAuras.GetNamePlateForUnit(region.state.unit)
|
||||||
should_glow_frame = true
|
should_glow_frame = true
|
||||||
|
elseif actions.glow_frame_type == "PARENTFRAME" then
|
||||||
|
glow_frame = region:GetParent()
|
||||||
|
should_glow_frame = true
|
||||||
end
|
end
|
||||||
|
|
||||||
if should_glow_frame then
|
if should_glow_frame then
|
||||||
|
|||||||
@@ -0,0 +1,233 @@
|
|||||||
|
-- Widget is based on the AceGUIWidget-DropDown.lua supplied with AceGUI-3.0
|
||||||
|
-- Original Widget created by Yssaril, modified by WeakAuras Team to handle Atlas
|
||||||
|
|
||||||
|
local AceGUI = LibStub("AceGUI-3.0")
|
||||||
|
local Media = LibStub("LibSharedMedia-3.0")
|
||||||
|
|
||||||
|
local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0")
|
||||||
|
|
||||||
|
do
|
||||||
|
local widgetType = "WA_LSM30_StatusbarAtlas"
|
||||||
|
local widgetVersion = 1
|
||||||
|
|
||||||
|
local contentFrameCache = {}
|
||||||
|
local function ReturnSelf(self)
|
||||||
|
self:ClearAllPoints()
|
||||||
|
self:Hide()
|
||||||
|
self.check:Hide()
|
||||||
|
table.insert(contentFrameCache, self)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function ContentOnClick(this, button)
|
||||||
|
local self = this.obj
|
||||||
|
self:Fire("OnValueChanged", this.text:GetText())
|
||||||
|
if self.dropdown then
|
||||||
|
self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function GetContentLine()
|
||||||
|
local frame
|
||||||
|
if next(contentFrameCache) then
|
||||||
|
frame = table.remove(contentFrameCache)
|
||||||
|
else
|
||||||
|
frame = CreateFrame("Button", nil, UIParent)
|
||||||
|
--frame:SetWidth(200)
|
||||||
|
frame:SetHeight(18)
|
||||||
|
frame:SetHighlightTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]], "ADD")
|
||||||
|
frame:SetScript("OnClick", ContentOnClick)
|
||||||
|
local check = frame:CreateTexture("OVERLAY")
|
||||||
|
check:SetWidth(16)
|
||||||
|
check:SetHeight(16)
|
||||||
|
check:SetPoint("LEFT",frame,"LEFT",1,-1)
|
||||||
|
check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check")
|
||||||
|
check:Hide()
|
||||||
|
frame.check = check
|
||||||
|
local bar = frame:CreateTexture("ARTWORK")
|
||||||
|
bar:SetHeight(16)
|
||||||
|
bar:SetPoint("LEFT",check,"RIGHT",1,0)
|
||||||
|
bar:SetPoint("RIGHT",frame,"RIGHT",-1,0)
|
||||||
|
frame.bar = bar
|
||||||
|
local text = frame:CreateFontString(nil,"OVERLAY","GameFontWhite")
|
||||||
|
|
||||||
|
local font, size = text:GetFont()
|
||||||
|
text:SetFont(font,size,"OUTLINE")
|
||||||
|
|
||||||
|
text:SetPoint("TOPLEFT", check, "TOPRIGHT", 3, 0)
|
||||||
|
text:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 0)
|
||||||
|
text:SetJustifyH("LEFT")
|
||||||
|
text:SetText("Test Test Test Test Test Test Test")
|
||||||
|
frame.text = text
|
||||||
|
frame.ReturnSelf = ReturnSelf
|
||||||
|
end
|
||||||
|
frame:Show()
|
||||||
|
return frame
|
||||||
|
end
|
||||||
|
|
||||||
|
local function OnAcquire(self)
|
||||||
|
self:SetHeight(44)
|
||||||
|
self:SetWidth(200)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function OnRelease(self)
|
||||||
|
self:SetText("")
|
||||||
|
self:SetLabel("")
|
||||||
|
self:SetDisabled(false)
|
||||||
|
|
||||||
|
self.value = nil
|
||||||
|
self.list = nil
|
||||||
|
self.open = nil
|
||||||
|
self.hasClose = nil
|
||||||
|
|
||||||
|
self.frame:ClearAllPoints()
|
||||||
|
self.frame:Hide()
|
||||||
|
end
|
||||||
|
|
||||||
|
local function SetValue(self, value) -- Set the value to an item in the List.
|
||||||
|
if self.list then
|
||||||
|
self:SetText(value or "")
|
||||||
|
end
|
||||||
|
self.value = value
|
||||||
|
end
|
||||||
|
|
||||||
|
local function GetValue(self)
|
||||||
|
return self.value
|
||||||
|
end
|
||||||
|
|
||||||
|
local function SetList(self, list) -- Set the list of values for the dropdown (key => value pairs)
|
||||||
|
self.list = list or Media:HashTable("statusbar")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function SetText(self, text) -- Set the text displayed in the box.
|
||||||
|
self.frame.text:SetText(text or "")
|
||||||
|
local statusbar = self.list[text] ~= text and self.list[text] or Media:Fetch('statusbar', text)
|
||||||
|
self.bar:SetTexture(statusbar)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function SetLabel(self, text) -- Set the text for the label.
|
||||||
|
self.frame.label:SetText(text or "")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function AddItem(self, key, value) -- Add an item to the list.
|
||||||
|
self.list = self.list or {}
|
||||||
|
self.list[key] = value
|
||||||
|
end
|
||||||
|
local SetItemValue = AddItem -- Set the value of a item in the list. <<same as adding a new item>>
|
||||||
|
|
||||||
|
local function SetMultiselect(self, flag) end -- Toggle multi-selecting. <<Dummy function to stay inline with the dropdown API>>
|
||||||
|
local function GetMultiselect() return false end-- Query the multi-select flag. <<Dummy function to stay inline with the dropdown API>>
|
||||||
|
local function SetItemDisabled(self, key) end-- Disable one item in the list. <<Dummy function to stay inline with the dropdown API>>
|
||||||
|
|
||||||
|
local function SetDisabled(self, disabled) -- Disable the widget.
|
||||||
|
self.disabled = disabled
|
||||||
|
if disabled then
|
||||||
|
self.frame:Disable()
|
||||||
|
else
|
||||||
|
self.frame:Enable()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function textSort(a,b)
|
||||||
|
return string.upper(a) < string.upper(b)
|
||||||
|
end
|
||||||
|
|
||||||
|
local sortedlist = {}
|
||||||
|
local function ToggleDrop(this)
|
||||||
|
local self = this.obj
|
||||||
|
if self.dropdown then
|
||||||
|
self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
|
||||||
|
AceGUI:ClearFocus()
|
||||||
|
else
|
||||||
|
AceGUI:SetFocus(self)
|
||||||
|
self.dropdown = AGSMW:GetDropDownFrame()
|
||||||
|
local width = self.frame:GetWidth()
|
||||||
|
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT")
|
||||||
|
self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0)
|
||||||
|
for k, v in pairs(self.list) do
|
||||||
|
sortedlist[#sortedlist+1] = k
|
||||||
|
end
|
||||||
|
table.sort(sortedlist, textSort)
|
||||||
|
for i, k in ipairs(sortedlist) do
|
||||||
|
local f = GetContentLine()
|
||||||
|
f.text:SetText(k)
|
||||||
|
--print(k)
|
||||||
|
if k == self.value then
|
||||||
|
f.check:Show()
|
||||||
|
end
|
||||||
|
|
||||||
|
local statusbar = self.list[k] ~= k and self.list[k] or Media:Fetch('statusbar',k)
|
||||||
|
f.bar:SetTexture(statusbar)
|
||||||
|
f.obj = self
|
||||||
|
f.dropdown = self.dropdown
|
||||||
|
self.dropdown:AddFrame(f)
|
||||||
|
end
|
||||||
|
wipe(sortedlist)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function ClearFocus(self)
|
||||||
|
if self.dropdown then
|
||||||
|
self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function OnHide(this)
|
||||||
|
local self = this.obj
|
||||||
|
if self.dropdown then
|
||||||
|
self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function Drop_OnEnter(this)
|
||||||
|
this.obj:Fire("OnEnter")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function Drop_OnLeave(this)
|
||||||
|
this.obj:Fire("OnLeave")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function Constructor()
|
||||||
|
local frame = AGSMW:GetBaseFrame()
|
||||||
|
local self = {}
|
||||||
|
|
||||||
|
self.type = widgetType
|
||||||
|
self.frame = frame
|
||||||
|
frame.obj = self
|
||||||
|
frame.dropButton.obj = self
|
||||||
|
frame.dropButton:SetScript("OnEnter", Drop_OnEnter)
|
||||||
|
frame.dropButton:SetScript("OnLeave", Drop_OnLeave)
|
||||||
|
frame.dropButton:SetScript("OnClick",ToggleDrop)
|
||||||
|
frame:SetScript("OnHide", OnHide)
|
||||||
|
|
||||||
|
local bar = frame:CreateTexture(nil, "OVERLAY")
|
||||||
|
bar:SetPoint("TOPLEFT", frame,"TOPLEFT",6,-25)
|
||||||
|
bar:SetPoint("BOTTOMRIGHT", frame,"BOTTOMRIGHT", -21, 5)
|
||||||
|
bar:SetAlpha(0.5)
|
||||||
|
self.bar = bar
|
||||||
|
|
||||||
|
self.alignoffset = 31
|
||||||
|
|
||||||
|
self.OnRelease = OnRelease
|
||||||
|
self.OnAcquire = OnAcquire
|
||||||
|
self.ClearFocus = ClearFocus
|
||||||
|
self.SetText = SetText
|
||||||
|
self.SetValue = SetValue
|
||||||
|
self.GetValue = GetValue
|
||||||
|
self.SetList = SetList
|
||||||
|
self.SetLabel = SetLabel
|
||||||
|
self.SetDisabled = SetDisabled
|
||||||
|
self.AddItem = AddItem
|
||||||
|
self.SetMultiselect = SetMultiselect
|
||||||
|
self.GetMultiselect = GetMultiselect
|
||||||
|
self.SetItemValue = SetItemValue
|
||||||
|
self.SetItemDisabled = SetItemDisabled
|
||||||
|
self.ToggleDrop = ToggleDrop
|
||||||
|
|
||||||
|
AceGUI:RegisterAsWidget(self)
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
|
||||||
|
|
||||||
|
end
|
||||||
@@ -649,10 +649,7 @@ function OptionsPrivate.GetActionOptions(data)
|
|||||||
end,
|
end,
|
||||||
name = L["Glow Frame Type"],
|
name = L["Glow Frame Type"],
|
||||||
order = 30.3,
|
order = 30.3,
|
||||||
values = {
|
values = OptionsPrivate.Private.glow_frame_types,
|
||||||
UNITFRAME = L["Unit Frame"],
|
|
||||||
FRAMESELECTOR = L["Frame Selector"]
|
|
||||||
},
|
|
||||||
hidden = function()
|
hidden = function()
|
||||||
return not data.actions.finish.do_glow
|
return not data.actions.finish.do_glow
|
||||||
or data.actions.finish.glow_action == nil
|
or data.actions.finish.glow_action == nil
|
||||||
|
|||||||
@@ -488,7 +488,6 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA
|
|||||||
args["condition" .. i .. "value" .. j] = {
|
args["condition" .. i .. "value" .. j] = {
|
||||||
type = "toggle",
|
type = "toggle",
|
||||||
width = WeakAuras.normalWidth,
|
width = WeakAuras.normalWidth,
|
||||||
name = blueIfNoValue(data, conditions[i].changes[j], "value", L["Differences"]),
|
|
||||||
desc = descIfNoValue(data, conditions[i].changes[j], "value", propertyType),
|
desc = descIfNoValue(data, conditions[i].changes[j], "value", propertyType),
|
||||||
order = order,
|
order = order,
|
||||||
get = function()
|
get = function()
|
||||||
@@ -498,6 +497,7 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA
|
|||||||
}
|
}
|
||||||
order = order + 1;
|
order = order + 1;
|
||||||
if (propertyType == "number") then
|
if (propertyType == "number") then
|
||||||
|
args["condition" .. i .. "value" .. j].name = blueIfNoValue(data, conditions[i].changes[j], "value", L["Differences"])
|
||||||
local properties = allProperties.propertyMap[property];
|
local properties = allProperties.propertyMap[property];
|
||||||
if (properties.min or properties.softMin) and (properties.max or properties.softMax) then
|
if (properties.min or properties.softMin) and (properties.max or properties.softMax) then
|
||||||
args["condition" .. i .. "value" .. j].type = "range";
|
args["condition" .. i .. "value" .. j].type = "range";
|
||||||
@@ -513,6 +513,11 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA
|
|||||||
args["condition" .. i .. "value" .. j].type = "input";
|
args["condition" .. i .. "value" .. j].type = "input";
|
||||||
args["condition" .. i .. "value" .. j].validate = WeakAuras.ValidateNumeric;
|
args["condition" .. i .. "value" .. j].validate = WeakAuras.ValidateNumeric;
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
args["condition" .. i .. "value" .. j].name = function()
|
||||||
|
local value = conditions[i].changes[j].value
|
||||||
|
return blueIfNoValue(data, conditions[i].changes[j], "value", L["Differences"], value and L["ON"] or L["OFF"])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
elseif (propertyType == "string" or propertyType == "texture") then
|
elseif (propertyType == "string" or propertyType == "texture") then
|
||||||
args["condition" .. i .. "value" .. j] = {
|
args["condition" .. i .. "value" .. j] = {
|
||||||
|
|||||||
@@ -1386,8 +1386,10 @@ function OptionsPrivate.CreateFrame()
|
|||||||
|
|
||||||
for _, id in ipairs(batchSelection) do
|
for _, id in ipairs(batchSelection) do
|
||||||
if not alreadySelected[id] then
|
if not alreadySelected[id] then
|
||||||
displayButtons[id]:Pick()
|
if displayButtons[id].frame:IsVisible() then
|
||||||
tinsert(tempGroup.controlledChildren, id)
|
displayButtons[id]:Pick()
|
||||||
|
tinsert(tempGroup.controlledChildren, id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
frame:ClearOptions(tempGroup.id)
|
frame:ClearOptions(tempGroup.id)
|
||||||
|
|||||||
@@ -6,18 +6,70 @@ local L = WeakAuras.L;
|
|||||||
|
|
||||||
-- Create region options table
|
-- Create region options table
|
||||||
local function createOptions(id, data)
|
local function createOptions(id, data)
|
||||||
|
local statusbarList = {}
|
||||||
|
WeakAuras.Mixin(statusbarList, SharedMedia:HashTable("statusbar"))
|
||||||
|
|
||||||
-- Region options
|
-- Region options
|
||||||
local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ceil(GetScreenHeight() / 20) * 20;
|
local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ceil(GetScreenHeight() / 20) * 20;
|
||||||
local options = {
|
local options = {
|
||||||
__title = L["Progress Bar Settings"],
|
__title = L["Progress Bar Settings"],
|
||||||
__order = 1,
|
__order = 1,
|
||||||
texture = {
|
textureSource = {
|
||||||
type = "select",
|
type = "select",
|
||||||
dialogControl = "LSM30_Statusbar",
|
|
||||||
order = 1,
|
order = 1,
|
||||||
width = WeakAuras.doubleWidth,
|
width = WeakAuras.doubleWidth,
|
||||||
|
name = L["Texture Selection Mode"],
|
||||||
|
values = {
|
||||||
|
LSM = L["LibSharedMedia"],
|
||||||
|
Picker = L["Texture Picker"]
|
||||||
|
},
|
||||||
|
get = function()
|
||||||
|
return data.textureSource or "LSM"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
texture = {
|
||||||
|
type = "select",
|
||||||
|
dialogControl = "WA_LSM30_StatusbarAtlas",
|
||||||
|
order = 2,
|
||||||
|
width = WeakAuras.doubleWidth,
|
||||||
name = L["Bar Texture"],
|
name = L["Bar Texture"],
|
||||||
values = AceGUIWidgetLSMlists.statusbar
|
values = statusbarList,
|
||||||
|
hidden = function()
|
||||||
|
return data.textureSource == "Picker"
|
||||||
|
end
|
||||||
|
},
|
||||||
|
textureInput = {
|
||||||
|
type = "input",
|
||||||
|
width = WeakAuras.doubleWidth - 0.15,
|
||||||
|
name = L["Texture"],
|
||||||
|
order = 3,
|
||||||
|
hidden = function()
|
||||||
|
return data.textureSource ~= "Picker"
|
||||||
|
end
|
||||||
|
},
|
||||||
|
chooseTexture = {
|
||||||
|
type = "execute",
|
||||||
|
name = L["Choose"],
|
||||||
|
width = 0.15,
|
||||||
|
order = 4,
|
||||||
|
func = function()
|
||||||
|
local path = {}
|
||||||
|
local paths = {}
|
||||||
|
for child in OptionsPrivate.Private.TraverseLeafsOrAura(data) do
|
||||||
|
paths[child.id] = path
|
||||||
|
end
|
||||||
|
OptionsPrivate.OpenTexturePicker(data, paths, {
|
||||||
|
texture = "textureInput",
|
||||||
|
color = "color",
|
||||||
|
}, OptionsPrivate.Private.texture_types, nil, true)
|
||||||
|
end,
|
||||||
|
imageWidth = 24,
|
||||||
|
imageHeight = 24,
|
||||||
|
control = "WeakAurasIcon",
|
||||||
|
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\browse",
|
||||||
|
hidden = function()
|
||||||
|
return data.textureSource ~= "Picker"
|
||||||
|
end
|
||||||
},
|
},
|
||||||
orientation = {
|
orientation = {
|
||||||
type = "select",
|
type = "select",
|
||||||
|
|||||||
@@ -97,3 +97,4 @@ AceGUI-Widgets\AceGuiWidget-WeakAurasProgressBar.lua
|
|||||||
AceGUI-Widgets\AceGUIWidget-WeakAurasSpinBox.lua
|
AceGUI-Widgets\AceGUIWidget-WeakAurasSpinBox.lua
|
||||||
AceGUI-Widgets\AceGUIWidget-WeakAurasInputFocus.lua
|
AceGUI-Widgets\AceGUIWidget-WeakAurasInputFocus.lua
|
||||||
AceGUI-Widgets\AceGUIWidget-WeakAurasMediaSound.lua
|
AceGUI-Widgets\AceGUIWidget-WeakAurasMediaSound.lua
|
||||||
|
AceGUI-Widgets\WeakAurasStatusbarAtlasWidget.lua
|
||||||
|
|||||||
Reference in New Issue
Block a user