Skip to content

Commit 7c3dac5

Browse files
committed
Changes bicon() to use the builtin 515 feature
1 parent 033f53c commit 7c3dac5

File tree

3 files changed

+8
-35
lines changed

3 files changed

+8
-35
lines changed

code/game/machinery/kitchen/smartfridge.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@
356356
if(istype(thisPile))
357357
thisPile.addAmount(1)
358358
else
359-
piles[formatted_name] = new/datum/fridge_pile(formatted_name, src, 1, costly_bicon(O))
359+
piles[formatted_name] = new/datum/fridge_pile(formatted_name, src, 1, bicon(O))
360360

361361

362362
/obj/machinery/smartfridge/proc/dump_bag(var/obj/item/weapon/storage/bag/B, var/mob/user)

code/game/machinery/vending.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ var/global/num_vending_terminals = 1
606606
var/datum/data/vending_product/R = new()
607607
R.custom = TRUE
608608
R.product_name = item.product_name()
609-
R.mini_icon = costly_bicon(item)
609+
R.mini_icon = bicon(item)
610610
R.display_color = pick("red", "blue", "green")
611611
R.amount = 1
612612
if(item.price) // price tagger - only works on new items

goon/code/datums/browserOutput.dm

+6-33
Original file line numberDiff line numberDiff line change
@@ -241,45 +241,18 @@ For the main html chat area
241241
var/list/partial = splittext(iconData, "{")
242242
return replacetext(copytext(partial[2], 3, -5), "\n", "")
243243

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.
247249

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]'>"
267251

268252
//Aliases for bicon
269253
/proc/bi(obj)
270254
bicon(obj)
271255

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-
283256
/proc/to_chat(target, message)
284257
//Ok so I did my best but I accept that some calls to this will be for shit like sound and images
285258
//It stands that we PROBABLY don't want to output those to the browser output so just handle them here

0 commit comments

Comments
 (0)