/
local disable_delayed_swaps = nil -- temporary. change nil to 1 to stop attempting to delay set swaps while casting |
local _ |
ItemRack.Version = 2.97 |
ItemRack.Version = 2.98 |
ItemRackUser = { |
Sets = {}, -- user's sets |
end |
-- itemrack itemstring updater. |
-- takes a saved ItemRack-style ID and returns an updated version with the latest player level injected, which helps us update outdated IDs saved when the player was lower level |
-- takes a saved ItemRack-style ID and returns an updated version with the latest player level and spec injected, which helps us update outdated IDs saved when the player was lower level or different spec |
function ItemRack.UpdateIRString(itemRackID) |
return (string.gsub(itemRackID or "", "^("..strrep("%d+:", 8)..")%d+", "%1"..UnitLevel("player"))) --note: parenthesis to discard 2nd return value (number of substitutions, which will always be 1) |
return (string.gsub(itemRackID or "", "^("..strrep("%d+:", 8)..")%d+:%d+", "%1"..UnitLevel("player")..":"..GetInspectSpecialization("player"))) --note: parenthesis to discard 2nd return value (number of substitutions, which will always be 1) |
end |
-- returns the provided ItemRack-style ID string with "item:" prepended, which turns it into a normal itemstring which we can then use for item lookups, itemlink generation and so on. |
-- if this is a special set that stored a setname, set current to that setname |
ItemRackUser.CurrentSet = ItemRackUser.Sets[setname].oldset |
ItemRackUser.Sets[setname].oldset = nil |
ItemRack.UpdateCurrentSet() |
end |
if ItemRackOptFrame and ItemRackOptFrame:IsVisible() then |
ItemRackOpt.ChangeEditingSet() |
local id |
for i in pairs(set) do |
id = ItemRack.GetID(i) |
if (exact and set[i]~=id) or (not exact and not ItemRack.SameID(set[i],ItemRack.GetID(i))) then |
return nil |
-- if (exact and set[i]~=id) or (not exact and not ItemRack.SameID(set[i],ItemRack.GetID(i))) then |
if (ItemRack.UpdateIRString(set[i]) ~= id) then |
return false |
end |
end |
return 1 |
return true |
end |
end |
function ItemRack.ToggleSet(setname,exact) |
if ItemRack.IsSetEquipped(setname,exact) then |
-- print("remove "..setname) |
ItemRack.UnequipSet(setname) |
else |
-- print("equip "..setname) |
ItemRack.EquipSet(setname) |
end |
end |
__ New in 2.98 - By Kharthus __ |
* Fixed items with different enchants |
__ New in 2.97 - By Kharthus __ |
* TOC update for 6.2 patch |