Quantcast

Working in marquees

Scott Sibley [08-09-10 - 18:36]
Working in marquees
Filename
Modules/Text.lua
StarTip.lua
diff --git a/Modules/Text.lua b/Modules/Text.lua
index b815aad..0780a7e 100644
--- a/Modules/Text.lua
+++ b/Modules/Text.lua
@@ -54,7 +54,7 @@ local linesToAddRight = {}
 local linesToAddRightR = {}
 local linesToAddRightG = {}
 local linesToAddRightB = {}
-local lines
+local lines = {}

 local function errorhandler(err)
     return geterrorhandler()(err)
@@ -398,11 +398,11 @@ function mod:OnInitialize()
     self.leftLines = StarTip.leftLines
     self.rightLines = StarTip.rightLines
     self:RegisterEvent("UPDATE_FACTION")
+	self:RegisterEvent("PLAYER_LOGIN")
     StarTip:SetOptionsDisabled(options, true)
 end

 function mod:OnEnable()
-	self:CreateLines()
     if TalentQuery then TalentQuery.RegisterCallback(self, "TalentQuery_Ready") end

     StarTip:SetOptionsDisabled(options, false)
@@ -486,8 +486,17 @@ function mod:CreateLines()
 				StarTip.del(c)
 				StarTip.del(cc)
 			end
+			local tmp = v.marquee
+
+			if v.marquee and not v.marqueeObj then
+				StarTip:Print("test")
+				v.marqueeObj = LibMarquee:New(mod.leftLines[lineNum], mod, v)
+				v.marqueeObj:Start()
+			end
+
         end
         self.NUM_LINES = lineNum
+
     end})
 	for i, v in ipairs(self.db.profile.lines) do
 		local appearance = StarTip:GetModule("Appearance")
@@ -505,6 +514,22 @@ function mod:CreateLines()
 	end
 end

+function mod:OnHide()
+	for i, v in ipairs(lines) do
+		if v.marqueeObj and v.marqueeObj.Stop then
+			v.marqueeObj:Stop()
+			v.marqueObj = nil
+		end
+	end
+end
+
+function mod:PLAYER_LOGIN()
+	for i, v in ipairs(mod.db.profile.lines) do
+		v.marqueeObj = nil
+	end
+	mod:CreateLines()
+end
+
 function mod:RebuildOpts()
     options = {
 		add = {
diff --git a/StarTip.lua b/StarTip.lua
index 25fee8a..96600fa 100644
--- a/StarTip.lua
+++ b/StarTip.lua
@@ -241,35 +241,6 @@ local function copy(tbl)
 	return localCopy
 end

---[[
-local property = {}
-
-property.Eval = function(self, runnable)
-	local is_valid
-	local result
-end
-
-property.P2N = function(self)
-
-end
-
-property.P2S = function(self)
-
-end
-
-property.SetValue = function(self)
-
-end
-
-do
-	StarTip.EvalCode = function(self, property)
-		if not self or not property then return end
-
-
-	end
-
-end
---]]
 StarTip:SetDefaultModuleState(false)

 function StarTip:OnInitialize()