Advanced Players List widget

Advanced Players List widget

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Marmoth
Posts: 63
Joined: 26 Mar 2008, 20:44

Advanced Players List widget

Post by Marmoth »

Hello all!

You can get the last version (should be) of the widget attached to this message.

Or better: use the widget database available on most lobbies.

-----------------------------------
Here is a description of what it does:


The advanced players list replaces the standard list of the players. The list has a better layout and sort players according to category (allies, ennemies, spectators). Each ennemy team is separated. Comsharing is visible (players pack). AI-players are shown.

Info and controls are included in several modules:
- RANK module displays an icon that indicates the rank of the player.
- SIDE module displays an icon that indicates the side (arm, core or so). It also shows players that are comsharing.
- ID module displays the player's ID.
- NAME module displays the player's name.
- CPUPING module displays the player's cpu usage and ping with nice coloured icons (red is worst).
- SHARE module displays ressources stall of allies and allow players to share units (double click) or ressources (slider). Use your own buttons to ask for ressources.
- TAKE module shows a take icon when an allied team has no player anymore (and no AI).
- POINT module shows a point icon when an allied player adds a point on the map. You can then click on the icon to focus on the point.
- SPEC module allows you to choose the player to spec when you are a spectator.
- CHAT module allows you to send private message to designated player (mostly useful in ffa games).

You can add/remove modules and set widget's position in tweak mode (Ctrl+F11). You can also choose there to show/hide spectators.The broad arrows show where the widget will expand if getting larger (more modules/players). To change those arrows, just drag the widget to the opposite border.

I hope you will enjoy it.

For bug reports, suggestions, questions or encouragement post here or email: themarmoth AT gmail DOT com.
Attachments
advPlayersList v8.0.zip
(226.86 KiB) Downloaded 70 times
Last edited by Marmoth on 16 Jan 2011, 20:26, edited 9 times in total.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: Advanced Players List widget (v02)

Post by Warlord Zsinj »

IW needs help producing our UI. We have a completed, compartmented photoshop mockup ready to be implemented. Are you interested in helping out?

You can find out more about us here: http://www.imperialwinter.com
Or here: http://sws.moddb.com/
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Advanced Players List widget (v02)

Post by Argh »

Cool, been wanting to get to this for P.U.R.E. for some time now.

I'll take a look at putting it in the top-right corner, so that it's not on the rest of my UI, etc. Thanks for taking the time to write this, I'll put it in World Builder if I don't find any showstoppers.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: Advanced Players List widget (v02)

Post by Hoi »

Warlord Zsinj wrote:IW needs help producing our UI. We have a completed, compartmented photoshop mockup ready to be implemented. Are you interested in helping out?

You can find out more about us here: http://www.imperialwinter.com
Or here: http://sws.moddb.com/
Warlord on recruiting path :mrgreen:
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Advanced Players List widget (v02)

Post by manolo_ »

it looks nice, but i wish the old ping-numbers back ;)
User avatar
Kaine
Posts: 60
Joined: 09 Aug 2008, 23:28

Re: Advanced Players List widget (v02)

Post by Kaine »

Very nice. Something like this has been long overdue. May I suggest having the numbers for ping and CPU usage display on mouseover of the respective icons or something like that? The icons are nice, but like manolo I think the numbers were useful too.

One minor bug though, I was spectators a game and there were 2 guys that died and got shoved into the spectator category. One of them left, and instead of having his name removed from the list, he just got the name of the other spectator.

Good widget though, especially for a first. Worth of getting included in spring IMO.
ZellSF
Posts: 1187
Joined: 08 Jul 2006, 19:07

Re: Advanced Players List widget (v02)

Post by ZellSF »

Doesn't scale properly to different resolutions than the default sadly... As otherwise this would've been a perfect replacement for the default player info if you ask me.

Clearly grouping allies and enemies, simplifying the ping/cpu display and not wasting lots of space on it, small icons for choosing who to spec, but otherwise clickthrough...

To replace the default player info, imo you need to figure out how to make darker names outline white and not black.
Attachments
Clipboard01.png
Clipboard01.png (70.11 KiB) Viewed 7159 times
User avatar
Marmoth
Posts: 63
Joined: 26 Mar 2008, 20:44

Re: Advanced Players List widget (v02)

Post by Marmoth »

Thanks for remarks, comments and interest. Ill see what i can do to ameliorate the points mentionned in your posts. There will be a v03 at least.

