Merge pull request #37934 from AutomaticFrenzy/patch/ssping

Migrate goonchat pings to a subsystem
This commit is contained in:
oranges
2018-05-22 09:39:12 +12:00
committed by letterjay
parent 6489ef5511
commit c27d97a6e5
4 changed files with 34 additions and 9 deletions
-9
View File
@@ -105,19 +105,10 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic
//do not convert to to_chat()
SEND_TEXT(owner, "<span class=\"userdanger\">Failed to load fancy chat, reverting to old chat. Certain features won't work.</span>")
pingLoop()
/datum/chatOutput/proc/showChat()
winset(owner, "output", "is-visible=false")
winset(owner, "browseroutput", "is-disabled=false;is-visible=true")
/datum/chatOutput/proc/pingLoop()
set waitfor = FALSE
while (owner)
ehjax_send(data = owner.is_afk(29) ? "softPang" : "pang") // SoftPang isn't handled anywhere but it'll always reset the opts.lastPang.
sleep(30)
/datum/chatOutput/proc/ehjax_send(client/C = owner, window = "browseroutput", data)
if(islist(data))
data = json_encode(data)