Quantcast

Change weapon detection

Darthpred [09-09-16 - 14:02]
Change weapon detection
Filename
ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua
ElvUI_SLE/modules/Armory/Constants.lua
ElvUI_SLE/modules/Armory/InspectArmory/InspectArmory.lua
diff --git a/ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua b/ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua
index d5ae4d9..7bda9f3 100644
--- a/ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua
+++ b/ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua
@@ -679,8 +679,10 @@ function CA:Update_Gear()
 					if E.db.sle.Armory.Character.NoticeMissing ~= false then
 						if not Slot.IsEnchanted and Info.Armory_Constants.EnchantableSlots[SlotName] then
 							local isValid = false
-							local isWeapon = (ItemType == "INVTYPE_WEAPONOFFHAND" or ItemType == "INVTYPE_WEAPON" or ItemType == "INVTYPE_2HWEAPON")
-							if (isWeapon and (TrueItemLevel and TrueItemLevel <= 750)) or (SlotName ~= 'SecondaryHandSlot' and not isWeapon) then
+							local isWeapon = Info.Armory_Constants.WeaponTypes[ItemType]
+							local isArtifact = (ItemRarity == 6)
+							-- print(isArtifact, ItemRarity)
+							if (isWeapon and not isArtifact) or (SlotName ~= 'SecondaryHandSlot' and not isWeapon) then
 								isValid = true
 							end
 							if isValid then
diff --git a/ElvUI_SLE/modules/Armory/Constants.lua b/ElvUI_SLE/modules/Armory/Constants.lua
index fb3d327..76e9abf 100644
--- a/ElvUI_SLE/modules/Armory/Constants.lua
+++ b/ElvUI_SLE/modules/Armory/Constants.lua
@@ -15,10 +15,20 @@ Info.Armory_Constants = {
 		'HeadSlot', 'HandsSlot', 'NeckSlot', 'WaistSlot', 'ShoulderSlot', 'LegsSlot', 'BackSlot', 'FeetSlot', 'ChestSlot', 'Finger0Slot',
 		'ShirtSlot', 'Finger1Slot', 'TabardSlot', 'Trinket0Slot', 'WristSlot', 'Trinket1Slot', 'SecondaryHandSlot', 'MainHandSlot'
 	},
-
+
 	EnchantableSlots = {
 		NeckSlot = true, BackSlot = true, Finger0Slot = true, Finger1Slot = true, MainHandSlot = true, SecondaryHandSlot = true,
 	},
+
+	WeaponTypes = {
+		["INVTYPE_WEAPON"] = true,
+		["INVTYPE_2HWEAPON"] = true,
+		["INVTYPE_WEAPONMAINHAND"] = true,
+		["INVTYPE_WEAPONOFFHAND"] = true,
+		["INVTYPE_RANGEDRIGHT"] = true,
+		["INVTYPE_RANGED"] = true,
+		["INVTYPE_THROWN"] = true,
+	},

 	UpgradeColor = {
 		[16] = '|cffff9614',
diff --git a/ElvUI_SLE/modules/Armory/InspectArmory/InspectArmory.lua b/ElvUI_SLE/modules/Armory/InspectArmory/InspectArmory.lua
index 1dda985..e4c296a 100644
--- a/ElvUI_SLE/modules/Armory/InspectArmory/InspectArmory.lua
+++ b/ElvUI_SLE/modules/Armory/InspectArmory/InspectArmory.lua
@@ -1923,8 +1923,9 @@ function IA:InspectFrame_DataSetting(DataTable)
 						if E.db.sle.Armory.Inspect.NoticeMissing ~= false then
 							if not Slot.IsEnchanted and Info.Armory_Constants.EnchantableSlots[SlotName] and Slot.Gradation.ItemEnchant then
 								local isValid = false
-								local isWeapon = (ItemType == "INVTYPE_WEAPONOFFHAND" or ItemType == "INVTYPE_WEAPON" or ItemType == "INVTYPE_2HWEAPON")
-								if (isWeapon and (TrueItemLevel and TrueItemLevel <= 750)) or (SlotName ~= 'SecondaryHandSlot' and not isWeapon) then
+								local isWeapon = Info.Armory_Constants.WeaponTypes[ItemType]
+								local isArtifact = (ItemRarity == 6)
+								if (isWeapon and not isArtifact) or (SlotName ~= 'SecondaryHandSlot' and not isWeapon) then
 									isValid = true
 								end
 								if isValid then