diff --git a/code/modules/client/asset_cache.dm b/code/modules/client/asset_cache.dm
index 64585baf26d..08e3a9a1862 100644
--- a/code/modules/client/asset_cache.dm
+++ b/code/modules/client/asset_cache.dm
@@ -61,7 +61,7 @@ You can set verify to TRUE if you want send() to sleep until the client has the
while(client && !client.completed_asset_jobs.Find(job) && t < timeout_time) // Reception is handled in Topic()
sleep(1) // Lock up the caller until this is received.
t++
-
+
if(t >= timeout_time)
log_admin(SPAN_DANGER("Timeout time [timeout_time] exceeded for asset: [asset_name] for client [client]. Please notify a developer."))
@@ -175,25 +175,6 @@ var/list/asset_datums = list()
/datum/asset/simple/send(client)
send_asset_list(client,assets,verify)
-/datum/asset/chem_master
- var/list/bottle_sprites = list("bottle-1", "bottle-2", "bottle-3", "bottle-4")
- var/max_pill_sprite = 20
- var/list/assets = list()
-
-/datum/asset/chem_master/register()
- for (var/i = 1 to max_pill_sprite)
- var/name = "pill[i].png"
- register_asset(name, icon('icons/obj/chemical.dmi', "pill[i]"))
- assets += name
-
- for (var/sprite in bottle_sprites)
- var/name = "[sprite].png"
- register_asset(name, icon('icons/obj/chemical.dmi', sprite))
- assets += name
-
-/datum/asset/chem_master/send(client)
- send_asset_list(client, assets)
-
/datum/asset/group
_abstract = /datum/asset/group
var/list/children
@@ -528,3 +509,16 @@ var/list/asset_datums = list()
else
Insert(imgid, I)
return ..()
+
+/datum/asset/spritesheet/chem_master
+ name = "chemmaster"
+ var/list/bottle_sprites = list("bottle-1", "bottle-2", "bottle-3", "bottle-4")
+ var/max_pill_sprite = 20
+
+/datum/asset/spritesheet/chem_master/register()
+ for (var/i = 1 to max_pill_sprite)
+ Insert("pill[i]", 'icons/obj/chemical.dmi', "pill[i]")
+
+ for (var/sprite in bottle_sprites)
+ Insert(sprite, icon('icons/obj/chemical.dmi', sprite))
+ return ..()
diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm
index 34b628897b7..54e1f8e1e2e 100644
--- a/code/modules/reagents/Chemistry-Machinery.dm
+++ b/code/modules/reagents/Chemistry-Machinery.dm
@@ -26,6 +26,7 @@
var/pillsprite = "1"
var/max_pill_count = 20
flags = OPENCONTAINER
+ var/datum/asset/spritesheet/chem_master/chem_asset
/obj/machinery/chem_master/Initialize()
. = ..()
@@ -202,16 +203,23 @@
var/obj/item/reagent_containers/food/condiment/P = new/obj/item/reagent_containers/food/condiment(get_turf(src))
reagents.trans_to_obj(P,50)
else if(href_list["change_pill"])
- var/dat = "
"
+ if(!chem_asset)
+ chem_asset = get_asset_datum(/datum/asset/spritesheet/chem_master)
+ var/dat = chem_asset.css_tag()
+ dat += ""
usr << browse(dat, "window=chem_master")
return
else if(href_list["change_bottle"])
- var/dat = ""
+ if(!chem_asset)
+ chem_asset = get_asset_datum(/datum/asset/spritesheet/chem_master)
+ var/dat = chem_asset.css_tag()
+ dat += ""
usr << browse(dat, "window=chem_master")
return
@@ -233,10 +241,9 @@
return
user.set_machine(src)
- var/datum/asset/pill_icons = get_asset_datum(/datum/asset/chem_master)
- pill_icons.send(user.client)
-
- var/dat = ""
+ if(!chem_asset)
+ chem_asset = get_asset_datum(/datum/asset/spritesheet/chem_master)
+ var/dat = chem_asset.css_tag()
if(!beaker)
dat = "Please insert beaker.
"
if(src.loaded_pill_bottle)
@@ -277,9 +284,9 @@
else
dat += "Empty
"
if(!condi)
- dat += "
Create pill (60 units max)
"
+ dat += "
Create pill (60 units max)[chem_asset.icon_tag("pill[pillsprite]")]
"
dat += "Create multiple pills
"
- dat += "Create bottle (60 units max)
"
+ dat += "Create bottle (60 units max)[chem_asset.icon_tag(bottlesprite)]"
else
dat += "Create bottle (50 units max)"
if(!condi)
diff --git a/html/changelogs/MDP-chemsheet.yml b/html/changelogs/MDP-chemsheet.yml
new file mode 100644
index 00000000000..eec91d0371c
--- /dev/null
+++ b/html/changelogs/MDP-chemsheet.yml
@@ -0,0 +1,41 @@
+################################
+# Example Changelog File
+#
+# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
+#
+# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
+# When it is, any changes listed below will disappear.
+#
+# Valid Prefixes:
+# bugfix
+# wip (For works in progress)
+# tweak
+# soundadd
+# sounddel
+# rscadd (general adding of nice things)
+# rscdel (general deleting of nice things)
+# imageadd
+# imagedel
+# maptweak
+# spellcheck (typo fixes)
+# experiment
+# balance
+# admin
+# backend
+# security
+# refactor
+#################################
+
+# Your name.
+author: MoondancerPony
+
+# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
+delete-after: True
+
+# Any changes you've made. See valid prefix list above.
+# INDENT WITH TWO SPACES. NOT TABS. SPACES.
+# SCREW THIS UP AND IT WON'T WORK.
+# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
+# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - refactor: "Chemmaster UI icons are now sent via spritesheets."