mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
Adds no-class mode to bicon proc
... and makes the bicons in View Variables use it. This seems to stop a small number of icon state classes from breaking Dream Seeker when directly browsed to a client. I don't actually understand why, but it works.
This commit is contained in:
@@ -161,7 +161,7 @@
|
||||
body += "<div align='center'><table width='100%'><tr><td width='50%'>"
|
||||
|
||||
if(sprite)
|
||||
body += "<table align='center' width='100%'><tr><td>[bicon(D)]</td><td>"
|
||||
body += "<table align='center' width='100%'><tr><td>[bicon(D, use_class=0)]</td><td>"
|
||||
else
|
||||
body += "<table align='center' width='100%'><tr><td>"
|
||||
|
||||
@@ -350,14 +350,14 @@ body
|
||||
|
||||
else if(isicon(value))
|
||||
#ifdef VARSICON
|
||||
html += "[name] = /icon (<span class='value'>[value]</span>) [bicon(value)]"
|
||||
html += "[name] = /icon (<span class='value'>[value]</span>) [bicon(value, use_class=0)]"
|
||||
#else
|
||||
html += "[name] = /icon (<span class='value'>[value]</span>)"
|
||||
#endif
|
||||
|
||||
else if(istype(value, /image))
|
||||
#ifdef VARSICON
|
||||
html += "<a href='?_src_=vars;Vars=\ref[value]'>[name] \ref[value]</a> = /image (<span class='value'>[value]</span>) [bicon(value)]"
|
||||
html += "<a href='?_src_=vars;Vars=\ref[value]'>[name] \ref[value]</a> = /image (<span class='value'>[value]</span>) [bicon(value, use_class=0)]"
|
||||
#else
|
||||
html += "<a href='?_src_=vars;Vars=\ref[value]'>[name] \ref[value]</a> = /image (<span class='value'>[value]</span>)"
|
||||
#endif
|
||||
|
||||
@@ -171,7 +171,8 @@ var/list/chatResources = list(
|
||||
var/list/partial = splittext(iconData, "{")
|
||||
return replacetext(copytext(partial[2], 3, -5), "\n", "")
|
||||
|
||||
/proc/bicon(var/obj)
|
||||
/proc/bicon(var/obj, var/use_class = 1)
|
||||
var/class = use_class ? "class='icon misc'" : null
|
||||
if (!obj)
|
||||
return
|
||||
|
||||
@@ -179,7 +180,7 @@ var/list/chatResources = list(
|
||||
if (!bicon_cache["\ref[obj]"]) // Doesn't exist yet, make it.
|
||||
bicon_cache["\ref[obj]"] = icon2base64(obj)
|
||||
|
||||
return "<img class='icon misc' src='data:image/png;base64,[bicon_cache["\ref[obj]"]]'>"
|
||||
return "<img [class] src='data:image/png;base64,[bicon_cache["\ref[obj]"]]'>"
|
||||
|
||||
// Either an atom or somebody fucked up and is gonna get a runtime, which I'm fine with.
|
||||
var/atom/A = obj
|
||||
@@ -191,8 +192,10 @@ var/list/chatResources = list(
|
||||
I = icon()
|
||||
I.Insert(temp, dir = SOUTH)
|
||||
bicon_cache[key] = icon2base64(I, key)
|
||||
if(use_class)
|
||||
class = "class='icon [A.icon_state]'"
|
||||
|
||||
return "<img class='icon [A.icon_state]' src='data:image/png;base64,[bicon_cache[key]]'>"
|
||||
return "<img [class] src='data:image/png;base64,[bicon_cache[key]]'>"
|
||||
|
||||
//Aliases for bicon
|
||||
/proc/bi(obj)
|
||||
|
||||
Reference in New Issue
Block a user