Quantcast

Some character frame changes (NOT DONE, DO NOT REPORT ERRORS TO ME... or die bitches)

Repooc [10-13-14 - 04:38]
Some character frame changes (NOT DONE, DO NOT REPORT ERRORS TO ME... or die bitches)

Signed-off-by: Repooc <repooc82@gmail.com>
Filename
ElvUI_SLE/defaults/profile.lua
ElvUI_SLE/media/textures/Gradation.tga
ElvUI_SLE/modules/characterframe/characterframe.lua
ElvUI_SLE/modules/characterframe/core.lua
ElvUI_SLE/options/characterframe_c.lua
diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua
index 6f8c8c1..7c80869 100644
--- a/ElvUI_SLE/defaults/profile.lua
+++ b/ElvUI_SLE/defaults/profile.lua
@@ -73,6 +73,7 @@ P['sle'] = {
 	['characterframeoptions'] = {
 		['shownormalgradient'] = true,
 		['showerrorgradient'] = true,
+		['gradientColor'] = { .41, .83, 1 },
 		['showimage'] = true,
 		['image'] = {
 			['dropdown'] = "SPACE",
diff --git a/ElvUI_SLE/media/textures/Gradation.tga b/ElvUI_SLE/media/textures/Gradation.tga
new file mode 100644
index 0000000..422ce5a
Binary files /dev/null and b/ElvUI_SLE/media/textures/Gradation.tga differ
diff --git a/ElvUI_SLE/modules/characterframe/characterframe.lua b/ElvUI_SLE/modules/characterframe/characterframe.lua
index efd6b01..199792c 100644
--- a/ElvUI_SLE/modules/characterframe/characterframe.lua
+++ b/ElvUI_SLE/modules/characterframe/characterframe.lua
@@ -1,10 +1,10 @@
-local E, L, V, P, G = unpack(ElvUI);
-local CFO = E:GetModule('CharacterFrameOptions');
+local E, L, V, P, G = unpack(ElvUI)
+local CFO = E:GetModule('CharacterFrameOptions')
 local LSM = LibStub("LibSharedMedia-3.0")

-local f = CreateFrame('Frame', 'SLEArmory', PaperDollFrame)
+local CA = CreateFrame('Frame', 'CharacterArmory', PaperDollFrame)
+local SlotIDList = {}
 local C = SLArmoryConstants
-
 local backgrounds = {
 	["SPACE"] = "Space",
 	["ALLIANCE"] = "Alliance-text",
@@ -13,68 +13,195 @@ local backgrounds = {
 	["CASTLE"] = "Castle",
 }

-local function GemSocket_OnClick(self, button)
-	self = self:GetParent()
-
-	if CursorHasItem() then
-		local CursorType, _, ItemLink = GetCursorInfo()
-
-		-- Check cursor item is gem type
-		if CursorType == 'item' and select(6, GetItemInfo(ItemLink)) == select(8, GetAuctionItemClasses()) then
-			SocketInventoryItem(GetInventorySlotInfo(self.slotName))
-			ClickSocketButton(self.socketNumber)
-
-			return
+do --<< Button Script >>--
+	CA.OnEnter = function(self)
+		if self.Link or self.Message then
+			GameTooltip:SetOwner(self, 'ANCHOR_RIGHT')
+
+			self:SetScript('OnUpdate', function()
+				GameTooltip:ClearLines()
+
+				if self.Link then
+					GameTooltip:SetHyperlink(self.Link)
+				end
+
+				if self.Link and self.Message then GameTooltip:AddLine(' ') end -- Line space
+
+				if self.Message then
+					GameTooltip:AddLine(self.Message, 1, 1, 1)
+				end
+
+				GameTooltip:Show()
+			end)
 		end
 	end
-
-	if self.GemItemID then
-		local itemName, itemLink = GetItemInfo(self.GemItemID)
-
-		if not IsShiftKeyDown() then
-			SetItemRef(itemLink, itemLink, 'LeftButton')
-		else
-			if button == 'RightButton' then
+
+	CA.OnLeave = function(self)
+		self:SetScript('OnUpdate', nil)
+		GameTooltip:Hide()
+	end
+
+	CA.GemSocket_OnEnter = function(self)
+		GameTooltip:SetOwner(self, 'ANCHOR_RIGHT')
+
+		local Parent = self:GetParent()
+
+		if Parent.GemItemID then
+			if type(Parent.GemItemID) == 'number' then
+				if GetItemInfo(Parent.GemItemID) then
+					GameTooltip:SetHyperlink(select(2, GetItemInfo(Parent.GemItemID)))
+				else
+					self:SetScript('OnUpdate', function()
+						if GetItemInfo(Parent.GemItemID) then
+							CA.GemSocket_OnEnter(self)
+							self:SetScript('OnUpdate', nil)
+						end
+					end)
+					return
+				end
+			else
+				GameTooltip:ClearLines()
+				GameTooltip:AddLine('|cffffffff'..Parent.GemItemID)
+			end
+		elseif Parent.GemType then
+			GameTooltip:ClearLines()
+			GameTooltip:AddLine('|cffffffff'.._G['EMPTY_SOCKET_'..Parent.GemType])
+		end
+
+		GameTooltip:Show()
+	end
+
+	CA.GemSocket_OnClick = function(self, button)
+		self = self:GetParent()
+
+		if CursorHasItem() then
+			local CursorType, _, ItemLink = GetCursorInfo()
+
+			-- Check cursor item is gem type
+			if CursorType == 'item' and select(6, GetItemInfo(ItemLink)) == select(8, GetAuctionItemClasses()) then
 				SocketInventoryItem(GetInventorySlotInfo(self.slotName))
-			elseif HandleModifiedItemClick(itemLink) then
-			elseif BrowseName and BrowseName:IsVisible() then
-				AuctionFrameBrowse_Reset(BrowseResetButton)
-				BrowseName:SetText(itemName)
-				BrowseName:SetFocus()
+				ClickSocketButton(self.socketNumber)
+
+				return
+			end
+		end
+
+		if self.GemItemID then
+			local itemName, itemLink = GetItemInfo(self.GemItemID)
+
+			if not IsShiftKeyDown() then
+				SetItemRef(itemLink, itemLink, 'LeftButton')
+			else
+				if button == 'RightButton' then
+					SocketInventoryItem(GetInventorySlotInfo(self.slotName))
+				elseif HandleModifiedItemClick(itemLink) then
+				elseif BrowseName and BrowseName:IsVisible() then
+					AuctionFrameBrowse_Reset(BrowseResetButton)
+					BrowseName:SetText(itemName)
+					BrowseName:SetFocus()
+				end
 			end
 		end
 	end
-end
-
-local function GemSocket_OnRecieveDrag(self)
-	self = self:GetParent()
-
-	if CursorHasItem() then
-		local CursorType, _, ItemLink = GetCursorInfo()
-
-		if CursorType == 'item' and select(6, GetItemInfo(ItemLink)) == select(8, GetAuctionItemClasses()) then
-			SocketInventoryItem(GetInventorySlotInfo(self.slotName))
-			ClickSocketButton(self.socketNumber)
+
+	CA.GemSocket_OnRecieveDrag = function(self)
+		self = self:GetParent()
+
+		if CursorHasItem() then
+			local CursorType, _, ItemLink = GetCursorInfo()
+
+			if CursorType == 'item' and select(6, GetItemInfo(ItemLink)) == select(8, GetAuctionItemClasses()) then
+				SocketInventoryItem(GetInventorySlotInfo(self.slotName))
+				ClickSocketButton(self.socketNumber)
+			end
 		end
 	end
 end

-local function CreateArmoryFrame(self)
+function CA:Setup_CharacterArmory()
 	--<< Core >>--
 	self:Point('TOPLEFT', CharacterFrameInset, 10, 20)
 	self:Point('BOTTOMRIGHT', CharacterFrameInsetRight, 'BOTTOMLEFT', -10, 5)

+	--<< Updater >>--
+	local args
+	self:SetScript('OnEvent', function(self, Event, ...)
+		if Event == 'SOCKET_INFO_SUCCESS' or Event == 'ITEM_UPGRADE_MASTER_UPDATE' or Event == 'TRANSMOGRIFY_UPDATE' or Event == 'PLAYER_ENTERING_WORLD' then
+			if Event == 'TRANSMOGRIFY_UPDATE' then
+				print(...)
+			end
+			self.GearUpdated = nil
+			self:SetScript('OnUpdate', self.CharacterArmory_DataSetting)
+		elseif Event == 'UNIT_INVENTORY_CHANGED' then
+			args = ...
+
+			if args == 'player' then
+				self.GearUpdated = nil
+				self:SetScript('OnUpdate', self.CharacterArmory_DataSetting)
+			end
+		elseif Event == 'PLAYER_EQUIPMENT_CHANGED' then
+			args = ...
+
+			self.GearUpdated = type(self.GearUpdated) == 'table' and self.GearUpdated or {}
+			self.GearUpdated[#self.GearUpdated + 1] = SlotIDList[args]
+			self:SetScript('OnUpdate', self.CharacterArmory_DataSetting)
+		elseif Event == 'COMBAT_LOG_EVENT_UNFILTERED' then
+			_, Event, _, _, _, _, _, _, args = ...
+
+			if Event == 'ENCHANT_APPLIED' and args == E.myname then
+				self.GearUpdated = nil
+				self:SetScript('OnUpdate', self.CharacterArmory_DataSetting)
+			end
+		elseif Event == 'UPDATE_INVENTORY_DURABILITY' then
+			self.DurabilityUpdated = nil
+			self:SetScript('OnUpdate', self.CharacterArmory_DataSetting)
+		end
+	end)
+	hooksecurefunc('CharacterFrame_Collapse', function()
+		CharacterFrame:SetWidth(448);
+	end)
+	hooksecurefunc('CharacterFrame_Expand', function()
+		CharacterFrame:SetWidth(650);
+	end)
+	hooksecurefunc('PaperDollFrame_SetLevel', function()
+		CharacterLevelText:SetText('|c'..RAID_CLASS_COLORS[E.myclass].colorStr..CharacterLevelText:GetText())
+
+		--Maybe Adjust Name, Level, Avg iLvL if bliz skinning is off?
+		CharacterFrameTitleText:ClearAllPoints()
+		CharacterFrameTitleText:Point('TOP', self, 'TOP', 0, 0)
+		CharacterFrameTitleText:SetParent(self)
+		CharacterLevelText:ClearAllPoints()
+		CharacterLevelText:SetPoint('TOP', CharacterFrameTitleText, 'BOTTOM', 0, 3)
+		CharacterLevelText:SetParent(self)
+	end)
+	--hooksecurefunc('CharacterFrame_Collapse', function() if Info.CharacterArmory_Activate then CharacterFrame:SetWidth(448) end end)
+	--hooksecurefunc('CharacterFrame_Expand', function() if Info.CharacterArmory_Activate then CharacterFrame:SetWidth(650) end end)
+	--hooksecurefunc('PaperDollFrame_SetLevel', function()
+		--if Info.CharacterArmory_Activate then
+			--CharacterLevelText:SetText('|c'..RAID_CLASS_COLORS[E.myclass].colorStr..CharacterLevelText:GetText())
+
+			--Maybe Adjust Name, Level, Avg iLvL if bliz skinning is off?
+			--CharacterFrameTitleText:ClearAllPoints()
+			--CharacterFrameTitleText:Point('TOP', self, 0, 15)
+			--CharacterFrameTitleText:SetParent(self)
+			--CharacterLevelText:ClearAllPoints()
+			--CharacterLevelText:SetPoint('TOP', CharacterFrameTitleText, 'BOTTOM', 0, -4)
+			--CharacterLevelText:SetParent(self)
+		--end
+	--end)
+
 	--<< Background >>--
 	self.BG = self:CreateTexture(nil, 'BACKGROUND')
 	--self.BG:SetInside()
 	self.BG:SetPoint("TOPLEFT", self, "TOPLEFT", -7, -20)
 	self.BG:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 7, 2)
+	CFO:UpdateCharacterBG()

 	--<< Change Model Frame's frameLevel >>--
 	CharacterModelFrame:SetFrameLevel(self:GetFrameLevel() + 2)

 	--<< Average Item Level >>--
-	C.Toolkit.TextSetting(self, nil, { ['Tag'] = 'AverageItemLevel', ['FontSize'] = 12, }, 'TOP', CharacterLevelText, 'BOTTOM', 0, 3)
+	C.Toolkit.TextSetting(self, nil, { Tag = 'AverageItemLevel', FontSize = 12, }, 'TOP', CharacterLevelText, 'BOTTOM', 0, 3)
 	local function ValueColorUpdate()
 		self.AverageItemLevel:SetText(C.Toolkit.Color_Value(L['Average'])..': '..format('%.2f', select(2, GetAverageItemLevel())))
 	end
@@ -100,28 +227,28 @@ local function CreateArmoryFrame(self)
 		Slot.Gradation:SetTexture('Interface\\AddOns\\ElvUI_SLE\\media\\textures\\Gradation')

 		if Slot.Direction == 'LEFT' then
-			Slot.Gradation:SetTexCoord(0, .5, 0, .5)
+			Slot.Gradation:SetTexCoord(0, 1, 0, 1)
 		else
-			Slot.Gradation:SetTexCoord(.5, 1, 0, .5)
+			Slot.Gradation:SetTexCoord(1, 0, 0, 1)
 		end

 		if slotName ~= 'ShirtSlot' and slotName ~= 'TabardSlot' then
 			-- Item Level
-			C.Toolkit.TextSetting(Slot, nil, { ['Tag'] = 'ItemLevel', ['FontSize'] = 10, ['directionH'] = Slot.Direction, }, 'TOP'..Slot.Direction, _G['Character'..slotName], 'TOP'..(Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT'), Slot.Direction == 'LEFT' and 2 or -2, -1)
+			C.Toolkit.TextSetting(Slot, nil, { Tag = 'ItemLevel', FontSize = 10, directionH = Slot.Direction, }, 'TOP'..Slot.Direction, _G['Character'..slotName], 'TOP'..(Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT'), Slot.Direction == 'LEFT' and 2 or -2, -1)

 			-- Enchantment Name
-			C.Toolkit.TextSetting(Slot, nil, { ['Tag'] = 'ItemEnchant', ['FontSize'] = 8, ['directionH'] = Slot.Direction, }, Slot.Direction, _G['Character'..slotName], Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT', Slot.Direction == 'LEFT' and 2 or -2, 1)
+			C.Toolkit.TextSetting(Slot, nil, { Tag = 'ItemEnchant', FontSize = 8, directionH = Slot.Direction, }, Slot.Direction, _G['Character'..slotName], Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT', Slot.Direction == 'LEFT' and 2 or -2, 1)
 			Slot.EnchantWarning = CreateFrame('Button', nil, Slot)
 			Slot.EnchantWarning:Size(E.db.sle.characterframeoptions.itemenchant.warningSize)
 			Slot.EnchantWarning.Texture = Slot.EnchantWarning:CreateTexture(nil, 'OVERLAY')
 			Slot.EnchantWarning.Texture:SetInside()
 			Slot.EnchantWarning.Texture:SetTexture('Interface\\AddOns\\ElvUI_SLE\\media\\textures\\Warning-Small')
 			Slot.EnchantWarning:Point(Slot.Direction, Slot.ItemEnchant, Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT', Slot.Direction == 'LEFT' and 3 or -3, 0)
-			Slot.EnchantWarning:SetScript('OnEnter', C.CommonScript.OnEnter)
-			Slot.EnchantWarning:SetScript('OnLeave', C.CommonScript.OnLeave)
+			Slot.EnchantWarning:SetScript('OnEnter', self.OnEnter)
+			Slot.EnchantWarning:SetScript('OnLeave', self.OnLeave)

 			-- Durability
-			C.Toolkit.TextSetting(Slot, nil, { ['Tag'] = 'Durability', ['FontSize'] = 10, ['directionH'] = Slot.Direction, }, 'BOTTOM'..Slot.Direction, _G['Character'..slotName], 'BOTTOM'..(Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT'), Slot.Direction == 'LEFT' and 2 or -2, 3)
+			C.Toolkit.TextSetting(Slot, nil, { Tag = 'Durability', FontSize = 10, directionH = Slot.Direction, }, 'BOTTOM'..Slot.Direction, _G['Character'..slotName], 'BOTTOM'..(Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT'), Slot.Direction == 'LEFT' and 2 or -2, 3)

 			-- Gem Socket
 			for i = 1, MAX_NUM_SOCKETS do
@@ -150,10 +277,10 @@ local function CreateArmoryFrame(self)
 				Slot['Socket'..i].Socket:SetInside()
 				Slot['Socket'..i].Socket:SetFrameLevel(Slot['Socket'..i]:GetFrameLevel() + 1)
 				Slot['Socket'..i].Socket:RegisterForClicks('AnyUp')
-				Slot['Socket'..i].Socket:SetScript('OnEnter', C.CommonScript.OnEnter)
-				Slot['Socket'..i].Socket:SetScript('OnLeave', C.CommonScript.OnLeave)
-				Slot['Socket'..i].Socket:SetScript('OnClick', GemSocket_OnClick)
-				Slot['Socket'..i].Socket:SetScript('OnReceiveDrag', GemSocket_OnRecieveDrag)
+				Slot['Socket'..i].Socket:SetScript('OnEnter', self.OnEnter)
+				Slot['Socket'..i].Socket:SetScript('OnLeave', self.OnLeave)
+				Slot['Socket'..i].Socket:SetScript('OnClick', self.GemSocket_OnClick)
+				Slot['Socket'..i].Socket:SetScript('OnReceiveDrag', self.GemSocket_OnRecieveDrag)

 				Slot['Socket'..i].Texture = Slot['Socket'..i].Socket:CreateTexture(nil, 'OVERLAY')
 				Slot['Socket'..i].Texture:SetTexCoord(.1, .9, .1, .9)
@@ -169,85 +296,109 @@ local function CreateArmoryFrame(self)
 			Slot.SocketWarning.Texture = Slot.SocketWarning:CreateTexture(nil, 'OVERLAY')
 			Slot.SocketWarning.Texture:SetInside()
 			Slot.SocketWarning.Texture:SetTexture('Interface\\AddOns\\ElvUI_SLE\\media\\textures\\Warning-Small')
-			Slot.SocketWarning:SetScript('OnEnter', C.CommonScript.OnEnter)
-			Slot.SocketWarning:SetScript('OnLeave', C.CommonScript.OnLeave)
+			Slot.SocketWarning:SetScript('OnEnter', self.OnEnter)
+			Slot.SocketWarning:SetScript('OnLeave', self.OnLeave)
 		end

+		SlotIDList[Slot.ID] = slotName
 		self[slotName] = Slot
 	end

 	-- GameTooltip for counting gem sockets and getting enchant effects
-	self.ScanTTForEnchanting1 = CreateFrame('GameTooltip', 'SLEArmoryScanTT_E1', nil, 'GameTooltipTemplate')
-	self.ScanTTForEnchanting1:SetOwner(UIParent, 'ANCHOR_NONE')
-
-	-- GameTooltip for checking that texture in tooltip is socket texture
-	self.ScanTTForEnchanting2 = CreateFrame('GameTooltip', 'SLEArmoryScanTT_E2', nil, 'GameTooltipTemplate')
-	self.ScanTTForEnchanting2:SetOwner(UIParent, 'ANCHOR_NONE')
+	self.ScanTT = CreateFrame('GameTooltip', 'SLE_CharacterArmory_ScanTT', nil, 'GameTooltipTemplate')
+	self.ScanTT:SetOwner(UIParent, 'ANCHOR_NONE')

 	-- For resizing paper doll frame when it toggled.
 	self.ChangeCharacterFrameWidth = CreateFrame('Frame')
 	self.ChangeCharacterFrameWidth:SetScript('OnShow', function()
 		if PaperDollFrame:IsVisible() then
-			CFO:ArmoryFrame_DataSetting()
+			self:CharacterArmory_DataSetting()
 		end
 	end)

-	CreateArmoryFrame = nil
+	self.Setup_CharacterArmory = nil
 end

-function CFO:ChangeGradiantVisibility()
-	for _, slotName in pairs(C.GearList) do
-		if E.db.sle.characterframeoptions.shownormalgradient ~= false then
-			f[slotName].Gradation:Show()
-		else
-			f[slotName].Gradation:Hide()
-		end
+local needUpdate
+function CA:CharacterArmory_DataSetting()
+	if not self:IsVisible() then return end
+
+	needUpdate = nil
+
+	if not self.DurabilityUpdated then
+		needUpdate = self:Update_Durability() or needUpdate
+	end
+
+	if self.GearUpdated ~= true then
+		needUpdate = self:Update_Gear() or needUpdate
+	end
+
+	if not needUpdate then
+		self:SetScript('OnUpdate', nil)
 	end
 end

-function CFO:ResizeErrorIcon()
+function CA:Update_Durability()
+	local Slot, r, g, b, CurrentDurability, MaxDurability
+
 	for _, slotName in pairs(C.GearList) do
-		if slotName ~= 'ShirtSlot' and slotName ~= 'TabardSlot' then
-			f[slotName].SocketWarning:Size(E.db.sle.characterframeoptions.itemgem.warningSize)
-			f[slotName].EnchantWarning:Size(E.db.sle.characterframeoptions.itemenchant.warningSize)
-			for i = 1, MAX_NUM_SOCKETS do
-				f[slotName]['Socket'..i]:Size(E.db.sle.characterframeoptions.itemgem.socketSize)
+		Slot = self[slotName]
+		CurrentDurability, MaxDurability = GetInventoryItemDurability(Slot.ID)
+
+		if CurrentDurability and MaxDurability then
+			if E.db.sle.characterframeoptions.itemdurability.show ~= false then
+				r, g, b = E:ColorGradient((CurrentDurability / MaxDurability), 1, 0, 0, 1, 1, 0, 0, 1, 0)
+				Slot.Durability:SetFormattedText("%s%.0f%%|r", E:RGBToHex(r, g, b), (CurrentDurability / MaxDurability) * 100)
+				Slot.Socket1:Point('BOTTOM'..Slot.Direction, Slot.Durability, 'BOTTOM'..(Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT'), Slot.Direction == 'LEFT' and 3 or -3, -2)
 			end
+		elseif Slot.Durability then
+			Slot.Durability:SetText('')
+			Slot.Socket1:Point('BOTTOM'..Slot.Direction, _G['Character'..slotName], 'BOTTOM'..(Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT'), Slot.Direction == 'LEFT' and 3 or -3, 3)
 		end
 	end
+
+	self.DurabilityUpdated = true
 end

-function CFO:ArmoryFrame_DataSetting()
-	if not f:IsVisible() then return end
+function CA:ClearTooltip(tooltip)
+	local tooltipName = tooltip:GetName()

-	local BGdrop = E.db.sle.characterframeoptions.image.dropdown
+	tooltip:ClearLines()
+	for i = 1, 10 do
+		_G[tooltipName..'Texture'..i]:SetTexture(nil)
+		_G[tooltipName..'Texture'..i]:ClearAllPoints()
+		_G[tooltipName..'Texture'..i]:Point('TOPLEFT', tooltip)
+	end
+end

+function CA:Update_Gear()
+	--if not CA:IsVisible() then return end
+	print("yep")
 	-- Get Player Profession
 	local Prof1, Prof2 = GetProfessions()
 	local Prof1_Level, Prof2_Level = 0, 0
-	CFO.PlayerProfession = {}
+	self.PlayerProfession = {}

 	if Prof1 then Prof1, _, Prof1_Level = GetProfessionInfo(Prof1) end
 	if Prof2 then Prof2, _, Prof2_Level = GetProfessionInfo(Prof2) end
-	if Prof1 and C.ProfessionList[Prof1] then CFO.PlayerProfession[(C.ProfessionList[Prof1].Key)] = Prof1_Level end
-	if Prof2 and C.ProfessionList[Prof2] then CFO.PlayerProfession[(C.ProfessionList[Prof2].Key)] = Prof2_Level end
+	if Prof1 and C.ProfessionList[Prof1] then self.PlayerProfession[(C.ProfessionList[Prof1].Key)] = Prof1_Level end
+	if Prof2 and C.ProfessionList[Prof2] then self.PlayerProfession[(C.ProfessionList[Prof2].Key)] = Prof2_Level end

-	local ErrorDetected
+	local ErrorDetected, needUpdate, needUpdateList
 	local r, g, b
-	local Slot, ItemLink, ItemRarity, BasicItemLevel, TrueItemLevel, ItemUpgradeID, ItemTexture, IsEnchanted, UsableEffect, CurrentLineText, GemID, GemTotal_1, GemTotal_2, GemCount, CurrentDurability, MaxDurability
-	local arg1, itemID, enchantID, _, _, _, _, arg2, arg3, arg4, arg5, arg6
+	local Slot, ItemLink, ItemData, ItemRarity, BasicItemLevel, TrueItemLevel, ItemUpgradeID, ItemTexture, IsEnchanted, UsableEffect, CurrentLineText, GemID, GemCount_Default, GemCount_Enable, GemCount_Now, GemCount

-	for _, slotName in pairs(C.GearList) do
+	for _, slotName in pairs(self.GearUpdated or C.GearList) do
 		if not (slotName == 'ShirtSlot' or slotName == 'TabardSlot') then
-			Slot = f[slotName]
-			Slot:EnableMouse(true)
+			Slot = self[slotName]
+			ItemLink = GetInventoryItemLink('player', Slot.ID)
+			--Slot:EnableMouse(true)

 			do --<< Clear Setting >>--
-				ErrorDetected, TrueItemLevel, IsEnchanted, UsableEffect, ItemRarity, ItemUpgradeID, ItemTexture = nil, nil, nil, nil, nil, nil, nil
+				needUpdate, ErrorDetected, TrueItemLevel, IsEnchanted, UsableEffect, ItemUpgradeID, ItemTexture = nil, nil, nil, nil, nil, nil, nil

 				Slot.ItemLevel:SetText(nil)
 				Slot.ItemEnchant:SetText(nil)
-				Slot.Durability:SetText('')
 				for i = 1, MAX_NUM_SOCKETS do
 					Slot['Socket'..i].Texture:SetTexture(nil)
 					Slot['Socket'..i].Socket.Link = nil
@@ -256,56 +407,56 @@ function CFO:ArmoryFrame_DataSetting()
 					Slot['Socket'..i]:Hide()
 				end

-				Slot.Socket1:Point('BOTTOM'..Slot.Direction, _G['Character'..slotName], 'BOTTOM'..(Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT'), Slot.Direction == 'LEFT' and 3 or -3, 0)
+				--Slot.Socket1:Point('BOTTOM'..Slot.Direction, _G['Character'..slotName], 'BOTTOM'..(Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT'), Slot.Direction == 'LEFT' and 3 or -3, 0)
 				Slot.EnchantWarning:Hide()
 				Slot.EnchantWarning.Message = nil
 				Slot.SocketWarning:Point(Slot.Direction, Slot.Socket1)
 				Slot.SocketWarning:Hide()
 				Slot.SocketWarning.Link = nil
 				Slot.SocketWarning.Message = nil
-
-				f.ScanTTForEnchanting1:ClearLines()
-				f.ScanTTForEnchanting2:ClearLines()
-				for i = 1, 10 do
-					_G['SLEArmoryScanTT_E1Texture'..i]:SetTexture(nil)
-					_G['SLEArmoryScanTT_E2Texture'..i]:SetTexture(nil)
-				end
 			end

-			ItemLink = GetInventoryItemLink('player', Slot.ID)
-
 			if ItemLink then
 				do --<< Gem Parts >>--
-					arg1, itemID, enchantID, _, _, _, _, arg2, arg3, arg4, arg5, arg6 = strsplit(':', ItemLink)
+					ItemData = { strsplit(':', ItemLink) }
+					ItemData[4], ItemData[5], ItemData[6], ItemData[7] = 0, 0, 0, 0

-					f.ScanTTForEnchanting1:SetInventoryItem('player', Slot.ID)
-					f.ScanTTForEnchanting2:SetHyperlink(format('%s:%s:%d:0:0:0:0:%s:%s:%s:%s:%s', arg1, itemID, enchantID, arg2, arg3, arg4, arg5, arg6))
+					for i = 1, #ItemData do
+						ItemData.FixedLink = (ItemData.FixedLink and ItemData.FixedLink..':' or '')..ItemData[i]
+					end
+
+					self:ClearTooltip(self.ScanTT)
+					self.ScanTT:SetHyperlink(ItemData.FixedLink)

-					GemTotal_1, GemTotal_2, GemCount = 0, 0, 0
+					GemCount_Default, GemCount_Now, GemCount = 0, 0, 0

 					-- First, Counting default gem sockets
 					for i = 1, MAX_NUM_SOCKETS do
-						ItemTexture = _G['SLEArmoryScanTT_E2Texture'..i]:GetTexture()
+						ItemTexture = _G['SLE_CharacterArmory_ScanTTTexture'..i]:GetTexture()

 						if ItemTexture and ItemTexture:find('Interface\\ItemSocketingFrame\\') then
-							GemTotal_1 = GemTotal_1 + 1
-							Slot['Socket'..GemTotal_1].GemType = strupper(gsub(ItemTexture, 'Interface\\ItemSocketingFrame\\UI--EmptySocket--', ''))
+							GemCount_Default = GemCount_Default + 1
+							Slot['Socket'..GemCount_Default].GemType = strupper(gsub(ItemTexture, 'Interface\\ItemSocketingFrame\\UI--EmptySocket--', ''))
 						end
 					end

 					-- Second, Check if slot's item enable to adding a socket
+					GemCount_Enable = GemCount_Default
 					if (slotName == 'WaistSlot' and UnitLevel('player') >= 70) or -- buckle
-						((slotName == 'WristSlot' or slotName == 'HandsSlot') and CFO.PlayerProfession.BlackSmithing and CFO.PlayerProfession.BlackSmithing >= 550) then -- BlackSmith
+						((slotName == 'WristSlot' or slotName == 'HandsSlot') and self.PlayerProfession.BlackSmithing and self.PlayerProfession.BlackSmithing >= 550) then -- BlackSmith

-						GemTotal_1 = GemTotal_1 + 1
-						Slot['Socket'..GemTotal_1].GemType = 'PRISMATIC'
+						GemCount_Enable = GemCount_Enable + 1
+						Slot['Socket'..GemCount_Enable].GemType = 'PRISMATIC'
 					end

+					self:ClearTooltip(self.ScanTT)
+					self.ScanTT:SetInventoryItem('player', Slot.ID)
+
 					-- Apply current item's gem setting
 					for i = 1, MAX_NUM_SOCKETS do
-						ItemTexture = _G['SLEArmoryScanTT_E1Texture'..i]:GetTexture()
+						ItemTexture = _G['SLE_CharacterArmory_ScanTTTexture'..i]:GetTexture()
 						GemID = select(i, GetInventoryItemGems(Slot.ID))
-
+
 						if Slot['Socket'..i].GemType and C.GemColor[Slot['Socket'..i].GemType] then
 							r, g, b = unpack(C.GemColor[Slot['Socket'..i].GemType])
 							Slot['Socket'..i].Socket:SetBackdropColor(r, g, b, .5)
@@ -315,7 +466,7 @@ function CFO:ArmoryFrame_DataSetting()
 							Slot['Socket'..i].Socket:SetBackdropBorderColor(1, 1, 1)
 						end

-						if ItemTexture then
+						if ItemTexture or GemID then
 							if E.db.sle.characterframeoptions.itemgem.show then
 								Slot['Socket'..i]:Show()
 								Slot.SocketWarning:Point(Slot.Direction, Slot['Socket'..i], (Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT'), Slot.Direction == 'LEFT' and 3 or -3, 0)
@@ -323,27 +474,38 @@ function CFO:ArmoryFrame_DataSetting()
 								Slot['Socket'..i]:Hide()
 								Slot.SocketWarning:Point(Slot.Direction, Slot['Socket1'], (Slot.Direction == 'LEFT' and 'LEFT' or 'RIGHT'), 0, 0)
 							end
-							GemTotal_2 = GemTotal_2 + 1
+
+							GemCount_Now = GemCount_Now + 1

 							if GemID then
 								GemCount = GemCount + 1
-								Slot['Socket'..i].Texture:SetTexture(ItemTexture)
 								Slot['Socket'..i].GemItemID = GemID
-								Slot['Socket'..i].Socket.Link = select(2, GetItemInfo(GemID))
+
+								_, Slot['Socket'..i].Socket.Link, _, _, _, _, _, _, _, ItemTexture = GetItemInfo(GemID)
+
+								if ItemTexture then
+									Slot['Socket'..i].Texture:SetTexture(ItemTexture)
+								else
+									needUpdate = true
+								end
 							end
 						end
 					end
+
+					--print(slotName..' : ', GemCount_Default, GemCount_Enable, GemCount_Now, GemCount)
+					if GemCount_Now < GemCount_Default then -- ItemInfo not loaded
+						needUpdate = true
+					end
 				end

 				_, _, ItemRarity, BasicItemLevel, _, _, _, _, _, ItemTexture = GetItemInfo(ItemLink)
-				--print(ItemRarity, ItemLink)
-				if ItemRarity == nil then return end
 				r, g, b = GetItemQualityColor(ItemRarity)

 				ItemUpgradeID = ItemLink:match(':(%d+)\124h%[')

-				for i = 1, f.ScanTTForEnchanting1:NumLines() do
-					CurrentLineText = _G['SLEArmoryScanTT_E1TextLeft'..i]:GetText()
+				--<< Enchant Parts >>--
+				for i = 1, self.ScanTT:NumLines() do
+					CurrentLineText = _G['SLE_CharacterArmory_ScanTTTextLeft'..i]:GetText()

 					if CurrentLineText:find(C.ItemLevelKey_Alt) then
 						TrueItemLevel = tonumber(CurrentLineText:match(C.ItemLevelKey_Alt))
@@ -390,9 +552,9 @@ function CFO:ArmoryFrame_DataSetting()
 						if ItemUpgradeID == '0' then
 							ItemUpgradeID = nil
 						else
-							if not C.ItemUpgrade[ItemUpgradeID] then
-								print('New Upgrade ID |cffceff00['..ItemUpgradeID..']|r : |cffceff00'..(TrueItemLevel - BasicItemLevel))
-							end
+							--if not C.ItemUpgrade[ItemUpgradeID] then
+								--print('New Upgrade ID |cffceff00['..ItemUpgradeID..']|r : |cffceff00'..(TrueItemLevel - BasicItemLevel))
+							--end

 							ItemUpgradeID = TrueItemLevel - BasicItemLevel
 						end
@@ -403,19 +565,7 @@ function CFO:ArmoryFrame_DataSetting()
 					end
 				end

-				--<< Durability Parts >>--
-				CurrentDurability, MaxDurability = GetInventoryItemDurability(Slot.ID)
-				if CurrentDurability and MaxDurability then
-					if E.db.sle.characterframeoptions.itemdurability.show ~= false then
-						--Slot.Durability:Show()
-						r, g, b = E:ColorGradient((CurrentDurability / MaxDurability), 1, 0, 0, 1, 1, 0, 0, 1, 0)
-						Slot.Durability:FontTemplate(LSM:Fetch("font", E.db.sle.characterframeoptions.itemdurability.font), E.db.sle.characterframeoptions.itemdurability.fontSize, E.db.sle.characterframeoptions.itemdurability.fontOutline)
-						Slot.Durability:SetFormattedText("%s%.0f%%|r", E:RGBToHex(r, g, b), (CurrentDurability / MaxDurability) * 100)
-						Slot.Socket1:Point('BOTTOM'..Slot.Direction, Slot.Durability, 'BOTTOM'..(Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT'), Slot.Direction == 'LEFT' and 3 or -3, -3)
-					end
-				end
-
-				-- Check Error
+				--[[ Check Error
 				if (not IsEnchanted and C.EnchantableSlots[slotName]) or ((slotName == 'Finger0Slot' or slotName == 'Finger1Slot') and CFO.PlayerProfession.Enchanting and CFO.PlayerProfession.Enchanting >= 550 and not IsEnchanted) then
 					ErrorDetected = true
 					if E.db.sle.characterframeoptions.itemenchant.showwarning ~= false then
@@ -507,40 +657,69 @@ function CFO:ArmoryFrame_DataSetting()
 							end
 						end)
 					end
-				end
+				end]]
 			end

 			-- Change Gradation
-			if ErrorDetected and E.db.sle.characterframeoptions.showerrorgradient ~= false then
-				if Slot.Direction == 'LEFT' then
-					Slot.Gradation:SetTexCoord(0, .5, .5, 1)
-				else
-					Slot.Gradation:SetTexCoord(.5, 1, .5, 1)
-				end
+			if ErrorDetected and E.db.sle.characterframeoptions.showerrorgradient then
+				Slot.Gradation:SetVertexColor(1, 0, 0)
 			else
-				if Slot.Direction == 'LEFT' then
-					Slot.Gradation:SetTexCoord(0, .5, 0, .5)
-				else
-					Slot.Gradation:SetTexCoord(.5, 1, 0, .5)
-				end
+				Slot.Gradation:SetVertexColor(unpack(E.db.sle.characterframeoptions.gradientColor))
+			end
+
+			if needUpdate then
+				needUpdateList = needUpdateList or {}
+				needUpdateList[#needUpdateList + 1] = slotName
 			end
 		end
 	end
-
+
+	self.AverageItemLevel:SetText(C.Toolkit.Color_Value(STAT_AVERAGE_ITEM_LEVEL)..': '..format('%.2f', select(2, GetAverageItemLevel())))
+
+	if needUpdateList then
+		self.GearUpdated = needUpdateList
+		return true
+	end
+
+	self.GearUpdated = true
+end
+
+function CFO:UpdateCharacterBG()
+	local BGdrop = E.db.sle.characterframeoptions.image.dropdown
 	if E.db.sle.characterframeoptions.showimage ~= false then
 		if BGdrop ~= "CUSTOM" then
-			f.BG:SetTexture('Interface\\AddOns\\ElvUI_SLE\\media\\textures\\'..backgrounds[BGdrop])
+			CA.BG:SetTexture('Interface\\AddOns\\ElvUI_SLE\\media\\textures\\'..backgrounds[BGdrop])
 		else
-			f.BG:SetTexture(E.db.sle.characterframeoptions.image.custom)
+			CA.BG:SetTexture(E.db.sle.characterframeoptions.image.custom)
 		end
 	else
-		f.BG:SetTexture(nil);
+		CA.BG:SetTexture(nil);
 	end
-
-	f.AverageItemLevel:SetText(C.Toolkit.Color_Value(L['Average'])..': '..format('%.2f', select(2, GetAverageItemLevel())))
 end

-function CFO:StartArmoryFrame()
+function CFO:ChangeGradiantVisibility()
+	for _, slotName in pairs(C.GearList) do
+		if E.db.sle.characterframeoptions.shownormalgradient ~= false then
+			CA[slotName].Gradation:Show()
+		else
+			CA[slotName].Gradation:Hide()
+		end
+	end
+end
+
+function CFO:ResizeErrorIcon()
+	for _, slotName in pairs(C.GearList) do
+		if slotName ~= 'ShirtSlot' and slotName ~= 'TabardSlot' then
+			CA[slotName].SocketWarning:Size(E.db.sle.characterframeoptions.itemgem.warningSize)
+			CA[slotName].EnchantWarning:Size(E.db.sle.characterframeoptions.itemenchant.warningSize)
+			for i = 1, MAX_NUM_SOCKETS do
+				CA[slotName]['Socket'..i]:Size(E.db.sle.characterframeoptions.itemgem.socketSize)
+			end
+		end
+	end
+end
+
+function CA:StartArmoryFrame()
 	-- Setting frame
 	CharacterFrame:SetHeight(444)
 	CharacterFrameInsetRight:SetPoint('TOPLEFT', CharacterFrameInset, 'TOPRIGHT', 110, 0)
@@ -564,24 +743,35 @@ function CFO:StartArmoryFrame()
 	CharacterModelFrameControlFrame:ClearAllPoints()
 	CharacterModelFrameControlFrame:SetPoint('BOTTOM', CharacterModelFrame, 'BOTTOM', -1.5, 1)

-	if CreateArmoryFrame then
-		CreateArmoryFrame(SLEArmory)
+	if CA.Setup_CharacterArmory then
+		CA:Setup_CharacterArmory()
+	else
+		CA:Show()
 	end
-	CFO:ArmoryFrame_DataSetting()
+	CA:CharacterArmory_DataSetting()

-	-- Run ArmoryMode
-	CFO:RegisterEvent('SOCKET_INFO_SUCCESS', 'ArmoryFrame_DataSetting')
+	-- Run SLE CharacterArmoryMode
+	--[[CFO:RegisterEvent('SOCKET_INFO_SUCCESS', 'ArmoryFrame_DataSetting')
 	CFO:RegisterEvent('PLAYER_EQUIPMENT_CHANGED', 'ArmoryFrame_DataSetting')
 	CFO:RegisterEvent('PLAYER_ENTERING_WORLD', 'ArmoryFrame_DataSetting')
 	CFO:RegisterEvent('UNIT_INVENTORY_CHANGED', 'ArmoryFrame_DataSetting')
 	CFO:RegisterEvent('EQUIPMENT_SWAP_FINISHED', 'ArmoryFrame_DataSetting')
 	CFO:RegisterEvent('UPDATE_INVENTORY_DURABILITY', 'ArmoryFrame_DataSetting')
 	CFO:RegisterEvent('ITEM_UPGRADE_MASTER_UPDATE', 'ArmoryFrame_DataSetting')
+	]]
+	CA:RegisterEvent('SOCKET_INFO_SUCCESS')
+	CA:RegisterEvent('PLAYER_EQUIPMENT_CHANGED')
+	CA:RegisterEvent('UNIT_INVENTORY_CHANGED')
+	CA:RegisterEvent('ITEM_UPGRADE_MASTER_UPDATE')
+	CA:RegisterEvent('TRANSMOGRIFY_UPDATE')
+	CA:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
+	CA:RegisterEvent('UPDATE_INVENTORY_DURABILITY')
+	CA:RegisterEvent('PLAYER_ENTERING_WORLD')

 	-- For frame resizing
-	f.ChangeCharacterFrameWidth:SetParent(PaperDollFrame)
+	CA.ChangeCharacterFrameWidth:SetParent(PaperDollFrame)
 	if PaperDollFrame:IsVisible() then
-		f.ChangeCharacterFrameWidth:Show()
+		CA.ChangeCharacterFrameWidth:Show()
 		CharacterFrame:SetWidth(CharacterFrameInsetRight:IsShown() and 650 or 448)
 	end
 end
@@ -589,69 +779,7 @@ end
 function CFO:Initialize()
 	if not E.private.sle.characterframeoptions.enable then return end

-	--[[if IsInGuild() then
-		f.ngt2 = CreateFrame("CheckButton", "nil", CharacterFrame, "SpellBookSkillLineTabTemplate")
-		f.ngt2:Show()
-		f.ngt2.tooltip = GUILD
-		f.ngt2:SetPoint("TOPLEFT", CharacterFrame, "TOPLEFT", 8, -10)
-		f.ngt2:StripTextures()
-		f.ngt2:CreateBackdrop()
-		--f.ngt2:SetSize(46, 46)
-		if GetGuildTabardFileNames() then
-			print("hihi")
-			f.ngt2:SetNormalTexture("Interface\\SpellBook\\GuildSpellbooktabBG")
-			f.ngt2:GetNormalTexture():SetTexCoord(.1, .9, .1, .9)
-			f.ngt2.TabardEmblem:Show()
-			f.ngt2.TabardIconFrame:Show()
-			SetLargeGuildTabardTextures("player", f.ngt2.TabardEmblem, f.ngt2:GetNormalTexture(), f.ngt2.TabardIconFrame)
-
-			--local emblemSize, columns, offset, emblemTexture
-			--emblemTexture = f.ngt2.TabardEmblem
-			--if (emblemTexture) then
-			--	emblemSize = 64 / 1024;
-			--	columns = 16
-			--	offset = 0;
-			--	emblemTexture:SetTexture("Interface\\GuildFrame\\GuildEmblemsLG_01");
-			--end
-			--SetGuildTabardTextures(emblemSize, columns, offset, "player", emblemTexture, f.ngt2:GetNormalTexture(), f.ngt2.TabardIconFrame)
-		else
-			f.ngt2:SetNormalTexture("Interface\\GuildFrame\\GuildLogo-NoLogo")
-		end
-	end]]

-	hooksecurefunc('CharacterFrame_Collapse', function()
-		CharacterFrame:SetWidth(448);
-	end)
-	hooksecurefunc('CharacterFrame_Expand', function()
-		CharacterFrame:SetWidth(650);
-	end)
-
-	hooksecurefunc('PaperDollFrame_SetLevel', function()
-		--[[local primaryTalentTree = GetSpecialization()
-		local classDisplayName, class = UnitClass("player")
-		local classColorString = RAID_CLASS_COLORS[class].colorStr
-		local PLAYER_LEVEL = "|c%s%s %s %s %s|r"
-		local PLAYER_LEVEL_NO_SPEC = "|c%s%s %s %s|r"
-		if (primaryTalentTree) then
-			local _, specName = GetSpecializationInfo(primaryTalentTree);
-		end
-
-		if (specName and specName ~= "") then
-			CharacterLevelText:SetFormattedText(PLAYER_LEVEL, classColorString, LEVEL, UnitLevel("player"), specName, classDisplayName);
-		else
-			CharacterLevelText:SetFormattedText(PLAYER_LEVEL_NO_SPEC, classColorString, LEVEL, UnitLevel("player"), classDisplayName);
-		end]]
-
-		CharacterLevelText:SetText('|c'..RAID_CLASS_COLORS[E.myclass].colorStr..CharacterLevelText:GetText())
-
-		--Maybe Adjust Name, Level, Avg iLvL if bliz skinning is off?
-		CharacterFrameTitleText:ClearAllPoints()
-		CharacterFrameTitleText:Point('TOP', f, 'TOP', 0, 0)
-		CharacterFrameTitleText:SetParent(f)
-		CharacterLevelText:ClearAllPoints()
-		CharacterLevelText:SetPoint('TOP', CharacterFrameTitleText, 'BOTTOM', 0, 3)
-		CharacterLevelText:SetParent(f)
-	end)

-	CFO:StartArmoryFrame()
+	CA:StartArmoryFrame()
 end
\ No newline at end of file
diff --git a/ElvUI_SLE/modules/characterframe/core.lua b/ElvUI_SLE/modules/characterframe/core.lua
index ea98c40..305706e 100644
--- a/ElvUI_SLE/modules/characterframe/core.lua
+++ b/ElvUI_SLE/modules/characterframe/core.lua
@@ -7,31 +7,27 @@ SLArmoryConstants = {
 	['EnchantKey'] = ENCHANTED_TOOLTIP_LINE:gsub('%%s', '(.+)'),
 	['ItemSetBonusKey'] = ITEM_SET_BONUS:gsub('%%s', '(.+)'),
 	['TransmogrifiedKey'] = TRANSMOGRIFIED:gsub('%%s', '(.+)'),
-
 	['GearList'] = {
 		'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
 	},
-
 	['UpgradeColor'] = {
 		[16] = '|cffff9614', [12] = '|cfff88ef4', [8] = '|cff2eb7e4', [4] = '|cffceff00'
 	},
-
 	['GemColor'] = {
 		['RED'] = { 1, .2, .2, }, ['YELLOW'] = { .97, .82, .29, }, ['BLUE'] = { .47, .67, 1, }
 	},
-
 	['EmptySocketString'] = {
 		[EMPTY_SOCKET_BLUE] = true, [EMPTY_SOCKET_COGWHEEL] = true, [EMPTY_SOCKET_HYDRAULIC] = true, [EMPTY_SOCKET_META] = true,
 		[EMPTY_SOCKET_NO_COLOR] = true, [EMPTY_SOCKET_PRISMATIC] = true, [EMPTY_SOCKET_RED] = true, [EMPTY_SOCKET_YELLOW] = true
 	},
-
+	--171 per Darth can we trust him? lol
 	['ItemUpgrade'] = {
 		['0'] = 0, ['1'] = 8,
+		['171'] = 0,
 		['373'] = 4, ['374'] = 8, ['375'] = 4, ['376'] = 4, ['377'] = 4, ['379'] = 4, ['380'] = 4,
 		['445'] = 0, ['446'] = 4, ['447'] = 8, ['451'] = 0, ['452'] = 8, ['453'] = 0, ['454'] = 4,
 		['455'] = 8, ['456'] = 0, ['457'] = 8, ['458'] = 0, ['459'] = 4, ['460'] = 8, ['461'] = 12,
@@ -40,28 +36,25 @@ SLArmoryConstants = {
 		['491'] = 0, ['492'] = 4, ['493'] = 8, ['494'] = 0, ['495'] = 4, ['496'] = 8, ['497'] = 12, ['498'] = 16,
 		['504'] = 12, ['505'] = 16, ['506'] = 20, ['507'] = 24,
 	},
-
 	['ItemBindString'] = { -- Usually transmogrify string is located upper than bind string so we need to check this string for adding a transmogrify string in tooltip.
-			[ITEM_BIND_ON_EQUIP] = true,
-			[ITEM_BIND_ON_PICKUP] = true,
-			[ITEM_BIND_TO_ACCOUNT] = true,
-			[ITEM_BIND_TO_BNETACCOUNT] = true
-		},
-
+		[ITEM_BIND_ON_EQUIP] = true,
+		[ITEM_BIND_ON_PICKUP] = true,
+		[ITEM_BIND_TO_ACCOUNT] = true,
+		[ITEM_BIND_TO_BNETACCOUNT] = true
+	},
 	['CanTransmogrifySlot'] = {
-			['HeadSlot'] = true,
-			['ShoulderSlot'] = true,
-			['BackSlot'] = true,
-			['ChestSlot'] = true,
-			['WristSlot'] = true,
-			['HandsSlot'] = true,
-			['WaistSlot'] = true,
-			['LegsSlot'] = true,
-			['FeetSlot'] = true,
-			['MainHandSlot'] = true,
-			['SecondaryHandSlot'] = true
-		},
-
+		['HeadSlot'] = true,
+		['ShoulderSlot'] = true,
+		['BackSlot'] = true,
+		['ChestSlot'] = true,
+		['WristSlot'] = true,
+		['HandsSlot'] = true,
+		['WaistSlot'] = true,
+		['LegsSlot'] = true,
+		['FeetSlot'] = true,
+		['MainHandSlot'] = true,
+		['SecondaryHandSlot'] = true
+	},
 	['ItemEnchant_Profession_Inscription'] = {
 		['NeedLevel'] = 600,
 		['4912'] = true, -- ?? ?? ????			Secret Ox Horn Inscription
@@ -69,7 +62,6 @@ SLArmoryConstants = {
 		['4914'] = true, -- ?? ??? ?? ????	Secret Tiger Claw Inscription
 		['4915'] = true, -- ?? ??? ??? ????	Secret Tiger Fang Inscription
 	},
-
 	['ItemEnchant_Profession_LeatherWorking'] = {
 		['NeedLevel'] = 575,
 		['4875'] = true, -- ?? ?? - ?				Fur Lining - Strength
@@ -77,16 +69,13 @@ SLArmoryConstants = {
 		['4878'] = true, -- ?? ?? - ??			Fur Lining - Stamina
 		['4879'] = true, -- ?? ?? - ???			Fur Lining - Agility
 	},
-
 	['ItemEnchant_Profession_Tailoring'] = {
 		['NeedLevel'] = 550,
 		['4892'] = true, -- ??? ??					Lightweave Embroidery
 		['4893'] = true, -- ??? ??					Darkglow Embroidery
 		['4894'] = true, -- ?? ??					Swordguard Embroidery
 	},
-
 	['ProfessionList'] = {},
-
 	['CommonScript'] = {
 		['OnEnter'] = function(self)
 			if self.Link or self.Message then
@@ -167,7 +156,6 @@ SLArmoryConstants = {
 			end
 		end,
 	},
-
 	['Toolkit'] = {
 		['Color_Value'] = function(InputText)
 			return E:RGBToHex(E.media.rgbvaluecolor[1], E.media.rgbvaluecolor[2], E.media.rgbvaluecolor[3])..(InputText and InputText..'|r' or '')
@@ -195,12 +183,12 @@ SLArmoryConstants = {

 				self = self.text
 			end
-
+
 			self:FontTemplate(Style.Font and LibStub('LibSharedMedia-3.0'):Fetch('font', Style.Font), Style.FontSize, Style.FontOutline)
 			self:SetJustifyH(Style.directionH or 'CENTER')
 			self:SetJustifyV(Style.directionV or 'MIDDLE')
 			self:SetText(Text)
-
+
 			if ... then
 				self:Point(...)
 			else
@@ -261,6 +249,7 @@ for ProfessionSkillID, Key in pairs({
 	[102161] = 'Mining',
 	[102216] = 'Skinning'
 })
+
 do
 	local ProfessionName, _, ProfessionTexture = GetSpellInfo(ProfessionSkillID)

@@ -330,7 +319,6 @@ _, L['Spec_Warlock_Affliction'] = GetSpecializationInfoByID(265)
 _, L['Spec_Warlock_Demonology'] = GetSpecializationInfoByID(266)
 _, L['Spec_Warlock_Destruction'] = GetSpecializationInfoByID(267)

-
 SLArmoryConstants['ClassRole'] = {
 	['WARRIOR'] = {
 		[L['Spec_Warrior_Arms']] = {		--무기
diff --git a/ElvUI_SLE/options/characterframe_c.lua b/ElvUI_SLE/options/characterframe_c.lua
index cb5290a..3908910 100644
--- a/ElvUI_SLE/options/characterframe_c.lua
+++ b/ElvUI_SLE/options/characterframe_c.lua
@@ -64,7 +64,7 @@ local function configTable()
 								type = 'toggle',
 								name = L["Show Background Image"],
 								get = function(info) return E.db.sle.characterframeoptions.showimage end,
-								set = function(info, value) E.db.sle.characterframeoptions.showimage = value; CFO:ArmoryFrame_DataSetting(); end,
+								set = function(info, value) E.db.sle.characterframeoptions.showimage = value; CFO:UpdateCharacterBG(); end,
 							},
 							dropdown = {
 								type = 'select',
@@ -81,7 +81,7 @@ local function configTable()
 								},
 								get = function() return E.db.sle.characterframeoptions.image.dropdown end,
 								set = function(_, value)
-									E.db.sle.characterframeoptions.image.dropdown = value; CFO:ArmoryFrame_DataSetting();
+									E.db.sle.characterframeoptions.image.dropdown = value; CFO:UpdateCharacterBG();
 								end,

 							},