update prototypes
This commit is contained in:
@@ -3024,10 +3024,10 @@ do
|
||||
local mh = GetInventorySlotInfo("MainHandSlot")
|
||||
local oh = GetInventorySlotInfo("SecondaryHandSlot")
|
||||
|
||||
local mh_name, mh_shortenedName, mh_exp, mh_dur, mh_charges, mh_EnchantID;
|
||||
local mh_name, mh_shortenedName, mh_exp, mh_dur, mh_charges;
|
||||
local mh_icon = GetInventoryItemTexture("player", mh);
|
||||
|
||||
local oh_name, oh_shortenedName, oh_exp, oh_dur, oh_charges, oh_EnchantID;
|
||||
local oh_name, oh_shortenedName, oh_exp, oh_dur, oh_charges;
|
||||
local oh_icon = GetInventoryItemTexture("player", oh);
|
||||
|
||||
local tenchFrame = nil
|
||||
@@ -3063,7 +3063,7 @@ do
|
||||
local function tenchUpdate()
|
||||
WeakAuras.StartProfileSystem("generictrigger");
|
||||
local _, mh_rem, oh_rem
|
||||
_, mh_rem, mh_charges, mh_EnchantID, _, oh_rem, oh_charges, oh_EnchantID = GetWeaponEnchantInfo();
|
||||
_, mh_rem, mh_charges, _, oh_rem, oh_charges = GetWeaponEnchantInfo();
|
||||
local time = GetTime();
|
||||
local mh_exp_new = mh_rem and (time + (mh_rem / 1000));
|
||||
local oh_exp_new = oh_rem and (time + (oh_rem / 1000));
|
||||
@@ -3104,11 +3104,11 @@ do
|
||||
end
|
||||
|
||||
function WeakAuras.GetMHTenchInfo()
|
||||
return mh_exp, mh_dur, mh_name, mh_shortenedName, mh_icon, mh_charges, mh_EnchantID;
|
||||
return mh_exp, mh_dur, mh_name, mh_shortenedName, mh_icon, mh_charges;
|
||||
end
|
||||
|
||||
function WeakAuras.GetOHTenchInfo()
|
||||
return oh_exp, oh_dur, oh_name, oh_shortenedName, oh_icon, oh_charges, oh_EnchantID;
|
||||
return oh_exp, oh_dur, oh_name, oh_shortenedName, oh_icon, oh_charges;
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3154,21 +3154,6 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
-- Item Count
|
||||
local itemCountWatchFrame;
|
||||
function WeakAuras.RegisterItemCountWatch()
|
||||
if not(itemCountWatchFrame) then
|
||||
itemCountWatchFrame = CreateFrame("frame");
|
||||
itemCountWatchFrame:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", "player");
|
||||
itemCountWatchFrame:SetScript("OnEvent", function()
|
||||
WeakAuras.StartProfileSystem("generictrigger");
|
||||
timer:ScheduleTimer(WeakAuras.ScanEvents, 0.2, "ITEM_COUNT_UPDATE");
|
||||
timer:ScheduleTimer(WeakAuras.ScanEvents, 0.5, "ITEM_COUNT_UPDATE");
|
||||
WeakAuras.StopProfileSystem("generictrigger");
|
||||
end);
|
||||
end
|
||||
end
|
||||
|
||||
do
|
||||
local scheduled_scans = {};
|
||||
|
||||
|
||||
+17
-31
@@ -3725,8 +3725,8 @@ WeakAuras.event_prototypes = {
|
||||
if (trigger.use_talent) then
|
||||
-- Single selection
|
||||
local index = trigger.talent and trigger.talent.single;
|
||||
local tier = index and ceil(index / 20)
|
||||
local column = index and ((index - 1) % 20 + 1)
|
||||
local tier = index and ceil(index / 30)
|
||||
local column = index and ((index - 1) % 30 + 1)
|
||||
|
||||
local ret = [[
|
||||
local tier = %s;
|
||||
@@ -3752,8 +3752,8 @@ WeakAuras.event_prototypes = {
|
||||
]]
|
||||
for index in pairs(trigger.talent.multi) do
|
||||
local tier, column
|
||||
local tier = index and ceil(index / 20)
|
||||
local column = index and ((index - 1) % 20 + 1)
|
||||
local tier = index and ceil(index / 30)
|
||||
local column = index and ((index - 1) % 30 + 1)
|
||||
local ret2 = [[
|
||||
if (not active) then
|
||||
tier = %s
|
||||
@@ -3884,7 +3884,7 @@ WeakAuras.event_prototypes = {
|
||||
end
|
||||
elseif inverse then -- inverse without a specific slot
|
||||
local found = false;
|
||||
for i = 1, 5 do
|
||||
for i = 1, 4 do
|
||||
local _, totemName, startTime, duration, icon = GetTotemInfo(i);
|
||||
if ((startTime and startTime ~= 0) and
|
||||
WeakAuras.CheckTotemName(totemName, triggerTotemName, triggerTotemPattern, triggerTotemPatternOperator)
|
||||
@@ -3903,7 +3903,7 @@ WeakAuras.event_prototypes = {
|
||||
state.icon = select(3, GetSpellInfo(triggerTotemName));
|
||||
end
|
||||
else -- check all slots
|
||||
for i = 1, 5 do
|
||||
for i = 1, 4 do
|
||||
local _, totemName, startTime, duration, icon = GetTotemInfo(i);
|
||||
active = (startTime and startTime ~= 0);
|
||||
|
||||
@@ -4002,24 +4002,16 @@ WeakAuras.event_prototypes = {
|
||||
"PLAYER_ENTERING_WORLD"
|
||||
}
|
||||
},
|
||||
internal_events = {
|
||||
"ITEM_COUNT_UPDATE",
|
||||
},
|
||||
force_events = "BAG_UPDATE",
|
||||
name = L["Item Count"],
|
||||
loadFunc = function(trigger)
|
||||
if(trigger.use_includeCharges) then
|
||||
WeakAuras.RegisterItemCountWatch();
|
||||
end
|
||||
end,
|
||||
init = function(trigger)
|
||||
--trigger.itemName = WeakAuras.CorrectItemName(trigger.itemName) or 0;
|
||||
trigger.itemName = trigger.itemName or 0;
|
||||
local itemName = type(trigger.itemName) == "number" and trigger.itemName or "[["..trigger.itemName.."]]";
|
||||
local ret = [[
|
||||
local count = GetItemCount(%s, %s, %s);
|
||||
local count = GetItemCount(%s, %s);
|
||||
]];
|
||||
return ret:format(itemName, trigger.use_includeBank and "true" or "nil", trigger.use_includeCharges and "true" or "nil");
|
||||
return ret:format(itemName, trigger.use_includeBank and "true" or "nil");
|
||||
end,
|
||||
args = {
|
||||
{
|
||||
@@ -4035,12 +4027,6 @@ WeakAuras.event_prototypes = {
|
||||
type = "toggle",
|
||||
test = "true"
|
||||
},
|
||||
{
|
||||
name = "includeCharges",
|
||||
display = L["Include Charges"],
|
||||
type = "toggle",
|
||||
test = "true"
|
||||
},
|
||||
{
|
||||
name = "count",
|
||||
display = L["Item Count"],
|
||||
@@ -4048,11 +4034,11 @@ WeakAuras.event_prototypes = {
|
||||
}
|
||||
},
|
||||
durationFunc = function(trigger)
|
||||
local count = GetItemCount(trigger.itemName, trigger.use_includeBank, trigger.use_includeCharges);
|
||||
local count = GetItemCount(trigger.itemName, trigger.use_includeBank);
|
||||
return count, 0, true;
|
||||
end,
|
||||
stacksFunc = function(trigger)
|
||||
local count = GetItemCount(trigger.itemName, trigger.use_includeBank, trigger.use_includeCharges);
|
||||
local count = GetItemCount(trigger.itemName, trigger.use_includeBank);
|
||||
return count, 0, true;
|
||||
end,
|
||||
nameFunc = function(trigger)
|
||||
@@ -4154,12 +4140,12 @@ WeakAuras.event_prototypes = {
|
||||
end
|
||||
end,
|
||||
iconFunc = function(trigger)
|
||||
local icon = "136116"
|
||||
local icon = "Interface\\Icons\\Spell_Nature_WispSplode"
|
||||
local form = GetShapeshiftForm()
|
||||
if form and form > 0 then
|
||||
icon = GetShapeshiftFormInfo(form);
|
||||
end
|
||||
return icon or "136116"
|
||||
return icon or "Interface\\Icons\\Spell_Nature_WispSplode"
|
||||
end,
|
||||
automaticrequired = true
|
||||
},
|
||||
@@ -4180,17 +4166,17 @@ WeakAuras.event_prototypes = {
|
||||
local triggerStack = %s
|
||||
local triggerRemaining = %s
|
||||
local triggerShowOn = %q
|
||||
local _, expirationTime, duration, name, stack, enchantID
|
||||
local _, expirationTime, duration, name, stack
|
||||
|
||||
if triggerWeaponType == "main" then
|
||||
expirationTime, duration, name, shortenedName, _, stack, enchantID = WeakAuras.GetMHTenchInfo()
|
||||
expirationTime, duration, name, shortenedName, _, stack = WeakAuras.GetMHTenchInfo()
|
||||
else
|
||||
expirationTime, duration, name, shortenedName, _, stack, enchantID = WeakAuras.GetOHTenchInfo()
|
||||
expirationTime, duration, name, shortenedName, _, stack = WeakAuras.GetOHTenchInfo()
|
||||
end
|
||||
|
||||
local remaining = expirationTime and expirationTime - GetTime()
|
||||
|
||||
local nameCheck = triggerName == "" or name and triggerName == name or shortenedName and triggerName == shortenedName or tonumber(triggerName) and enchantID and tonumber(triggerName) == enchantID
|
||||
local nameCheck = triggerName == "" or name and triggerName == name or shortenedName and triggerName == shortenedName
|
||||
local stackCheck = not triggerStack or stack and stack %s triggerStack
|
||||
local remainingCheck = not triggerRemaining or remaining and remaining %s triggerRemaining
|
||||
local found = expirationTime and nameCheck and stackCheck and remainingCheck
|
||||
@@ -4221,7 +4207,7 @@ WeakAuras.event_prototypes = {
|
||||
{
|
||||
name = "enchant",
|
||||
display = L["Weapon Enchant"],
|
||||
desc = L["Enchant Name or ID"],
|
||||
desc = L["Enchant Name"],
|
||||
type = "string",
|
||||
test = "true"
|
||||
},
|
||||
|
||||
+11
-17
@@ -251,12 +251,9 @@ local function update_forms()
|
||||
wipe(WeakAuras.form_types);
|
||||
WeakAuras.form_types[0] = "0 - "..L["Humanoid"]
|
||||
for i = 1, GetNumShapeshiftForms() do
|
||||
local _, _, _, id = GetShapeshiftFormInfo(i);
|
||||
if(id) then
|
||||
local name = GetSpellInfo(id);
|
||||
if(name) then
|
||||
WeakAuras.form_types[i] = i.." - "..name
|
||||
end
|
||||
local _, name = GetShapeshiftFormInfo(i);
|
||||
if(name) then
|
||||
WeakAuras.form_types[i] = i.." - "..name
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -557,23 +554,20 @@ WeakAuras.spec_types_2 = {
|
||||
WeakAuras.spec_types_specific = {}
|
||||
WeakAuras.spec_types_all = {}
|
||||
|
||||
-- TODO
|
||||
WeakAuras.talent_types = {}
|
||||
for tab = 1, 5 do
|
||||
for num_talent = 1, 20 do
|
||||
local talentId = (tab - 1)*20+num_talent
|
||||
for num_talent = 1, 30 do
|
||||
local talentId = (tab - 1)*30+num_talent
|
||||
WeakAuras.talent_types[talentId] = L["Tab "]..tab.." - "..num_talent
|
||||
end
|
||||
end
|
||||
|
||||
WeakAuras.pvp_talent_types = {}
|
||||
|
||||
-- GetTotemInfo() only works for the first 5 totems
|
||||
WeakAuras.totem_types = {};
|
||||
local totemString = L["Totem #%i"];
|
||||
for i = 1, 5 do
|
||||
WeakAuras.totem_types[i] = totemString:format(i);
|
||||
end
|
||||
WeakAuras.totem_types = {
|
||||
[1] = L["Fire"],
|
||||
[2] = L["Earth"],
|
||||
[3] = L["Water"],
|
||||
[4] = L["Air"]
|
||||
}
|
||||
|
||||
WeakAuras.texture_types = {
|
||||
["Blizzard Alerts"] = {
|
||||
|
||||
@@ -1380,7 +1380,6 @@ function WeakAuras.UnregisterForGlobalConditions(id)
|
||||
end
|
||||
|
||||
WeakAuras.talent_types_specific = {}
|
||||
WeakAuras.pvp_talent_types_specific = {}
|
||||
function WeakAuras.CreateTalentCache()
|
||||
local _, player_class = UnitClass("player")
|
||||
|
||||
@@ -1389,7 +1388,7 @@ function WeakAuras.CreateTalentCache()
|
||||
for tab = 1, GetNumTalentTabs() do
|
||||
for num_talent = 1, GetNumTalents(tab) do
|
||||
local talentName, talentIcon = GetTalentInfo(tab, num_talent);
|
||||
local talentId = (tab - 1)*20+num_talent
|
||||
local talentId = (tab - 1)*30+num_talent
|
||||
if (talentName and talentIcon) then
|
||||
WeakAuras.talent_types_specific[player_class][talentId] = "|T"..talentIcon..":0|t "..talentName
|
||||
end
|
||||
@@ -5460,10 +5459,6 @@ do
|
||||
if not(hiddenTooltip) then
|
||||
hiddenTooltip = CreateFrame("GameTooltip", "WeakAurasTooltip", nil, "GameTooltipTemplate");
|
||||
hiddenTooltip:SetOwner(WorldFrame, "ANCHOR_NONE");
|
||||
hiddenTooltip:AddFontStrings(
|
||||
hiddenTooltip:CreateFontString("$parentTextLeft1", nil, "GameTooltipText"),
|
||||
hiddenTooltip:CreateFontString("$parentTextRight1", nil, "GameTooltipText")
|
||||
);
|
||||
end
|
||||
return hiddenTooltip;
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user