OpenDreamProject / OpenDream

A project for running games made in the DM programming language
MIT License
208 stars 112 forks source link

Toggling darkmode via chat doesn't toggle the statpanel browser's theme #1872

Open ike709 opened 4 months ago

ike709 commented 4 months ago

Tested on Paradise. In BYOND, toggling the chat theme should automatically toggle the DMF color. But in OpenDream, you have to run the "Toggle Darkmode" verb separately for the DMF to change.

Proof of BYOND behavior: https://github.com/OpenDreamProject/OpenDream/assets/5714543/15eb695f-1461-4518-81c2-53eb46510ff3

ike709 commented 2 months ago

This was fixed for TG but Paradise must handle it differently because it's still an issue there.

ike709 commented 2 months ago

Paradise seems to handle it via cookies:

$('#toggleDarkChat').click(function(e) {
        internalOutput('<span class="internal boldnshit">Dark Chat toggled. Reconnecting to chat.</span>', 'internal');
        var backlog = $messages.html()
        if(getCookie('darkChat') == "on"){
            setCookie('darkChat', "off", 365)
        } else {
            setCookie('darkChat', "on", 365)
        }
        localStorage.setItem('backlog', backlog)
        location.reload();
    });
ike709 commented 2 months ago

This seems to be an issue with us canceling the reload if the paths are identical, but not canceling identical paths causes goonchat to have a seizure. I'm not sure how to differentiate paths that should be canceled from paths that shouldn't.

image