OpenTTD

Tasklist

FS#532 - Chat Messages: set # of seconds before chat dissapears

Attached to Project: OpenTTD
Opened by Kenn Booth (Smoovious) - Tuesday, 09 January 2007, 16:12 GMT
Last edited by Remko Bijker (Rubidium) - Tuesday, 14 December 2010, 15:00 GMT
Type Patch
Category Interface
Status Closed
Assigned To Kenn Booth (Smoovious)
Operating System All
Severity Very Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Need to be able to set how long chat messages remain on the screen before they dissapear in real-time, up to 255 seconds
This task depends upon

Closed by  Remko Bijker (Rubidium)
Tuesday, 14 December 2010, 15:00 GMT
Reason for closing:  Implemented
Additional comments about closing:  In r21513
Comment by Kenn Booth (Smoovious) - Monday, 12 March 2007, 00:30 GMT
Ok... I added a setting to set how many real-time seconds chat messages stay on the screen... I kept the min 10 game-day limit also... I adjusted some message settings to keep more on the screen, and to keep lots of long broken-up messages from falling over the top of the chat window... probably do more later, but for now, I got the objective of this request...

Probably some style issues to it...

Here it is..., the diff is based on r9127...

-- Smoovious
Comment by Kenn Booth (Smoovious) - Monday, 12 March 2007, 00:31 GMT
ps: diff was tested in Win32 and OSX... still needs testing on the other platforms...
Comment by Kenn Booth (Smoovious) - Monday, 12 March 2007, 18:24 GMT
removed some redundant code of mine
probably still has style issues... >sighs< :)

New: added setting to keep messages visible at least # of real-time seconds
Change: adjusted message count limits to allow more text to remain on the screen
Fix: adjusted chat window size so when you have many multi-line messages, ones at the top won't fall over the top of the window anymore
Removed: Unneccesary FOR loop in TextMessageDailyLoop() used to remove old messages. Now only the oldest message will be checked for deletion, once per game-day

-- Smoovious
Comment by Kenn Booth (Smoovious) - Tuesday, 13 March 2007, 23:26 GMT
Removed: now-unnecessary 'duration' variable (and related variables)

also removed a couple more bits of redundancy I introduced.
style cleanup

-- Smoovious

Comment by Kenn Booth (Smoovious) - Friday, 16 March 2007, 22:04 GMT
Ok, got a new patch...

-Feature: message duration is now configurable to real-time seconds through the patch menu
-Feature: shaded area now only shows behind the actual text, not the entire window area
-Fix: many long messages now won't force the text over the top of the chat window area
-Change: can now have more chat messages on the screen

plus some various comment and code cleanup from my earlier patches

Screenshot included.

-- Smoovious

Comment by Kenn Booth (Smoovious) - Friday, 16 March 2007, 22:08 GMT
ugh... forgot screenshots don't save the visible text. :(
Comment by Kenn Booth (Smoovious) - Friday, 16 March 2007, 22:18 GMT
Lets try this one...
Comment by Kenn Booth (Smoovious) - Saturday, 17 March 2007, 06:38 GMT
Hopefully, this is the last revision of the patch...

-Feature: message duration now configurable
-Feature: shaded area now configurable to none|lines|window
-Fix: many long messages now won't force the text over the top of the chat window area
-Change: can now have more chat messages on the screen
-Cleanup: made some ugly code that actually draws the messages/shadow, a little less ugly

-- Smoovious
Comment by Kenn Booth (Smoovious) - Tuesday, 26 June 2007, 23:27 GMT
Revised to current trunk (as of r10349)

-Feature: chat message duration now configurable
-Feature: shaded area now configurable to none|line|box(default)
-Fix: many long messages now won't force the text over the top of the chat window area
-Change: can now have more chat messages on the screen
-Cleanup: made some ugly code that draws the messages/shadow, slightly less ugly

-- Smoovious
Comment by Kenn Booth (Smoovious) - Thursday, 28 June 2007, 05:59 GMT
Revised to current trunk (as of r10369)

made some minor changes also which didn't change the logic.

-- Smoovious
Comment by Kenn Booth (Smoovious) - Friday, 06 July 2007, 07:33 GMT
Revised to current trunk (as of r10450)

messages will now dissapear regardless of if you're paused or not. (thanks to peter1138 pointing out another option available to me)

also did some renaming, to make it clearer which parts were for the chat window, apart from those for the text effects.

-- Smoovious
Comment by Remko Bijker (Rubidium) - Thursday, 26 July 2007, 10:09 GMT
The chat messages will stay forever (well, until other chat messages overwrite them) when _realtime_ticks overflows.
Comment by Kenn Booth (Smoovious) - Thursday, 26 July 2007, 10:38 GMT
hmm... how often would it overflow tho... thought I figured it out to something like 45 days, but I may be remembering wrong...

