Quantcast

Gem hiding. Seems to work

Darthpred [03-06-14 - 11:41]
Gem hiding. Seems to work
Filename
ElvUI_SLE/config/profile.lua
ElvUI_SLE/modules/characterframe/characterframe.lua
ElvUI_SLE/modules/characterframe/options.lua
diff --git a/ElvUI_SLE/config/profile.lua b/ElvUI_SLE/config/profile.lua
index f1031e6..46c28e5 100755
--- a/ElvUI_SLE/config/profile.lua
+++ b/ElvUI_SLE/config/profile.lua
@@ -89,7 +89,8 @@ P['sle'] = {
 			['warningSize'] = 12,
 			['mouseover'] = false,
 		},
-		['itemgem'] = {
+		['itemgem'] = {
+			['show'] = true,
 			['showwarning'] = true,
 			['socketSize'] = 12,
 			['warningSize'] = 12,
diff --git a/ElvUI_SLE/modules/characterframe/characterframe.lua b/ElvUI_SLE/modules/characterframe/characterframe.lua
index 6eba9c0..db24b7b 100755
--- a/ElvUI_SLE/modules/characterframe/characterframe.lua
+++ b/ElvUI_SLE/modules/characterframe/characterframe.lua
@@ -214,7 +214,7 @@ end
 function CFO:ArmoryFrame_DataSetting()
 	if not f:IsVisible() then return end
 	local BGdrop = E.db.sle.characterframeoptions.image.dropdown
-
+	local fuck = true
 	-- Get Player Profession
 	local Prof1, Prof2 = GetProfessions()
 	local Prof1_Level, Prof2_Level = 0, 0
@@ -295,6 +295,7 @@ function CFO:ArmoryFrame_DataSetting()
 					end

 					-- Apply current item's gem setting
+
 					for i = 1, MAX_NUM_SOCKETS do
 						ItemTexture = _G['KnightArmoryScanTT_E1Texture'..i]:GetTexture()
 						GemID = select(i, GetInventoryItemGems(Slot.ID))
@@ -309,10 +310,18 @@ function CFO:ArmoryFrame_DataSetting()
 						end

 						if ItemTexture then
-							Slot['Socket'..i]:Show()
+							if E.db.sle.characterframeoptions.itemgem.show then
+								Slot['Socket'..i]:Show()
+							else
+								Slot['Socket'..i]:Hide()
+							end
 							GemTotal_2 = GemTotal_2 + 1
-							Slot.SocketWarning:Point(Slot.Direction, Slot['Socket'..i], (Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT'), Slot.Direction == 'LEFT' and 3 or -3, 0)
-
+							if E.db.sle.characterframeoptions.itemgem.show then
+								Slot.SocketWarning:Point(Slot.Direction, Slot['Socket'..i], (Slot.Direction == 'LEFT' and 'RIGHT' or 'LEFT'), Slot.Direction == 'LEFT' and 3 or -3, 0)
+							else
+								Slot.SocketWarning:Point(Slot.Direction, Slot['Socket1'], (Slot.Direction == 'LEFT' and 'LEFT' or 'RIGHT'), 0, 0)
+							end
+
 							if GemID then
 								GemCount = GemCount + 1
 								Slot['Socket'..i].Texture:SetTexture(ItemTexture)
@@ -321,6 +330,7 @@ function CFO:ArmoryFrame_DataSetting()
 							end
 						end
 					end
+
 				end

 				_, _, ItemRarity, BasicItemLevel, _, _, _, _, _, ItemTexture = GetItemInfo(ItemLink)
diff --git a/ElvUI_SLE/modules/characterframe/options.lua b/ElvUI_SLE/modules/characterframe/options.lua
index 6081d98..0ce14ef 100755
--- a/ElvUI_SLE/modules/characterframe/options.lua
+++ b/ElvUI_SLE/modules/characterframe/options.lua
@@ -293,15 +293,23 @@ local function configTable()
 				guiInline = true,
 				disabled = function() return not E.private.sle.characterframeoptions.enable end,
 				args = {
-					showwarning = {
+					show = {
 						order = 1,
 						type = "toggle",
+						name = L["Show Gems"],
+						desc = L["Show gem slots near the item"],
+						get = function(info) return E.db.sle.characterframeoptions.itemgem.show end,
+						set = function(info, value) E.db.sle.characterframeoptions.itemgem.show = value; CFO:ArmoryFrame_DataSetting(); end,
+					},
+					showwarning = {
+						order = 2,
+						type = "toggle",
 						name = L["Show Warning"],
 						get = function(info) return E.db.sle.characterframeoptions.itemgem.showwarning end,
 						set = function(info, value) E.db.sle.characterframeoptions.itemgem.showwarning = value; CFO:ArmoryFrame_DataSetting(); end,
 					},
 					warningsize = {
-						order = 2,
+						order = 3,
 						name = L["Warning Size"],
 						desc = L["Set the icon size that the warning notification will use."],
 						type = "range",
@@ -310,7 +318,7 @@ local function configTable()
 						set = function(info, value) E.db.sle.characterframeoptions.itemgem.warningSize = value; CFO:ResizeErrorIcon(); end,
 					},
 					socketsize = {
-						order = 3,
+						order = 4,
 						name = L["Socket Size"],
 						desc = L["Set the size of sockets to show."],
 						type = "range",