Quantcast

Test model for screensaver

Darthpred [08-26-14 - 23:27]
Test model for screensaver
Filename
ElvUI_SLE/modules/screensaver.lua
ElvUI_SLE/options/media_c.lua
diff --git a/ElvUI_SLE/modules/screensaver.lua b/ElvUI_SLE/modules/screensaver.lua
index e81655b..e3f4364 100644
--- a/ElvUI_SLE/modules/screensaver.lua
+++ b/ElvUI_SLE/modules/screensaver.lua
@@ -94,8 +94,8 @@ function S:Setup()
 	SS.RaceCrest = SS.Top:CreateTexture(nil, 'ARTWORK')
 	SS.RaceCrest:SetTexture(CrestPath..RaceToken)
 	SS.ExPack = SS.Top:CreateTexture(nil, 'OVERLAY')
-	-- SS.ExPack:SetTexture([[Interface\Glues\Common\Glues-WoW-MPLogo.blp]])
 	SS.ExPack:SetTexture([[Interface\Glues\Common\Glues-WoW-WoDLogo.blp]])
+	-- SS.ExPack:SetTexture([[Interface\Glues\Common\Glues-WoW-MPLogo.blp]])
 	SS.ExPack:SetSize(150, 75)
 	SS.model = CreateFrame("PlayerModel", "ScreenModel", SS)
 	SS.Top.Title = SS.Top:CreateFontString(nil, "OVERLAY")
@@ -109,6 +109,11 @@ function S:Setup()
 	SS.Top.GuildR = SS.Top:CreateFontString(nil, "OVERLAY")
 	SS.ScrollFrame = CreateFrame("ScrollingMessageFrame", nil, SS)

+	SS.testmodel = CreateFrame("PlayerModel", "ScreenTestModel", E.UIParent)
+	SS.testmodel:SetPoint("RIGHT", E.UIParent, "RIGHT", -5, 0)
+	SS.testmodel:SetSize((GetScreenHeight()/6), (GetScreenHeight()/3))
+	SS.testmodel:Hide()
+
 	-- SS.ScrollFrame:SetShadowColor(0, 0, 0, 0)
 	SS.ScrollFrame:SetFading(false)
 	SS.ScrollFrame:SetFadeDuration(0)
@@ -140,10 +145,33 @@ function S:Setup()
 	SS.Top.Title:SetText("|cff00AAFF"..L['You Are Away From Keyboard'].."|r")
 end

+local AnimTime, testM
+
+function S:TestShow()
+	if AnimTime then AnimTime:Cancel() end
+	testM = E.db.sle.media.screensaver.model
+	SS.testmodel:Show()
+	SS.testmodel:SetUnit("player")
+	SS.testmodel:SetPosition(0.3,0,-0.1)
+	SS.testmodel:SetFacing(-0.5)
+	SS.testmodel:SetAnimation(testM)
+	SS.testmodel:SetScript("OnAnimFinished", S.AnimTestFinished)
+
+	AnimTime = C_Timer.NewTimer(10, S.TestHide)
+end
+
+function S:TestHide()
+	SS.testmodel:Hide()
+end
+
 function S:AnimFinished()
 	SS.model:SetAnimation(E.db.sle.media.screensaver.model)
 end

+function S:AnimTestFinished()
+	SS.testmodel:SetAnimation(testM)
+end
+
 function S:Shown()
 	Level, Name, TipNum = UnitLevel("player"), UnitPVPName("player"), random(1, #Tips)
 	if IsInGuild() then
diff --git a/ElvUI_SLE/options/media_c.lua b/ElvUI_SLE/options/media_c.lua
index 6c15cc7..dbdcb3b 100644
--- a/ElvUI_SLE/options/media_c.lua
+++ b/ElvUI_SLE/options/media_c.lua
@@ -487,6 +487,14 @@ local function configTable()
 								type = "range",
 								min = 130, max = E.screenheight/6, step = 1,
 							},
+							testmodel = {
+								order = 4,
+								type = 'execute',
+								name = "Test Animation",
+								desc = "Shows a test model with selected animation for 10 seconds. Ckicking again will reset timer.",
+								-- disabled = function() return not E.db.chat.chatHistory end,
+								func = function() S:TestShow() end,
+							},
 						},
 					},
 				},