@@ -238,45 +238,18 @@ For the main html chat area
238
238
var /list /partial = splittext(iconData, " {" )
239
239
return replacetext(copytext(partial[2 ], 3 , - 5 ), " \n " , " " )
240
240
241
- / proc / bicon(var /obj )
242
- if (! obj)
243
- return
241
+ / proc / bicon( atom / A)
242
+ if (isatom(A))
243
+ A = A. appearance // The caching is not very smart if you use the object directly.
244
+
245
+ spawn (5 ){} // Do nothing. Just hold onto a ref of A for a moment. Hopefully there will be a better way to do this later.
244
246
245
- if (isicon(obj))
246
- // Icons get pooled constantly, references are no good here.
247
- /* if (!bicon_cache["\ref[obj]"]) // Doesn't exist yet, make it.
248
- bicon_cache["\ref[obj]"] = icon2base64(obj)
249
- return "<img class='icon misc' src='data:image/png;base64,[bicon_cache["\ref[obj]"]]'>"*/
250
- return " <img class='icon misc' src='data:image/png;base64,[ icon2base64(obj)] '>"
251
-
252
- // Either an atom or somebody fucked up and is gonna get a runtime, which I'm fine with.
253
- var /atom /A = obj
254
- var /key = (" [ A. icon] " || " \ref [ A. icon] " )+ " :[ A. icon_state] "
255
- if (! bicon_cache[key]) // Doesn't exist, make it.
256
- var /icon /I = icon(A. icon, A. icon_state, SOUTH , 1 , 0 )
257
- if (! " [ A. icon] " ) // Shitty workaround for a BYOND issue.
258
- var /icon /temp = I
259
- I = icon()
260
- I. Insert(temp, dir = SOUTH )
261
- bicon_cache[key] = icon2base64(I, key)
262
-
263
- return " <img class='icon [ A. icon_state] ' src='data:image/png;base64, [ bicon_cache[key]] '>"
247
+ return " <img class='icon' src='\ref [ A] '>"
264
248
265
249
// Aliases for bicon
266
250
/ proc / bi(obj)
267
251
bicon (obj)
268
252
269
- // Costlier version of bicon() that uses getFlatIcon() to account for overlays, underlays, etc. Use with extreme moderation, ESPECIALLY on mobs.
270
- / proc / costly_bicon(var /obj )
271
- if (! obj)
272
- return
273
-
274
- if (isicon(obj))
275
- return bicon(obj)
276
-
277
- var /icon /I = getFlatIcon(obj)
278
- return bicon(I)
279
-
280
253
/ proc / to_chat(target, message)
281
254
// Ok so I did my best but I accept that some calls to this will be for shit like sound and images
282
255
// It stands that we PROBABLY don't want to output those to the browser output so just handle them here
0 commit comments