View Single Post
01-15-15, 10:14 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
The simplest option is probably just to do this:
Code:
hooksecurefunc("GuildRosterButton_SetStringText", function(buttonString, text, isOnline, class)
     if strmatch(text, "%D") then
        -- text contains something that isn't a number, use the standard font:
        buttonString:SetFontObject(GameFontHighlightSmall)
    else
        -- text contains only numbers, use a smaller font:
        buttonString:SetFontObject(GameFontWhiteTiny)
    end
end)
If there are some other columns that display numbers that you don't want to make smaller, this might work, but I didn't test it:
Code:
hooksecurefunc("GuildRoster_Update", function()
	-- What viewing mode are we in?
	local currentGuildView = UIDropDownMenu_GetSelectedValue(GuildRosterViewDropdown)
	
	-- In most viewing modes the target column shows a level:
	local fontObject = GameFontWhiteTiny
	-- But in one viewing mode it shows text:
	if currentGuildView == "guildStatus" then
		fontObject = GameFontHighlightSmall
	end

	-- Loop over all the rows in the roster list:
	local buttons = GuildRosterContainer.buttons
	for i = 1, #buttons do
		local button = buttons[i]
		-- And apply the desired font object:
		button.string1:SetFontObject(GameFontWhiteTiny)
	end
end)
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 01-16-15 at 04:14 PM.
  Reply With Quote