From 365fe761a000e0f7926143d02ad89ca279063d88 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Thu, 3 Aug 2017 07:59:38 -0500 Subject: [PATCH] Makes bIcon scale to 16x16 like byond chat output did (#2238) --- code/modules/goonchat/browserOutput.dm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/code/modules/goonchat/browserOutput.dm b/code/modules/goonchat/browserOutput.dm index 407c6c2846..7b236ea56f 100644 --- a/code/modules/goonchat/browserOutput.dm +++ b/code/modules/goonchat/browserOutput.dm @@ -180,21 +180,24 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic /proc/bicon(thing) if (!thing) return - + var/static/list/bicon_cache = list() if (isicon(thing)) - //Icons get pooled constantly, references are no good here. - /*if (!bicon_cache["\ref[obj]"]) // Doesn't exist yet, make it. - bicon_cache["\ref[obj]"] = icon2base64(obj) - return ""*/ - return "" + 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]" - var/static/list/bicon_cache = list() + 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()