Grid

139 - Grid is updating fonts registered with SML incorrectly

This is happening in the latest Grid, just downloaded it 10 minutes ago. Basically, when a new font is registered with SML and LibSharedMedia_Update fires, you are only passing the font path and not the size causing an error at line #391 in GridFrame.lua.

Replacing the GridFrame:LibSharedMedia_Update function on line #1128 in GridFrame.lua with the below fixes the issue.

function GridFrame:LibSharedMedia_Update(callback, type, handle)
	if type == "font" then
		self:WithAllFrames(function (f) f:SetFrameFont(media:Fetch("font", self.db.profile.font), self.db.profile.fontSize) end)
	elseif type == "statusbar" then
		self:WithAllFrames(function (f) f:SetFrameTexture(media:Fetch("statusbar", self.db.profile.texture)) end)
	end
end
User When Change
Pastamancer Tue, 11 Aug 2009 19:23:15 Changed status from New to Fixed
Arrowmaster Sat, 20 Jun 2009 05:59:36 Changed description type from Plain Text to WikiCreole

Changed description:
  Replacing the GridFrame:LibSharedMedia_Update function on line #1128 in GridFrame.lua with the below fixes the issue.

+ <<code lua>>
-  function GridFrame:LibSharedMedia_Update(callback, type, handle)
+ function GridFrame:LibSharedMedia_Update(callback, type, handle)
-  	if type == "font" then
+ 	if type == "font" then
-  		self:WithAllFrames(function (f) f:SetFrameFont(media:Fetch("font", self.db.profile.font), self.db.profile.fontSize) end)
+ 		self:WithAllFrames(function (f) f:SetFrameFont(media:Fetch("font", self.db.profile.font), self.db.profile.fontSize) end)
-  	elseif type == "statusbar" then
+ 	elseif type == "statusbar" then
-  		self:WithAllFrames(function (f) f:SetFrameTexture(media:Fetch("statusbar", self.db.profile.texture)) end)
+ 		self:WithAllFrames(function (f) f:SetFrameTexture(media:Fetch("statusbar", self.db.profile.texture)) end)
  	end
-  end
+ end
+ <</code>>
-
- Since some of the syntax seems to be getting removed or whatever, http://shadowed.pastey.net/115203 is the unedited one.
Shadowed Mon, 01 Jun 2009 15:04:47 Changed description:
   		self:WithAllFrames(function (f) f:SetFrameTexture(media:Fetch("statusbar", self.db.profile.texture)) end)
  	end
   end
+
+ Since some of the syntax seems to be getting removed or whatever, http://shadowed.pastey.net/115203 is the unedited one.
Shadowed Mon, 01 Jun 2009 15:02:41 Changed description type from Textile to Plain Text

Changed description:
  Replacing the GridFrame:LibSharedMedia_Update function on line #1128 in GridFrame.lua with the below fixes the issue.

- @ function GridFrame:LibSharedMedia_Update(callback, type, handle)
+  function GridFrame:LibSharedMedia_Update(callback, type, handle)
   	if type == "font" then
   		self:WithAllFrames(function (f) f:SetFrameFont(media:Fetch("font", self.db.profile.font), self.db.profile.fontSize) end)
   	elseif type == "statusbar" then
   		self:WithAllFrames(function (f) f:SetFrameTexture(media:Fetch("statusbar", self.db.profile.texture)) end)
  	end
   end
- @
Shadowed Sat, 30 May 2009 21:12:10 Create

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

  • 2 comments
  • Avatar of Xara Xara Thu, 30 Jul 2009 12:11:24

    Grid Version r1200

    Without savedvariables/grid.lua I still get this error every time a profile is loaded:

    Interface\AddOns\Grid\GridFrame.lua:407: Usage: <unnamed>:SetFont("font", fontHeight [, flags])

    see you

  • Avatar of gnarfoz gnarfoz Sat, 20 Jun 2009 05:58:01

    The provided fix works flawlessly for me. :)

  • 2 comments

Facts

Last updated on
11 Aug 2009
Reported on
30 May 2009
Status
Fixed - Developer made requested changes. QA should verify.
Type
Defect - A shortcoming, fault, or imperfection
Priority
Medium - Normal priority.

Reported by

Possible assignees

Votes (Total: +12, Average: +3.0)