Quantcast

I should follow my own advise.

Scott Sibley [09-19-10 - 11:56]
I should follow my own advise.
Filename
Modules/Debug.lua
Modules/Text.lua
Modules/UnitTooltip.lua
diff --git a/Modules/Debug.lua b/Modules/Debug.lua
index 3e90447..1582420 100644
--- a/Modules/Debug.lua
+++ b/Modules/Debug.lua
@@ -40,7 +40,7 @@ function mod:OnInitialize()
 end

 local function new1()
-	return LibBuffer:New("Debug buffer", 0, " ")
+	return LibBuffer:New("Debug buffer", random(50), " ")
 end

 local function updateText(widget)
@@ -66,14 +66,12 @@ local function update()
 	ResourceServer.Update()
 	local mem1, percent1, memdiff1, totalMem1, totaldiff1 = ResourceServer.GetMemUsage("StarTip")
 	for j = 1, random(50) do
-		local object = new2()
-		object.cols = random(50)
-		object:Start()
+		local object = new1()
 		tinsert(objects, object)
 	end
 	ResourceServer.Update()
 	local mem2, percent2, memdiff2, totalMem2, totaldiff2 = ResourceServer.GetMemUsage("StarTip")
-	StarTip:Print("Memory",  plugin.memshort(mem2 - mem1), plugin.memshort(memdiff2))
+	StarTip:Print("Memory", plugin.memshort(mem2), plugin.memshort(mem2 - mem1), plugin.memshort(memdiff2))
 end

 function mod:OnEnable()
diff --git a/Modules/Text.lua b/Modules/Text.lua
index 763dfb7..d51f87f 100644
--- a/Modules/Text.lua
+++ b/Modules/Text.lua
@@ -164,10 +164,13 @@ local mem, percent, memdiff, totalMem, totaldiff, memperc = GetMemUsage("StarTip
 if mem then
     if totalMem == 0 then totalMem = 100; mem = 0 end
     memperc = mem / totalMem * 100
-	return Colorize(format("%s (%.2f%%)", timeshort(mem), memperc), Color2RGBA(0xffff00))
+	return format("%s (%.2f%%)", memshort(mem), memperc)
 end
 ]],
-		cols = 34,
+		color = [[
+return Color2RGBA(0xffff00)
+]],
+		cols = 20,
 		update = 1000,
 		dontRtrim = true,
 		points = {{"TOPLEFT", "GameTooltip", "BOTTOMLEFT", 0, -124}},
@@ -181,7 +184,7 @@ end
 		name = "CPU Percent",
 		enabled = false,
 		value = [[
-if not scriptProfile then return Colorize("Profiling Off", 0, 1, 0) end
+if not scriptProfile then return "Profiling Off" end
 local cpu, percent, cpudiff, totalCPU, totaldiff, cpuperc = GetCPUUsage("StarTip")
 if cpu then
     return format("CPU: %.2f%%", cpuperc)
@@ -198,7 +201,7 @@ if cpu then
     return r, g, b
 end
 ]],
-		cols = 34,
+		cols = 14,
 		align = WidgetText.ALIGN_RIGHT,
 		update = 1000,
 		dontRtrim = true,
@@ -213,15 +216,18 @@ end
 		name = "CPU Total",
 		enabled = false,
 		value = [[
-if not scriptProfile then return Colorize("Profiling Off", 0, 1, 0) end
+if not scriptProfile then return "Profiling Off" end
 local cpu, percent, cpudiff, totalCPU, totaldiff = GetCPUUsage("StarTip")
 if cpu then
     if totalCPU == 0 then totalCPU = 100; cpu = 0 end
     cpuperc = cpu / totalCPU * 100;
-    return Colorize(format("%s (%.2f%%)", timeshort(cpu), cpuperc), Color2RGBA(0xffff00))
+    return format("%s (%.2f%%)", timeshort(cpu), cpuperc)
 end
 ]],
-		cols = 34,
+		color = [[
+return 1, 1, 0
+]],
+		cols = 14,
 		align = WidgetText.ALIGN_RIGHT,
 		update = 1000,
 		dontRtrim = true,
diff --git a/Modules/UnitTooltip.lua b/Modules/UnitTooltip.lua
index b33a332..390f30b 100644
--- a/Modules/UnitTooltip.lua
+++ b/Modules/UnitTooltip.lua
@@ -654,7 +654,7 @@ function mod:RebuildOpts()
 				StarTip:RebuildOpts()
 				self:CreateLines()
 			end,
-			order = 8
+			order = 9
 		},
 	}
     for i, v in ipairs(self.db.profile.lines) do