Thread Tools Display Modes
01-14-15, 11:38 PM   #1
EKE
An Aku'mai Servant
 
EKE's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2011
Posts: 37
Guild member level font size change

Guild member level and search level get "..." because the font style make number text wide

like this:
http://i.imgur.com/RH6hDuA.png

i know it use "GameFontHighlightSmall" but i want change them only,

can any addon do this? or only need simple code?
  Reply With Quote
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
01-16-15, 02:42 PM   #3
EKE
An Aku'mai Servant
 
EKE's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2011
Posts: 37
Originally Posted by Phanx View Post
The simplest option is probably just to do this......
oops, seems second part code get error at line 14 (i've try to fix it and test)

these two code were tested, but i found......not work?

If there is no way to solution to this problem, maybe change "GameFontHighlightSmall" font size is the last choice

and also i feel guildui on zhTW client have many bugs, i should change client location to contrast....... -_-

thank for your reply
  Reply With Quote
01-16-15, 04:14 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Code:
for = 1, #buttons do
---->
Code:
for i = 1, #buttons do
__________________
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.
  Reply With Quote
01-16-15, 07:24 PM   #5
EKE
An Aku'mai Servant
 
EKE's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2011
Posts: 37
oh :/

lua error said GuildRosterButton_SetStringText/GuildRoster_Update is not a function
  Reply With Quote
01-17-15, 02:49 AM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Your addon needs to wait until the Blizzard_GuildUI loads. The simplest method would be to add this in your TOC file:

Code:
## LoadOnDemand: 1
## LoadWith: Blizzard_GuildUI
__________________
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.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Guild member level font size change


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off