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