Message Separator widget

Message Separator widget

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

Moderator: Moderators

Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Message Separator widget

Post by Kloot »

** updated to version 2.1 **

A common source of annoyance for people
seems to be that Spring's system messages
are mixed with those typed by players, so I've
written a simple LuaUI widget to separate them.
What you get when you install it looks like this:

shot 1
shot 2

(ie. not much, it has some rough edges but gets
the job done ;))

Download here (park the file in LuaUI/Widgets).
Last edited by Kloot on 28 Dec 2007, 01:21, edited 16 times in total.
User avatar
Peet
Malcontent
Posts: 4383
Joined: 27 Feb 2006, 22:04

Post by Peet »

Win! Does it have a set size, or does it resize according to the screen res?
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

What about some options that let you choose which messages you want to display?
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

The boxes resize horizontally with the viewport width, but their vertical dimensions are (for the moment) fixed.

LordMatt: could you be more specific as to which message classes you would like to be able to filter out? :)
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

Well ideally ingame chat would work like this:
Player messages color coded to the player in one slot. Spring system error messages in white the other one slot, perhaps with the unit error messages separated. The option to disable unit error messages.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

version 1.1 (link outdated, see first post)

Fixes:

* messages no longer overflow horizontally (excess characters just get cut off)
* text-boxes now scale vertically with the viewport as well
* toggable unit error message filter (ctrl+f to activate/deactivate)

Note: you can expand the message filter's power by adding your own patterns to the MESSAGE_FILTERS variable at the top of the script, currently it only looks for "can't reach destination" matches (since those are by far the most common).
Last edited by Kloot on 17 Jul 2007, 13:17, edited 1 time in total.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

It looks very nice so far. :-) One other thing you should add is the option for transparent windows and outlined text (as is possible with the regular GUI for the chat window). I think a lot of people prefer it without the background.
User avatar
Deathblane
Posts: 505
Joined: 01 Feb 2006, 01:22

Post by Deathblane »

Agreed, then it'll be perfect.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

version 1.2 (link outdated, see first post)

New features:

* toggable text-box transparency (ctrl+s to switch between solid/transparent rendering)

Thanks for the input, guys.
Last edited by Kloot on 18 Jul 2008, 00:19, edited 2 times in total.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

Woah that looks very nice! :-) Two minor issues: The first line of the system messages is right underneath where you type in chat, making it really hard to read what you're typing. I don't know if this is a problem for all resolutions or not, but mine is 1280X1024. Also, it doesn't save your selection for ctrl+s!

Edit: It started spamming this error in game after about 10 minutes (with 12 people in it)

Code: Select all

error = 1, Call_DrawScreenItems, LuaUI\Widgets\MessageSeparator.lua:240: attempt to index local `playerColor' (a nil value)
Last edited by LordMatt on 01 Feb 2007, 21:54, edited 1 time in total.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

The text input-field overlapping the bottom box is indeed hindersome, but the position where it's drawn isn't configurable (short of unbinding the chat action and re-implementing it widget-side, which is what I'm slowly leaning to), so you'll have to type blind for a while. ;)

Good point about saving the selections, cheers.

Edit: ack, I see I should've tested it more. Fix underway.
Last edited by Kloot on 18 Jul 2008, 00:19, edited 2 times in total.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

See bugreport above.

Also, why couldn't you just move the system messages window a little lower?
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

Because then the system messages would appear closer to the middle of your screen, which could be a bit distracting. On the other hand it's far less work than the alternative, so I'll shove my aesthetic objections aside just this once. :]

version 1.3 (link outdated, see first post)

Fixes:

* system message box moved further down
* null-pointer check added when retrieving player color
Last edited by Kloot on 17 Jul 2007, 13:18, edited 2 times in total.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

MOAR BUGZ!

Code: Select all

error = 1, Call_DrawScreenItems, LuaUI\Widgets\MessageSeparator.lua:303: attempt to perform arithmetic on local `i' (a nil value)
This almost on game load, even before the start. Also it didn't save still. :P
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

ALSO MOAR FIXORZ (sort of), please redownload and try to break it again.

PS. the saving code is already done, but before releasing that into the wild I'd rather be sure the rest of the widget is functioning as it should...
Last edited by Kloot on 18 Jul 2008, 00:20, edited 1 time in total.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

No more errors.
ZellSF
Posts: 1187
Joined: 08 Jul 2006, 19:07

Post by ZellSF »

This thing is great, but it really needs a way to resize/move the message boxes (which I see you already plan to do, please make it so the boxes move / resize separately).
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

version 1.4 (link outdated, see first post)

New features:

* text-boxes are now draggable if dragging is enabled (toggle with ctrl+g)
* settings are now saved
Last edited by Kloot on 17 Jul 2007, 13:18, edited 1 time in total.
ZellSF
Posts: 1187
Joined: 08 Jul 2006, 19:07

Post by ZellSF »

Yai, great stuff, but how I change font size?
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

Kloot, it looked like the messages weren't wrapping properly, also, position information was not saved between sessions. Ideally, you would be able to resize the boxes such that in larger screen resolutions, you could put them side by side under the resources along the top. Keep it up! :-)
Post Reply

Return to “Lua Scripts”