diff --git a/code/modules/chemical/Chemistry-Machinery.dm b/code/modules/chemical/Chemistry-Machinery.dm index 7edfc5fa4e..57eb90fbea 100644 --- a/code/modules/chemical/Chemistry-Machinery.dm +++ b/code/modules/chemical/Chemistry-Machinery.dm @@ -173,6 +173,7 @@ var/condi = 0 var/bottlesprite = "1" //yes, strings var/pillsprite = "1" + var/client/has_sprites = list() New() var/datum/reagents/R = new/datum/reagents(100) @@ -314,7 +315,6 @@ #define MAX_PILL_SPRITE 20 //max icon state of the pill sprites var/dat = "" for(var/i = 1 to MAX_PILL_SPRITE) - usr << browse_rsc(icon('chemical.dmi', "pill" + num2text(i)), "pill[i].png") dat += "" dat += "
" usr << browse(dat, "window=chem_master") @@ -323,7 +323,6 @@ #define MAX_BOTTLE_SPRITE 20 //max icon state of the bottle sprites var/dat = "" for(var/i = 1 to MAX_BOTTLE_SPRITE) - usr << browse_rsc(icon('chemical.dmi', "bottle" + num2text(i)), "bottle[i].png") dat += "" dat += "
" usr << browse(dat, "window=chem_master") @@ -346,13 +345,34 @@ attack_hand(mob/user as mob) if(stat & BROKEN) + spawn() + if(!(user.client in has_sprites)) //yes, it's in three places, so they get downloaded even when they arent going to be shown, because they could be in the future + spawn() + has_sprites += user.client + for(var/i = 1 to MAX_PILL_SPRITE) + usr << browse_rsc(icon('chemical.dmi', "pill" + num2text(i)), "pill[i].png") + for(var/i = 1 to MAX_BOTTLE_SPRITE) + usr << browse_rsc(icon('chemical.dmi', "bottle" + num2text(i)), "bottle[i].png") return user.machine = src var/dat = "" if(!beaker) dat = "Please insert beaker.
" dat += "Close" + if(!(user.client in has_sprites)) + spawn() + has_sprites += user.client + for(var/i = 1 to MAX_PILL_SPRITE) + usr << browse_rsc(icon('chemical.dmi', "pill" + num2text(i)), "pill[i].png") + for(var/i = 1 to MAX_BOTTLE_SPRITE) + usr << browse_rsc(icon('chemical.dmi', "bottle" + num2text(i)), "bottle[i].png") else + if(!(user.client in has_sprites)) + has_sprites += user.client + for(var/i = 1 to MAX_PILL_SPRITE) + usr << browse_rsc(icon('chemical.dmi', "pill" + num2text(i)), "pill[i].png") + for(var/i = 1 to MAX_BOTTLE_SPRITE) + usr << browse_rsc(icon('chemical.dmi', "bottle" + num2text(i)), "bottle[i].png") var/datum/reagents/R = beaker:reagents dat += "Eject beaker and Clear Buffer

" if(!R.total_volume) @@ -381,10 +401,8 @@ else dat += "Empty
" if(!condi) - usr << browse_rsc(icon('chemical.dmi', "pill" + pillsprite), "pill.png") - dat += "

Create pill (50 units max)
" - usr << browse_rsc(icon('chemical.dmi', "bottle" + bottlesprite), "bottle.png") - dat += "Create bottle (30 units max)" + dat += "

Create pill (50 units max)
" + dat += "Create bottle (30 units max)" else dat += "Create bottle (50 units max)" if(!condi)