Ulysses

General => Developers Corner => Topic started by: iViscosity on September 04, 2017, 12:15:39 PM

Title: Hide players from TTT Scoreboard
Post by: iViscosity on September 04, 2017, 12:15:39 PM
I've been looking through the TTT hooks page (http://ttt.badking.net/guides/hooks) but I can't find anything there that could help me with this. This is just a small idea I had to be able to hide certain players or ULib groups from the scoreboard, in-case someone wanted to keep an eye on something without it being obvious that they're there. Just wondering if anyone knows how to do that or has done it themself.
Title: Re: Hide players from TTT Scoreboard
Post by: MrPresident on September 04, 2017, 04:17:51 PM
You'll have to modify the scoreboard file. Find where it does the player loop and then set a conditional to skip any players (groups) you wish.
Title: Re: Hide players from TTT Scoreboard
Post by: iViscosity on September 04, 2017, 05:03:39 PM
You'll have to modify the scoreboard file. Find where it does the player loop and then set a conditional to skip any players (groups) you wish.
That's what I thought it was going to have to come to but I wanted a cleaner way to do it with an add-on. Oh well, I guess.

Sent from my XT1710-02 using Tapatalk

Title: Re: Hide players from TTT Scoreboard
Post by: JamminR on September 04, 2017, 08:01:00 PM
Quote
TTTScoreboardColorForPlayer (ply)
Client
Called to determine what colour a player's name should be on the scoreboard. Hence, it must return a Color object, or return nil (or nothing at all). The "ply" parameter contains a player object, so you can for example check the player's SteamID and give certain people a special colour. Note that TTT also uses this hook for the default colours, so you should return nil for players that you do not want to do anything special with.

Have you tested trying to set the color of the player the exact same as the background?
I doubt it would work well, but might be something to try.
Title: Re: Hide players from TTT Scoreboard
Post by: iViscosity on September 04, 2017, 08:34:38 PM
I did think about that, but I thought it would just leave a blank space in the middle with other values in the board still.

Sent from my XT1710-02 using Tapatalk

Title: Re: Hide players from TTT Scoreboard
Post by: monkeymacman on September 04, 2017, 09:44:55 PM
I'm not sure of the specifics of it (right now on mobile), but maybe making a separate score group and maybe there's some way you could hide that (I think group:SetVisible(false) works)
Title: Re: Hide players from TTT Scoreboard
Post by: iViscosity on September 04, 2017, 09:51:51 PM
Interesting thought. You mean by using TTTScoreGroups (http://ttt.badking.net/guides/hooks) to create another group? The issue I have is how do I make that group invisible.

I could probably use how Innocents can't see GROUP_NOTFOUND...

I'll take a look into it tomorrow.

Sent using Tapatalk. Owner of iViscosity Gaming.

Title: Re: Hide players from TTT Scoreboard
Post by: monkeymacman on September 04, 2017, 09:56:21 PM

Interesting thought. You mean by using TTTScoreGroups (http://ttt.badking.net/guides/hooks) to create another group? The issue I have is how do I make that group invisible.

I could probably use how Innocents can't see GROUP_NOTFOUND...

I'll take a look into it tomorrow.

Sent using Tapatalk. Owner of iViscosity Gaming.
Yes, that's what I mean. And I am 90% sure you should be able to use :SetVisible because after a quick look the scoreboard and some point checka if there's less than 1 player in a scoregroup and if so uses that function to hide it, but I'm not sure if that hides everybody in it, or just the label itself.
Title: Re: Hide players from TTT Scoreboard
Post by: iViscosity on September 04, 2017, 10:08:37 PM
Yes, that's what I mean. And I am 90% sure you should be able to use :SetVisible because after a quick look the scoreboard and some point checka if there's less than 1 player in a scoregroup and if so uses that function to hide it, but I'm not sure if that hides everybody in it, or just the label itself.
I can test it tomorrow. It seems to hide the entire group (for example there is no Spectators tab if there is no one spectating). Thanks for the help. I'll test it out tomorrow when I'm home from school and see how it works.


Sent using Tapatalk. Owner of iViscosity Gaming.