Skip to content

Commit

Permalink
Fixes syringe icons (tgstation#34704)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShizCalev authored and AnturK committed Jan 22, 2018
1 parent 6c8ee68 commit d504c7e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions code/modules/reagents/reagent_containers/syringes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@

var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) // transfer from, transfer to - who cares?

to_chat(user, "<span class='notice'>You fill [src] with [trans] units of the solution.</span>")
to_chat(user, "<span class='notice'>You fill [src] with [trans] units of the solution. It now contains [reagents.total_volume] units.</span>")
if (reagents.total_volume >= reagents.maximum_volume)
mode=!mode
update_icon()
Expand Down Expand Up @@ -154,23 +154,27 @@


/obj/item/reagent_containers/syringe/update_icon()
var/rounded_vol = CLAMP(round((reagents.total_volume / volume * 15),5), 0, 15)
cut_overlays()
var/rounded_vol
if(reagents.total_volume)
rounded_vol = CLAMP(round((reagents.total_volume / volume * 15),5), 1, 15)
var/image/filling_overlay = mutable_appearance('icons/obj/reagentfillings.dmi', "syringe[rounded_vol]")
filling_overlay.color = mix_color_from_reagents(reagents.reagent_list)
add_overlay(filling_overlay)
else
rounded_vol = 0
icon_state = "[rounded_vol]"
item_state = "syringe_[rounded_vol]"
if(ismob(loc))
var/mob/M = loc
var/injoverlay
switch(mode)
if (SYRINGE_DRAW)
injoverlay = "draw"
if (SYRINGE_INJECT)
injoverlay = "inject"
add_overlay(injoverlay)
icon_state = "[rounded_vol]"
item_state = "syringe_[rounded_vol]"

if(reagents.total_volume)
var/image/filling_overlay = mutable_appearance('icons/obj/reagentfillings.dmi', "syringe[rounded_vol]")
filling_overlay.color = mix_color_from_reagents(reagents.reagent_list)
add_overlay(filling_overlay)
M.update_inv_hands()

/obj/item/reagent_containers/syringe/epinephrine
name = "syringe (epinephrine)"
Expand Down
Binary file modified icons/mob/inhands/equipment/medical_lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/inhands/equipment/medical_righthand.dmi
Binary file not shown.
Binary file modified icons/obj/reagentfillings.dmi
Binary file not shown.
Binary file modified icons/obj/syringe.dmi
Binary file not shown.

0 comments on commit d504c7e

Please sign in to comment.