Quantcast

Show/Hide Durability & Item Level Added

Repooc [03-04-14 - 00:16]
Show/Hide Durability & Item Level Added
Filename
ElvUI_SLE/config/profile.lua
ElvUI_SLE/locales/english.lua
ElvUI_SLE/locales/russian.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 138607d..1512739 100755
--- a/ElvUI_SLE/config/profile.lua
+++ b/ElvUI_SLE/config/profile.lua
@@ -69,14 +69,16 @@ P['sle'] = {
 			['custom'] = "",
 		},
 		['itemlevel'] = {
-			["font"] = "ElvUI Pixel",
-			["fontSize"] = 10,
-			["fontOutline"] = "OUTLINE",
+			['show'] = true,
+			['font'] = "ElvUI Pixel",
+			['fontSize'] = 10,
+			['fontOutline'] = "OUTLINE",
 		},
 		['itemdurability'] = {
-			["font"] = "ElvUI Pixel",
-			["fontSize"] = 10,
-			["fontOutline"] = "OUTLINE",
+			['show'] = true,
+			['font'] = "ElvUI Pixel",
+			['fontSize'] = 10,
+			['fontOutline'] = "OUTLINE",
 		},
 		['itemenchant'] = {
 			['show'] = true,
diff --git a/ElvUI_SLE/locales/english.lua b/ElvUI_SLE/locales/english.lua
index c6f0696..3f04a49 100755
--- a/ElvUI_SLE/locales/english.lua
+++ b/ElvUI_SLE/locales/english.lua
@@ -83,8 +83,10 @@ L["Set the font outline that the item level will use."] = true
 L["The font that the item durability will use."] = true
 L["Set the font size that the item durability will use."] = true
 L["Set the font outline that the item durability will use."] = true
-L["Enchanting"] = true
-L["Show Enchant Text"] = true
+L["Enchanting"] = true
+L["Show Durability"] = true
+L["Show Enchants"] = true
+L["Show Item Level"] = true
 L["Show the enchantment effect near the enchanted item"] = true
 L["Show the enchantment effect near the enchanted item (not the item itself) when mousing over."] = true
 L["Show Warning"] = true
diff --git a/ElvUI_SLE/locales/russian.lua b/ElvUI_SLE/locales/russian.lua
index 4c1d35e..1b2038a 100755
--- a/ElvUI_SLE/locales/russian.lua
+++ b/ElvUI_SLE/locales/russian.lua
@@ -84,7 +84,7 @@ L["The font that the item durability will use."] = "Шрифт прочност
 L["Set the font size that the item durability will use."] = "Размер шрифта прочности предметов."
 L["Set the font outline that the item durability will use."] = "Граница шрифта прочности предметов."
 L["Enchanting"] = "Зачарование"
-L["Show Enchant Text"] = "Текст чар"
+L["Show Enchant"] = "Текст чар"
 L["Show the enchantment effect near the enchanted item (not the item itself) when mousing over."] = "Показывать эффект чар около предмета при наведении курсора в ту область."
 L["Show the enchantment effect near the enchanted item"] = "Показывать наложенные чары рядом с предметом"
 L["Show Warning"] = "Предупреждения"
diff --git a/ElvUI_SLE/modules/characterframe/characterframe.lua b/ElvUI_SLE/modules/characterframe/characterframe.lua
index 213a909..6eba9c0 100755
--- a/ElvUI_SLE/modules/characterframe/characterframe.lua
+++ b/ElvUI_SLE/modules/characterframe/characterframe.lua
@@ -383,17 +383,22 @@ function CFO:ArmoryFrame_DataSetting()
 							ItemUpgradeID = TrueItemLevel - BasicItemLevel
 						end
 					end
-					Slot.ItemLevel:FontTemplate(LSM:Fetch("font", E.db.sle.characterframeoptions.itemlevel.font), E.db.sle.characterframeoptions.itemlevel.fontSize, E.db.sle.characterframeoptions.itemlevel.fontOutline)
-					Slot.ItemLevel:SetText((Slot.Direction == 'LEFT' and TrueItemLevel or '')..(ItemUpgradeID and (Slot.Direction == 'LEFT' and ' ' or '')..(C.UpgradeColor[ItemUpgradeID] or '|cffaaaaaa')..'(+'..ItemUpgradeID..')|r'..(Slot.Direction == 'RIGHT' and ' ' or '') or '')..(Slot.Direction == 'RIGHT' and TrueItemLevel or ''))
+					if E.db.sle.characterframeoptions.itemlevel.show ~= false then
+						Slot.ItemLevel:FontTemplate(LSM:Fetch("font", E.db.sle.characterframeoptions.itemlevel.font), E.db.sle.characterframeoptions.itemlevel.fontSize, E.db.sle.characterframeoptions.itemlevel.fontOutline)
+						Slot.ItemLevel:SetText((Slot.Direction == 'LEFT' and TrueItemLevel or '')..(ItemUpgradeID and (Slot.Direction == 'LEFT' and ' ' or '')..(C.UpgradeColor[ItemUpgradeID] or '|cffaaaaaa')..'(+'..ItemUpgradeID..')|r'..(Slot.Direction == 'RIGHT' and ' ' or '') or '')..(Slot.Direction == 'RIGHT' and TrueItemLevel or ''))
+					end
 				end

 				--<< Durability Parts >>--
 				CurrentDurability, MaxDurability = GetInventoryItemDurability(Slot.ID)
 				if CurrentDurability and MaxDurability then
-					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)
+					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
diff --git a/ElvUI_SLE/modules/characterframe/options.lua b/ElvUI_SLE/modules/characterframe/options.lua
index cb00e3d..6081d98 100755
--- a/ElvUI_SLE/modules/characterframe/options.lua
+++ b/ElvUI_SLE/modules/characterframe/options.lua
@@ -95,82 +95,111 @@ local function configTable()
 				guiInline = true,
 				disabled = function() return not E.private.sle.characterframeoptions.enable end,
 				args = {
-					font = {
-						type = "select", dialogControl = 'LSM30_Font',
-						order = 1,
-						--name = L["Fonts"],
-						name = L["Font"],
-						desc = L["The font that the item level will use."],
-						values = AceGUIWidgetLSMlists.font,
-						get = function(info) return E.db.sle.characterframeoptions.itemlevel.font end,
-						set = function(info, value) E.db.sle.characterframeoptions.itemlevel.font = value; CFO:ArmoryFrame_DataSetting(); end,
-					},
-					fontSize = {
-						order = 2,
-						name = L["Font Size"],
-						desc = L["Set the font size that the item level will use."],
-						type = "range",
-						min = 6, max = 22, step = 1,
-						get = function(info) return E.db.sle.characterframeoptions.itemlevel.fontSize end,
-						set = function(info, value) E.db.sle.characterframeoptions.itemlevel.fontSize = value; CFO:ArmoryFrame_DataSetting(); end,
-					},
-					fontOutline = {
+					show = {
 						order = 3,
-						name = L["Font Outline"],
-						desc = L["Set the font outline that the item level will use."],
-						type = "select",
-						values = {
-							['NONE'] = L['None'],
-							['OUTLINE'] = 'OUTLINE',
-							['MONOCHROME'] = 'MONOCHROME',
-							['MONOCHROMEOUTLINE'] = 'MONOCROMEOUTLINE',
-							['THICKOUTLINE'] = 'THICKOUTLINE',
+						type = "toggle",
+						name = L["Show Item Level"],
+						get = function(info) return E.db.sle.characterframeoptions.itemlevel.show end,
+						set = function(info, value) E.db.sle.characterframeoptions.itemlevel.show = value; CFO:ArmoryFrame_DataSetting(); end,
+					},
+					fontGroup = {
+						order = 5,
+						type = 'group',
+						guiInline = true,
+						name = L['Font'],
+						args = {
+							font = {
+								type = "select", dialogControl = 'LSM30_Font',
+								order = 1,
+								--name = L["Fonts"],
+								name = L["Font"],
+								desc = L["The font that the item level will use."],
+								values = AceGUIWidgetLSMlists.font,
+								get = function(info) return E.db.sle.characterframeoptions.itemlevel.font end,
+								set = function(info, value) E.db.sle.characterframeoptions.itemlevel.font = value; CFO:ArmoryFrame_DataSetting(); end,
+							},
+							fontSize = {
+								order = 2,
+								name = L["Font Size"],
+								desc = L["Set the font size that the item level will use."],
+								type = "range",
+								min = 6, max = 22, step = 1,
+								get = function(info) return E.db.sle.characterframeoptions.itemlevel.fontSize end,
+								set = function(info, value) E.db.sle.characterframeoptions.itemlevel.fontSize = value; CFO:ArmoryFrame_DataSetting(); end,
+							},
+							fontOutline = {
+								order = 3,
+								name = L["Font Outline"],
+								desc = L["Set the font outline that the item level will use."],
+								type = "select",
+								values = {
+									['NONE'] = L['None'],
+									['OUTLINE'] = 'OUTLINE',
+									['MONOCHROME'] = 'MONOCHROME',
+									['MONOCHROMEOUTLINE'] = 'MONOCROMEOUTLINE',
+									['THICKOUTLINE'] = 'THICKOUTLINE',
+								},
+								get = function(info) return E.db.sle.characterframeoptions.itemlevel.fontOutline end,
+								set = function(info, value) E.db.sle.characterframeoptions.itemlevel.fontOutline = value; CFO:ArmoryFrame_DataSetting(); end,
+							},
 						},
-						get = function(info) return E.db.sle.characterframeoptions.itemlevel.fontOutline end,
-						set = function(info, value) E.db.sle.characterframeoptions.itemlevel.fontOutline = value; CFO:ArmoryFrame_DataSetting(); end,
 					},
 				},
 			},
 			itemdurabilty = {
 				type = "group",
-				--name = L["Item Durability"],
 				name = DURABILITY,
 				order = 77,
 				guiInline = true,
 				disabled = function() return not E.private.sle.characterframeoptions.enable end,
 				args = {
-					font = {
-						type = "select", dialogControl = 'LSM30_Font',
-						order = 1,
-						name = L["Font"],
-						desc = L["The font that the item durability will use."],
-						values = AceGUIWidgetLSMlists.font,
-						get = function(info) return E.db.sle.characterframeoptions.itemdurability.font end,
-						set = function(info, value) E.db.sle.characterframeoptions.itemdurability.font = value; CFO:ArmoryFrame_DataSetting(); end,
-					},
-					fontSize = {
-						order = 2,
-						name = L["Font Size"],
-						desc = L["Set the font size that the item durability will use."],
-						type = "range",
-						min = 6, max = 22, step = 1,
-						get = function(info) return E.db.sle.characterframeoptions.itemdurability.fontSize end,
-						set = function(info, value) E.db.sle.characterframeoptions.itemdurability.fontSize = value; CFO:ArmoryFrame_DataSetting(); end,
-					},
-					fontOutline = {
+					show = {
 						order = 3,
-						name = L["Font Outline"],
-						desc = L["Set the font outline that the item durability will use."],
-						type = "select",
-						values = {
-							['NONE'] = L['None'],
-							['OUTLINE'] = 'OUTLINE',
-							['MONOCHROME'] = 'MONOCHROME',
-							['MONOCHROMEOUTLINE'] = 'MONOCROMEOUTLINE',
-							['THICKOUTLINE'] = 'THICKOUTLINE',
+						type = "toggle",
+						name = L["Show Durability"],
+						get = function(info) return E.db.sle.characterframeoptions.itemdurability.show end,
+						set = function(info, value) E.db.sle.characterframeoptions.itemdurability.show = value; CFO:ArmoryFrame_DataSetting(); end,
+					},
+					fontGroup = {
+						order = 5,
+						type = 'group',
+						guiInline = true,
+						name = L['Font'],
+						args = {
+							font = {
+								type = "select", dialogControl = 'LSM30_Font',
+								order = 1,
+								name = L["Font"],
+								desc = L["The font that the item durability will use."],
+								values = AceGUIWidgetLSMlists.font,
+								get = function(info) return E.db.sle.characterframeoptions.itemdurability.font end,
+								set = function(info, value) E.db.sle.characterframeoptions.itemdurability.font = value; CFO:ArmoryFrame_DataSetting(); end,
+							},
+							fontSize = {
+								order = 2,
+								name = L["Font Size"],
+								desc = L["Set the font size that the item durability will use."],
+								type = "range",
+								min = 6, max = 22, step = 1,
+								get = function(info) return E.db.sle.characterframeoptions.itemdurability.fontSize end,
+								set = function(info, value) E.db.sle.characterframeoptions.itemdurability.fontSize = value; CFO:ArmoryFrame_DataSetting(); end,
+							},
+							fontOutline = {
+								order = 3,
+								name = L["Font Outline"],
+								desc = L["Set the font outline that the item durability will use."],
+								type = "select",
+								values = {
+									['NONE'] = L['None'],
+									['OUTLINE'] = 'OUTLINE',
+									['MONOCHROME'] = 'MONOCHROME',
+									['MONOCHROMEOUTLINE'] = 'MONOCROMEOUTLINE',
+									['THICKOUTLINE'] = 'THICKOUTLINE',
+								},
+								get = function(info) return E.db.sle.characterframeoptions.itemdurability.fontOutline end,
+								set = function(info, value) E.db.sle.characterframeoptions.itemdurability.fontOutline = value; CFO:ArmoryFrame_DataSetting(); end,
+							},
 						},
-						get = function(info) return E.db.sle.characterframeoptions.itemdurability.fontOutline end,
-						set = function(info, value) E.db.sle.characterframeoptions.itemdurability.fontOutline = value; CFO:ArmoryFrame_DataSetting(); end,
 					},
 				},
 			},
@@ -184,7 +213,7 @@ local function configTable()
 					show = {
 						order = 1,
 						type = "toggle",
-						name = L["Show Enchant Text"],
+						name = L["Show Enchants"],
 						desc = L["Show the enchantment effect near the enchanted item"],
 						get = function(info) return E.db.sle.characterframeoptions.itemenchant.show end,
 						set = function(info, value) E.db.sle.characterframeoptions.itemenchant.show = value; CFO:ArmoryFrame_DataSetting(); end,