From 9ee0d6aa6d2330ac0a3c8ff550704ea49dc2df9f Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Thu, 22 Jun 2017 19:50:15 -0500 Subject: [PATCH] Makes oldchat show while goonchat loads, sends preload messages there. --- code/modules/client/client_procs.dm | 4 +- code/modules/goonchat/browserOutput.dm.rej | 51 ++++++++++++++++++++++ interface/skin.dmf | 28 +++++++++++- 3 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 code/modules/goonchat/browserOutput.dm.rej diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 5adc38c669..7e509d2cdc 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -591,8 +591,8 @@ GLOBAL_LIST(external_rsc_urls) log_access("Failed Login: [key] [computer_id] [address] - CID randomizer check") var/url = winget(src, null, "url") //special javascript to make them reconnect under a new window. - src << browse("byond://[url]?token=[token]", "border=0;titlebar=0;size=1x1") - src << browse("You will be automatically taken to the game, if not, click here to be taken manually", "window=browseroutput") + src << browse({"byond://[url]?token=[token]"}, "border=0;titlebar=0;size=1x1;window=redirect") + to_chat(src, {"You will be automatically taken to the game, if not, click here to be taken manually"}) /client/proc/note_randomizer_user() var/const/adminckey = "CID-Error" diff --git a/code/modules/goonchat/browserOutput.dm.rej b/code/modules/goonchat/browserOutput.dm.rej new file mode 100644 index 0000000000..1ac5a9bb0e --- /dev/null +++ b/code/modules/goonchat/browserOutput.dm.rej @@ -0,0 +1,51 @@ +diff a/code/modules/goonchat/browserOutput.dm b/code/modules/goonchat/browserOutput.dm (rejected hunks) +@@ -32,7 +32,7 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic + alert(owner.mob, "Updated chat window does not exist. If you are using a custom skin file please allow the game to update.") + return + +- if(winget(owner, "browseroutput", "is-disabled") == "false") //Already setup ++ if(winget(owner, "browseroutput", "is-visible") == "true") //Already setup + doneLoading() + + else //Not setup +@@ -90,7 +90,10 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic + + testing("Chat loaded for [owner.ckey]") + loaded = TRUE +- winset(owner, "browseroutput", "is-disabled=false") ++ winset(owner, "output", "is-disabled=true;is-visible=false") ++ winset(owner, "browseroutput", "is-disabled=false;is-visible=true") ++ ++ + for(var/message in messageQueue) + to_chat(owner, message) + +@@ -228,7 +231,7 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic + targets = target + if(!targets.len) + return +- ++ var/original_message = message + //Some macros remain in the string even after parsing and fuck up the eventual output + message = replacetext(message, "\improper", "") + message = replacetext(message, "\proper", "") +@@ -241,14 +244,16 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic + + if (!C) + continue +- ++ + if(!C.chatOutput || C.chatOutput.broken) // A player who hasn't updated his skin file. +- C << message ++ C << original_message + return TRUE +- ++ + if(!C.chatOutput.loaded) + //Client sucks at loading things, put their messages in a queue + C.chatOutput.messageQueue += message ++ //But also send it to their output window since that shows until goonchat loads ++ C << original_message + return + + // url_encode it TWICE, this way any UTF-8 characters are able to be decoded by the Javascript. diff --git a/interface/skin.dmf b/interface/skin.dmf index e711b4f197..647a12a924 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -1617,7 +1617,7 @@ window "outputwindow" font-style = "" text-color = #000000 background-color = #ffffff - is-visible = true + is-visible = false is-disabled = true is-transparent = false is-default = false @@ -1632,6 +1632,32 @@ window "outputwindow" use-title = false on_show = "" on_hide = "" + elem "output" + type = OUTPUT + pos = 0,0 + size = 640x480 + anchor1 = 0,0 + anchor2 = 100,100 + font-family = "" + font-size = 0 + font-style = "" + text-color = #000000 + background-color = #ffffff + is-visible = true + is-disabled = false + is-transparent = false + is-default = true + border = none + drop-zone = false + right-click = false + saved-params = "" + on-size = "" + show-history = false + show-url = false + auto-format = false + use-title = false + on_show = "" + on_hide = "" window "statwindow" elem "statwindow"