Quantcast

Cleaned up some stuff and now gem and enchant warning icons are resizable.

Repooc [02-24-14 - 20:01]
Cleaned up some stuff and now gem and enchant warning icons are resizable.
Filename
ElvUI_SLE/config/profile.lua
ElvUI_SLE/modules/characterframe/characterframe.lua
ElvUI_SLE/modules/characterframe/core.lua
ElvUI_SLE/modules/characterframe/options.lua
diff --git a/ElvUI_SLE/config/profile.lua b/ElvUI_SLE/config/profile.lua
index b0f9839..87bcbe3 100755
--- a/ElvUI_SLE/config/profile.lua
+++ b/ElvUI_SLE/config/profile.lua
@@ -77,9 +77,11 @@ P['sle'] = {
 		},
 		['itemenchant'] = {
 			['enable'] = true,
-			["font"] = "ElvUI Font",
-			["fontSize"] = 12,
-			["fontOutline"] = "OUTLINE",
+			['font'] = "ElvUI Font",
+			['fontSize'] = 12,
+			['fontOutline'] = "OUTLINE",
+			['showwarning'] = true,
+			['warningSize'] = 12,
 		},
 		['itemgem'] = {
 			['enable'] = true,
diff --git a/ElvUI_SLE/modules/characterframe/characterframe.lua b/ElvUI_SLE/modules/characterframe/characterframe.lua
index e9d86ed..b08eb7c 100755
--- a/ElvUI_SLE/modules/characterframe/characterframe.lua
+++ b/ElvUI_SLE/modules/characterframe/characterframe.lua
@@ -2,7 +2,7 @@ local E, L, V, P, G, _ = unpack(ElvUI);
 local CFO = E:NewModule('CharacterFrameOptions', 'AceEvent-3.0');

 local f = CreateFrame('Frame', 'KnightArmory', PaperDollFrame)
-local C = KnightFrame_Armory_Constants
+local C = SLArmoryConstants

 local function GemSocket_OnClick(self, button)
 	self = self:GetParent()
@@ -102,7 +102,7 @@ local function CreateArmoryFrame(self)
 			-- 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)
 			Slot.EnchantWarning = CreateFrame('Button', nil, Slot)
-			Slot.EnchantWarning:Size(12)
+			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.tga')
@@ -183,23 +183,11 @@ local function CreateArmoryFrame(self)
 	CreateArmoryFrame = nil
 end

---function CFO:ResizeErrorIcon(IconSize)
---	local Slot
---	for _, slotName in pairs(KnightFrame_Armory_Constants.GearList) do
---		if slotName ~= 'ShirtSlot' and slotName ~= 'TabardSlot' then
-		--Slot = KnightArmory.slotName
-		--print(IconSize)
---		f[slotName].SocketWarning:Size(IconSize)
-		--Slot.EnchantWarning:Size(IconSize)
-	--	end
-	--end
---end
-
-function CFO:ResizeErrorIcon(IconSize)
+function CFO:ResizeErrorIcon()
 	for _, slotName in pairs(C.GearList) do
 		if slotName ~= 'ShirtSlot' and slotName ~= 'TabardSlot' then
-			f[slotName].SocketWarning:Size(IconSize)
-			--f[slotName].EnchantWarning:Size(IconSize)
+			f[slotName].SocketWarning:Size(E.db.sle.characterframeoptions.itemgem.warningSize)
+			f[slotName].EnchantWarning:Size(E.db.sle.characterframeoptions.itemenchant.warningSize)
 		end
 	end
 end
diff --git a/ElvUI_SLE/modules/characterframe/core.lua b/ElvUI_SLE/modules/characterframe/core.lua
index 7ebf5e6..900b91f 100644
--- a/ElvUI_SLE/modules/characterframe/core.lua
+++ b/ElvUI_SLE/modules/characterframe/core.lua
@@ -1,7 +1,7 @@
 local E, L, V, P, G, _  = unpack(ElvUI)

 -- Constants
