Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2003:
[Freeciv-Dev] Re: (PR#2771) Color messages, event based
Home

[Freeciv-Dev] Re: (PR#2771) Color messages, event based

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: stepan@xxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2771) Color messages, event based
From: "a-l@xxxxxxx" <a-l@xxxxxxx>
Date: Fri, 18 Apr 2003 04:04:38 -0700
Reply-to: rt@xxxxxxxxxxxxxx

I take back that patch. It was a bad idea to add Events for private 
messages. You wouldn't want to have options for redirecting messages
to other windows, unless you intend to turn Freeciv into an IRC
client.

This new patch simply looks at the first character of the string, and
applies one color for private and another for public chat messages. At
first I thought of this as a kludge, but if Freeciv has '-', '*' and
'<' to indicate special messages, why not use that for colorization?

So that is an exception - otherwise events are used for colorization.

This is still only for GTK1, other GUIs need different, maybe more
complex stuff to actually print the color. It wasn't immediately
obvious how to do it in GTK2. Nevertheless, chatline_common.c needed
to be modified in preparation for this: The text fridge stored
everything as one long string, separated only by newline chars.
That makes it difficult to attach one event to each message.

Also, I put the event-to-color coordination in the gui-gtk/chatline.c
because I imagine more advanced clients might want to play with font
types, etc, not just color.

I added a local option to turn it off.

append_output_window() works the same.
append_output_window_col() is new.


Arnstein



Attachment: colortext-2.diff.gz
Description: colortext-2.diff.gz


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#2771) Color messages, event based, a-l@xxxxxxx <=