Quantcast

New options for afk

Darthpred [08-29-16 - 07:12]
New options for afk
Filename
ElvUI_SLE/defaults/profile.lua
ElvUI_SLE/locales/english.lua
ElvUI_SLE/locales/russian.lua
ElvUI_SLE/modules/afk.lua
ElvUI_SLE/options/afk_c.lua
diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua
index 93e1a94..8c741f5 100644
--- a/ElvUI_SLE/defaults/profile.lua
+++ b/ElvUI_SLE/defaults/profile.lua
@@ -603,18 +603,28 @@ P["sle"] = {
 				["font"] = "PT Sans Narrow",
 				["size"] = 15,
 				["outline"] = "OUTLINE",
+				["xOffset"] = 0,
+				["yOffset"] = 0,
 			},
 			["player"] = {
 				["font"] = "PT Sans Narrow",
 				["size"] = 15,
 				["outline"] = "OUTLINE",
+				["xOffset"] = 0,
+				["yOffset"] = 0,
 			},
 			["tips"] = {
 				["font"] = "PT Sans Narrow",
 				["size"] = 20,
 				["outline"] = "OUTLINE",
 			},
-			["crest"] = 128,
+			["crest"] = {
+				["size"] = 128,
+				["xOffset_faction"] = 0,
+				["yOffset_faction"] = 0,
+				["xOffset_race"] = 0,
+				["yOffset_race"] = 0,
+			},
 			["xpack"] = 150,
 			["height"] = 135,
 			["playermodel"] = {
diff --git a/ElvUI_SLE/locales/english.lua b/ElvUI_SLE/locales/english.lua
index 0a337a6..bf2fc62 100644
--- a/ElvUI_SLE/locales/english.lua
+++ b/ElvUI_SLE/locales/english.lua
@@ -187,7 +187,16 @@ L["SLE_TIPS"] = { --This doesn't need to be translated, every locale can has own
 L["Enable S&L's additional features for AFK screen."] = true
 L["Button restrictions"] = true
 L["Use ElvUI's restrictions for button presses."] = true
-L["Crest Size"] = true
+L["Crest"] = true
+L["Faction Crest X-Offset"] = true
+L["Faction Crest Y-Offset"] = true
+L["Race Crest X-Offset"] = true
+L["Race Crest Y-Offset"] = true
+L["Texts Positions"] = true
+L["Date X-Offset"] = true
+L["Date Y-Offset"] = true
+L["Player Info X-Offset"] = true
+L["Player Info Y-Offset"] = true
 L["X-Pack Logo Size"] = true
 L["Template"] = true
 L["Player Model"] = true
diff --git a/ElvUI_SLE/locales/russian.lua b/ElvUI_SLE/locales/russian.lua
index 6869223..816827b 100644
--- a/ElvUI_SLE/locales/russian.lua
+++ b/ElvUI_SLE/locales/russian.lua
@@ -182,7 +182,16 @@ L["SLE_TIPS"] = { --This doesn't need to be translated, every locale can has own
 L["Enable S&L's additional features for AFK screen."] = "Активировать дополнительные опции для режима АФК."
 L["Button restrictions"] = "Ограничения клавиш"
 L["Use ElvUI's restrictions for button presses."] = "Использовать ограничения Elv'а на нажатия клавиш."
-L["Crest Size"] = "Размер герба"
+L["Crest"] = "Герб"
+L["Faction Crest X-Offset"] = "Отступ по X герба фракции"
+L["Faction Crest Y-Offset"] = "Отступ по Y герба фракции"
+L["Race Crest X-Offset"] = "Отступ по X герба класса"
+L["Race Crest Y-Offset"] = "Отступ по Y герба класса"
+L["Texts Positions"] = "Позиции текстов"
+L["Date X-Offset"] = "Отступ даты по X"
+L["Date Y-Offset"] = "Отступ даты по Y"
+L["Player Info X-Offset"] = "Отступ инфо игрока по X"
+L["Player Info Y-Offset"] = "Отступ инфо игрока по Y"
 L["X-Pack Logo Size"] = "Размел иконки дополнения"
 L["Template"] = "Шаблон"
 L["Player Model"] = "Модель игрока"
diff --git a/ElvUI_SLE/modules/afk.lua b/ElvUI_SLE/modules/afk.lua
index 029c6d5..e588d53 100644
--- a/ElvUI_SLE/modules/afk.lua
+++ b/ElvUI_SLE/modules/afk.lua
@@ -38,8 +38,8 @@ function S:Media()
 	SS.timePassed:SetTextColor(1, 1, 1)

 	SS.ExPack:SetSize(S.db.xpack, S.db.xpack/2)
-	SS.FactCrest:SetSize(S.db.crest, S.db.crest)
-	SS.RaceCrest:SetSize(S.db.crest, S.db.crest)
+	SS.FactCrest:SetSize(S.db.crest.size, S.db.crest.size)
+	SS.RaceCrest:SetSize(S.db.crest.size, S.db.crest.size)
 	SS.Elv:SetSize(S.db.xpack, S.db.xpack/2)
 	SS.sle:SetSize(S.db.xpack, S.db.xpack/2)
 end
@@ -111,17 +111,17 @@ function S:Setup()
 	SS.timePassed:ClearAllPoints()
 	SS.timePassed:Point("LEFT", SS.AFKtitle, "RIGHT", 4, -1)
 	SS.ExPack:Point("CENTER", SS.Top, "BOTTOM", 0, 0)
-	SS.FactCrest:ClearAllPoints()
-	SS.FactCrest:Point("CENTER", SS.Top, "BOTTOM", -(T.GetScreenWidth()/6), 0)
-	SS.RaceCrest:Point("CENTER", SS.Top, "BOTTOM", (T.GetScreenWidth()/6), 0)
-	SS.Date:Point("RIGHT", SS.Top, "RIGHT", -40, 10)
+	-- SS.FactCrest:ClearAllPoints()
+	-- SS.FactCrest:Point("CENTER", SS.Top, "BOTTOM", -(T.GetScreenWidth()/6), 0)
+	-- SS.RaceCrest:Point("CENTER", SS.Top, "BOTTOM", (T.GetScreenWidth()/6), 0)
+	-- SS.Date:Point("RIGHT", SS.Top, "RIGHT", -40, 10)
 	SS.Time:Point("TOP", SS.Date, "BOTTOM", 0, -2)
 	SS.Elv:SetPoint("CENTER", SS.Bottom, "TOP", -(T.GetScreenWidth()/10), 0)
 	SS.sle:SetPoint("CENTER", SS.Bottom, "TOP", (T.GetScreenWidth()/10), 0)
 	SS.PlayerName:ClearAllPoints()
 	SS.Guild:ClearAllPoints()
 	SS.GuildRank:ClearAllPoints()
-	SS.PlayerInfo:Point("RIGHT", SS.Date, "LEFT", -100, 0)
+	-- SS.PlayerInfo:Point("RIGHT", SS.Date, "LEFT", -100, 0)
 	SS.PlayerName:Point("BOTTOM", SS.PlayerInfo, "TOP", 0, 2)
 	SS.Guild:SetPoint("TOP", SS.PlayerInfo, "BOTTOM", 0, -2)
 	SS.GuildRank:SetPoint("TOP", SS.Guild, "BOTTOM", 0, -2)
@@ -206,6 +206,16 @@ function S:Show()
 	SS.ScrollFrame:SetHeight(S.db.tips.size+4)
 	SS.ScrollFrame.bg:SetHeight(S.db.tips.size+20)

+	--Elements
+	SS.FactCrest:ClearAllPoints()
+	SS.RaceCrest:ClearAllPoints()
+	SS.Date:ClearAllPoints()
+	SS.PlayerInfo:ClearAllPoints()
+	SS.FactCrest:Point("CENTER", SS.Top, "BOTTOM", -(T.GetScreenWidth()/6) + S.db.crest.xOffset_faction, 0 + S.db.crest.yOffset_faction)
+	SS.RaceCrest:Point("CENTER", SS.Top, "BOTTOM", (T.GetScreenWidth()/6) + S.db.crest.xOffset_race, 0 + S.db.crest.yOffset_race)
+	SS.Date:Point("RIGHT", SS.Top, "RIGHT", -40 + S.db.date.xOffset, 10 + S.db.date.yOffset)
+	SS.PlayerInfo:Point("RIGHT", SS.TOP, "RIGHT", -(T.GetScreenWidth()/6), 0)
+
 	--Resizing chat
 	SS.chat:SetHeight(SS.Top:GetHeight())

@@ -380,6 +390,10 @@ end
 function S:Initialize()
 	if not SLE.initialized then return end
 	SS = AFK.AFKMode
+	if type(E.db.sle.screensaver.crest) == "number" then
+		E.db.sle.screensaver.crest = nil
+		E.db.sle.screensaver.crest = P.sle.screensaver.crest
+	end
 	S.db = E.db.sle.screensaver
 	S.OnKeyDown = SS:GetScript("OnKeyDown")
 	if not E.private.sle.module.screensaver then return end
@@ -448,6 +462,10 @@ function S:Initialize()

 	function S:ForUpdateAll()
 		-- if not E.private.sle.module.screensaver then return end
+		if type(E.db.sle.screensaver.crest) == "number" then
+			E.db.sle.screensaver.crest = nil
+			E.db.sle.screensaver.crest = P.sle.screensaver.crest
+		end
 		S.db = E.db.sle.screensaver
 		S:SetupAnimations()
 		S:Hide()
diff --git a/ElvUI_SLE/options/afk_c.lua b/ElvUI_SLE/options/afk_c.lua
index 63be998..3ad37af 100644
--- a/ElvUI_SLE/options/afk_c.lua
+++ b/ElvUI_SLE/options/afk_c.lua
@@ -89,11 +89,45 @@ local function configTable()
 						args = {
 							crest = {
 								order = 1,
-								name = L["Crest Size"],
-								type = "range",
-								min = 84, max = 256, step = 1,
-								get = function(info) return E.db.sle.screensaver.crest end,
-								set = function(info, value) E.db.sle.screensaver.crest = value; S:Media() end,
+								type = "group",
+								guiInline = true,
+								name = L["Crest"],
+								get = function(info) return E.db.sle.screensaver.crest[ info[#info] ] end,
+								set = function(info, value) E.db.sle.screensaver.crest[ info[#info] ] = value; end,
+								args = {
+									size = {
+										order = 1,
+										name = L["Size"],
+										type = "range",
+										min = 84, max = 256, step = 1,
+										get = function(info) return E.db.sle.screensaver.crest.size end,
+										set = function(info, value) E.db.sle.screensaver.crest.size = value; S:Media() end,
+									},
+									xOffset_faction = {
+										order = 2,
+										name = L["Faction Crest X-Offset"],
+										type = "range",
+										min = -(T.GetScreenWidth()/2), max = T.GetScreenWidth()/2, step = 1,
+									},
+									yOffset_faction = {
+										order = 3,
+										name = L["Faction Crest Y-Offset"],
+										type = "range",
+										min = -(T.GetScreenWidth()/2), max = T.GetScreenWidth()/2, step = 1,
+									},
+									xOffset_race = {
+										order = 4,
+										name = L["Race Crest X-Offset"],
+										type = "range",
+										min = -(T.GetScreenWidth()/2), max = T.GetScreenWidth()/2, step = 1,
+									},
+									yOffset_race = {
+										order = 5,
+										name = L["Race Crest Y-Offset"],
+										type = "range",
+										min = -(T.GetScreenWidth()/2), max = T.GetScreenWidth()/2, step = 1,
+									},
+								},
 							},
 							xpack = {
 								order = 2,
@@ -111,8 +145,48 @@ local function configTable()
 								get = function(info) return E.db.sle.screensaver.height end,
 								set = function(info, value) E.db.sle.screensaver.height = value end,
 							},
-							animType = {
+							texts = {
 								order = 4,
+								type = "group",
+								name = L["Texts Positions"],
+								guiInline = true,
+								args = {
+									xOffset_date = {
+										order = 1,
+										name = L["Date X-Offset"],
+										type = "range",
+										min = -(T.GetScreenWidth()/2), max = T.GetScreenWidth()/2, step = 1,
+										get = function(info) return E.db.sle.screensaver.date.xOffset end,
+										set = function(info, value) E.db.sle.screensaver.date.xOffset = value end,
+									},
+									yOffset_date = {
+										order = 1,
+										name = L["Date Y-Offset"],
+										type = "range",
+										min = -(T.GetScreenWidth()/2), max = T.GetScreenWidth()/2, step = 1,
+										get = function(info) return E.db.sle.screensaver.date.yOffset end,
+										set = function(info, value) E.db.sle.screensaver.date.yOffset = value end,
+									},
+									xOffset_player = {
+										order = 1,
+										name = L["Player Info X-Offset"],
+										type = "range",
+										min = -(T.GetScreenWidth()/2), max = T.GetScreenWidth()/2, step = 1,
+										get = function(info) return E.db.sle.screensaver.player.xOffset end,
+										set = function(info, value) E.db.sle.screensaver.player.xOffset = value end,
+									},
+									yOffset_player = {
+										order = 1,
+										name = L["Player Info Y-Offset"],
+										type = "range",
+										min = -(T.GetScreenWidth()/2), max = T.GetScreenWidth()/2, step = 1,
+										get = function(info) return E.db.sle.screensaver.player.yOffset end,
+										set = function(info, value) E.db.sle.screensaver.player.yOffset = value end,
+									},
+								},
+							},
+							animType = {
+								order = 5,
 								name = L["Template"],
 								type = "select",
 								disabled = function() return E.db.sle.screensaver.panelTemplate == 0 end,