-KnightFrame_Armory_Constants = {
+SLArmoryConstants = {
 	['ItemLevelKey'] = ITEM_LEVEL:gsub('%%d', '(.+)'),
 	['EnchantKey'] = ENCHANTED_TOOLTIP_LINE:gsub('%%s', '(.+)'),
 	['ItemSetBonusKey'] = ITEM_SET_BONUS:gsub('%%s', '(.+)'),
@@ -179,7 +179,7 @@ KnightFrame_Armory_Constants = {
 				_G[buttonName].CheckButton:Point('CENTER', _G[buttonName].CheckButtonBG)
 				_G[buttonName].CheckButton:SetTexture('Interface\\Buttons\\UI-CheckBox-Check')

-				KnightFrame_Armory_Constants.Toolkit.TextSetting(_G[buttonName], buttonText, fontInfo, 'LEFT', _G[buttonName].CheckButtonBG, 'RIGHT', 6, 0)
+				SLArmoryConstants.Toolkit.TextSetting(_G[buttonName], buttonText, fontInfo, 'LEFT', _G[buttonName].CheckButtonBG, 'RIGHT', 6, 0)

 				_G[buttonName].hover = _G[buttonName]:CreateTexture(nil, 'HIGHLIGHT')
 				_G[buttonName].hover:SetTexture('Interface\\Buttons\\UI-CheckBox-Highlight')
diff --git a/ElvUI_SLE/modules/characterframe/options.lua b/ElvUI_SLE/modules/characterframe/options.lua
index 76e5060..93a5963 100755
--- a/ElvUI_SLE/modules/characterframe/options.lua
+++ b/ElvUI_SLE/modules/characterframe/options.lua
@@ -45,6 +45,7 @@ local function configTable()
 						type = 'toggle',
 						name = L["Show Error Highlight"],
 						desc = L["Highlights equipment slot if an error has been found."],
+						--disabled = function() return not E.private.sle.characterframeoptions.enable or not E.db.sle.characterframeoptions.equipmentgradient end,
 						get = function(info) return E.db.sle.characterframeoptions.missingnotice end,
 						set = function(info, value) E.db.sle.characterframeoptions.missingnotice = value; CFO:ArmoryFrame_DataSetting(); end,
 					},
@@ -239,6 +240,31 @@ local function configTable()
 							},
 						},
 					},
+					warningGroup = {
+						order = 3,
+						type = 'group',
+						guiInline = true,
+						--disabled = function () return not E.db.sle.characterframeoptions.itemenchant.enable end,
+						name = L['Enchant Warning'],
+						args = {
+							showwarning = {
+								order = 1,
+								type = "toggle",
+								name = L["Show Enchant Warning"],
+								get = function(info) return E.db.sle.characterframeoptions.itemenchant.showwarning end,
+								set = function(info, value) E.db.sle.characterframeoptions.itemenchant.showwarning = value; --[[CFO:ArmoryFrame_DataSetting();]] end,
+							},
+							warningsize = {
+								order = 2,
+								name = L["Warning Size"],
+								desc = L["Set the icon size that the warning notification will use."],
+								type = "range",
+								min = 8, max = 18, step = 1,
+								get = function(info) return E.db.sle.characterframeoptions.itemenchant.warningSize end,
+								set = function(info, value) E.db.sle.characterframeoptions.itemenchant.warningSize = value; CFO:ResizeErrorIcon(); end,
+							},
+						},
+					},
 				},
 			},
 			itemgem = {
@@ -256,7 +282,7 @@ local function configTable()
 						get = function(info) return E.db.sle.characterframeoptions.itemgem.enable end,
 						set = function(info, value) E.db.sle.characterframeoptions.itemgem.enable = value; --[[CFO:ToggleCFO()]] end,
 					},
-					gemwarningGroup = {
+					warningGroup = {
 						order = 2,
 						type = 'group',
 						guiInline = true,
@@ -277,7 +303,7 @@ local function configTable()
 								type = "range",
 								min = 8, max = 18, step = 1,
 								get = function(info) return E.db.sle.characterframeoptions.itemgem.warningSize end,
-								set = function(info, value) E.db.sle.characterframeoptions.itemgem.warningSize = value; CFO:ResizeErrorIcon(value); end,
+								set = function(info, value) E.db.sle.characterframeoptions.itemgem.warningSize = value; CFO:ResizeErrorIcon(); end,
 							},
 						},
 					},