ID:2444322
 
So I was playing around with the winset command, trying to set up a "night mode" in the game. making the chat background darker and the text brighter at night. But the process seems to be breaking some resources in chat.

My code for changing my chat's colors around is simply...
                for(var/client/M) if(M.mob)
winset(M, "chat_global.output", "background-color=#2c2c2c")
winset(M, "chat_global.output", "text-color=#f4f4f4")


but...

if I load a resource in chat, and then use winset to change the colors like that..., the resource seems to become corrupted and cant be displayed any more.


for example...
        var/output  = {"<center><b>[fadename(usr,alertcolortxt)]</b></b><br><a href='?src=\ref[usr];cshow=[Z.type]'><IMG SRC=\ref[Z.icon] ICONSTATE="[Z.icon_state]" ICONDIR=NORTH></a><br>[html_encode(msg)]<br><b><font color=[namec(usr)]>[time2text(world.timeofday,"DDD MMM DD hh:mm")]</font></b></center><br>"}




That's the output line for one of my announce verbs. It shows the north dir of the icon of an object of my choosing along with an output of text. The image of the card is also a link to open a window with a description of the object. It's a card game, it shows a picture of the card, and you can click on the picture to see the full text of the card.

The output looks like this... https://i.imgur.com/ps3uqIB.png

But, after i run the winset command, If i run the same command with the same object...

My output looks like this... https://i.imgur.com/wY9dO6F.png

And then even if I return the values for the background and text back to their initial settings...

The output looks like this... https://i.imgur.com/eW7eGLX.png

Seems like the cache for that icon is getting corrupted from that somehow?

I also noticed that if I run that command, images posted in chat that had any type of transparency to them still show the old background color.

I announced this with the light background, then switched to the dark background, the old announced picture shows the light background still in the transparent sections. https://i.imgur.com/bpsxCqB.png

When you announce an image does byond do some background buggery that converts that samples the background color and flattens the image with no transparency to it?

So I guess 3 questions.

1. Any idea why this is screwing up my resources, and if so how do I fix it?
2. Is there a way to fix that weird background color in old images issue?
3. Is there a way to apply these color updates to existing text in chat, and not just new text moving forward?