mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
Port TG updating appearances (#17943)
* Get pants that match or else you gonna look silly yo
* Posters
* Fix other hud elements
* Rereviewed
* Update shotglass.dm
* Fix for new merged PRs
* Typo
* Coming across other stuff
* Update theblob.dm
* No takebacksies
* smh i forget to leave a comment
* Updated for the detgun and cards
* Should have rerun langserver again
* No longer plastic, more in scope
* Damn you bluespace
* Reverting turret logic, out of scope at this point
* Tweak that part
* Went over energy guns again, and fixed UI White's sprite sheet
* Welding masks, glasses, and JUSTICE
* Update portable_atmospherics.dm
* Cleaning up, clearing things up
* Review and suggestions
* Update valve.dm
* More tweaks
* Missing character
* Not distinct lightmasks, so they can be overlays
* Update generator.dm
* Add parameter so holodeck doesn't try to make a perfect copy
* Update unsorted.dm
* Spiders
* Better fix for spiders, fix vamps too
* Ghosts
* Update telekinesis.dm
* Cleaning up old procs
* It's set up to not copy datums... Unless they're in a list
* Donuts, duct tape, and detgun. D3VR coming to Early Access
* Update procs that interact with doors so they call update_state instead
* Forgot one spot, and actually might as well just force lock
* Cleaning up other things... Sigh, and kitty ears
* oops
* Getting used to how it works
* blinds
* Going back to the suit obscuring thing, so it doesn't update all the time
* Missed that from merging master
* I made this PR and forgot about it
* Fix runtimes in cards
* Make things a bit more unified
* Update update_icons.dm
* yarn, really?
* Update library_equipment.dm
* Update shieldgen.dm
* Every time Charlie merges something, I go back and see if I can improve things further
* what's this? more?
* Update misc_special.dm
* wow, paper
* Review
* More reviews
* To be sure, seems like being broken messed something sometimes
* Brought airlocks closer to how TG works to iron out some stuff
* Pizza and morgue
* Doesn't seem to hurt, tried with holodeck
* Revert "Doesn't seem to hurt, tried with holodeck"
This reverts commit 158529302b.
* Icon conflict
* Fix organ damage
* Don't ask how. Why. It's like that on prod too.
* Cutting down on things and updating from TG.
* More flexible. Just in case the thing you stuck it on didn't destroy.
* Hydro was one the things I touched earlier on, better rework it
* Reviews
* Cleaning up further, also bri'ish
* Undo a change I did, and switch over to a more recent implementation
* Update biogenerator.dm
* Rolling back to old airlocks, but with new duct taped note
* Functionally the same. I'd just rather not have the smoothing happen there
* Went over APCs again
* Fix welding helmet names in species files
* Update airlock.dm
* Update persistent_overlay.dm
* Oh, topic
This commit is contained in:
@@ -129,7 +129,7 @@
|
||||
else
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/chem_dispenser/update_icon()
|
||||
/obj/machinery/chem_dispenser/update_icon_state()
|
||||
if(panel_open)
|
||||
icon_state = "[initial(icon_state)]-o"
|
||||
return
|
||||
@@ -228,7 +228,7 @@
|
||||
if(Adjacent(usr) && !issilicon(usr))
|
||||
usr.put_in_hands(beaker)
|
||||
beaker = null
|
||||
update_icon()
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
else
|
||||
return FALSE
|
||||
|
||||
@@ -257,7 +257,7 @@
|
||||
I.forceMove(src)
|
||||
to_chat(user, "<span class='notice'>You set [I] on the machine.</span>")
|
||||
SStgui.update_uis(src) // update all UIs attached to src
|
||||
update_icon()
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
return
|
||||
return ..()
|
||||
|
||||
@@ -429,7 +429,7 @@
|
||||
cell = new(src)
|
||||
dispensable_reagents = sortList(dispensable_reagents)
|
||||
current_reagent = pick(dispensable_reagents)
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/item/handheld_chem_dispenser/Destroy()
|
||||
@@ -453,7 +453,7 @@
|
||||
target.reagents.add_reagent(current_reagent, actual)
|
||||
cell.charge -= actual / efficiency
|
||||
to_chat(user, "<span class='notice'>You dispense [actual] unit\s of [current_reagent] into [target].</span>")
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
else if(free) // If actual is nil and there's still free space, it means we're out of juice
|
||||
to_chat(user, "<span class='warning'>Insufficient energy to complete operation.</span>")
|
||||
if("remove")
|
||||
@@ -511,7 +511,7 @@
|
||||
if("dispense")
|
||||
if(params["reagent"] in dispensable_reagents)
|
||||
current_reagent = params["reagent"]
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
if("mode")
|
||||
switch(params["mode"])
|
||||
if("remove")
|
||||
@@ -520,15 +520,14 @@
|
||||
mode = "dispense"
|
||||
if("isolate")
|
||||
mode = "isolate"
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
else
|
||||
return FALSE
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
/obj/item/handheld_chem_dispenser/update_icon()
|
||||
cut_overlays()
|
||||
|
||||
/obj/item/handheld_chem_dispenser/update_overlays()
|
||||
. = ..()
|
||||
if(cell && cell.charge)
|
||||
var/image/power_light = image('icons/obj/chemical.dmi', src, "light_low")
|
||||
var/percent = round((cell.charge / cell.maxcharge) * 100)
|
||||
@@ -539,17 +538,16 @@
|
||||
power_light.icon_state = "light_mid"
|
||||
if(67 to INFINITY)
|
||||
power_light.icon_state = "light_full"
|
||||
add_overlay(power_light)
|
||||
. += power_light
|
||||
|
||||
var/image/mode_light = image('icons/obj/chemical.dmi', src, "light_remove")
|
||||
mode_light.icon_state = "light_[mode]"
|
||||
add_overlay(mode_light)
|
||||
. += mode_light
|
||||
|
||||
var/image/chamber_contents = image('icons/obj/chemical.dmi', src, "reagent_filling")
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[current_reagent]
|
||||
chamber_contents.icon += R.color
|
||||
add_overlay(chamber_contents)
|
||||
..()
|
||||
. += chamber_contents
|
||||
|
||||
/obj/item/handheld_chem_dispenser/process() //Every [recharge_time] seconds, recharge some reagents for the cyborg
|
||||
if(isrobot(loc) && cell.charge < cell.maxcharge)
|
||||
@@ -559,7 +557,7 @@
|
||||
R.cell.charge -= actual
|
||||
cell.charge += actual
|
||||
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
return TRUE
|
||||
|
||||
/obj/item/handheld_chem_dispenser/attackby(obj/item/W, mob/user, params)
|
||||
@@ -576,7 +574,7 @@
|
||||
W.loc = src
|
||||
cell = W
|
||||
to_chat(user, "<span class='notice'>You install a cell in [src].</span>")
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/handheld_chem_dispenser/screwdriver_act(mob/user, obj/item/I)
|
||||
if(!isrobot(loc) && cell)
|
||||
@@ -584,7 +582,7 @@
|
||||
cell.loc = get_turf(src)
|
||||
cell = null
|
||||
to_chat(user, "<span class='notice'>You remove the cell from [src].</span>")
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
@@ -66,11 +66,13 @@
|
||||
else if(A == loaded_pill_bottle)
|
||||
loaded_pill_bottle = null
|
||||
|
||||
/obj/machinery/chem_master/update_icon()
|
||||
overlays.Cut()
|
||||
/obj/machinery/chem_master/update_icon_state()
|
||||
icon_state = "mixer[beaker ? "1" : "0"][powered() ? "" : "_nopower"]"
|
||||
|
||||
/obj/machinery/chem_master/update_overlays()
|
||||
. = ..()
|
||||
if(powered())
|
||||
overlays += "waitlight"
|
||||
. += "waitlight"
|
||||
|
||||
/obj/machinery/chem_master/blob_act(obj/structure/blob/B)
|
||||
if(prob(50))
|
||||
|
||||
@@ -19,9 +19,8 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/computer/pandemic/set_broken()
|
||||
icon_state = (beaker ? "mixer1_b" : "mixer0_b")
|
||||
overlays.Cut()
|
||||
stat |= BROKEN
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/computer/pandemic/proc/GetVirusByIndex(index)
|
||||
if(beaker && beaker.reagents)
|
||||
@@ -54,17 +53,16 @@
|
||||
update_icon()
|
||||
playsound(loc, 'sound/machines/ping.ogg', 30, 1)
|
||||
|
||||
/obj/machinery/computer/pandemic/update_icon()
|
||||
/obj/machinery/computer/pandemic/update_icon_state()
|
||||
if(stat & BROKEN)
|
||||
icon_state = (beaker ? "mixer1_b" : "mixer0_b")
|
||||
return
|
||||
|
||||
icon_state = "mixer[(beaker)?"1":"0"][(powered()) ? "" : "_nopower"]"
|
||||
|
||||
if(wait)
|
||||
overlays.Cut()
|
||||
else
|
||||
overlays += "waitlight"
|
||||
/obj/machinery/computer/pandemic/update_overlays()
|
||||
. = list()
|
||||
if(!wait)
|
||||
. += "waitlight"
|
||||
|
||||
/obj/machinery/computer/pandemic/Topic(href, href_list)
|
||||
if(..())
|
||||
|
||||
@@ -126,9 +126,9 @@
|
||||
/obj/machinery/reagentgrinder/handle_atom_del(atom/A)
|
||||
if(A == beaker)
|
||||
beaker = null
|
||||
update_icon()
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
/obj/machinery/reagentgrinder/update_icon()
|
||||
/obj/machinery/reagentgrinder/update_icon_state()
|
||||
if(beaker)
|
||||
icon_state = "juicer1"
|
||||
else
|
||||
@@ -173,7 +173,7 @@
|
||||
return FALSE
|
||||
beaker = I
|
||||
beaker.loc = src
|
||||
update_icon()
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
updateUsrDialog()
|
||||
return TRUE //no afterattack
|
||||
|
||||
@@ -310,7 +310,7 @@
|
||||
return
|
||||
beaker.loc = src.loc
|
||||
beaker = null
|
||||
update_icon()
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/eject()
|
||||
|
||||
@@ -66,12 +66,12 @@
|
||||
/obj/item/reagent_containers/proc/add_lid()
|
||||
if(has_lid)
|
||||
container_type ^= REFILLABLE | DRAINABLE
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/reagent_containers/proc/remove_lid()
|
||||
if(has_lid)
|
||||
container_type |= REFILLABLE | DRAINABLE
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/reagent_containers/attack_self(mob/user)
|
||||
if(has_lid)
|
||||
|
||||
@@ -36,14 +36,20 @@
|
||||
to_chat(loc, "<span class='warning'>[src] identifies and removes a harmful substance.</span>")
|
||||
else
|
||||
visible_message("<span class='warning'>[src] identifies and removes a harmful substance.</span>")
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/reagent_containers/applicator/update_icon()
|
||||
cut_overlays()
|
||||
/obj/item/reagent_containers/applicator/update_icon_state()
|
||||
if(applying)
|
||||
icon_state = "mender-active"
|
||||
else
|
||||
icon_state = "mender"
|
||||
|
||||
/obj/item/reagent_containers/applicator/update_overlays()
|
||||
. = ..()
|
||||
if(reagents.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance('icons/goonstation/objects/objects.dmi', "mender-fluid")
|
||||
filling.color = mix_color_from_reagents(reagents.reagent_list)
|
||||
add_overlay(filling)
|
||||
. += filling
|
||||
var/reag_pct = round((reagents.total_volume / volume) * 100)
|
||||
var/mutable_appearance/applicator_bar = mutable_appearance('icons/goonstation/objects/objects.dmi', "app_e")
|
||||
switch(reag_pct)
|
||||
@@ -53,7 +59,7 @@
|
||||
applicator_bar.icon_state = "app_he"
|
||||
if(0)
|
||||
applicator_bar.icon_state = "app_e"
|
||||
add_overlay(applicator_bar)
|
||||
. += applicator_bar
|
||||
|
||||
/obj/item/reagent_containers/applicator/attack(mob/living/M, mob/user)
|
||||
if(!reagents.total_volume)
|
||||
@@ -72,7 +78,7 @@
|
||||
user.visible_message("<span class='warning'>[user] begins mending [M] with [src].</span>", "<span class='notice'>You begin mending [M] with [src].</span>")
|
||||
if(M.reagents)
|
||||
applying = TRUE
|
||||
icon_state = "mender-active"
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
apply_to(M, user, 0.2) // We apply a very weak application up front, then loop.
|
||||
while(do_after(user, 10, target = M))
|
||||
measured_health = M.health
|
||||
@@ -84,7 +90,7 @@
|
||||
to_chat(user, "<span class='notice'>[src] is out of reagents and powers down automatically.</span>")
|
||||
break
|
||||
applying = FALSE
|
||||
icon_state = "mender"
|
||||
update_icon()
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
|
||||
|
||||
|
||||
@@ -13,12 +13,11 @@
|
||||
volume = 30
|
||||
|
||||
/obj/item/reagent_containers/glass/bottle/on_reagent_change()
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/reagent_containers/glass/bottle/update_icon()
|
||||
overlays.Cut()
|
||||
/obj/item/reagent_containers/glass/bottle/update_overlays()
|
||||
. = ..()
|
||||
underlays.Cut()
|
||||
|
||||
if(reagents.total_volume)
|
||||
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]10")
|
||||
|
||||
@@ -39,8 +38,7 @@
|
||||
underlays += filling
|
||||
|
||||
if(!is_open_container())
|
||||
var/image/lid = image(icon, src, "lid_[icon_state]")
|
||||
overlays += lid
|
||||
. += "lid_[icon_state]"
|
||||
|
||||
/obj/item/reagent_containers/glass/bottle/decompile_act(obj/item/matter_decompiler/C, mob/user)
|
||||
if(!reagents.total_volume)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
container_type = OPENCONTAINER
|
||||
has_lid = TRUE
|
||||
resistance_flags = ACID_PROOF
|
||||
blocks_emissive = FALSE
|
||||
var/label_text = ""
|
||||
|
||||
/obj/item/reagent_containers/glass/New()
|
||||
@@ -128,11 +129,10 @@
|
||||
var/can_assembly = 1
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/on_reagent_change()
|
||||
update_icon()
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/update_icon()
|
||||
overlays.Cut()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/update_overlays()
|
||||
. = ..()
|
||||
if(reagents.total_volume)
|
||||
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]10")
|
||||
|
||||
@@ -154,14 +154,14 @@
|
||||
filling.icon_state = "[icon_state]100"
|
||||
|
||||
filling.icon += mix_color_from_reagents(reagents.reagent_list)
|
||||
overlays += filling
|
||||
. += filling
|
||||
|
||||
if(!is_open_container())
|
||||
var/image/lid = image(icon, src, "lid_[initial(icon_state)]")
|
||||
overlays += lid
|
||||
. += "lid_[initial(icon_state)]"
|
||||
if(blocks_emissive == FALSE)
|
||||
. += emissive_blocker(icon, "lid_[initial(icon_state)]")
|
||||
if(assembly)
|
||||
overlays += "assembly"
|
||||
..()
|
||||
. += "assembly"
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/verb/remove_assembly()
|
||||
set name = "Remove Assembly"
|
||||
@@ -173,7 +173,7 @@
|
||||
to_chat(usr, "<span class='notice'>You detach [assembly] from [src]</span>")
|
||||
usr.put_in_hands(assembly)
|
||||
assembly = null
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
else
|
||||
to_chat(usr, "<span class='notice'>There is no assembly to remove.</span>")
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
assembly = W
|
||||
user.drop_item()
|
||||
W.forceMove(src)
|
||||
overlays += "assembly"
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -254,6 +254,7 @@
|
||||
amount_per_transfer_from_this = 10
|
||||
origin_tech = "materials=2;engineering=3;plasmatech=3"
|
||||
container_type = OPENCONTAINER
|
||||
blocks_emissive = EMISSIVE_BLOCK_GENERIC
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/noreact/New()
|
||||
..()
|
||||
@@ -268,6 +269,7 @@
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,50,100,300)
|
||||
container_type = OPENCONTAINER
|
||||
blocks_emissive = EMISSIVE_BLOCK_GENERIC
|
||||
origin_tech = "bluespace=5;materials=4;plasmatech=4"
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/cryoxadone
|
||||
@@ -297,6 +299,7 @@
|
||||
armor = list(MELEE = 10, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 75, ACID = 50) //Weak melee protection, because you can wear it on your head
|
||||
slot_flags = SLOT_HEAD
|
||||
resistance_flags = NONE
|
||||
blocks_emissive = EMISSIVE_BLOCK_GENERIC
|
||||
container_type = OPENCONTAINER
|
||||
dog_fashion = /datum/dog_fashion/head/bucket
|
||||
|
||||
|
||||
@@ -116,10 +116,10 @@
|
||||
to_chat(user, "<span class='warning'>[src] is empty!</span>")
|
||||
return
|
||||
..()
|
||||
update_icon()
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
return TRUE
|
||||
|
||||
/obj/item/reagent_containers/hypospray/autoinjector/update_icon()
|
||||
/obj/item/reagent_containers/hypospray/autoinjector/update_icon_state()
|
||||
if(reagents.total_volume > 0)
|
||||
icon_state = initial(icon_state)
|
||||
else
|
||||
|
||||
@@ -22,24 +22,24 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/reagent_containers/iv_bag/on_reagent_change()
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/reagent_containers/iv_bag/pickup(mob/user)
|
||||
. = ..()
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/reagent_containers/iv_bag/dropped(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/reagent_containers/iv_bag/attack_self(mob/user)
|
||||
..()
|
||||
mode = !mode
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/reagent_containers/iv_bag/attack_hand()
|
||||
..()
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/reagent_containers/iv_bag/proc/begin_processing(mob/target)
|
||||
injection_target = target
|
||||
@@ -70,13 +70,13 @@
|
||||
var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1) //The amount of reagents we'll transfer to the person
|
||||
reagents.reaction(injection_target, REAGENT_INGEST, fraction) //React the amount we're transfering.
|
||||
reagents.trans_to(injection_target, amount_per_transfer_from_this)
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
else // Drawing
|
||||
if(reagents.total_volume < reagents.maximum_volume)
|
||||
injection_target.transfer_blood_to(src, amount_per_transfer_from_this)
|
||||
for(var/datum/reagent/x in injection_target.reagents.reagent_list) // Pull small amounts of reagents from the person while drawing blood
|
||||
injection_target.reagents.trans_to(src, amount_per_transfer_from_this/10)
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/reagent_containers/iv_bag/attack(mob/living/M, mob/living/user, def_zone)
|
||||
return
|
||||
@@ -133,21 +133,20 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/item/reagent_containers/iv_bag/update_icon()
|
||||
overlays.Cut()
|
||||
|
||||
/obj/item/reagent_containers/iv_bag/update_overlays()
|
||||
. = ..()
|
||||
if(reagents.total_volume)
|
||||
var/percent = round((reagents.total_volume / volume) * 10) // We round the 1's place off of our percent for easy image processing.
|
||||
var/image/filling = image('icons/goonstation/objects/iv.dmi', src, "[icon_state][percent]")
|
||||
|
||||
filling.icon += mix_color_from_reagents(reagents.reagent_list)
|
||||
overlays += filling
|
||||
. += filling
|
||||
if(ismob(loc))
|
||||
switch(mode)
|
||||
if(IV_DRAW)
|
||||
overlays += "draw"
|
||||
. += "draw"
|
||||
if(IV_INJECT)
|
||||
overlays += "inject"
|
||||
. += "inject"
|
||||
|
||||
/obj/item/reagent_containers/iv_bag/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/pen) || istype(I, /obj/item/flashlight/pen))
|
||||
@@ -171,7 +170,7 @@
|
||||
if(blood_type != null)
|
||||
name = "[initial(name)] - [blood_type]"
|
||||
reagents.add_reagent("blood", 200, list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_type"=blood_type,"resistances"=null,"trace_chem"=null))
|
||||
update_icon()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
|
||||
/obj/item/reagent_containers/iv_bag/blood/random/Initialize()
|
||||
|
||||
@@ -149,18 +149,23 @@
|
||||
mode = SYRINGE_DRAW
|
||||
update_icon()
|
||||
|
||||
/obj/item/reagent_containers/syringe/update_icon()
|
||||
cut_overlays()
|
||||
/obj/item/reagent_containers/syringe/update_icon_state()
|
||||
var/rounded_vol
|
||||
if(reagents && reagents.total_volume)
|
||||
rounded_vol = clamp(round((reagents.total_volume / volume * 15), 5), 1, 15)
|
||||
else
|
||||
rounded_vol = 0
|
||||
icon_state = "[rounded_vol]"
|
||||
item_state = "syringe_[rounded_vol]"
|
||||
|
||||
/obj/item/reagent_containers/syringe/update_overlays()
|
||||
. = ..()
|
||||
var/rounded_vol
|
||||
if(reagents && 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.icon += mix_color_from_reagents(reagents.reagent_list)
|
||||
add_overlay(filling_overlay)
|
||||
else
|
||||
rounded_vol = 0
|
||||
icon_state = "[rounded_vol]"
|
||||
item_state = "syringe_[rounded_vol]"
|
||||
. += filling_overlay
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
var/injoverlay
|
||||
@@ -169,7 +174,7 @@
|
||||
injoverlay = "draw"
|
||||
if(SYRINGE_INJECT)
|
||||
injoverlay = "inject"
|
||||
add_overlay(injoverlay)
|
||||
. += injoverlay
|
||||
M.update_inv_l_hand()
|
||||
M.update_inv_r_hand()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user