From 95cfe5baa0ee5afa3a14f3824f7fb6628f17435f Mon Sep 17 00:00:00 2001 From: LetterJay Date: Tue, 15 Aug 2017 19:48:26 -0500 Subject: [PATCH] Update browserOutput.dm --- code/modules/goonchat/browserOutput.dm | 51 -------------------------- 1 file changed, 51 deletions(-) diff --git a/code/modules/goonchat/browserOutput.dm b/code/modules/goonchat/browserOutput.dm index ebdc7ab421..85770f618a 100644 --- a/code/modules/goonchat/browserOutput.dm +++ b/code/modules/goonchat/browserOutput.dm @@ -165,57 +165,6 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic log_world("\[[time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")]\] Client: [(src.owner.key ? src.owner.key : src.owner)] triggered JS error: [error]") //Global chat procs -//Converts an icon to base64. Operates by putting the icon in the iconCache savefile, -// exporting it as text, and then parsing the base64 from that. -// (This relies on byond automatically storing icons in savefiles as base64) -/proc/icon2base64(icon/icon, iconKey = "misc") - if (!isicon(icon)) - return FALSE - WRITE_FILE(GLOB.iconCache[iconKey], icon) - var/iconData = GLOB.iconCache.ExportText(iconKey) - var/list/partial = splittext(iconData, "{") - return replacetext(copytext(partial[2], 3, -5), "\n", "") - -/proc/bicon(thing) - if (!thing) - return - var/static/list/bicon_cache = list() - if (isicon(thing)) - var/icon/I = thing - var/icon_md5 = md5(I) - if (!bicon_cache[icon_md5]) // Doesn't exist yet, make it. - I = icon(I) //copy it - I.Scale(16,16) //scale it - bicon_cache[icon_md5] = icon2base64(thing) //base64 it - return "" - - // Either an atom or somebody fucked up and is gonna get a runtime, which I'm fine with. - var/atom/A = thing - var/key = "[istype(A.icon, /icon) ? "\ref[A.icon]" : A.icon]:[A.icon_state]" - - - if (!bicon_cache[key]) // Doesn't exist, make it. - var/icon/I = icon(A.icon, A.icon_state, SOUTH, 1) - I.Scale(16,16) - if (ishuman(thing)) // Shitty workaround for a BYOND issue. - var/icon/temp = I - I = icon() - I.Insert(temp, dir = SOUTH) - bicon_cache[key] = icon2base64(I, key) - - return "" - -//Costlier version of bicon() that uses getFlatIcon() to account for overlays, underlays, etc. Use with extreme moderation, ESPECIALLY on mobs. -/proc/costly_bicon(thing) - if (!thing) - return - - if (isicon(thing)) - return bicon(thing) - - var/icon/I = getFlatIcon(thing) - return bicon(I) - /proc/to_chat(target, message) if(!target) return