mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 05:23:22 +01:00
Update SSOverlays (ported from Baystation) (#19051)
Our SSOverlays system is outdated, and is likely the cause of many of the issues seen in #18895. It has also been linked to a massive server performance decrease. This brings an updated system from Baystation, hopefully with speed increases. Should be testmerged, ideally with #18895. --------- Co-authored-by: Cody Brittain <cbrittain10@live.com>
This commit is contained in:
co-authored by
Cody Brittain
parent
405a05b819
commit
9983fca311
@@ -286,7 +286,7 @@
|
||||
if(istype(T, /turf/simulated/wall))
|
||||
var/turf/simulated/wall/W = T
|
||||
W.thermite = 1
|
||||
W.add_overlay(image('icons/effects/effects.dmi',icon_state = "#673910"))
|
||||
W.AddOverlays(image('icons/effects/effects.dmi',icon_state = "#673910"))
|
||||
remove_self(5, holder)
|
||||
return
|
||||
|
||||
|
||||
@@ -637,7 +637,7 @@
|
||||
M.transforming = 1
|
||||
M.canmove = 0
|
||||
M.icon = null
|
||||
M.cut_overlays()
|
||||
M.ClearOverlays()
|
||||
M.set_invisibility(101)
|
||||
for(var/obj/item/W in M)
|
||||
if(istype(W, /obj/item/implant)) //TODO: Carn. give implants a dropped() or something
|
||||
|
||||
@@ -32,17 +32,17 @@
|
||||
setLabel(R.name)
|
||||
|
||||
/obj/item/reagent_containers/chem_disp_cartridge/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(reagents?.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance(icon, "[icon_state]-[get_filling_state()]")
|
||||
filling.color = reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
if(!is_open_container())
|
||||
var/lid_icon = "lid_[icon_state]"
|
||||
var/mutable_appearance/lid = mutable_appearance(icon, lid_icon)
|
||||
add_overlay(lid)
|
||||
AddOverlays(lid)
|
||||
|
||||
/obj/item/reagent_containers/chem_disp_cartridge/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
|
||||
. = ..()
|
||||
|
||||
@@ -55,16 +55,16 @@
|
||||
w_class = ITEMSIZE_SMALL
|
||||
|
||||
/obj/item/reagent_containers/blood/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(blood_type)
|
||||
add_overlay(image('icons/obj/bloodpack.dmi', "[blood_type]"))
|
||||
AddOverlays(image('icons/obj/bloodpack.dmi', "[blood_type]"))
|
||||
|
||||
if(attached_mob)
|
||||
add_overlay(image('icons/obj/bloodpack.dmi', "dongle"))
|
||||
AddOverlays(image('icons/obj/bloodpack.dmi', "dongle"))
|
||||
|
||||
if(reagents && reagents.total_volume)
|
||||
add_overlay(overlay_image('icons/obj/bloodpack.dmi', "[icon_state][get_filling_state()]", color = reagents.get_color()))
|
||||
AddOverlays(overlay_image('icons/obj/bloodpack.dmi', "[icon_state][get_filling_state()]", color = reagents.get_color()))
|
||||
|
||||
/obj/item/reagent_containers/blood/attack(mob/living/carbon/human/M as mob, mob/living/carbon/human/user as mob, var/target_zone)
|
||||
if(user == M && (MODE_VAMPIRE in user.mind?.antag_datums))
|
||||
|
||||
@@ -41,18 +41,18 @@
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
|
||||
/obj/item/reagent_containers/hypospray/borghypo/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
var/rid = reagent_ids[mode]
|
||||
var/singleton/reagent/R = GET_SINGLETON(rid)
|
||||
if(reagent_volumes[rid])
|
||||
filling = image(icon, src, "[initial(icon_state)][reagent_volumes[rid]]")
|
||||
filling.color = R.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
var/mutable_appearance/reagent_bar = mutable_appearance(icon, "[initial(icon_state)]_reagents")
|
||||
reagent_bar.color = R.get_color()
|
||||
add_overlay(reagent_bar)
|
||||
AddOverlays(reagent_bar)
|
||||
|
||||
/obj/item/reagent_containers/hypospray/borghypo/Destroy()
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
@@ -147,7 +147,7 @@
|
||||
|
||||
/obj/item/reagent_containers/hypospray/borghypo/service/update_icon()
|
||||
underlays.Cut()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
var/rid = reagent_ids[mode]
|
||||
var/singleton/reagent/R = GET_SINGLETON(rid)
|
||||
@@ -163,7 +163,7 @@
|
||||
if(80 to 90) filling.icon_state = "[icon_state]-80"
|
||||
if(91 to INFINITY) filling.icon_state = "[icon_state]-100"
|
||||
filling.color = R.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
/obj/item/reagent_containers/hypospray/borghypo/service/attack(var/mob/M, var/mob/user)
|
||||
return
|
||||
|
||||
@@ -93,10 +93,10 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/reagent_containers/dropper/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(reagents.total_volume)
|
||||
worn_overlay = "filling"
|
||||
add_overlay(overlay_image(icon, "dropper-[get_filling_state()]", color = reagents.get_color()))
|
||||
AddOverlays(overlay_image(icon, "dropper-[get_filling_state()]", color = reagents.get_color()))
|
||||
worn_overlay_color = reagents.get_color() // handles inhands
|
||||
else
|
||||
worn_overlay = null
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
. = ..()
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/cans/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(fuselength)
|
||||
var/image/fuseoverlay = image('icons/obj/fuses.dmi', icon_state = "fuse_short")
|
||||
switch(fuselength)
|
||||
@@ -50,10 +50,10 @@
|
||||
fuseoverlay.icon_state = "lit_fuse"
|
||||
fuseoverlay.pixel_x = can_size_overrides["x"]
|
||||
fuseoverlay.pixel_y = can_size_overrides["y"]
|
||||
add_overlay(fuseoverlay)
|
||||
AddOverlays(fuseoverlay)
|
||||
if(bombcasing > BOMBCASING_EMPTY)
|
||||
var/image/casingoverlay = image('icons/obj/fuses.dmi', icon_state = "pipe_bomb")
|
||||
add_overlay(casingoverlay)
|
||||
AddOverlays(casingoverlay)
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/cans/attackby(obj/item/attacking_item, mob/user)
|
||||
if(istype(attacking_item, /obj/item/grenade/chem_grenade/large))
|
||||
|
||||
@@ -242,12 +242,12 @@ If you add a drink with an empty icon sprite, ensure it is in the same folder, e
|
||||
reagents_to_add = list(/singleton/reagent/water = 30)
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/waterbottle/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(reagents?.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance(icon, "[icon_state]-[get_filling_state()]")
|
||||
filling.color = reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
//heehoo bottle flipping
|
||||
/obj/item/reagent_containers/food/drinks/waterbottle/throw_impact()
|
||||
@@ -333,7 +333,7 @@ If you add a drink with an empty icon sprite, ensure it is in the same folder, e
|
||||
return ..()
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/shaker/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(top)
|
||||
icon_state = "shakertop"
|
||||
item_state = "shakertop"
|
||||
@@ -343,9 +343,9 @@ If you add a drink with an empty icon sprite, ensure it is in the same folder, e
|
||||
if(reagents.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance('icons/obj/shaker.dmi', "[icon_state]-[get_filling_state()]")
|
||||
filling.color = reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
if(cap)
|
||||
add_overlay("shaker_cap")
|
||||
AddOverlays("shaker_cap")
|
||||
update_held_icon()
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/shaker/AltClick(mob/user)
|
||||
@@ -472,12 +472,12 @@ If you add a drink with an empty icon sprite, ensure it is in the same folder, e
|
||||
center_of_mass = list("x" = 16, "y" = 16)
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/shaker_cup/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(reagents?.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance('icons/obj/shaker.dmi', "[icon_state]-[get_filling_state()]")
|
||||
filling.color = reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/shaker_cup/AltClick(mob/user)
|
||||
set_APTFT()
|
||||
|
||||
@@ -133,12 +133,12 @@
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/bottle/update_icon()
|
||||
underlays.Cut()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if("[icon_state]-[get_filling_state()]" in icon)
|
||||
if(reagents?.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance(icon, "[icon_state]-[get_filling_state()]")
|
||||
filling.color = reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
set_light(0)
|
||||
if(rag)
|
||||
var/underlay_image = image(icon='icons/obj/item/reagent_containers/food/drinks/drink_effects.dmi', icon_state=rag.on_fire? "[rag_underlay]_lit" : rag_underlay)
|
||||
@@ -220,7 +220,7 @@
|
||||
var/mutable_appearance/froth = mutable_appearance('icons/obj/item/reagent_containers/food/drinks/drink_effects.dmi', "froth_bottle_[intensity_state]")
|
||||
froth.pixel_x = offset_x
|
||||
froth.pixel_y = offset_y
|
||||
add_overlay(froth)
|
||||
AddOverlays(froth)
|
||||
CUT_OVERLAY_IN(froth, 2 SECONDS)
|
||||
|
||||
//Keeping this here for now, I'll ask if I should keep it here.
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
var/i = 0
|
||||
var/list/words = list()
|
||||
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
var/list/ovr = list()
|
||||
for(var/obj/item/reagent_containers/food/snacks/O in ingredients)
|
||||
words += O.ingredient_name || O.name
|
||||
@@ -59,7 +59,7 @@
|
||||
T.pixel_y = (ingredients.len * 2)+1
|
||||
ovr += T
|
||||
|
||||
add_overlay(ovr)
|
||||
AddOverlays(ovr)
|
||||
|
||||
name = lowertext("[english_list(words)] [base_name]")
|
||||
if(length(name) > 80) name = "[pick(list("absurd","colossal","enormous","ridiculous"))] [base_name]"
|
||||
|
||||
@@ -199,11 +199,11 @@
|
||||
to_chat(user, SPAN_NOTICE("You scoop up some of \the [src] with \the [U]."))
|
||||
|
||||
bitecount++
|
||||
U.cut_overlays()
|
||||
U.ClearOverlays()
|
||||
U.loaded = src.name
|
||||
var/image/I = new(U.icon, "loadedfood")
|
||||
I.color = src.filling_color
|
||||
U.add_overlay(I)
|
||||
U.AddOverlays(I)
|
||||
|
||||
reagents.trans_to_obj(U, min(reagents.total_volume,U.transfer_amt))
|
||||
if(is_liquid)
|
||||
@@ -326,7 +326,7 @@
|
||||
J.alpha = 200
|
||||
J.blend_mode = BLEND_OVERLAY
|
||||
J.tag = "coating"
|
||||
add_overlay(J)
|
||||
AddOverlays(J)
|
||||
|
||||
if (user)
|
||||
user.visible_message(SPAN_NOTICE("[user] dips [src] into \the [applied_coating_reagent.name]"), SPAN_NOTICE("You dip [src] into \the [applied_coating_reagent.name]"))
|
||||
@@ -357,7 +357,7 @@
|
||||
var/image/J = image(I)
|
||||
J.alpha = 200
|
||||
J.tag = "coating"
|
||||
add_overlay(J)
|
||||
AddOverlays(J)
|
||||
|
||||
if (do_coating_prefix == 1)
|
||||
name = "[our_coating.coated_adj] [name]"
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
var/image/I = image(icon,"fruit_rind")
|
||||
I.color = "#B1E4BE"
|
||||
fruit_icon_cache["rind-#B1E4BE"] = I
|
||||
add_overlay(fruit_icon_cache["rind-#B1E4BE"])
|
||||
AddOverlays(fruit_icon_cache["rind-#B1E4BE"])
|
||||
if(!fruit_icon_cache["slice-#B1E4BE"])
|
||||
var/image/I = image(icon,"fruit_slice")
|
||||
I.color = "#9FE4B0"
|
||||
fruit_icon_cache["slice-#B1E4BE"] = I
|
||||
add_overlay(fruit_icon_cache["slice-#B1E4BE"])
|
||||
AddOverlays(fruit_icon_cache["slice-#B1E4BE"])
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/soup/qilvo
|
||||
name = "qilvo"
|
||||
|
||||
@@ -70,13 +70,13 @@
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/sashimi/update_icon()
|
||||
icon_state = "sashimi_base"
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
var/slice_offset = (slices-1)*2
|
||||
for(var/slice = 1 to slices)
|
||||
var/image/I = image(icon = icon, icon_state = "sashimi")
|
||||
I.pixel_x = slice_offset-((slice-1)*4)
|
||||
I.pixel_y = I.pixel_x
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/sashimi/attackby(obj/item/attacking_item, mob/user)
|
||||
if(!(locate(/obj/structure/table) in loc))
|
||||
|
||||
@@ -132,22 +132,22 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(reagents?.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance(icon, "[icon_state]-[get_filling_state()]")
|
||||
filling.color = reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
if(!is_open_container())
|
||||
var/lid_icon = "lid_[icon_state]"
|
||||
var/mutable_appearance/lid = mutable_appearance(icon, lid_icon)
|
||||
add_overlay(lid)
|
||||
AddOverlays(lid)
|
||||
|
||||
if(label_text)
|
||||
var/label_icon = "label_[icon_state]"
|
||||
var/mutable_appearance/label = mutable_appearance(icon, label_icon)
|
||||
add_overlay(label)
|
||||
AddOverlays(label)
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/large
|
||||
name = "large beaker"
|
||||
@@ -283,11 +283,11 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/reagent_containers/glass/bucket/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(reagents.total_volume > 0)
|
||||
add_overlay("water_[initial(icon_state)]")
|
||||
AddOverlays("water_[initial(icon_state)]")
|
||||
if(!is_open_container())
|
||||
add_overlay("lid_[initial(icon_state)]")
|
||||
AddOverlays("lid_[initial(icon_state)]")
|
||||
|
||||
/obj/item/reagent_containers/glass/bucket/on_reagent_change()
|
||||
update_icon()
|
||||
|
||||
@@ -35,22 +35,22 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/reagent_containers/glass/bottle/update_icon() // You know, bottles should be a subtype of beakers. But not gonna change a million and one paths today. - Wezzy.
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(reagents?.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance(icon, "[icon_state]-[get_filling_state()]")
|
||||
filling.color = reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
if(!is_open_container())
|
||||
var/lid_icon = "lid_[icon_state]"
|
||||
var/mutable_appearance/lid = mutable_appearance(icon, lid_icon)
|
||||
add_overlay(lid)
|
||||
AddOverlays(lid)
|
||||
|
||||
if(label_text)
|
||||
var/label_icon = "label_[icon_state]"
|
||||
var/mutable_appearance/label = mutable_appearance(icon, label_icon)
|
||||
add_overlay(label)
|
||||
AddOverlays(label)
|
||||
|
||||
/obj/item/reagent_containers/glass/bottle/inaprovaline
|
||||
name = "inaprovaline bottle"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
var/fillsource = "coffeecup"
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/drinkingglass/newglass/coffeecup/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(reagents.total_volume)
|
||||
var/image/filling = image('icons/obj/drink_glasses/coffecup.dmi', src, null)
|
||||
@@ -24,7 +24,7 @@
|
||||
if(80 to 99) filling.icon_state = "[fillsource]80"
|
||||
if(100 to INFINITY) filling.icon_state = "[fillsource]100"
|
||||
filling.color = reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
// ------------------------ nations
|
||||
|
||||
@@ -278,7 +278,7 @@
|
||||
volume = 60
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/drinkingglass/newglass/coffeecup/tall/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(reagents.total_volume)
|
||||
var/image/filling = image('icons/obj/drink_glasses/coffecup_tall.dmi', src, null)
|
||||
@@ -291,7 +291,7 @@
|
||||
if(90 to 99) filling.icon_state = "[fillsource]90"
|
||||
if(100 to INFINITY) filling.icon_state = "[fillsource]100"
|
||||
filling.color = reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/drinkingglass/newglass/coffeecup/tall/black
|
||||
name = "tall black coffee cup"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
return
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/drinkingglass/newglass/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(reagents.total_volume)
|
||||
var/image/filling = image(icon, src, "[icon_state]10")
|
||||
@@ -26,7 +26,7 @@
|
||||
if(90 to 99) filling.icon_state = "[icon_state]90"
|
||||
if(100 to INFINITY) filling.icon_state = "[icon_state]100"
|
||||
filling.color = reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/drinkingglass/newglass/square
|
||||
name = "half-pint glass"
|
||||
@@ -109,12 +109,12 @@
|
||||
volume = 20
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/drinkingglass/newglass/coffeecup/teacup/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(reagents.total_volume)
|
||||
var/image/filling = image('icons/obj/drink_glasses/teacup.dmi', src, "[icon_state]100")
|
||||
filling.color = reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/drinkingglass/newglass/cognac
|
||||
name = "snifter glass"
|
||||
@@ -144,7 +144,7 @@
|
||||
if(reagents?.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance(icon, "yunomi-[get_filling_state()]")
|
||||
filling.color = reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/drinkingglass/newglass/konyang/grey
|
||||
desc = "A ceramic teacup of Japanese origin, most frequently used for teas brewed at a lower temperature because of its lack of a handle. \
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
inject(M, user, M.Adjacent(user))
|
||||
|
||||
/obj/item/reagent_containers/hypospray/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
var/rounded_vol = round(reagents.total_volume, round(reagents.maximum_volume / (volume / 5)))
|
||||
icon_state = "[initial(icon_state)]_[rounded_vol]"
|
||||
@@ -74,7 +74,7 @@
|
||||
filling.icon_state = "[initial(icon_state)][rounded_vol]"
|
||||
|
||||
filling.color = reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
/obj/item/reagent_containers/hypospray/proc/inject(var/mob/M, var/mob/user, proximity)
|
||||
if(!proximity || !istype(M))
|
||||
@@ -173,10 +173,10 @@
|
||||
. = ..()
|
||||
|
||||
/obj/item/reagent_containers/hypospray/autoinjector/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(!is_open_container())
|
||||
var/mutable_appearance/backing_overlay = mutable_appearance(icon, "autoinjector_secured")
|
||||
add_overlay(backing_overlay)
|
||||
AddOverlays(backing_overlay)
|
||||
|
||||
icon_state = "[initial(icon_state)][spent]"
|
||||
item_state = "[initial(item_state)][spent]"
|
||||
@@ -184,7 +184,7 @@
|
||||
if(reagents.total_volume)
|
||||
var/mutable_appearance/reagent_overlay = mutable_appearance(icon, "autoinjector_reagents")
|
||||
reagent_overlay.color = reagents.get_color()
|
||||
add_overlay(reagent_overlay)
|
||||
AddOverlays(reagent_overlay)
|
||||
update_held_icon()
|
||||
|
||||
/obj/item/reagent_containers/hypospray/autoinjector/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
|
||||
|
||||
@@ -132,10 +132,10 @@
|
||||
. = ..()
|
||||
|
||||
/obj/item/reagent_containers/inhaler/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(!is_open_container())
|
||||
var/mutable_appearance/backing_overlay = mutable_appearance(icon, "autoinhaler_secured")
|
||||
add_overlay(backing_overlay)
|
||||
AddOverlays(backing_overlay)
|
||||
|
||||
icon_state = "[initial(icon_state)][spent]"
|
||||
item_state = "[initial(item_state)][spent]"
|
||||
@@ -143,7 +143,7 @@
|
||||
if(reagents.total_volume)
|
||||
var/mutable_appearance/reagent_overlay = mutable_appearance(icon, "autoinhaler_reagents")
|
||||
reagent_overlay.color = reagents.get_color()
|
||||
add_overlay(reagent_overlay)
|
||||
AddOverlays(reagent_overlay)
|
||||
update_held_icon()
|
||||
|
||||
/obj/item/reagent_containers/inhaler/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
|
||||
|
||||
@@ -24,13 +24,13 @@
|
||||
return
|
||||
|
||||
/obj/item/reagent_containers/personal_inhaler_cartridge/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
var/rounded_vol = round(reagents.total_volume, round(reagents.maximum_volume / (volume / 5)))
|
||||
|
||||
if(reagents.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance(icon, "[initial(icon_state)][rounded_vol]")
|
||||
filling.color = reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
/obj/item/reagent_containers/personal_inhaler_cartridge/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
|
||||
. = ..()
|
||||
@@ -109,14 +109,14 @@
|
||||
. += "<span class='notice'>\The [stored_cartridge] is attached to \the [src].</span>"
|
||||
|
||||
/obj/item/personal_inhaler/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(stored_cartridge)
|
||||
add_overlay(stored_cartridge.icon_state)
|
||||
AddOverlays(stored_cartridge.icon_state)
|
||||
if(stored_cartridge.reagents.total_volume)
|
||||
var/rounded_vol = round(stored_cartridge.reagents.total_volume, round(stored_cartridge.reagents.maximum_volume / (stored_cartridge.volume / 5)))
|
||||
var/image/filling = image(icon, "[stored_cartridge.icon_state][rounded_vol]")
|
||||
filling.color = stored_cartridge.reagents.get_color()
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
|
||||
/obj/item/personal_inhaler/attack_self(mob/user as mob)
|
||||
if(stored_cartridge)
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/reagent_containers/ladle/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(!reagents.total_volume)
|
||||
return
|
||||
var/image/over = image(icon, "ladle_overlay")
|
||||
over.color = reagents.get_color()
|
||||
add_overlay(over)
|
||||
AddOverlays(over)
|
||||
|
||||
@@ -269,7 +269,7 @@
|
||||
return
|
||||
|
||||
/obj/item/reagent_containers/syringe/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
var/iconstring = initial(item_state)
|
||||
if(mode == SYRINGE_BROKEN)
|
||||
@@ -278,11 +278,11 @@
|
||||
return
|
||||
|
||||
if(mode == SYRINGE_CAPPED)
|
||||
add_overlay("capped")
|
||||
AddOverlays("capped")
|
||||
|
||||
if(reagents && reagents.total_volume)
|
||||
worn_overlay = Clamp(round((reagents.total_volume / volume * 15),5), 1, 15) //rounded_vol
|
||||
add_overlay(overlay_image(icon, "[iconstring][worn_overlay]", color = reagents.get_color()))
|
||||
AddOverlays(overlay_image(icon, "[iconstring][worn_overlay]", color = reagents.get_color()))
|
||||
worn_overlay_color = reagents.get_color() // handles inhands
|
||||
else
|
||||
worn_overlay = 0 // don't change to null, or it will break
|
||||
@@ -295,7 +295,7 @@
|
||||
injoverlay = "draw"
|
||||
if (SYRINGE_INJECT)
|
||||
injoverlay = "inject"
|
||||
add_overlay(injoverlay)
|
||||
AddOverlays(injoverlay)
|
||||
|
||||
/obj/item/reagent_containers/syringe/proc/syringestab(mob/living/carbon/target as mob, mob/living/carbon/user as mob)
|
||||
if(mode == SYRINGE_CAPPED)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
/obj/item/reagent_containers/glass/beaker/teapot/lidded/update_icon()
|
||||
if(lid)
|
||||
icon_state = initial(icon_state) + "_lid"
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
else
|
||||
..()
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/reagent_containers/toothbrush/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(reagents.has_reagent(/singleton/reagent/drink/toothpaste))
|
||||
add_overlay("toothpaste_overlay")
|
||||
AddOverlays("toothpaste_overlay")
|
||||
|
||||
/obj/item/reagent_containers/toothbrush/attack_self(mob/user as mob)
|
||||
if(!reagents.total_volume)
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
var/mutable_appearance/MA = new(attacking_item)
|
||||
MA.pixel_x += 1
|
||||
MA.pixel_y += 6
|
||||
add_overlay(MA)
|
||||
AddOverlays(MA)
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user