Ok, done.
This commit is contained in:
@@ -18,26 +18,27 @@
|
||||
/obj/item/reagent_containers/glass/bottle/on_reagent_change(changetype)
|
||||
update_icon()
|
||||
|
||||
/obj/item/reagent_containers/glass/bottle/update_icon()
|
||||
cut_overlays()
|
||||
/obj/item/reagent_containers/glass/bottle/update_overlays()
|
||||
. = ..()
|
||||
if(!cached_icon)
|
||||
cached_icon = icon_state
|
||||
if(reagents.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[icon_state]-10")
|
||||
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[cached_icon]-10", color = mix_color_from_reagents(reagents.reagent_list))
|
||||
|
||||
var/percent = round((reagents.total_volume / volume) * 100)
|
||||
switch(percent)
|
||||
if(0 to 9)
|
||||
filling.icon_state = "[icon_state]-10"
|
||||
filling.icon_state = "[cached_icon]-10"
|
||||
if(10 to 29)
|
||||
filling.icon_state = "[icon_state]25"
|
||||
filling.icon_state = "[cached_icon]25"
|
||||
if(30 to 49)
|
||||
filling.icon_state = "[icon_state]50"
|
||||
filling.icon_state = "[cached_icon]50"
|
||||
if(50 to 69)
|
||||
filling.icon_state = "[icon_state]75"
|
||||
filling.icon_state = "[cached_icon]75"
|
||||
if(70 to INFINITY)
|
||||
filling.icon_state = "[icon_state]100"
|
||||
filling.icon_state = "[cached_icon]100"
|
||||
|
||||
filling.color = mix_color_from_reagents(reagents.reagent_list)
|
||||
add_overlay(filling)
|
||||
. += filling
|
||||
|
||||
|
||||
/obj/item/reagent_containers/glass/bottle/epinephrine
|
||||
|
||||
Reference in New Issue
Block a user