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 Aug 11, 2009 at 19:23 UTC Changed status from New to Fixed
Arrowmaster Jun 20, 2009 at 05:59 UTC 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 Jun 01, 2009 at 15:04 UTC 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 Jun 01, 2009 at 15:02 UTC 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 May 30, 2009 at 21:12 UTC Create

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

  • 2 comments
  • Avatar of Xara Xara Jul 30, 2009 at 12:11 UTC - 0 likes

    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 Jun 20, 2009 at 05:58 UTC - 0 likes

    The provided fix works flawlessly for me. :)

  • 2 comments

Facts

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

Reported by

Possible assignees