[ready]Makes bIcon better (#29690)

Goonchat will use the asset cache, you now have to specify who to send the icons too.

Goonchat will now load icons in the background, displaying them once they load. this prevents the message from being delayed while the icons are sent.

Icons that aren't preloaded using the asset cache system will not render on ie8 clients. This is because of a ie8 bug that prevents changes on runtime created images from rendering.
This commit is contained in:
Kyle Spier-Swenson
2017-08-14 10:40:50 +12:00
committed by oranges
parent d7da0b0de4
commit f2cf4c2f5c
67 changed files with 356 additions and 220 deletions
@@ -169,7 +169,7 @@
. += "You recognise the footprints as belonging to:\n"
for(var/shoe in shoe_types)
var/obj/item/clothing/shoes/S = shoe
. += "some <B>[initial(S.name)]</B> [bicon(initial(S.icon))]\n"
. += "some <B>[initial(S.name)]</B> [icon2html(initial(S.icon), user)]\n"
to_chat(user, .)
+1 -1
View File
@@ -22,7 +22,7 @@
/obj/effect/mine/proc/triggermine(mob/victim)
if(triggered)
return
visible_message("<span class='danger'>[victim] sets off [bicon(src)] [src]!</span>")
visible_message("<span class='danger'>[victim] sets off [icon2html(src, viewers(src))] [src]!</span>")
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
s.start()
+2 -2
View File
@@ -558,7 +558,7 @@ GLOBAL_LIST_EMPTY(PDAs)
if (!silent)
playsound(loc, 'sound/machines/twobeep.ogg', 50, 1)
audible_message("[bicon(src)] *[ttone]*", null, 3)
audible_message("[icon2html(src, hearers(src))] *[ttone]*", null, 3)
//Search for holder of the PDA.
var/mob/living/L = null
if(loc && isliving(loc))
@@ -575,7 +575,7 @@ GLOBAL_LIST_EMPTY(PDAs)
hrefstart = "<a href='?src=\ref[L];track=[html_encode(source.owner)]'>"
hrefend = "</a>"
to_chat(L, "[\bicon(src)] <b>Message from [hrefstart][source.owner] ([source.ownjob])[hrefend], </b>\"[msg.message]\"[msg.get_photo_ref()] (<a href='byond://?src=\ref[src];choice=Message;skiprefresh=1;target=\ref[source]'>Reply</a>)")
to_chat(L, "[icon2html(src)] <b>Message from [hrefstart][source.owner] ([source.ownjob])[hrefend], </b>\"[msg.message]\"[msg.get_photo_ref()] (<a href='byond://?src=\ref[src];choice=Message;skiprefresh=1;target=\ref[source]'>Reply</a>)")
update_icon()
add_overlay(icon_alert)
@@ -88,27 +88,27 @@
if(isliving(loc))
var/mob/living/M = loc
if(!emagged)
to_chat(M, "<span class='boldannounce'>[bicon(src)] RADIATION PULSE DETECTED.</span>")
to_chat(M, "<span class='boldannounce'>[bicon(src)] Severity: [amount]</span>")
to_chat(M, "<span class='boldannounce'>[icon2html(src, M)] RADIATION PULSE DETECTED.</span>")
to_chat(M, "<span class='boldannounce'>[icon2html(src, M)] Severity: [amount]</span>")
else
to_chat(M, "<span class='boldannounce'>[bicon(src)] !@%$AT!(N P!LS! D/TEC?ED.</span>")
to_chat(M, "<span class='boldannounce'>[bicon(src)] &!F2rity: <=[amount]#1</span>")
to_chat(M, "<span class='boldannounce'>[icon2html(src, M)] !@%$AT!(N P!LS! D/TEC?ED.</span>")
to_chat(M, "<span class='boldannounce'>[icon2html(src, M)] &!F2rity: <=[amount]#1</span>")
update_icon()
/obj/item/device/geiger_counter/attack_self(mob/user)
scanning = !scanning
update_icon()
to_chat(user, "<span class='notice'>[bicon(src)] You switch [scanning ? "on" : "off"] [src].</span>")
to_chat(user, "<span class='notice'>[icon2html(src, user)] You switch [scanning ? "on" : "off"] [src].</span>")
/obj/item/device/geiger_counter/attack(mob/living/M, mob/user)
if(user.a_intent == INTENT_HELP)
if(!emagged)
user.visible_message("<span class='notice'>[user] scans [M] with [src].</span>", "<span class='notice'>You scan [M]'s radiation levels with [src]...</span>")
if(!M.radiation)
to_chat(user, "<span class='notice'>[bicon(src)] Radiation levels within normal boundaries.</span>")
to_chat(user, "<span class='notice'>[icon2html(src, user)] Radiation levels within normal boundaries.</span>")
return 1
else
to_chat(user, "<span class='boldannounce'>[bicon(src)] Subject is irradiated. Radiation levels: [M.radiation].</span>")
to_chat(user, "<span class='boldannounce'>[icon2html(src, user)] Subject is irradiated. Radiation levels: [M.radiation].</span>")
return 1
else
user.visible_message("<span class='notice'>[user] scans [M] with [src].</span>", "<span class='danger'>You project [src]'s stored radiation into [M]'s body!</span>")
+2 -2
View File
@@ -527,7 +527,7 @@
return list(pick(messages))
/obj/item/toy/talking/proc/toy_talk(mob/user, message)
user.loc.visible_message("<span class='[span]'>[bicon(src)] [message]</span>")
user.loc.visible_message("<span class='[span]'>[icon2html(src, viewers(user.loc))] [message]</span>")
if(chattering)
chatter(message, phomeme, user)
@@ -1082,7 +1082,7 @@
user.visible_message("<span class='notice'>[user] pulls back the string on [src].</span>")
icon_state = "[initial(icon_state)]_used"
sleep(5)
audible_message("<span class='danger'>[bicon(src)] Hiss!</span>")
audible_message("<span class='danger'>[icon2html(src, viewers(src))] Hiss!</span>")
var/list/possible_sounds = list('sound/voice/hiss1.ogg', 'sound/voice/hiss2.ogg', 'sound/voice/hiss3.ogg', 'sound/voice/hiss4.ogg')
var/chosen_sound = pick(possible_sounds)
playsound(get_turf(src), chosen_sound, 50, 1)
@@ -525,7 +525,7 @@ AI MODULES
laws[1] = generate_ion_law()
to_chat(user, "<span class='notice'>You press the button on [src].</span>")
playsound(user, 'sound/machines/click.ogg', 20, 1)
src.loc.visible_message("<span class='warning'>[bicon(src)] [laws[1]]</span>")
src.loc.visible_message("<span class='warning'>[icon2html(src, viewers(loc))] [laws[1]]</span>")
/******************** Mother Drone ******************/
+1 -1
View File
@@ -106,7 +106,7 @@
update_label()
/obj/item/weapon/card/id/attack_self(mob/user)
user.visible_message("<span class='notice'>[user] shows you: [bicon(src)] [src.name].</span>", \
user.visible_message("<span class='notice'>[user] shows you: [icon2html(src, viewers(user))] [src.name].</span>", \
"<span class='notice'>You show \the [src.name].</span>")
src.add_fingerprint(user)
return
@@ -37,10 +37,10 @@
out += "<span class='notice'>You'll need to get closer to see any more.</span>"
return
for(var/obj/item/I in loadedItems)
out += "<span class='info'>[bicon(I)] It has \the [I] loaded.</span>"
out += "<span class='info'>[icon2html(I, user)] It has \the [I] loaded.</span>"
CHECK_TICK
if(tank)
out += "<span class='notice'>[bicon(tank)] It has \the [tank] mounted onto it.</span>"
out += "<span class='notice'>[icon2html(tank, user)] It has \the [tank] mounted onto it.</span>"
to_chat(user, out.Join("<br>"))
/obj/item/weapon/pneumatic_cannon/attackby(obj/item/weapon/W, mob/user, params)
+1 -1
View File
@@ -26,7 +26,7 @@
to_chat(user, "<span class='notice'>You'll need to get closer to see any more.</span>")
return
if(tank)
to_chat(user, "<span class='notice'>[bicon(tank)] It has \the [tank] mounted onto it.</span>")
to_chat(user, "<span class='notice'>[icon2html(tank, user)] It has \the [tank] mounted onto it.</span>")
/obj/item/weapon/melee/powerfist/attackby(obj/item/weapon/W, mob/user, params)