GCD

19 - Startup & Cooldowns error fix

See my patch (it's fix startup error - typos and showing cooldowns errors):

Index: Modules/Cooldowns.lua
===================================================================
--- Modules/Cooldowns.lua  (revision 58)
+++ Modules/Cooldowns.lua  (working copy)
@@ -341,18 +341,19 @@
 end
 
 local function OnUpdate(self, elapsed)
-        local perc = (GetTime() - self.startTime / self.duration
-        self.texture:SetVertexColor(1.0,perc,perc)
-        local dur = floor((self.duration - (GetTime() - self.startTime))*10)/10
-        if dur > 99 then
-            dur = '>>'
-        elseif dur > 10 then
-            dur = ceil(dur)
-        end
-        self.cdText:SetText(dur)
-        if perc >= 1 then
-            module:Hide(self)
-        end
+    if self.startTime == nil then return end
+    local perc = (GetTime() - self.startTime / self.duration
+    self.texture:SetVertexColor(1.0,perc,perc)
+    local dur = floor((self.duration - (GetTime() - self.startTime))*10)/10
+    if dur > 99 then
+        dur = '>>'
+    elseif dur > 10 then
+        dur = ceil(dur)
+    end
+    self.cdText:SetText(dur)
+    if perc >= 1 then
+        module:Hide(self)
+    end
 end
 
 function module:ApplyOptions()
@@ -374,14 +375,15 @@
                 
                 v.frame = frame
             end
-            v.frame:SetWidth(self.db.char.size*frame:GetEffectiveScale())
-            v.frame:SetHeight(self.db.char.size*frame:GetEffectiveScale())
+            v.frame:SetWidth(self.db.char.size*v.frame:GetEffectiveScale())
+            v.frame:SetHeight(self.db.char.size*v.frame:GetEffectiveScale())
             v.frame:ClearAllPoints()
             v.frame:SetPoint("CENTER", anchor, "CENTER", v.pos.x, v.pos.y)
             v.frame.texture:SetTexture(v.icon)
-            v.frame.texture:SetWidth(self.db.char.size*frame:GetEffectiveScale())
-            v.frame.texture:SetHeight(self.db.char.size*frame:GetEffectiveScale())
+            v.frame.texture:SetWidth(self.db.char.size*v.frame:GetEffectiveScale())
+            v.frame.texture:SetHeight(self.db.char.size*v.frame:GetEffectiveScale())
             v.frame.cdText:SetFont(media:Fetch("font" self.db.char.font self.db.char.fontSize "OUTLINE, MONOCHROME")
+            self:Hide(v.frame)
         end
     end
 end

User When Change
Finghin Aug 07, 2010 at 09:47 UTC Changed status from New to Fixed
Zuz666 Aug 06, 2010 at 16:40 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

Facts

Last updated
Aug 07, 2010
Reported
Aug 06, 2010
Status
Fixed - Developer made requested changes. QA should verify.
Type
Defect - A shortcoming, fault, or imperfection
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees