ID:135769
 
I have defined client.script in one of my files to set what the chat window should look like, but is there a way I can change that during my game? For example, say my chat window is blue text on a black bacground by default, but I want it to change to a black text on a red background during combat.

I tried altering client.script in a proc, but BYOND didn't like that very much. :-D

=$= Big J Money =$=
Define a style called "combat", apply it to combat text, and give it a red background and black text.

<code>// In client.script .combat { background:red; text:black } // In the code src << "<span class=combat>CHARGE!!!!!!!</span>"</code>

Incidentally, black on red text looks horrible. =P
In response to Crispy
Thing is, it would revert the next time you got any output in the text window. I believe Lummox is working on a way to edit client.script at runtime.
In response to Nadrew
You can send the player a different style sheet as it is now. Just send them the style html tag with whatever you want inside.
In response to Jon88
That's not a permanent thing -- it reverts to the original style sheet everytime output is sent to the client.
In response to Nadrew
So you make sure that all text sent to the player during that time is marked with that style. World-wide messages would present slightly more of a problem, but that could be overcome without too many difficulties.
In response to Crispy
Yeah -- but Lummox is working on an easier way. I'll just wait for that, heh.
In response to Nadrew
Really? I don't think it does if there was never an original style sheet to begin with. In some games, people send style html tags with pretty bad settings, and things don't revert until someone sends another style html tag.