-- Smoovious
Comment by Remko Bijker (Rubidium) - Thursday, 26 July 2007, 10:44 GMT
Every 49 days IIRC, but that is NOT equal to after 49 days!

So we are going to get bug reports about this issue.
Comment by Kenn Booth (Smoovious) - Thursday, 26 July 2007, 10:47 GMT
Well, not a big deal... I've dealt with handling byte-rollover issues before... will update this when I finish something else I'm working on.

Thanks for the critique.

-- Smoovious
Comment by Kenn Booth (Smoovious) - Thursday, 26 July 2007, 16:35 GMT
-Fix: handle _realtime_tick byte rollover gracefully

-- Smoovious
Comment by Remko Bijker (Rubidium) - Wednesday, 15 August 2007, 17:52 GMT
Why did you clutter this patch with the text->chat change too? It makes it very hard to see what actually changed and what didn't change (except for the naming).
Comment by Kenn Booth (Smoovious) - Saturday, 18 August 2007, 21:21 GMT
It more clearly differentiates the chat-related stuff, from the rest of the more generic text-related stuff.

As far as I was able to determine, and I did a LOT of looking before I changed it, there weren't any other text-related routines that called those chat routines, that didn't have anything to do with the chat window.

When I first made the patch, it wasn't clear which text routines were associated with each other. The more I worked on it, the more I realized how seperate the chat routines, and the text effect routines were. Soo... since they're all about the chat window, I renamed them for the chat window... instead of text windows/effects.

(and I considered the change, to be the opposite of 'clutter')

-- Smoovious
Comment by Remko Bijker (Rubidium) - Saturday, 18 August 2007, 21:25 GMT
I didn't say you cluttered the code, I said you cluttered the patch itself. The name changing makes it non-obvious what really is changed.

The name change in itself is good, but doing a name change *and* functionality change in the same patch is not.
Comment by Kenn Booth (Smoovious) - Saturday, 18 August 2007, 21:28 GMT
I feel it is inappropriate for me to make a change like that, in a patch, if I'm not making other changes in there as well...

It is one thing if I'm making the change as part of other changes I'm making in there... quite another if I'm just making a patch to change function names by themselves, with no other interest in that section of code, considering I'm not one of the top-tier coders, that is...

-- Smoovious


Comment by Remko Bijker (Rubidium) - Saturday, 18 August 2007, 21:44 GMT
It is not inappropriate to suggest such naming changes, especially if it makes a difference between several parts of the code more obvious. I myself started with some whitespace patches, which got applied pretty fast.

Doing them together with functional changes just makes it harder to review the patch, which wastes time on both sides and interest in the "top-tier coders" in the review process. There's some "law" somewhere that states that the longer a patch is, the harder it is to get it included and the more difficult/complex a patch is, the harder it is.
Comment by Kenn Booth (Smoovious) - Saturday, 18 August 2007, 22:04 GMT
k... well... I won't have much time for a while to seperate them... in the middle of truck driving school... taking up a huge amount of time...

I should be able to have seperated patches for them by end of next week...

-- Smoovious
Comment by Kenn Booth (Smoovious) - Sunday, 19 August 2007, 03:08 GMT
Ok, here's a patch that only covers the variable/function name changes (plus a few comments)

-- Smoovious
Comment by Kenn Booth (Smoovious) - Sunday, 19 August 2007, 21:59 GMT
Updated to reflect changes made by my chat_text_cleanup patch being committed (r10932)

-- Smoovious
Comment by Kenn Booth (Smoovious) - Sunday, 09 December 2007, 03:10 GMT
What more do I need to do on this patch for it to be accepted into trunk at this point?

-- Smoovious

(besides, get it current again)
Comment by Jean-Francois Claeys (Belugas) - Sunday, 09 December 2007, 12:45 GMT
1) wait for after 0.6 release
2) try to remember where was it said/promised/suggested that we did liked the patch and that we want it in trunk
Comment by Kenn Booth (Smoovious) - Sunday, 09 December 2007, 20:31 GMT
well, it isn't easy to remember at this point exactly who said they liked it and what-not... I haven't had anyone say they didn't like it... I've had constructive criticizm of coding style from time to time, which I had addressed. It had been well received among the people who did try it, and gave me comments.

I just don't want to keep updating it if it has been decided that it isn't going in...

Even more constructive criticism would be nice.

I don't spend a lot of time at home anymore, so gotta cram in my work on it within a few days at a time...

Guess what I want most is _some_ kind of feedback... .. .

-- Smoovious
Comment by Kenn Booth (Smoovious) - Sunday, 09 December 2007, 22:03 GMT
Updated to r11610...

-- Smoovious

Loading...