About Imperial Winter, i am interested in principle, please send me an email with a bit more information: what are the goals, is there already a lua team, how free am i in the design of the UI? (you can find my adress on the widget's page on spring.jobjol.nl)
ZellSF
Posts: 1187
Joined: 08 Jul 2006, 19:07

Re: Advanced Players List widget (v02)

Post by ZellSF »

Also, it probably should show spectator cpu usage if its consistently above that of the players, as when the spectators slow down the game it's usually a good idea to kick them. Maybe as an option or something, I don't know.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: Advanced Players List widget (v02)

Post by Warlord Zsinj »

Marmoth; I've emailed you, let me know if you haven't received it.
User avatar
Marmoth
Posts: 63
Joined: 26 Mar 2008, 20:44

Re: Advanced Players List widget (v02)

Post by Marmoth »

Version 03 is out:

http://spring.jobjol.nl/show_file.php?id=1388

- Bugs mentionned above have been solved (font size/double spec).
- White outline system for dark player colors has been added.
- Removes/restores standard players list automatically.

Comments and bug reports welcome, as always.
User avatar
Marmoth
Posts: 63
Joined: 26 Mar 2008, 20:44

Re: Advanced Players List widget (v02)

Post by Marmoth »

For the next version, i plan to integrate a M/E sharing (and requesting system).
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Advanced Players List widget (v02)

Post by imbaczek »

you could also do unit sharing, but it has to be done carefully to eliminate accidental clicks.
User avatar
Marmoth
Posts: 63
Joined: 26 Mar 2008, 20:44

Re: Advanced Players List widget (v02)

Post by Marmoth »

Unit sharing button already exists. To avoid errors, it requires double click.
ZellSF
Posts: 1187
Joined: 08 Jul 2006, 19:07

Re: Advanced Players List widget (v02)

Post by ZellSF »

Very nice. I still have two more suggestions though. First alphabetic sorting, second make sharing units automatically create informative points.

A bug though, spectator list colouring seems screwed up. See screenshot later in thread. If it's intended to change colour, I'd base it on cpu use, not network lag, oh and make cpu use go red faster.

(also, with metal and energy sharing, be careful about how much screen space you use please, or make it optional)
Last edited by ZellSF on 18 Aug 2008, 01:52, edited 2 times in total.
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Re: Advanced Players List widget (v02)

Post by BrainDamage »

Marmoth wrote:- New sidepics system: automatically loaded from the "/luaUI/Images/advplayerslist/" directory, including default pic (no more gfx bug)
For mods devs and other interested players: if you have factions other than core/arm, put a 16x16 pixels png picture in the directory mentionned above with a name "<side_name>.png". Colors should be grey scale (but the picture must be saved as RGB) for later player coloration. If you use transparency, don't save transparent pixel's color. You can also send me the pics so that i add them to the archive.
there is a sidepics folder already inside the mod archive, you can use that (you can access it using the VFS)

oh, if i can suggest you, next time you'll make a release post a screenshot of how the widget looks ingame

ok, gonna try this now ...
ZellSF
Posts: 1187
Joined: 08 Jul 2006, 19:07

Re: Advanced Players List widget (v02)

Post by ZellSF »

Image
There's a screenshot. The empty row isn't a bug, FYI.

Anyway, now that I've compared some, I'm wondering if there's any way you make the way it figures out what to outline with white a bit more similar to how the default list does?

The default playerlist outlines fastforwardhere and Master_Chief with white also.

IMO, it's already more than qualified to replace the default player list.. Though I don't think there's been any changes to what widgets are enabled by default in a wihle.

Edit: Also I realize this isn't something that you possibly could accidentally do often, but if you click and hold an eye icon and drag your mouse away, the eye icons stop working.
Last edited by ZellSF on 18 Aug 2008, 02:01, edited 1 time in total.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Advanced Players List widget (v02)

Post by Argh »

Ok... took at look at v. 3. Pretty cool, but not quite ready to stick into World Builder yet. Here are my humble suggestions on things that might really improve the polish.


1. Please use a percentile, and a two-variable setup x,z for placement of the Widget arbitrarily on the screen, with everything else placed relative to that value, x,z. This makes integrating something like this into people's projects easy, and will also greatly help you get the code to run properly over the long run as well.

Here's some code to do it with:

Code: Select all

function widget:ViewResize(viewsizeX, viewsizeZ)

local x = viewsizeX
local z = viewsizeZ
xPosition = x * 0.85
zPosition = z * 0.1

end
This code results in the "origin" of all other values for position being relative to a percentile of the screen, no matter what resolution we're talking about. In this case, it's 85% from 0 to max distance X, 10% from the top of the screen Z (0).

Everything else should be expressed that way. That way you know, absolutely, that no elements will ever be drawn over the value of X or Z, unless you failed at basic math somewhere.

This allows other people to quickly re-use this code and place it somewhat arbitrarily, and it will work identically on users' screens, no matter what resolution they're using. Very important. Static placement is not a good solution.

2. You can even do this with text, to normalize text sizes to meet a certain standard (I do this in P.U.R.E.):

Code: Select all

textsize = 15 * (x / 1600)
In the case above, I'm using a 1600 pixel wide screen to test my code with. 15 was found to be the right size for the text I'm displaying in my UI. So that formula ensures that no matter what arbitrary size the screen is in pixels X, the text remains the same relative value.

The current setup is always 200 pixels away from max X, which is not ideal- it should always be a percentile value of the current X,Z value (and reset if the screensize changes).

3. Don't forget to localize variables such as gl.Color, etc. This speeds up CPU usage considerably, and with a Widget that's performing a lot of operations constantly, this is a big deal.
User avatar
Kaine
Posts: 60
Joined: 09 Aug 2008, 23:28

Re: Advanced Players List widget (v02)

Post by Kaine »

Minor bug: Conflicts with dgun limit widget. The top line flashes the same color as the Dgun Limits text. See attachment below.
Attachments
aplbug.jpg
bug
(35.9 KiB) Downloaded 63 times
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Re: Advanced Players List widget (v02)

Post by Gnomre »

Kaine wrote:Minor bug: Conflicts with dgun limit widget. The top line flashes the same color as the Dgun Limits text. See attachment below.
I can't get the download links for this widget to work, but at a guess it's more the fault of the dgun widget than this one. Someone probably forgot to reset gl.Color after using some other color; I've noticed in personal development that the color can and will transfer between widgets until gl.Color is changed. The obvious way to circumvent this is to explicitly set the color for everything, even at the beginning, in your own widgets. Of course, that just masks the sloppy code in the other widget.

I'm known to be wrong sometimes, though, so please don't bite my head off if there's a different cause :)
Post Reply

Return to “Lua Scripts”