From 80ec2035a9ba4df73e2cf2d33058b2880b240748 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Mon, 29 Dec 2014 10:39:40 +0400 Subject: [PATCH] Equipping sounds are annoying --- ElvUI_SLE/modules/equipmanager.lua | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/ElvUI_SLE/modules/equipmanager.lua b/ElvUI_SLE/modules/equipmanager.lua index fc81376..368a5f6 100644 --- a/ElvUI_SLE/modules/equipmanager.lua +++ b/ElvUI_SLE/modules/equipmanager.lua @@ -7,24 +7,40 @@ local gsub, strfind = string.gsub, string.find, string.sub local function Equip(event) local primary = GetSpecialization() + local equipSet + for i = 1, GetNumEquipmentSets() do + local name, _, _, isEquipped = GetEquipmentSetInfo(i) + if isEquipped then + equipSet = name + + end + end if primary ~= nil then local inInstance, instanceType = IsInInstance() if (event == "ACTIVE_TALENT_GROUP_CHANGED") then if GetActiveSpecGroup() == 1 then - UseEquipmentSet(E.private.sle.equip.primary) + if equipSet ~= E.private.sle.equip.primary and E.private.sle.equip.primary ~= "NONE" then + UseEquipmentSet(E.private.sle.equip.primary) + end else - UseEquipmentSet(E.private.sle.equip.secondary) + if equipSet ~= E.private.sle.equip.secondary and E.private.sle.equip.secondary ~= "NONE" then + UseEquipmentSet(E.private.sle.equip.secondary) + end end end if (instanceType == "party" or instanceType == "raid") then - UseEquipmentSet(E.private.sle.equip.instance) + if equipSet ~= E.private.sle.equip.instance and E.private.sle.equip.instance ~= "NONE" then + UseEquipmentSet(E.private.sle.equip.instance) + end end if (instanceType == "pvp" or instanceType == "arena") then - UseEquipmentSet(E.private.sle.equip.pvp) + if equipSet ~= E.private.sle.equip.pvp and E.private.sle.equip.pvp ~= "NONE" then + UseEquipmentSet(E.private.sle.equip.pvp) + end end if E.private.sle.equip.pvp ~= "NONE" then @@ -32,7 +48,9 @@ local function Equip(event) local _, localizedName, isActive = GetWorldPVPAreaInfo(i) if (GetRealZoneText() == localizedName and isActive) then - UseEquipmentSet(E.private.sle.equip.pvp) + if equipSet ~= E.private.sle.equip.pvp then + UseEquipmentSet(E.private.sle.equip.pvp) + end end end end -- 1.7.9.5