Quantcast

Some additions to font changing

Darthpred [07-13-14 - 02:35]
Some additions to font changing
Filename
ElvUI_SLE/core/core.lua
ElvUI_SLE/defaults/private.lua
ElvUI_SLE/options/media_c.lua
diff --git a/ElvUI_SLE/core/core.lua b/ElvUI_SLE/core/core.lua
index 44f0106..a3bd729 100644
--- a/ElvUI_SLE/core/core.lua
+++ b/ElvUI_SLE/core/core.lua
@@ -63,15 +63,27 @@ local function CheckIncompatible()
 	end
 end

+local subOff
+
+local function ZoneTextPos()
+    if ( PVPInfoTextString:GetText() == "" ) then
+        SubZoneTextString:SetPoint("TOP", "ZoneTextString", "BOTTOM", 0, -subOff);
+    else
+        SubZoneTextString:SetPoint("TOP", "PVPInfoTextString", "BOTTOM", 0, -subOff);
+    end
+end
+
 local function SetFonts()
-	local zoneFont = LSM:Fetch('font', E.global.sle.fonts.zone.font)
-	local zoneSize = E.global.sle.fonts.zone.size
-	local zoneOutline = E.global.sle.fonts.zone.outline
-	local subzoneFont = LSM:Fetch('font', E.global.sle.fonts.subzone.font)
-	local subzoneSize = E.global.sle.fonts.subzone.size
-	local subzoneOutline = E.global.sle.fonts.subzone.outline
-	ZoneTextString:SetFont(zoneFont, zoneSize, zoneOutline)
-	SubZoneTextString:SetFont(subzoneFont, subzoneSize, subzoneOutline)
+	local db = E.global.sle.fonts
+
+	ZoneTextString:SetFont(LSM:Fetch('font', db.zone.font), db.zone.size, db.zone.outline)
+	PVPInfoTextString:SetFont(LSM:Fetch('font', db.pvp.font), db.pvp.size, db.pvp.outline)
+	PVPArenaTextString:SetFont(LSM:Fetch('font', db.pvp.font), db.pvp.size, db.pvp.outline)
+	SubZoneTextString:SetFont(LSM:Fetch('font', db.subzone.font), db.subzone.size, db.subzone.outline)
+
+	--Dat is like experiment, don't touch--
+	subOff = db.subzone.offset
+	hooksecurefunc("SetZoneText", ZoneTextPos)
 end

 function SLE:Initialize()
diff --git a/ElvUI_SLE/defaults/private.lua b/ElvUI_SLE/defaults/private.lua
index e19dc31..24917e4 100644
--- a/ElvUI_SLE/defaults/private.lua
+++ b/ElvUI_SLE/defaults/private.lua
@@ -83,6 +83,12 @@ G['sle'] = {
 			['font'] = "ElvUI Font",
 			['size'] = 25,
 			['outline'] = "OUTLINE",
+			['offset'] = 0,
+		},
+		['pvp'] = {
+			['font'] = "ElvUI Font",
+			['size'] = 22,
+			['outline'] = "OUTLINE",
 		},
 	},
 }
\ No newline at end of file
diff --git a/ElvUI_SLE/options/media_c.lua b/ElvUI_SLE/options/media_c.lua
index 6b5dc2e..634fe5f 100644
--- a/ElvUI_SLE/options/media_c.lua
+++ b/ElvUI_SLE/options/media_c.lua
@@ -112,6 +112,54 @@ E.Options.args.sle.args.media = {
 								['THICKOUTLINE'] = 'THICKOUTLINE',
 							},
 						},
+						offset = {
+							order = 4,
+							name = L["Offset"],
+							type = "range",
+							min = 0, max = 30, step = 1,
+							get = function(info) return E.global.sle.fonts.subzone.offset end,
+							set = function(info, value) E.global.sle.fonts.subzone.offset = value; E:StaticPopup_Show("GLOBAL_RL") end,
+						},
+					},
+				},
+				pvpstatus = {
+					type = "group",
+					name = "PvP Status Text",
+					order = 5,
+					guiInline = true,
+					disabled = function() return not E.global.sle.fonts.enable end,
+					args = {
+						font = {
+							type = "select", dialogControl = 'LSM30_Font',
+							order = 1,
+							name = L["Default Font"],
+							values = AceGUIWidgetLSMlists.font,
+							get = function(info) return E.global.sle.fonts.pvp.font end,
+							set = function(info, value) E.global.sle.fonts.pvp.font = value; E:StaticPopup_Show("GLOBAL_RL") end,
+						},
+						size = {
+							order = 2,
+							name = L["Font Size"],
+							type = "range",
+							min = 6, max = 48, step = 1,
+							get = function(info) return E.global.sle.fonts.pvp.size end,
+							set = function(info, value) E.global.sle.fonts.pvp.size = value; E:StaticPopup_Show("GLOBAL_RL") end,
+						},
+						outline = {
+							order = 3,
+							name = L["Font Outline"],
+							desc = L["Set the font outline."],
+							type = "select",
+							get = function(info) return E.global.sle.fonts.pvp.outline end,
+							set = function(info, value) E.global.sle.fonts.pvp.outline = value; E:StaticPopup_Show("GLOBAL_RL") end,
+							values = {
+								['NONE'] = L['None'],
+								['OUTLINE'] = 'OUTLINE',
+
+								['MONOCHROMEOUTLINE'] = 'MONOCROMEOUTLINE',
+								['THICKOUTLINE'] = 'THICKOUTLINE',
+							},
+						},
 					},
 				},
 			},