mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-29 16:10:02 +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
+2
-2
@@ -12,8 +12,8 @@ var/image/mark = image('icons/zone.dmi', icon_state = "mark")
|
||||
/turf/var/tmp/dbg_img
|
||||
/turf/proc/dbg(image/img, d = 0)
|
||||
if(d > 0) img.dir = d
|
||||
cut_overlay(dbg_img)
|
||||
add_overlay(img)
|
||||
CutOverlays(dbg_img)
|
||||
AddOverlays(img)
|
||||
dbg_img = img
|
||||
|
||||
/proc/soft_assert(thing,fail)
|
||||
|
||||
+2
-2
@@ -53,11 +53,11 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
|
||||
//Do a contamination overlay? Temporary measure to keep contamination less deadly than it was.
|
||||
if(!contaminated)
|
||||
contaminated = 1
|
||||
add_overlay(contamination_overlay, TRUE)
|
||||
AddOverlays(contamination_overlay, ATOM_ICON_CACHE_PROTECTED)
|
||||
|
||||
/obj/item/proc/decontaminate()
|
||||
contaminated = 0
|
||||
cut_overlay(contamination_overlay, TRUE)
|
||||
CutOverlays(contamination_overlay, ATOM_ICON_CACHE_PROTECTED)
|
||||
|
||||
/mob/proc/contaminate()
|
||||
|
||||
|
||||
@@ -177,6 +177,9 @@
|
||||
/// Decrease the size of L by 1 from the end. Is the old last entry index.
|
||||
#define LIST_DEC(L) ((L).len--)
|
||||
|
||||
/// Explicitly set the length of L to NEWLEN, adding nulls or dropping entries. Is the same value as NEWLEN.
|
||||
#define LIST_RESIZE(L, NEWLEN) ((L).len = (NEWLEN))
|
||||
|
||||
/// Drops x into the the src's location, and then nulls its reference.
|
||||
#define DROP_NULL(x) if(x) { x.dropInto(loc); x = null}
|
||||
|
||||
|
||||
@@ -52,6 +52,8 @@ var/list/mimic_defines = list(
|
||||
/// If a dense atom like a platform does not allow movement through it like a window pane BUT allows pickup.
|
||||
#define ATOM_FLAG_ALWAYS_ALLOW_PICKUP FLAG(7)
|
||||
|
||||
#define ATOM_AWAITING_OVERLAY_UPDATE FLAG(10)
|
||||
|
||||
// Movable flags.
|
||||
|
||||
/// Does this object require proximity checking in Enter()?
|
||||
|
||||
@@ -98,8 +98,8 @@
|
||||
|
||||
|
||||
// -- SSoverlays --
|
||||
#define CUT_OVERLAY_IN(ovr, time) addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, cut_overlay), ovr), time, TIMER_STOPPABLE | TIMER_CLIENT_TIME)
|
||||
#define ATOM_USING_SSOVERLAY(atom) (atom.our_overlays || atom.priority_overlays)
|
||||
#define CUT_OVERLAY_IN(ovr, time) addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, CutOverlays), ovr), time, TIMER_STOPPABLE | TIMER_CLIENT_TIME)
|
||||
#define ATOM_USING_SSOVERLAY(atom) (atom.atom_overlay_cache || atom.atom_protected_overlay_cache)
|
||||
|
||||
// -- SSticker --
|
||||
#define ROUND_IS_STARTED (SSticker.current_state >= GAME_STATE_PLAYING)
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
var/turf/T = get_step(src, reverse_ndir(adjacency))
|
||||
if(is_type_in_list(T, can_blend_with))
|
||||
if(attach_overlay)
|
||||
add_overlay("[reverse_ndir(adjacency)]_[attach_overlay]", overlay_layer)
|
||||
AddOverlays("[reverse_ndir(adjacency)]_[attach_overlay]", overlay_layer)
|
||||
walls_found |= adjacency
|
||||
dir_mods["[adjacency]"] = "-[blend_overlay]"
|
||||
for(var/adjacency in list(N_NORTH, N_SOUTH))
|
||||
@@ -307,7 +307,7 @@
|
||||
if(((adjacencies & adjacency) && (adjacencies && diagonal)) && (has_adjacency || has_diagonal))
|
||||
dir_mods["[adjacency][diagonal]"] = "-[prefix][walls_found & adjacency ? "wall" : "win"]-[suffix][walls_found & diagonal ? "wall" : "win"]"
|
||||
if(attach_overlay)
|
||||
add_overlay("[prefix][suffix]_[attach_overlay]", overlay_layer)
|
||||
AddOverlays("[prefix][suffix]_[attach_overlay]", overlay_layer)
|
||||
return dir_mods
|
||||
|
||||
/proc/ndir_to_initial(var/ndir)
|
||||
@@ -409,10 +409,10 @@
|
||||
LAZYADD(New, se)
|
||||
|
||||
if(Old)
|
||||
cut_overlay(Old)
|
||||
CutOverlays(Old)
|
||||
|
||||
if(New)
|
||||
add_overlay(New)
|
||||
AddOverlays(New)
|
||||
|
||||
if (icon_state && !(smoothing_flags & SMOOTH_NO_CLEAR_ICON))
|
||||
icon_state = null
|
||||
@@ -558,7 +558,7 @@
|
||||
/atom/proc/clear_smooth_overlays()
|
||||
SHOULD_NOT_SLEEP(TRUE)
|
||||
|
||||
cut_overlay(list(top_left_corner, top_right_corner, bottom_left_corner, bottom_right_corner))
|
||||
CutOverlays(list(top_left_corner, top_right_corner, bottom_left_corner, bottom_right_corner))
|
||||
top_left_corner = null
|
||||
top_right_corner = null
|
||||
bottom_right_corner = null
|
||||
@@ -577,7 +577,7 @@
|
||||
O += sw
|
||||
bottom_right_corner = se
|
||||
O += se
|
||||
add_overlay(O)
|
||||
AddOverlays(O)
|
||||
|
||||
/proc/reverse_ndir(ndir)
|
||||
SHOULD_NOT_SLEEP(TRUE)
|
||||
|
||||
+14
-14
@@ -118,27 +118,27 @@ mob
|
||||
underlays += image(icon='old_or_unused.dmi',icon_state="red", pixel_x = -32)
|
||||
|
||||
// Testing image overlays
|
||||
add_overlay(image(icon='old_or_unused.dmi',icon_state="green", pixel_x = 32, pixel_y = -32))
|
||||
add_overlay(image(icon='old_or_unused.dmi',icon_state="green", pixel_x = 32, pixel_y = 32))
|
||||
add_overlay(image(icon='old_or_unused.dmi',icon_state="green", pixel_x = -32, pixel_y = -32))
|
||||
AddOverlays(image(icon='old_or_unused.dmi',icon_state="green", pixel_x = 32, pixel_y = -32))
|
||||
AddOverlays(image(icon='old_or_unused.dmi',icon_state="green", pixel_x = 32, pixel_y = 32))
|
||||
AddOverlays(image(icon='old_or_unused.dmi',icon_state="green", pixel_x = -32, pixel_y = -32))
|
||||
|
||||
// Testing icon file overlays (defaults to mob's state)
|
||||
add_overlay('_flat_demoIcons2.dmi')
|
||||
AddOverlays('_flat_demoIcons2.dmi')
|
||||
|
||||
// Testing icon_state overlays (defaults to mob's icon)
|
||||
add_overlay("white")
|
||||
AddOverlays("white")
|
||||
|
||||
// Testing dynamic icon overlays
|
||||
var/icon/I = icon('old_or_unused.dmi', icon_state="aqua")
|
||||
I.Shift(NORTH,16,1)
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
// Testing dynamic image overlays
|
||||
I=image(icon=I,pixel_x = -32, pixel_y = 32)
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
// Testing object types (and layers)
|
||||
add_overlay(/obj/effect/overlay_test)
|
||||
AddOverlays(/obj/effect/overlay_test)
|
||||
|
||||
loc = locate (10,10,1)
|
||||
verb
|
||||
@@ -166,9 +166,9 @@ mob
|
||||
// Update the label to show it
|
||||
winset(src,"imageLabel","image='[REF(I)]'");
|
||||
|
||||
Add_Overlay()
|
||||
AddOverlays()
|
||||
set name = "4. Add Overlay"
|
||||
add_overlay(image(icon='old_or_unused.dmi',icon_state="yellow",pixel_x = rand(-64,32), pixel_y = rand(-64,32))
|
||||
AddOverlays(image(icon='old_or_unused.dmi',icon_state="yellow",pixel_x = rand(-64,32), pixel_y = rand(-64,32))
|
||||
|
||||
Stress_Test()
|
||||
set name = "5. Stress Test"
|
||||
@@ -176,7 +176,7 @@ mob
|
||||
// The third parameter forces it to generate a new one, even if it's already cached
|
||||
getFlatIcon(src,0,2)
|
||||
if(prob(5))
|
||||
Add_Overlay()
|
||||
AddOverlays()
|
||||
Browse_Icon()
|
||||
|
||||
Cache_Test()
|
||||
@@ -793,7 +793,7 @@ world
|
||||
camo_image.pixel_y--
|
||||
if(5)
|
||||
camo_image.pixel_y++
|
||||
add_overlay(camo_image)//And finally add the overlay.
|
||||
AddOverlays(camo_image)//And finally add the overlay.
|
||||
|
||||
/proc/build_disappear_icon(atom/A)
|
||||
var/icon/disappear_icon = new(getFlatIcon(A))
|
||||
@@ -1205,9 +1205,9 @@ lighting determines lighting capturing (optional), suppress_errors suppreses err
|
||||
set waitfor = FALSE
|
||||
if(!overlay_image)
|
||||
return
|
||||
add_overlay(overlay_image)
|
||||
AddOverlays(overlay_image)
|
||||
sleep(duration)
|
||||
cut_overlay(overlay_image)
|
||||
CutOverlays(overlay_image)
|
||||
|
||||
/// Perform a shake on an atom, resets its position afterwards
|
||||
/atom/proc/Shake(pixelshiftx = 2, pixelshifty = 2, duration = 2.5 SECONDS, shake_interval = 0.02 SECONDS)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
overlay.blend_mode = BLEND_ADD
|
||||
a_cache_icon[icon_state] = overlay
|
||||
|
||||
target.add_overlay(list(multiply, overlay))
|
||||
target.AddOverlays(list(multiply, overlay))
|
||||
|
||||
/proc/make_screen_overlay(icon, icon_state, brightness_factor = null, glow_radius = 1)
|
||||
var/image/overlay = image(icon, icon_state)
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
icon = owner.button_icon
|
||||
icon_state = owner.background_icon_state
|
||||
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
var/image/img
|
||||
if(owner.action_type == AB_ITEM && owner.target)
|
||||
var/obj/item/I = owner.target
|
||||
@@ -165,7 +165,7 @@
|
||||
img.pixel_y = 0
|
||||
if(owner.button_icon_color)
|
||||
img.color = owner.button_icon_color
|
||||
add_overlay(img)
|
||||
AddOverlays(img)
|
||||
|
||||
if(!owner.IsAvailable())
|
||||
color = rgb(128,0,0,128)
|
||||
@@ -200,8 +200,8 @@
|
||||
return
|
||||
|
||||
/obj/screen/movable/action_button/hide_toggle/update_icon()
|
||||
cut_overlays()
|
||||
add_overlay(hidden ? "show" : "hide")
|
||||
ClearOverlays()
|
||||
AddOverlays(hidden ? "show" : "hide")
|
||||
|
||||
//This is the proc used to update all the action buttons. Properly defined in /mob/living/
|
||||
/mob/proc/update_action_buttons()
|
||||
|
||||
@@ -341,8 +341,8 @@
|
||||
mymob.zone_sel.icon = ui_style
|
||||
mymob.zone_sel.color = ui_color
|
||||
mymob.zone_sel.alpha = ui_alpha
|
||||
mymob.zone_sel.cut_overlays()
|
||||
mymob.zone_sel.add_overlay(image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]"))
|
||||
mymob.zone_sel.ClearOverlays()
|
||||
mymob.zone_sel.AddOverlays(image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]"))
|
||||
hud_elements |= mymob.zone_sel
|
||||
|
||||
//Handle the gun settings buttons
|
||||
@@ -531,7 +531,7 @@
|
||||
icon = set_icon
|
||||
var/image/status_overlay = image('icons/mob/screen/hud_status.dmi', null, set_overlay)
|
||||
status_overlay.appearance_flags = RESET_COLOR
|
||||
add_overlay(status_overlay)
|
||||
AddOverlays(status_overlay)
|
||||
status_message = set_status_message
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel()
|
||||
mymob.zone_sel.icon = 'icons/mob/screen/morph.dmi'
|
||||
mymob.zone_sel.cut_overlays()
|
||||
mymob.zone_sel.add_overlay(image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]"))
|
||||
mymob.zone_sel.ClearOverlays()
|
||||
mymob.zone_sel.AddOverlays(image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]"))
|
||||
|
||||
var/obj/screen/resist = new /obj/screen()
|
||||
resist.name = "resist"
|
||||
|
||||
@@ -133,8 +133,8 @@
|
||||
mymob.zone_sel = new /obj/screen/zone_sel()
|
||||
|
||||
mymob.zone_sel.icon = 'icons/mob/screen/construct.dmi'
|
||||
mymob.zone_sel.cut_overlays()
|
||||
mymob.zone_sel.add_overlay(image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]"))
|
||||
mymob.zone_sel.ClearOverlays()
|
||||
mymob.zone_sel.AddOverlays(image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]"))
|
||||
|
||||
mymob.purged = new /obj/screen()
|
||||
mymob.purged.icon = 'icons/mob/screen/construct.dmi'
|
||||
|
||||
@@ -118,8 +118,8 @@ var/obj/screen/robot_inventory
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel()
|
||||
mymob.zone_sel.icon = 'icons/mob/screen/robot.dmi'
|
||||
mymob.zone_sel.cut_overlays()
|
||||
mymob.zone_sel.add_overlay(image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]"))
|
||||
mymob.zone_sel.ClearOverlays()
|
||||
mymob.zone_sel.AddOverlays(image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]"))
|
||||
|
||||
// Computer device hud
|
||||
if(r.computer)
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
/obj/screen/inventory/MouseExited()
|
||||
..()
|
||||
cut_overlay(object_overlays)
|
||||
CutOverlays(object_overlays)
|
||||
object_overlays.Cut()
|
||||
|
||||
/obj/screen/inventory/proc/add_overlays()
|
||||
@@ -74,7 +74,7 @@
|
||||
else
|
||||
item_overlay.color = "#00ff00"
|
||||
object_overlays += item_overlay
|
||||
add_overlay(object_overlays)
|
||||
AddOverlays(object_overlays)
|
||||
|
||||
/obj/screen/inventory/proc/set_color_for(var/set_color, var/set_time)
|
||||
if(color_changed)
|
||||
@@ -281,9 +281,9 @@
|
||||
SEND_SIGNAL(user, COMSIG_MOB_ZONE_SEL_CHANGE, user)
|
||||
|
||||
/obj/screen/zone_sel/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
selecting_appearance = mutable_appearance('icons/mob/zone_sel.dmi', "[selecting]")
|
||||
add_overlay(selecting_appearance)
|
||||
AddOverlays(selecting_appearance)
|
||||
|
||||
/obj/screen/Click(location, control, params)
|
||||
if(!usr)
|
||||
@@ -554,7 +554,7 @@
|
||||
if(!removed_hand_overlay)
|
||||
var/state = (hud.l_hand_hud_object == src) ? "l_hand_removed" : "r_hand_removed"
|
||||
removed_hand_overlay = image("icon" = 'icons/mob/screen_gen.dmi', "icon_state" = state)
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(hud.mymob && ishuman(hud.mymob))
|
||||
var/mob/living/carbon/human/H = hud.mymob
|
||||
var/obj/item/organ/external/O
|
||||
@@ -563,11 +563,11 @@
|
||||
else
|
||||
O = H.organs_by_name[BP_R_HAND]
|
||||
if(!O || O.is_stump())
|
||||
add_overlay(removed_hand_overlay)
|
||||
AddOverlays(removed_hand_overlay)
|
||||
else if(O && (!O.is_usable() || O.is_malfunctioning()))
|
||||
add_overlay(disabled_hand_overlay)
|
||||
AddOverlays(disabled_hand_overlay)
|
||||
if(H.handcuffed)
|
||||
add_overlay(handcuff_overlay)
|
||||
AddOverlays(handcuff_overlay)
|
||||
|
||||
/obj/screen/inventory/back
|
||||
name = "back"
|
||||
|
||||
@@ -44,14 +44,14 @@
|
||||
spell_holder.client.screen -= O
|
||||
O.handle_icon_updates = 0
|
||||
showing = 0
|
||||
cut_overlays()
|
||||
add_overlay(closed_state)
|
||||
ClearOverlays()
|
||||
AddOverlays(closed_state)
|
||||
else if(forced_state != 1)
|
||||
open_spellmaster()
|
||||
update_spells(1)
|
||||
showing = 1
|
||||
cut_overlays()
|
||||
add_overlay(open_state)
|
||||
ClearOverlays()
|
||||
AddOverlays(open_state)
|
||||
|
||||
/obj/screen/movable/spell_master/proc/open_spellmaster()
|
||||
var/list/screen_loc_xy = text2list(screen_loc,",")
|
||||
@@ -178,7 +178,7 @@
|
||||
if((last_charge == spell.charge_counter || !handle_icon_updates) && !forced_update)
|
||||
return //nothing to see here
|
||||
|
||||
cut_overlay(spell.hud_state)
|
||||
CutOverlays(spell.hud_state)
|
||||
|
||||
if(spell.charge_type == Sp_RECHARGE || spell.charge_type == Sp_CHARGES)
|
||||
if(spell.charge_counter < spell.charge_max)
|
||||
@@ -186,27 +186,27 @@
|
||||
if(spell.charge_counter > 0)
|
||||
var/icon/partial_charge = icon(src.icon, "[spell_base]_spell_ready")
|
||||
partial_charge.Crop(1, 1, partial_charge.Width(), round(partial_charge.Height() * spell.charge_counter / spell.charge_max))
|
||||
add_overlay(partial_charge)
|
||||
AddOverlays(partial_charge)
|
||||
if(last_charged_icon)
|
||||
cut_overlay(last_charged_icon)
|
||||
CutOverlays(last_charged_icon)
|
||||
last_charged_icon = partial_charge
|
||||
else if(last_charged_icon)
|
||||
cut_overlay(last_charged_icon)
|
||||
CutOverlays(last_charged_icon)
|
||||
last_charged_icon = null
|
||||
else
|
||||
icon_state = "[spell_base]_spell_ready"
|
||||
if(last_charged_icon)
|
||||
cut_overlay(last_charged_icon)
|
||||
CutOverlays(last_charged_icon)
|
||||
else
|
||||
icon_state = "[spell_base]_spell_ready"
|
||||
|
||||
add_overlay(spell.hud_state)
|
||||
AddOverlays(spell.hud_state)
|
||||
|
||||
last_charge = spell.charge_counter
|
||||
|
||||
cut_overlay("silence")
|
||||
CutOverlays("silence")
|
||||
if(spell.silenced)
|
||||
add_overlay("silence")
|
||||
AddOverlays("silence")
|
||||
|
||||
/obj/screen/spell/Click()
|
||||
if(!usr || !spell)
|
||||
|
||||
@@ -202,7 +202,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
|
||||
T.post_update_air_properties()
|
||||
T.needs_air_update = 0
|
||||
#ifdef ZASDBG
|
||||
T.cut_overlay(mark)
|
||||
T.CutOverlays(mark)
|
||||
updated++
|
||||
#endif
|
||||
|
||||
@@ -219,7 +219,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
|
||||
T.post_update_air_properties()
|
||||
T.needs_air_update = 0
|
||||
#ifdef ZASDBG
|
||||
T.cut_overlay(mark)
|
||||
T.CutOverlays(mark)
|
||||
updated++
|
||||
#endif
|
||||
|
||||
@@ -368,7 +368,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
|
||||
return
|
||||
tiles_to_update += T
|
||||
#ifdef ZASDBG
|
||||
T.add_overlay(mark)
|
||||
T.AddOverlays(mark)
|
||||
#endif
|
||||
T.needs_air_update = 1
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ SUBSYSTEM_DEF(economy)
|
||||
if(!R.stamped)
|
||||
R.stamped = new
|
||||
R.stamped += /obj/item/stamp
|
||||
R.add_overlay(stampoverlay)
|
||||
R.AddOverlays(stampoverlay)
|
||||
R.stamps += "<HR><i>This paper has been stamped by the Accounts Database.</i>"
|
||||
|
||||
//add the account
|
||||
|
||||
@@ -62,7 +62,7 @@ SUBSYSTEM_DEF(xenoarch)
|
||||
var/datum/find/F = archeo_turf.finds[1]
|
||||
if(F.excavation_required <= F.view_range)
|
||||
archeo_turf.archaeo_overlay = "overlay_archaeo[rand(1,3)]"
|
||||
archeo_turf.add_overlay(archeo_turf.archaeo_overlay)
|
||||
archeo_turf.AddOverlays(archeo_turf.archaeo_overlay)
|
||||
|
||||
//have a chance for an artifact to spawn here, but not in animal or plant digsites
|
||||
if(isnull(M.artifact_find) && digsite != 1 && digsite != 2)
|
||||
|
||||
@@ -1,248 +1,307 @@
|
||||
/// SSoverlays. Target the normal overlay cache.
|
||||
var/global/const/ATOM_ICON_CACHE_NORMAL = FLAG(0)
|
||||
|
||||
/// SSoverlays. Target the protected overlay cache.
|
||||
var/global/const/ATOM_ICON_CACHE_PROTECTED = FLAG(1)
|
||||
|
||||
/// SSoverlays. Target both normal and protected overlay caches.
|
||||
var/global/const/ATOM_ICON_CACHE_ALL = (ATOM_ICON_CACHE_NORMAL | ATOM_ICON_CACHE_PROTECTED)
|
||||
|
||||
|
||||
SUBSYSTEM_DEF(overlays)
|
||||
name = "Overlay"
|
||||
name = "Overlays"
|
||||
flags = SS_TICKER
|
||||
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY
|
||||
wait = 1
|
||||
wait = 1 // ticks
|
||||
priority = SS_PRIORITY_OVERLAY
|
||||
init_order = INIT_ORDER_OVERLAY
|
||||
|
||||
var/list/processing = list()
|
||||
/// The queue of atoms that need under/overlay updates.
|
||||
var/static/list/atom/queue = list()
|
||||
|
||||
/// A list([icon] = list([state] = [appearance], ...), ...) cache of appearances.
|
||||
var/static/list/state_cache = list()
|
||||
|
||||
/// A list([icon] = [appearance], ...) cache of appearances.
|
||||
var/static/list/icon_cache = list()
|
||||
|
||||
/// The number of appearances currently cached.
|
||||
var/static/cache_size = 0
|
||||
|
||||
var/idex = 1
|
||||
var/list/overlay_icon_state_caches = list()
|
||||
var/list/overlay_icon_cache = list()
|
||||
initialized = FALSE
|
||||
|
||||
/datum/controller/subsystem/overlays/stat_entry(msg)
|
||||
msg = "Ov:[processing.len - (idex - 1)]"
|
||||
return ..()
|
||||
/datum/controller/subsystem/overlays/Recover()
|
||||
LIST_RESIZE(queue, 0)
|
||||
LIST_RESIZE(state_cache, 0)
|
||||
LIST_RESIZE(icon_cache, 0)
|
||||
cache_size = 0
|
||||
var/count = 0
|
||||
for (var/atom/atom)
|
||||
atom.atom_flags &= ~ATOM_AWAITING_OVERLAY_UPDATE
|
||||
if (++count % 500)
|
||||
continue
|
||||
CHECK_TICK
|
||||
|
||||
/datum/controller/subsystem/overlays/Initialize()
|
||||
/datum/controller/subsystem/overlays/Initialize(start_uptime)
|
||||
initialized = TRUE
|
||||
Flush()
|
||||
fire(FALSE, TRUE)
|
||||
|
||||
return SS_INIT_SUCCESS
|
||||
|
||||
/datum/controller/subsystem/overlays/Recover()
|
||||
overlay_icon_state_caches = SSoverlays.overlay_icon_state_caches
|
||||
overlay_icon_cache = SSoverlays.overlay_icon_cache
|
||||
processing = SSoverlays.processing
|
||||
/datum/controller/subsystem/overlays/stat_entry(msg)
|
||||
msg = "Queued Atoms: [length(queue)], Cache Size: [cache_size]"
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/overlays/fire(resumed = FALSE, mc_check = TRUE)
|
||||
var/list/processing = src.processing
|
||||
while(idex <= processing.len)
|
||||
var/atom/thing = processing[idex++]
|
||||
/datum/controller/subsystem/overlays/fire(resumed, no_mc_tick)
|
||||
var/queue_length = length(queue)
|
||||
if (queue_length)
|
||||
var/atom/atom
|
||||
for (var/i = 1 to queue_length)
|
||||
atom = queue[i]
|
||||
if (QDELETED(atom))
|
||||
continue
|
||||
if (atom.atom_flags & ATOM_AWAITING_OVERLAY_UPDATE)
|
||||
atom.UpdateOverlays()
|
||||
if (no_mc_tick)
|
||||
if (i % 1000)
|
||||
continue
|
||||
CHECK_TICK
|
||||
else if (MC_TICK_CHECK)
|
||||
queue.Cut(1, i + 1)
|
||||
return
|
||||
queue.Cut(1, queue_length + 1)
|
||||
|
||||
if(!QDELETED(thing) && thing.overlay_queued) // Don't double-process if something already forced a compile.
|
||||
thing.compile_overlays()
|
||||
/datum/controller/subsystem/overlays/proc/GetStateAppearance(icon, state)
|
||||
var/list/subcache = state_cache[icon]
|
||||
if (!subcache)
|
||||
subcache = list()
|
||||
state_cache[icon] = subcache
|
||||
if (!subcache[state])
|
||||
var/image/image = image(icon, null, state)
|
||||
subcache[state] = image.appearance
|
||||
++cache_size
|
||||
return subcache[state]
|
||||
|
||||
if(mc_check)
|
||||
if(MC_TICK_CHECK)
|
||||
break
|
||||
|
||||
/datum/controller/subsystem/overlays/proc/GetIconAppearance(icon)
|
||||
if (!icon_cache[icon])
|
||||
var/image/image = image(icon)
|
||||
icon_cache[icon] = image.appearance
|
||||
++cache_size
|
||||
return icon_cache[icon]
|
||||
|
||||
|
||||
/datum/controller/subsystem/overlays/proc/GetAppearanceList(atom/subject, list/sources)
|
||||
if (!sources)
|
||||
return list()
|
||||
if (!islist(sources))
|
||||
sources = list(sources)
|
||||
var/list/result = list()
|
||||
var/icon/icon = subject.icon
|
||||
var/atom/entry
|
||||
for (var/i = 1 to length(sources))
|
||||
entry = sources[i]
|
||||
if (!entry)
|
||||
continue
|
||||
else if (istext(entry))
|
||||
result += GetStateAppearance(icon, entry)
|
||||
else if (isicon(entry))
|
||||
result += GetIconAppearance(entry)
|
||||
else
|
||||
CHECK_TICK
|
||||
if (isloc(entry))
|
||||
if (entry.atom_flags & ATOM_AWAITING_OVERLAY_UPDATE)
|
||||
entry.UpdateOverlays()
|
||||
if (!ispath(entry))
|
||||
result += entry.appearance
|
||||
else
|
||||
var/image/image = entry
|
||||
result += image.appearance
|
||||
return result
|
||||
|
||||
if (idex > 1)
|
||||
processing.Cut(1, idex)
|
||||
idex = 1
|
||||
|
||||
/datum/controller/subsystem/overlays/proc/Flush()
|
||||
if(processing.len)
|
||||
log_subsystem("overlays", "Flushing [processing.len] overlays.")
|
||||
fire(mc_check = FALSE)
|
||||
/// Immediately runs an overlay update.
|
||||
/atom/proc/ImmediateOverlayUpdate()
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
UpdateOverlays()
|
||||
|
||||
/atom/proc/compile_overlays()
|
||||
var/list/oo = our_overlays
|
||||
var/list/po = priority_overlays
|
||||
if(LAZYLEN(po) && LAZYLEN(oo))
|
||||
overlays = oo + po
|
||||
else if(LAZYLEN(oo))
|
||||
overlays = oo
|
||||
else if(LAZYLEN(po))
|
||||
overlays = po
|
||||
else
|
||||
overlays.Cut()
|
||||
|
||||
overlay_queued = FALSE
|
||||
|
||||
/atom/movable/compile_overlays()
|
||||
..()
|
||||
UPDATE_OO_IF_PRESENT
|
||||
|
||||
/turf/compile_overlays()
|
||||
..()
|
||||
if (istype(above))
|
||||
update_above()
|
||||
|
||||
/proc/iconstate2appearance(icon, iconstate)
|
||||
var/static/image/stringbro = new()
|
||||
var/list/icon_states_cache = SSoverlays.overlay_icon_state_caches
|
||||
var/list/cached_icon = icon_states_cache[icon]
|
||||
if (cached_icon)
|
||||
var/cached_appearance = cached_icon["[iconstate]"]
|
||||
if (cached_appearance)
|
||||
return cached_appearance
|
||||
stringbro.icon = icon
|
||||
stringbro.icon_state = iconstate
|
||||
if (!cached_icon) //not using the macro to save an associated lookup
|
||||
cached_icon = list()
|
||||
icon_states_cache[icon] = cached_icon
|
||||
var/cached_appearance = stringbro.appearance
|
||||
cached_icon["[iconstate]"] = cached_appearance
|
||||
return cached_appearance
|
||||
|
||||
/proc/icon2appearance(icon)
|
||||
var/static/image/iconbro = new()
|
||||
var/list/icon_cache = SSoverlays.overlay_icon_cache
|
||||
. = icon_cache[icon]
|
||||
if (!.)
|
||||
iconbro.icon = icon
|
||||
. = iconbro.appearance
|
||||
icon_cache[icon] = .
|
||||
|
||||
#define APPEARANCEIFY(origin, target) \
|
||||
if (istext(origin)) { \
|
||||
target = iconstate2appearance(icon, origin); \
|
||||
} \
|
||||
else if (isicon(origin)) { \
|
||||
target = icon2appearance(origin); \
|
||||
} \
|
||||
else { \
|
||||
appearance_bro.appearance = origin; \
|
||||
if (!ispath(origin)) { \
|
||||
appearance_bro.dir = origin.dir; \
|
||||
} \
|
||||
target = appearance_bro.appearance; \
|
||||
}
|
||||
|
||||
/atom/proc/build_appearance_list(atom/new_overlays)
|
||||
var/static/image/appearance_bro = new
|
||||
if (islist(new_overlays))
|
||||
listclearnulls(new_overlays)
|
||||
for (var/i in 1 to length(new_overlays))
|
||||
var/image/cached_overlay = new_overlays[i]
|
||||
APPEARANCEIFY(cached_overlay, new_overlays[i])
|
||||
return new_overlays
|
||||
else
|
||||
APPEARANCEIFY(new_overlays, .)
|
||||
|
||||
#undef APPEARANCEIFY
|
||||
#define NOT_QUEUED_ALREADY (!(overlay_queued))
|
||||
#define QUEUE_FOR_COMPILE overlay_queued = TRUE; SSoverlays.processing += src;
|
||||
|
||||
/atom/proc/cut_overlays(priority = FALSE, force_compile = FALSE)
|
||||
var/list/cached_overlays = our_overlays
|
||||
var/list/cached_priority = priority_overlays
|
||||
|
||||
var/need_compile = FALSE
|
||||
|
||||
if(LAZYLEN(cached_overlays)) //don't queue empty lists, don't cut priority overlays
|
||||
cached_overlays.Cut() //clear regular overlays
|
||||
need_compile = TRUE
|
||||
|
||||
if(priority && LAZYLEN(cached_priority))
|
||||
cached_priority.Cut()
|
||||
need_compile = TRUE
|
||||
|
||||
if(need_compile)
|
||||
if(!SS_IS_RUNNING(SSoverlays))
|
||||
compile_overlays()
|
||||
else if(NOT_QUEUED_ALREADY)
|
||||
QUEUE_FOR_COMPILE
|
||||
|
||||
/atom/proc/cut_overlay(list/overlays, priority = FALSE, force_compile = FALSE)
|
||||
if(!overlays)
|
||||
/**
|
||||
* Shared behavior for ClearOverlays & CutUnderlays. Do not use directly.
|
||||
* null: nothing changed, do nothing
|
||||
* FALSE: update should be queued
|
||||
* TRUE: update should be queued, cache should be nulled
|
||||
*/
|
||||
/atom/proc/CutCacheBehavior(sources, cache)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
var/initial_length = length(cache)
|
||||
if (!initial_length)
|
||||
return
|
||||
cache -= sources
|
||||
var/after_length = length(cache)
|
||||
if (!after_length)
|
||||
return TRUE
|
||||
if (initial_length > after_length)
|
||||
return FALSE
|
||||
|
||||
overlays = build_appearance_list(overlays)
|
||||
|
||||
var/list/cached_overlays = our_overlays //sanic
|
||||
var/list/cached_priority = priority_overlays
|
||||
var/init_o_len = LAZYLEN(cached_overlays)
|
||||
var/init_p_len = LAZYLEN(cached_priority) //starter pokemon
|
||||
|
||||
LAZYREMOVE(cached_overlays, overlays)
|
||||
if(priority)
|
||||
LAZYREMOVE(cached_priority, overlays)
|
||||
|
||||
if(force_compile && !SS_IS_RUNNING(SSoverlays))
|
||||
compile_overlays()
|
||||
else if(NOT_QUEUED_ALREADY && ((init_o_len != LAZYLEN(cached_priority)) || (init_p_len != LAZYLEN(cached_overlays))))
|
||||
QUEUE_FOR_COMPILE
|
||||
|
||||
/atom/proc/add_overlay(list/overlays, priority = FALSE, force_compile = FALSE)
|
||||
if(!overlays)
|
||||
/// Enqueues the atom for an overlay update if not already queued
|
||||
/atom/proc/QueueOverlayUpdate()
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
if (atom_flags & ATOM_AWAITING_OVERLAY_UPDATE)
|
||||
return
|
||||
atom_flags |= ATOM_AWAITING_OVERLAY_UPDATE
|
||||
SSoverlays.queue += src
|
||||
|
||||
overlays = build_appearance_list(overlays)
|
||||
|
||||
if (!overlays || (islist(overlays) && !overlays.len))
|
||||
// No point trying to compile if we don't have any overlays.
|
||||
/// Builds the atom's overlay state from caches
|
||||
/atom/proc/UpdateOverlays()
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
atom_flags &= ~ATOM_AWAITING_OVERLAY_UPDATE
|
||||
if (QDELING(src))
|
||||
LIST_RESIZE(overlays, 0)
|
||||
return
|
||||
|
||||
if(priority)
|
||||
LAZYADD(priority_overlays, overlays)
|
||||
else
|
||||
LAZYADD(our_overlays, overlays)
|
||||
|
||||
if(force_compile && !SS_IS_RUNNING(SSoverlays))
|
||||
compile_overlays()
|
||||
else if(NOT_QUEUED_ALREADY)
|
||||
QUEUE_FOR_COMPILE
|
||||
|
||||
/atom/proc/set_overlays(list/overlays, priority = FALSE, force_compile = FALSE) // Sets overlays to a list, equivalent to cut_overlays() + add_overlays().
|
||||
if (!overlays)
|
||||
return
|
||||
|
||||
overlays = build_appearance_list(overlays)
|
||||
|
||||
if (priority)
|
||||
LAZYCLEARLIST(priority_overlays)
|
||||
if (overlays)
|
||||
LAZYADD(priority_overlays, overlays)
|
||||
else
|
||||
LAZYCLEARLIST(our_overlays)
|
||||
if (overlays)
|
||||
LAZYADD(our_overlays, overlays)
|
||||
|
||||
if(force_compile && !SS_IS_RUNNING(SSoverlays))
|
||||
compile_overlays()
|
||||
else if (NOT_QUEUED_ALREADY)
|
||||
QUEUE_FOR_COMPILE
|
||||
|
||||
/atom/proc/copy_overlays(atom/other, cut_old = FALSE, force_compile = FALSE) //copys our_overlays from another atom
|
||||
if(!other)
|
||||
if(cut_old)
|
||||
cut_overlays()
|
||||
return
|
||||
|
||||
var/list/cached_other = other.our_overlays
|
||||
if(cached_other)
|
||||
if(cut_old)
|
||||
our_overlays = cached_other.Copy()
|
||||
if (length(atom_protected_overlay_cache))
|
||||
if (length(atom_overlay_cache))
|
||||
overlays = atom_protected_overlay_cache + atom_overlay_cache
|
||||
else
|
||||
our_overlays |= cached_other
|
||||
if(force_compile && !SS_IS_RUNNING(SSoverlays))
|
||||
compile_overlays()
|
||||
else if(NOT_QUEUED_ALREADY)
|
||||
QUEUE_FOR_COMPILE
|
||||
else if(cut_old)
|
||||
cut_overlays()
|
||||
overlays = atom_protected_overlay_cache
|
||||
else if (length(atom_overlay_cache))
|
||||
overlays = atom_overlay_cache
|
||||
else
|
||||
LIST_RESIZE(overlays, 0)
|
||||
|
||||
#undef NOT_QUEUED_ALREADY
|
||||
#undef QUEUE_FOR_COMPILE
|
||||
|
||||
//TODO: Better solution for these?
|
||||
/image/proc/add_overlay(x)
|
||||
overlays += x
|
||||
/// Clears the atom's overlay cache(s) and queues an update if needed. Use CLEAR_TARGET_* flags.
|
||||
/atom/proc/ClearOverlays(cache_target = ATOM_ICON_CACHE_NORMAL)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
if (cache_target & ATOM_ICON_CACHE_PROTECTED)
|
||||
if (!atom_protected_overlay_cache)
|
||||
return
|
||||
LAZYCLEARLIST(atom_protected_overlay_cache)
|
||||
QueueOverlayUpdate()
|
||||
if (cache_target & ATOM_ICON_CACHE_NORMAL)
|
||||
if (!atom_overlay_cache)
|
||||
return
|
||||
LAZYCLEARLIST(atom_overlay_cache)
|
||||
QueueOverlayUpdate()
|
||||
|
||||
/image/proc/cut_overlay(x)
|
||||
overlays -= x
|
||||
|
||||
/image/proc/cut_overlays(x)
|
||||
overlays.Cut()
|
||||
/**
|
||||
* Adds specific overlay(s) to the atom.
|
||||
* It is designed so any of the types allowed to be added to /atom/overlays can be added here too. More details below.
|
||||
*
|
||||
* @param sources The overlay(s) to add. These may be
|
||||
* - A string: In which case it is treated as an icon_state of the atom's icon.
|
||||
* - An icon: It is treated as an icon.
|
||||
* - An atom: Its own overlays are compiled and then it's appearance is added. (Meaning its current apperance is frozen).
|
||||
* - An image: Image's apperance is added (i.e. subsequently editing the image will not edit the overlay)
|
||||
* - A type path: Added to overlays as is. Does whatever it is BYOND does when you add paths to overlays.
|
||||
* - Or a list containing any of the above.
|
||||
* @param cache_target If ATOM_ICON_CACHE_PROTECTED, add to the protected cache instead of normal.
|
||||
*/
|
||||
/atom/proc/AddOverlays(sources, cache_target = ATOM_ICON_CACHE_NORMAL)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
if (!sources)
|
||||
return
|
||||
sources = SSoverlays.GetAppearanceList(src, sources)
|
||||
if (!length(sources))
|
||||
return
|
||||
if (cache_target & ATOM_ICON_CACHE_PROTECTED)
|
||||
if (atom_protected_overlay_cache)
|
||||
atom_protected_overlay_cache += sources
|
||||
else
|
||||
atom_protected_overlay_cache = sources
|
||||
else if (atom_overlay_cache)
|
||||
atom_overlay_cache += sources
|
||||
else
|
||||
atom_overlay_cache = sources
|
||||
QueueOverlayUpdate()
|
||||
|
||||
|
||||
/**
|
||||
* Removes specific overlay(s) from the atom's normal or protected overlay cache and queue an update.
|
||||
*
|
||||
* @param overlays The overlays to removed. See AddOverlays for legal source types.
|
||||
* @param cache_target A mask of ICON_CACHE_TARGET_*.
|
||||
*/
|
||||
/atom/proc/CutOverlays(sources, cache_target = ATOM_ICON_CACHE_NORMAL)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
if (!sources)
|
||||
return
|
||||
sources = SSoverlays.GetAppearanceList(src, sources)
|
||||
if (!length(sources))
|
||||
return
|
||||
var/update
|
||||
if (cache_target & ATOM_ICON_CACHE_PROTECTED)
|
||||
var/outcome = CutCacheBehavior(sources, atom_protected_overlay_cache)
|
||||
if (!isnull(outcome))
|
||||
update = TRUE
|
||||
if (outcome == TRUE)
|
||||
atom_protected_overlay_cache = null
|
||||
if (cache_target & ATOM_ICON_CACHE_NORMAL)
|
||||
var/outcome = CutCacheBehavior(sources, atom_overlay_cache)
|
||||
if (!isnull(outcome))
|
||||
update = TRUE
|
||||
if (outcome == TRUE)
|
||||
atom_overlay_cache = null
|
||||
if (update)
|
||||
QueueOverlayUpdate()
|
||||
|
||||
|
||||
/// AddOverlays with ClearOverlays first. See AddOverlays for behavior.
|
||||
/atom/proc/SetOverlays(sources, cache_target = ATOM_ICON_CACHE_NORMAL)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
ClearOverlays(cache_target)
|
||||
AddOverlays(sources, cache_target)
|
||||
|
||||
|
||||
/**
|
||||
* Copy the overlays from another atom.
|
||||
*
|
||||
* @param other The atom to copy overlays from.
|
||||
* @param clear If TRUE, clear before adding other's overlays.
|
||||
* @param cache_target A mask of ICON_CACHE_TARGET_* indicating what to copy.
|
||||
*/
|
||||
/atom/proc/CopyOverlays(atom/other, clear, cache_target = ATOM_ICON_CACHE_NORMAL)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
if (clear)
|
||||
ClearOverlays(cache_target)
|
||||
if (!istype(other))
|
||||
return
|
||||
if (cache_target & ATOM_ICON_CACHE_PROTECTED)
|
||||
AddOverlays(other.atom_protected_overlay_cache, ATOM_ICON_CACHE_PROTECTED)
|
||||
if (cache_target & ATOM_ICON_CACHE_NORMAL)
|
||||
AddOverlays(other.atom_overlay_cache, ATOM_ICON_CACHE_NORMAL)
|
||||
|
||||
|
||||
// Skin-deep API parity for images.
|
||||
// Reference <https://www.byond.com/docs/ref/#/atom/var/overlays> for permitted types.
|
||||
|
||||
/// Adds sources to the image's overlays.
|
||||
/image/proc/AddOverlays(sources)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
overlays |= sources
|
||||
|
||||
|
||||
/// Removes sources from the image's overlays.
|
||||
/image/proc/CutOverlays(sources)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
overlays -= sources
|
||||
|
||||
|
||||
/// Removes all of the image's overlays.
|
||||
/image/proc/ClearOverlays()
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
LIST_RESIZE(overlays, 0)
|
||||
|
||||
|
||||
/// Copies the overlays from the atom other, clearing first if set, and using the caches indicated.
|
||||
/image/proc/CopyOverlays(atom/other, clear, cache_target = ATOM_ICON_CACHE_ALL)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
if (clear)
|
||||
LIST_RESIZE(overlays, 0)
|
||||
if (!istype(other))
|
||||
return
|
||||
if (cache_target & ATOM_ICON_CACHE_PROTECTED)
|
||||
overlays |= other.atom_protected_overlay_cache
|
||||
if (cache_target & ATOM_ICON_CACHE_NORMAL)
|
||||
overlays |= other.atom_overlay_cache
|
||||
|
||||
/atom
|
||||
var/tmp/list/our_overlays //our local copy of (non-priority) overlays without byond magic. Use procs in SSoverlays to manipulate
|
||||
var/tmp/list/priority_overlays //overlays that should remain on top and not normally removed when using cut_overlay functions, like c4.
|
||||
var/tmp/overlay_queued
|
||||
|
||||
+10
-4
@@ -56,6 +56,12 @@
|
||||
/// How this atom should react to having its astar blocking checked
|
||||
var/can_astar_pass = CANASTARPASS_DENSITY
|
||||
|
||||
/// This atom's cache of non-protected overlays, used for normal icon additions. Do not manipulate directly- See SSoverlays.
|
||||
var/list/atom_overlay_cache
|
||||
|
||||
/// This atom's cache of overlays that can only be removed explicitly, like C4. Do not manipulate directly- See SSoverlays.
|
||||
var/list/atom_protected_overlay_cache
|
||||
|
||||
/atom/Destroy(force)
|
||||
if(opacity)
|
||||
updateVisibility(src)
|
||||
@@ -80,11 +86,11 @@
|
||||
if(icon_update_queued)
|
||||
SSicon_update.remove_from_queue(src)
|
||||
|
||||
if(length(our_overlays))
|
||||
LAZYCLEARLIST(our_overlays)
|
||||
if(length(atom_overlay_cache))
|
||||
LAZYCLEARLIST(atom_overlay_cache)
|
||||
|
||||
if(length(priority_overlays))
|
||||
LAZYCLEARLIST(priority_overlays)
|
||||
if(length(atom_protected_overlay_cache))
|
||||
LAZYCLEARLIST(atom_protected_overlay_cache)
|
||||
|
||||
if(orbiters)
|
||||
for(var/thing in orbiters)
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
C.transforming = TRUE
|
||||
C.canmove = FALSE
|
||||
C.icon = null
|
||||
C.cut_overlays()
|
||||
C.ClearOverlays()
|
||||
C.set_invisibility(101)
|
||||
var/atom/movable/overlay/animation = new /atom/movable/overlay(C.loc)
|
||||
animation.icon_state = "blank"
|
||||
|
||||
@@ -62,7 +62,7 @@ In short:
|
||||
set waitfor = FALSE
|
||||
for(var/turf/T in world) // Expensive, but CHECK_TICK should prevent lag.
|
||||
if(istype(T, /turf/space))
|
||||
T.add_overlay("hell01")
|
||||
T.AddOverlays("hell01")
|
||||
else
|
||||
var/static/image/I = image('icons/turf/space.dmi', "hell01")
|
||||
T.underlays += I
|
||||
|
||||
@@ -472,18 +472,18 @@
|
||||
|
||||
|
||||
/obj/structure/cult/pylon/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(pylonmode == PYLON_TURRET)
|
||||
anchored = TRUE
|
||||
if(empowered)
|
||||
add_overlay("crystal_overcharge")
|
||||
AddOverlays("crystal_overcharge")
|
||||
set_light(7, 3, l_color = "#a160bf")
|
||||
else
|
||||
set_light(6, 3, l_color = "#3e0000")
|
||||
add_overlay("crystal_turret")
|
||||
AddOverlays("crystal_turret")
|
||||
else if(!isbroken)
|
||||
set_light(5, 2, l_color = "#3e0000")
|
||||
add_overlay("crystal_idle")
|
||||
AddOverlays("crystal_idle")
|
||||
if(pylonmode == PYLON_AWAITING_SACRIFICE)
|
||||
anchored = TRUE
|
||||
else
|
||||
|
||||
@@ -14,10 +14,10 @@ var/global/universe_has_ended = 0
|
||||
|
||||
/datum/universal_state/supermatter_cascade/OnTurfChange(var/turf/T)
|
||||
if(T.name == "space")
|
||||
T.add_overlay("end01")
|
||||
T.AddOverlays("end01")
|
||||
T.underlays -= "end01"
|
||||
else
|
||||
T.cut_overlay("end01")
|
||||
T.CutOverlays("end01")
|
||||
|
||||
/datum/universal_state/supermatter_cascade/DecayTurf(var/turf/T)
|
||||
if(istype(T,/turf/simulated/wall))
|
||||
@@ -101,7 +101,7 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked
|
||||
set waitfor = FALSE
|
||||
for(var/turf/T in world)
|
||||
if(istype(T, /turf/space))
|
||||
T.add_overlay("end01")
|
||||
T.AddOverlays("end01")
|
||||
else
|
||||
if (isNotAdminLevel(T.z))
|
||||
T.underlays += "end01"
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
else
|
||||
active = 0
|
||||
icon_state = "pinoff"
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
to_chat(usr, "<span class='notice'>You deactivate the pinpointer</span>")
|
||||
|
||||
/obj/item/pinpointer/advpinpointer/process()
|
||||
@@ -113,12 +113,12 @@
|
||||
icon_state = "pinonfar"
|
||||
|
||||
/obj/item/pinpointer/advpinpointer/proc/set_z_overlays(var/atom/target)
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(AreConnectedZLevels(src.loc.z, target.z))
|
||||
if(src.loc.z > target.z)
|
||||
add_overlay("pinzdown")
|
||||
AddOverlays("pinzdown")
|
||||
else if(src.loc.z < target.z)
|
||||
add_overlay("pinzup")
|
||||
AddOverlays("pinzup")
|
||||
else
|
||||
active = 0
|
||||
if(ismob(loc))
|
||||
|
||||
@@ -267,9 +267,9 @@
|
||||
else if(attacking_item.isscrewdriver())
|
||||
src.panel_open = !src.panel_open
|
||||
to_chat(user, "You [src.panel_open ? "open" : "close"] the maintenance panel.")
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(src.panel_open)
|
||||
add_overlay("[initial(icon_state)]-o")
|
||||
AddOverlays("[initial(icon_state)]-o")
|
||||
return TRUE
|
||||
else if(default_part_replacement(user, attacking_item))
|
||||
return TRUE
|
||||
|
||||
@@ -495,14 +495,14 @@ pixel_x = 10;
|
||||
return 0
|
||||
|
||||
/obj/machinery/alarm/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
icon_state = "alarmp"
|
||||
|
||||
if(wiresexposed)
|
||||
icon_state = "alarmx"
|
||||
|
||||
if((stat & (NOPOWER|BROKEN)) || shorted)
|
||||
add_overlay("alarm_fan_off")
|
||||
AddOverlays("alarm_fan_off")
|
||||
set_light(0)
|
||||
return
|
||||
|
||||
@@ -511,7 +511,7 @@ pixel_x = 10;
|
||||
icon_level = max(icon_level, 1) //if there's an atmos alarm but everything is okay locally, no need to go past yellow
|
||||
|
||||
alarm_overlay = make_screen_overlay(icon, "alarm[icon_level]")
|
||||
add_overlay(alarm_overlay)
|
||||
AddOverlays(alarm_overlay)
|
||||
|
||||
var/new_color = null
|
||||
switch(icon_level)
|
||||
@@ -525,9 +525,9 @@ pixel_x = 10;
|
||||
set_light(l_range = L_WALLMOUNT_RANGE, l_power = L_WALLMOUNT_POWER, l_color = new_color)
|
||||
|
||||
if(regulating_temperature)
|
||||
add_overlay("alarm_fan_on")
|
||||
AddOverlays("alarm_fan_on")
|
||||
else
|
||||
add_overlay("alarm_fan_off")
|
||||
AddOverlays("alarm_fan_off")
|
||||
|
||||
/obj/machinery/alarm/proc/refresh_all()
|
||||
for(var/id_tag in alarm_area.air_vent_names)
|
||||
|
||||
@@ -275,7 +275,7 @@ update_flag
|
||||
*/
|
||||
|
||||
if (src.destroyed)
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
set_light(FALSE)
|
||||
src.icon_state = text("[]-1", src.canister_color)
|
||||
return
|
||||
@@ -286,31 +286,31 @@ update_flag
|
||||
if(check_change()) //Returns 1 if no change needed to icons.
|
||||
return
|
||||
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
set_light(FALSE)
|
||||
|
||||
if(signaler)
|
||||
add_overlay("signaler")
|
||||
AddOverlays("signaler")
|
||||
|
||||
if(update_flag & 1)
|
||||
add_overlay("can-open")
|
||||
AddOverlays("can-open")
|
||||
if(update_flag & 2)
|
||||
add_overlay("can-connector")
|
||||
AddOverlays("can-connector")
|
||||
if(update_flag & 4)
|
||||
var/mutable_appearance/indicator_overlay = mutable_appearance(icon, "can-o0", plane = EFFECTS_ABOVE_LIGHTING_PLANE)
|
||||
add_overlay(indicator_overlay)
|
||||
AddOverlays(indicator_overlay)
|
||||
set_light(1.4, 1, COLOR_RED_LIGHT)
|
||||
if(update_flag & 8)
|
||||
var/mutable_appearance/indicator_overlay = mutable_appearance(icon, "can-o1", plane = EFFECTS_ABOVE_LIGHTING_PLANE)
|
||||
add_overlay(indicator_overlay)
|
||||
AddOverlays(indicator_overlay)
|
||||
set_light(1.4, 1, COLOR_RED_LIGHT)
|
||||
else if(update_flag & 16)
|
||||
var/mutable_appearance/indicator_overlay = mutable_appearance(icon, "can-o2", plane = EFFECTS_ABOVE_LIGHTING_PLANE)
|
||||
add_overlay(indicator_overlay)
|
||||
AddOverlays(indicator_overlay)
|
||||
set_light(1.4, 1, COLOR_YELLOW)
|
||||
else if(update_flag & 32)
|
||||
var/mutable_appearance/indicator_overlay = mutable_appearance(icon, "can-o3", plane = EFFECTS_ABOVE_LIGHTING_PLANE)
|
||||
add_overlay(indicator_overlay)
|
||||
AddOverlays(indicator_overlay)
|
||||
set_light(1.4, 1, COLOR_BRIGHT_GREEN)
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
|
||||
@@ -21,20 +21,20 @@
|
||||
src.target = locate(/obj/machinery/atmospherics/pipe) in loc
|
||||
|
||||
/obj/machinery/meter/process()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(!target)
|
||||
add_overlay("pressure_off")
|
||||
add_overlay("buttons-x")
|
||||
AddOverlays("pressure_off")
|
||||
AddOverlays("buttons-x")
|
||||
return FALSE
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
add_overlay("pressure_off")
|
||||
AddOverlays("pressure_off")
|
||||
return FALSE
|
||||
|
||||
var/datum/gas_mixture/environment = target.return_air()
|
||||
if(!environment)
|
||||
add_overlay("buttons_x")
|
||||
add_overlay("pressure0")
|
||||
AddOverlays("buttons_x")
|
||||
AddOverlays("pressure0")
|
||||
return FALSE
|
||||
|
||||
var/button_overlay_name
|
||||
@@ -88,8 +88,8 @@
|
||||
if(atmos_overlay.color != temp_color)
|
||||
atmos_overlay.color = temp_color
|
||||
|
||||
add_overlay(button_overlay)
|
||||
add_overlay(atmos_overlay)
|
||||
AddOverlays(button_overlay)
|
||||
AddOverlays(atmos_overlay)
|
||||
|
||||
if(frequency)
|
||||
var/datum/radio_frequency/radio_connection = SSradio.return_frequency(frequency)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
src.air_contents.adjust_multi(GAS_OXYGEN, air_mix[GAS_OXYGEN], GAS_NITROGEN, air_mix[GAS_NITROGEN])
|
||||
|
||||
/obj/machinery/portable_atmospherics/powered/pump/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(on && cell && cell.charge)
|
||||
icon_state = "psiphon:1"
|
||||
@@ -41,10 +41,10 @@
|
||||
icon_state = "psiphon:0"
|
||||
|
||||
if(holding)
|
||||
add_overlay("siphon-open")
|
||||
AddOverlays("siphon-open")
|
||||
|
||||
if(connected_port)
|
||||
add_overlay("siphon-connector")
|
||||
AddOverlays("siphon-connector")
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
|
||||
/obj/machinery/portable_atmospherics/powered/scrubber/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(on && cell && cell.charge)
|
||||
icon_state = "pscrubber:1"
|
||||
@@ -47,10 +47,10 @@
|
||||
icon_state = "pscrubber:0"
|
||||
|
||||
if(holding)
|
||||
add_overlay("scrubber-open")
|
||||
AddOverlays("scrubber-open")
|
||||
|
||||
if(connected_port)
|
||||
add_overlay("scrubber-connector")
|
||||
AddOverlays("scrubber-connector")
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -242,11 +242,11 @@
|
||||
else if((autolathe_flags & AUTOLATHE_BUSY))
|
||||
process_queue_item()
|
||||
|
||||
/// Used so that we don't try to add_overlay every tick the autolathe processes.
|
||||
/// Used so that we don't try to AddOverlays every tick the autolathe processes.
|
||||
/obj/machinery/autolathe/proc/start_processing_queue_item()
|
||||
if(does_flick)
|
||||
//Fancy autolathe animation.
|
||||
add_overlay("process")
|
||||
AddOverlays("process")
|
||||
autolathe_flags |= AUTOLATHE_STARTED|AUTOLATHE_BUSY
|
||||
|
||||
/obj/machinery/autolathe/proc/process_queue_item()
|
||||
@@ -269,7 +269,7 @@
|
||||
|
||||
print_queue -= currently_printing
|
||||
QDEL_NULL(currently_printing)
|
||||
cut_overlay("process")
|
||||
CutOverlays("process")
|
||||
I.update_icon()
|
||||
update_use_power(POWER_USE_IDLE)
|
||||
|
||||
@@ -364,7 +364,7 @@
|
||||
var/obj/item/stack/material/sheet = eating
|
||||
var/icon/load = icon(icon, "load")
|
||||
load.Blend(sheet.material.icon_colour,ICON_MULTIPLY)
|
||||
add_overlay(load)
|
||||
AddOverlays(load)
|
||||
CUT_OVERLAY_IN(load, 6)
|
||||
|
||||
if(istype(eating, /obj/item/stack))
|
||||
|
||||
@@ -282,13 +282,13 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/body_scanconsole/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if((stat & BROKEN) || (stat & NOPOWER))
|
||||
return
|
||||
else
|
||||
if(!console_overlay)
|
||||
console_overlay = make_screen_overlay(icon, "body_scannerconsole-screen")
|
||||
add_overlay(console_overlay)
|
||||
AddOverlays(console_overlay)
|
||||
set_light(1.4, 1, COLOR_PURPLE)
|
||||
|
||||
/obj/machinery/body_scanconsole/Initialize()
|
||||
|
||||
@@ -74,14 +74,14 @@
|
||||
return
|
||||
|
||||
/obj/machinery/case_button/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(stat & NOPOWER)
|
||||
update_use_power(POWER_USE_OFF)
|
||||
add_overlay("b[button]d") //Add the deactivated button overlay
|
||||
add_overlay("g[cover]d") //Add the deactivated cover overlay
|
||||
AddOverlays("b[button]d") //Add the deactivated button overlay
|
||||
AddOverlays("g[cover]d") //Add the deactivated cover overlay
|
||||
return
|
||||
add_overlay("b[button][active]") //Add the button as overlay
|
||||
add_overlay("g[cover][covered]") //Add the glass/shield overlay
|
||||
AddOverlays("b[button][active]") //Add the button as overlay
|
||||
AddOverlays("g[cover][covered]") //Add the glass/shield overlay
|
||||
return
|
||||
|
||||
//Activate the button - Needs to return 1 for the activation to be successful
|
||||
|
||||
@@ -24,20 +24,20 @@
|
||||
charge_level = new_level
|
||||
|
||||
/obj/machinery/cell_charger/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(charging)
|
||||
charging.update_icon()
|
||||
add_overlay(charging.icon_state)
|
||||
add_overlay("ccharger-on")
|
||||
AddOverlays(charging.icon_state)
|
||||
AddOverlays("ccharger-on")
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
add_overlay(charging.overlays)
|
||||
AddOverlays(charging.overlays)
|
||||
|
||||
if(INOPERABLE(src) || !charging)
|
||||
return
|
||||
|
||||
update_charge_level()
|
||||
add_overlay("cell-o2")
|
||||
add_overlay("[icon_state]-o[charge_level]")
|
||||
AddOverlays("cell-o2")
|
||||
AddOverlays("[icon_state]-o[charge_level]")
|
||||
|
||||
/obj/machinery/cell_charger/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
|
||||
. = ..()
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
layer = ABOVE_HUMAN_LAYER
|
||||
if(WEST)
|
||||
layer = ABOVE_HUMAN_LAYER
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(stat & NOPOWER)
|
||||
set_light(0)
|
||||
return
|
||||
@@ -104,23 +104,23 @@
|
||||
if(stat & BROKEN)
|
||||
icon_state = "[icon_state]-broken"
|
||||
if (overlay_layer != layer)
|
||||
add_overlay(image(icon, icon_broken, overlay_layer))
|
||||
AddOverlays(image(icon, icon_broken, overlay_layer))
|
||||
else
|
||||
add_overlay(icon_broken)
|
||||
AddOverlays(icon_broken)
|
||||
else if (icon_screen)
|
||||
if (is_holographic)
|
||||
holographic_overlay(src, src.icon, icon_screen)
|
||||
if (icon_scanline)
|
||||
add_overlay(icon_scanline)
|
||||
AddOverlays(icon_scanline)
|
||||
if (icon_keyboard)
|
||||
if((stat & NOPOWER) && has_off_keyboards)
|
||||
add_overlay("[icon_keyboard]_off")
|
||||
AddOverlays("[icon_keyboard]_off")
|
||||
else
|
||||
add_overlay(icon_keyboard)
|
||||
AddOverlays(icon_keyboard)
|
||||
else if (overlay_layer != layer)
|
||||
add_overlay(image(icon, icon_screen, overlay_layer))
|
||||
AddOverlays(image(icon, icon_screen, overlay_layer))
|
||||
else
|
||||
add_overlay(icon_screen)
|
||||
AddOverlays(icon_screen)
|
||||
|
||||
/obj/machinery/computer/power_change()
|
||||
..()
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
right.queue_icon_update()
|
||||
|
||||
/obj/machinery/crusher_base/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
var/obj/machinery/crusher_base/left = locate(/obj/machinery/crusher_base, get_step(src, WEST))
|
||||
var/obj/machinery/crusher_base/right = locate(/obj/machinery/crusher_base, get_step(src, EAST))
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
else
|
||||
holographic_overlay(src, icon, "[asmtype]-overlay-green")
|
||||
if(panel_open)
|
||||
add_overlay("[asmtype]-hatch")
|
||||
AddOverlays("[asmtype]-hatch")
|
||||
update_above()
|
||||
|
||||
/obj/machinery/crusher_base/power_change()
|
||||
|
||||
@@ -319,29 +319,29 @@
|
||||
user.pulling = null
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
icon_state = "pod[on]"
|
||||
var/image/I
|
||||
|
||||
if(panel_open)
|
||||
add_overlay("pod_panel")
|
||||
AddOverlays("pod_panel")
|
||||
|
||||
I = image(icon, "pod[on]_top")
|
||||
I.pixel_z = 32
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
if(occupant)
|
||||
var/image/pickle = image(occupant.icon, occupant.icon_state)
|
||||
pickle.overlays = occupant.overlays
|
||||
pickle.pixel_z = 11
|
||||
add_overlay(pickle)
|
||||
AddOverlays(pickle)
|
||||
|
||||
I = image(icon, "lid[on]")
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
I = image(icon, "lid[on]_top")
|
||||
I.pixel_z = 32
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
if(powered())
|
||||
var/warn_state = "off"
|
||||
@@ -351,10 +351,10 @@
|
||||
warn_state = "danger"
|
||||
else if(air_contents.temperature >= temperature_warning_threshold)
|
||||
warn_state = "warn"
|
||||
add_overlay(screen_overlays["cryo-[warn_state]"])
|
||||
AddOverlays(screen_overlays["cryo-[warn_state]"])
|
||||
I = screen_overlays["cryo-[warn_state]-top"]
|
||||
I.pixel_z = 32
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/proc/process_occupant()
|
||||
if(air_contents.total_moles < 10)
|
||||
|
||||
@@ -261,23 +261,23 @@ GLOBAL_LIST_EMPTY(frozen_crew)
|
||||
disallow_occupant_types = list(/mob/living/silicon/robot)
|
||||
|
||||
/obj/machinery/cryopod/living_quarters/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
var/image/I = image(icon, "pod_top")
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
|
||||
if(occupant)
|
||||
I = image(icon, "pod_back")
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
name = "[name] ([occupant])"
|
||||
I = image(occupant.icon, occupant.icon_state, dir = SOUTH)
|
||||
I.overlays = occupant.overlays
|
||||
I.pixel_z = 11
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
I = image(icon, "pod_door")
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
else
|
||||
name = initial(name)
|
||||
|
||||
|
||||
@@ -1100,25 +1100,25 @@ About the new airlock wires panel:
|
||||
if(p_open)
|
||||
panel_overlay = panel_file
|
||||
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
add_overlay(frame_color_overlay)
|
||||
add_overlay(color_overlay)
|
||||
add_overlay(panel_overlay)
|
||||
add_overlay(filling_overlay)
|
||||
add_overlay(stripe_overlay)
|
||||
add_overlay(stripe_filling_overlay)
|
||||
add_overlay(weld_overlay)
|
||||
add_overlay(brace_overlay)
|
||||
add_overlay(lights_overlay)
|
||||
add_overlay(sparks_overlay)
|
||||
add_overlay(damage_overlay)
|
||||
AddOverlays(frame_color_overlay)
|
||||
AddOverlays(color_overlay)
|
||||
AddOverlays(panel_overlay)
|
||||
AddOverlays(filling_overlay)
|
||||
AddOverlays(stripe_overlay)
|
||||
AddOverlays(stripe_filling_overlay)
|
||||
AddOverlays(weld_overlay)
|
||||
AddOverlays(brace_overlay)
|
||||
AddOverlays(lights_overlay)
|
||||
AddOverlays(sparks_overlay)
|
||||
AddOverlays(damage_overlay)
|
||||
|
||||
if(force_compile)
|
||||
compile_overlays()
|
||||
UpdateOverlays()
|
||||
|
||||
/obj/machinery/door/airlock/do_animate(animation)
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
switch(animation)
|
||||
if("opening")
|
||||
|
||||
@@ -414,8 +414,8 @@
|
||||
// Adds an icon in case the screen is broken/off, stolen from status_display.dm
|
||||
/obj/machinery/door_timer/proc/set_picture(var/state)
|
||||
picture_state = state
|
||||
cut_overlays()
|
||||
add_overlay(picture_state)
|
||||
ClearOverlays()
|
||||
AddOverlays(picture_state)
|
||||
|
||||
//Checks to see if there's 1 line or 2, adds text-icons-numbers/letters over display
|
||||
// Stolen from status_display
|
||||
@@ -438,7 +438,7 @@
|
||||
var/image/ID = image('icons/obj/status_display.dmi', icon_state=char)
|
||||
ID.pixel_x = -(d-1)*5 + px
|
||||
ID.pixel_y = py
|
||||
I.add_overlay(ID)
|
||||
I.AddOverlays(ID)
|
||||
return I
|
||||
|
||||
// Door Timers
|
||||
|
||||
@@ -422,13 +422,13 @@
|
||||
/obj/machinery/door/firedoor/close()
|
||||
if(!can_close())
|
||||
return
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
latetoggle()
|
||||
START_PROCESSING_MACHINE(src, MACHINERY_PROCESS_SELF)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/door/firedoor/open(forced = 0, user = usr)
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(hatch_open)
|
||||
hatch_open = 0
|
||||
visible_message("The maintenance panel of \the [src] closes.")
|
||||
@@ -445,7 +445,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/door/firedoor/do_animate(animation)
|
||||
compile_overlays()
|
||||
UpdateOverlays()
|
||||
switch(animation)
|
||||
if("opening")
|
||||
flick("door_opening", src)
|
||||
@@ -455,18 +455,18 @@
|
||||
playsound(src, close_sound, 37, 1)
|
||||
|
||||
/obj/machinery/door/firedoor/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
set_light(0)
|
||||
var/do_set_light = 0
|
||||
|
||||
if(density)
|
||||
icon_state = "door_closed"
|
||||
if(hatch_open)
|
||||
add_overlay("hatch")
|
||||
AddOverlays("hatch")
|
||||
if(blocked)
|
||||
add_overlay("welded")
|
||||
AddOverlays("welded")
|
||||
if(pdiff_alert)
|
||||
add_overlay(overlay_image(icon, icon_state = "palert", plane = EFFECTS_ABOVE_LIGHTING_PLANE))
|
||||
AddOverlays(overlay_image(icon, icon_state = "palert", plane = EFFECTS_ABOVE_LIGHTING_PLANE))
|
||||
do_set_light = 1
|
||||
if(dir_alerts)
|
||||
for (var/d = 1; d <= 4; d++)
|
||||
@@ -477,15 +477,15 @@
|
||||
if (!dir_alerts[d])
|
||||
continue
|
||||
if (dir_alerts[d] & FIREDOOR_ALERT_COLD)
|
||||
add_overlay(overlay_image(icon, icon_state = "alert_cold", plane = EFFECTS_ABOVE_LIGHTING_PLANE))
|
||||
AddOverlays(overlay_image(icon, icon_state = "alert_cold", plane = EFFECTS_ABOVE_LIGHTING_PLANE))
|
||||
if (dir_alerts[d] & FIREDOOR_ALERT_HOT)
|
||||
add_overlay(overlay_image(icon, icon_state = "alert_hot", plane = EFFECTS_ABOVE_LIGHTING_PLANE))
|
||||
AddOverlays(overlay_image(icon, icon_state = "alert_hot", plane = EFFECTS_ABOVE_LIGHTING_PLANE))
|
||||
|
||||
do_set_light = TRUE
|
||||
else
|
||||
icon_state = "door_open"
|
||||
if(blocked)
|
||||
add_overlay("welded_open")
|
||||
AddOverlays("welded_open")
|
||||
|
||||
if(do_set_light)
|
||||
set_light(2, 0.5, COLOR_SUN)
|
||||
|
||||
@@ -33,10 +33,10 @@ var/list/doppler_arrays = list()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
else
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(!(stat & NOPOWER))
|
||||
set_light(2, 1, COLOR_CYAN)
|
||||
add_overlay(image(icon, src, "teleport"))
|
||||
AddOverlays(image(icon, src, "teleport"))
|
||||
|
||||
/obj/machinery/doppler_array/proc/sense_explosion(var/x0,var/y0,var/z0,var/devastation_range,var/heavy_impact_range,var/light_impact_range)
|
||||
if(!active)
|
||||
|
||||
@@ -28,31 +28,31 @@
|
||||
. += "The current alert level is [get_security_level()]."
|
||||
|
||||
/obj/machinery/firealarm/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(wiresexposed)
|
||||
switch(buildstage)
|
||||
if(2)
|
||||
add_overlay("fire_b2")
|
||||
AddOverlays("fire_b2")
|
||||
if(1)
|
||||
add_overlay("fire_b1")
|
||||
AddOverlays("fire_b1")
|
||||
if(0)
|
||||
add_overlay("fire_b0")
|
||||
AddOverlays("fire_b0")
|
||||
return
|
||||
|
||||
if(stat & BROKEN)
|
||||
add_overlay("firex")
|
||||
AddOverlays("firex")
|
||||
set_light(0)
|
||||
else if(stat & NOPOWER)
|
||||
add_overlay("firep")
|
||||
AddOverlays("firep")
|
||||
set_light(0)
|
||||
else
|
||||
var/area/A = get_area(src)
|
||||
if(A.fire)
|
||||
add_overlay("fire1")
|
||||
AddOverlays("fire1")
|
||||
set_light(l_range = L_WALLMOUNT_HI_RANGE, l_power = L_WALLMOUNT_HI_POWER, l_color = COLOR_RED)
|
||||
else
|
||||
add_overlay("fire0")
|
||||
AddOverlays("fire0")
|
||||
set_light(0)
|
||||
|
||||
/obj/machinery/firealarm/fire_act(datum/gas_mixture/air, temperature, volume)
|
||||
|
||||
@@ -112,11 +112,11 @@
|
||||
|
||||
if (!src.anchored)
|
||||
user.show_message(text("<span class='warning'>[src] can now be moved.</span>"))
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
else if (src.anchored)
|
||||
user.show_message(text("<span class='warning'>[src] is now secured.</span>"))
|
||||
add_overlay("[base_state]-s")
|
||||
AddOverlays("[base_state]-s")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/button/flasher
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
. += SPAN_WARNING("\The [src] has no cell installed!")
|
||||
|
||||
/obj/machinery/floodlight/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
icon_state = "flood[open ? "o" : ""][open && cell ? "b" : ""]0[on]"
|
||||
|
||||
/obj/machinery/floodlight/process()
|
||||
|
||||
@@ -123,7 +123,7 @@ var/list/floor_light_cache = list()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/floor_light/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
var/list/floor_light_cache = SSicon_cache.floor_light_cache
|
||||
if(use_power && !broken())
|
||||
if(damaged == null)
|
||||
@@ -133,7 +133,7 @@ var/list/floor_light_cache = list()
|
||||
I.color = default_light_colour
|
||||
I.layer = layer+0.001
|
||||
floor_light_cache[cache_key] = I
|
||||
add_overlay(floor_light_cache[cache_key])
|
||||
AddOverlays(floor_light_cache[cache_key])
|
||||
else
|
||||
if(damaged == 0) //Needs init.
|
||||
damaged = rand(1,4)
|
||||
@@ -143,7 +143,7 @@ var/list/floor_light_cache = list()
|
||||
I.color = default_light_colour
|
||||
I.layer = layer+0.001
|
||||
floor_light_cache[cache_key] = I
|
||||
add_overlay(floor_light_cache[cache_key])
|
||||
AddOverlays(floor_light_cache[cache_key])
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
else
|
||||
|
||||
@@ -92,9 +92,9 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/iv_drip/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(beaker)
|
||||
add_overlay("beaker")
|
||||
AddOverlays("beaker")
|
||||
var/datum/reagents/reagents = beaker.reagents
|
||||
if(reagents?.total_volume)
|
||||
var/image/filling = image('icons/obj/iv_drip.dmi', src, "reagent")
|
||||
@@ -111,17 +111,17 @@
|
||||
filling.icon_state = "reagent[fill_level]"
|
||||
var/reagent_color = reagents.get_color()
|
||||
filling.icon += reagent_color
|
||||
add_overlay(filling)
|
||||
AddOverlays(filling)
|
||||
if(attached)
|
||||
add_overlay("iv_in")
|
||||
AddOverlays("iv_in")
|
||||
if(mode)
|
||||
add_overlay("light_green")
|
||||
AddOverlays("light_green")
|
||||
else
|
||||
add_overlay("light_red")
|
||||
AddOverlays("light_red")
|
||||
if(blood_message_sent)
|
||||
add_overlay("light_yellow")
|
||||
AddOverlays("light_yellow")
|
||||
else
|
||||
add_overlay("iv_out")
|
||||
AddOverlays("iv_out")
|
||||
if(tank)
|
||||
if(istype(tank, /obj/item/tank/oxygen))
|
||||
tank_type = "oxy"
|
||||
@@ -131,7 +131,7 @@
|
||||
tank_type = "phoron"
|
||||
else
|
||||
tank_type = "other"
|
||||
add_overlay("tank_[tank_type]")
|
||||
AddOverlays("tank_[tank_type]")
|
||||
|
||||
var/tank_level = 2
|
||||
switch(tank.percent())
|
||||
@@ -142,16 +142,16 @@
|
||||
if(60 to 79) tank_level = 4
|
||||
if(80 to 90) tank_level = 5
|
||||
if(91 to INFINITY) tank_level = 6
|
||||
add_overlay("[tank.gauge_icon][tank_level]")
|
||||
AddOverlays("[tank.gauge_icon][tank_level]")
|
||||
if(breath_mask)
|
||||
if(breather)
|
||||
add_overlay("mask_on")
|
||||
AddOverlays("mask_on")
|
||||
else
|
||||
add_overlay("mask_off")
|
||||
AddOverlays("mask_off")
|
||||
if(epp_active)
|
||||
add_overlay("light_blue")
|
||||
AddOverlays("light_blue")
|
||||
if(panel_open)
|
||||
add_overlay("panel_open")
|
||||
AddOverlays("panel_open")
|
||||
|
||||
/obj/machinery/iv_drip/process()
|
||||
breather_process()
|
||||
@@ -500,7 +500,7 @@
|
||||
toggle_epp()
|
||||
|
||||
/obj/machinery/iv_drip/proc/do_crash()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
visible_message(SPAN_WARNING("\The [src] falls over with a buzz, spilling out it's contents!"))
|
||||
flick("iv_crash[is_loose ? "" : "_tank_[tank_type]"]", src)
|
||||
playsound(src, 'sound/effects/table_slam.ogg', 50, extrarange = MEDIUM_RANGE_SOUND_EXTRARANGE)
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/media/jukebox/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(stat & (NOPOWER|BROKEN) || !anchored)
|
||||
if(stat & BROKEN)
|
||||
icon_state = "[state_base]-broken"
|
||||
@@ -60,9 +60,9 @@
|
||||
icon_state = state_base
|
||||
if(playing)
|
||||
if(emagged)
|
||||
add_overlay("[state_base]-emagged")
|
||||
AddOverlays("[state_base]-emagged")
|
||||
else
|
||||
add_overlay("[state_base]-running")
|
||||
AddOverlays("[state_base]-running")
|
||||
|
||||
/obj/machinery/media/jukebox/Topic(href, href_list)
|
||||
if(..() || !(Adjacent(usr) || istype(usr, /mob/living/silicon)))
|
||||
@@ -219,10 +219,10 @@
|
||||
)
|
||||
|
||||
/obj/machinery/media/jukebox/phonograph/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
icon_state = state_base
|
||||
if(playing)
|
||||
add_overlay("[state_base]-running")
|
||||
AddOverlays("[state_base]-running")
|
||||
|
||||
/obj/machinery/media/jukebox/audioconsole
|
||||
name = "audioconsole"
|
||||
@@ -245,10 +245,10 @@
|
||||
)
|
||||
|
||||
/obj/machinery/media/jukebox/audioconsole/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
icon_state = state_base
|
||||
if(playing)
|
||||
add_overlay("[state_base]-running")
|
||||
AddOverlays("[state_base]-running")
|
||||
|
||||
/obj/machinery/media/jukebox/audioconsole/wall
|
||||
icon = 'icons/obj/audioconsole_wall.dmi'
|
||||
@@ -271,7 +271,7 @@
|
||||
)
|
||||
|
||||
/obj/machinery/media/jukebox/gramophone/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
icon_state = state_base
|
||||
if(playing)
|
||||
add_overlay("[state_base]-running")
|
||||
AddOverlays("[state_base]-running")
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/light_switch/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(!(stat & NOPOWER))
|
||||
holographic_overlay(src, icon, "light[on]-overlay")
|
||||
if (!light_range || light_color != on ? "#82ff4c" : "#f86060")
|
||||
|
||||
@@ -52,12 +52,12 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/mecha_part_fabricator/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
icon_state = "fab-base"
|
||||
if(busy)
|
||||
add_overlay("fab-active")
|
||||
AddOverlays("fab-active")
|
||||
if(panel_open)
|
||||
add_overlay("fab-panel")
|
||||
AddOverlays("fab-panel")
|
||||
|
||||
/obj/machinery/mecha_part_fabricator/dismantle()
|
||||
for(var/f in materials)
|
||||
@@ -174,7 +174,7 @@
|
||||
var/count = 0
|
||||
var/icon/load = icon(icon, "load")
|
||||
load.Blend(M.material.icon_colour,ICON_MULTIPLY)
|
||||
add_overlay(load)
|
||||
AddOverlays(load)
|
||||
CUT_OVERLAY_IN(load, 6)
|
||||
|
||||
while(materials[M.material.name] + M.perunit <= res_max_amount && M.amount >= 1)
|
||||
|
||||
@@ -156,30 +156,30 @@ var/list/obj/machinery/newscaster/allCasters = list()
|
||||
icon_state = initial(icon_state)
|
||||
set_light(FALSE)
|
||||
if(isbroken) //If the thing is smashed, add crack overlay on top of the unpowered sprite.
|
||||
cut_overlays()
|
||||
add_overlay(screen_overlays["crack3"])
|
||||
ClearOverlays()
|
||||
AddOverlays(screen_overlays["crack3"])
|
||||
return
|
||||
|
||||
cut_overlays() //reset overlays
|
||||
ClearOverlays() //reset overlays
|
||||
|
||||
add_overlay(screen_overlays["newscaster-screen"])
|
||||
AddOverlays(screen_overlays["newscaster-screen"])
|
||||
set_light(1.4, 1.3, COLOR_CYAN)
|
||||
|
||||
if(!alert || !SSnews.wanted_issue) // since we're transparent I don't want overlay nonsense
|
||||
add_overlay(screen_overlays["newscaster-title"])
|
||||
AddOverlays(screen_overlays["newscaster-title"])
|
||||
|
||||
if(SSnews.wanted_issue) //wanted icon state, there can be no overlays on it as it's a priority message
|
||||
add_overlay(screen_overlays["newscaster-wanted"])
|
||||
AddOverlays(screen_overlays["newscaster-wanted"])
|
||||
return
|
||||
|
||||
if(alert) //new message alert overlay
|
||||
add_overlay(screen_overlays["newscaster-alert"])
|
||||
AddOverlays(screen_overlays["newscaster-alert"])
|
||||
|
||||
if(hitstaken == 0)
|
||||
add_overlay(screen_overlays["newscaster-scanline"])
|
||||
AddOverlays(screen_overlays["newscaster-scanline"])
|
||||
|
||||
if(hitstaken > 0) //Cosmetic damage overlay
|
||||
add_overlay(screen_overlays["crack[hitstaken]"])
|
||||
AddOverlays(screen_overlays["crack[hitstaken]"])
|
||||
|
||||
icon_state = initial(icon_state)
|
||||
return
|
||||
|
||||
@@ -49,12 +49,12 @@ var/bomb_set
|
||||
if (src.auth)
|
||||
if (panel_open == 0)
|
||||
panel_open = 1
|
||||
add_overlay("panel_open")
|
||||
AddOverlays("panel_open")
|
||||
to_chat(user, "You unscrew the control panel of [src].")
|
||||
attacking_item.play_tool_sound(src, 50)
|
||||
else
|
||||
panel_open = 0
|
||||
cut_overlay("panel_open")
|
||||
CutOverlays("panel_open")
|
||||
to_chat(user, "You screw the control panel of [src] back on.")
|
||||
attacking_item.play_tool_sound(src, 50)
|
||||
else
|
||||
@@ -62,7 +62,7 @@ var/bomb_set
|
||||
to_chat(user, "\The [src] emits a buzzing noise, the panel staying locked in.")
|
||||
if (panel_open == 1)
|
||||
panel_open = 0
|
||||
cut_overlay("panel_open")
|
||||
CutOverlays("panel_open")
|
||||
to_chat(user, "You screw the control panel of \the [src] back on.")
|
||||
attacking_item.play_tool_sound(src, 50)
|
||||
flick("lock", src)
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
|
||||
|
||||
/obj/machinery/porta_turret/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
underlays.Cut()
|
||||
|
||||
if(stat & BROKEN)
|
||||
@@ -916,7 +916,7 @@
|
||||
installation = attacking_item //installation becomes I.type
|
||||
build_step = 4
|
||||
icon_state = "turret_frame_4_[case_sprite_set]"
|
||||
add_overlay("turret_[E.turret_sprite_set]_off")
|
||||
AddOverlays("turret_[E.turret_sprite_set]_off")
|
||||
return TRUE
|
||||
|
||||
else if(attacking_item.iswrench())
|
||||
@@ -944,8 +944,8 @@
|
||||
build_step = 6
|
||||
to_chat(user, "<span class='notice'>You close the access hatch.</span>")
|
||||
icon_state = "turret_frame_5a_[case_sprite_set]"
|
||||
add_overlay("turret_[E.turret_sprite_set]_off")
|
||||
add_overlay("turret_frame_5b_[case_sprite_set]")
|
||||
AddOverlays("turret_[E.turret_sprite_set]_off")
|
||||
AddOverlays("turret_frame_5b_[case_sprite_set]")
|
||||
return TRUE
|
||||
|
||||
//attack_hand() removes the prox sensor
|
||||
@@ -955,10 +955,10 @@
|
||||
var/obj/item/stack/M = attacking_item
|
||||
if(M.use(2))
|
||||
to_chat(user, "<span class='notice'>You add some metal armor to the exterior frame.</span>")
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
icon_state = "turret_frame_5a_[case_sprite_set]"
|
||||
add_overlay("turret_[E.turret_sprite_set]_off")
|
||||
add_overlay("turret_frame_5c_[case_sprite_set]")
|
||||
AddOverlays("turret_[E.turret_sprite_set]_off")
|
||||
AddOverlays("turret_frame_5c_[case_sprite_set]")
|
||||
build_step = 7
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need two sheets of metal to continue construction.</span>")
|
||||
@@ -968,9 +968,9 @@
|
||||
attacking_item.play_tool_sound(get_turf(src), 100)
|
||||
build_step = 5
|
||||
to_chat(user, "<span class='notice'>You open the access hatch.</span>")
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
icon_state = "turret_frame_4_[case_sprite_set]"
|
||||
add_overlay("turret_[E.turret_sprite_set]_off")
|
||||
AddOverlays("turret_[E.turret_sprite_set]_off")
|
||||
return TRUE
|
||||
|
||||
if(7)
|
||||
@@ -1025,10 +1025,10 @@
|
||||
to_chat(user, "<span class='notice'>You pry off the turret's exterior armor.</span>")
|
||||
new /obj/item/stack/material/steel(loc, 2)
|
||||
build_step = 6
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
icon_state = "turret_frame_5a_[case_sprite_set]"
|
||||
add_overlay("turret_[E.turret_sprite_set]_off")
|
||||
add_overlay("turret_frame_5c_[case_sprite_set]")
|
||||
AddOverlays("turret_[E.turret_sprite_set]_off")
|
||||
AddOverlays("turret_frame_5c_[case_sprite_set]")
|
||||
return TRUE
|
||||
|
||||
if(attacking_item.ispen()) //you can rename turrets like bots!
|
||||
@@ -1047,7 +1047,7 @@
|
||||
build_step = 3
|
||||
E.forceMove(src.loc)
|
||||
installation = null
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
icon_state = "turret_frame_3_[case_sprite_set]"
|
||||
to_chat(user, "<span class='notice'>You remove [E.name] from the turret frame.</span>")
|
||||
|
||||
|
||||
@@ -183,20 +183,20 @@
|
||||
desc += "<br>It is capable of repairing stationbounds' burn damage."
|
||||
|
||||
/obj/machinery/recharge_station/proc/build_overlays()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
switch(round(chargepercentage()))
|
||||
if(1 to 20)
|
||||
add_overlay("statn_c0")
|
||||
AddOverlays("statn_c0")
|
||||
if(21 to 40)
|
||||
add_overlay("statn_c20")
|
||||
AddOverlays("statn_c20")
|
||||
if(41 to 60)
|
||||
add_overlay("statn_c40")
|
||||
AddOverlays("statn_c40")
|
||||
if(61 to 80)
|
||||
add_overlay("statn_c60")
|
||||
AddOverlays("statn_c60")
|
||||
if(81 to 98)
|
||||
add_overlay("statn_c80")
|
||||
AddOverlays("statn_c80")
|
||||
if(99 to 110)
|
||||
add_overlay("statn_c100")
|
||||
AddOverlays("statn_c100")
|
||||
|
||||
/obj/machinery/recharge_station/update_icon()
|
||||
..()
|
||||
|
||||
@@ -148,26 +148,26 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/requests_console/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = initial(icon_state)
|
||||
set_light(FALSE)
|
||||
else
|
||||
switch(newmessagepriority)
|
||||
if(0)
|
||||
add_overlay(screen_overlays["req_comp-idle"])
|
||||
AddOverlays(screen_overlays["req_comp-idle"])
|
||||
set_light(1.4, 1.3, COLOR_CYAN)
|
||||
if(1)
|
||||
add_overlay(screen_overlays["req_comp-alert"])
|
||||
AddOverlays(screen_overlays["req_comp-alert"])
|
||||
set_light(1.4, 1.3, COLOR_CYAN)
|
||||
if(2)
|
||||
add_overlay(screen_overlays["req_comp-redalert"])
|
||||
AddOverlays(screen_overlays["req_comp-redalert"])
|
||||
set_light(1.4, 1.3, COLOR_ORANGE)
|
||||
if(3)
|
||||
add_overlay(screen_overlays["req_comp-yellowalert"])
|
||||
AddOverlays(screen_overlays["req_comp-yellowalert"])
|
||||
set_light(1.4, 1.3, COLOR_ORANGE)
|
||||
|
||||
add_overlay(screen_overlays["req_comp-scanline"])
|
||||
AddOverlays(screen_overlays["req_comp-scanline"])
|
||||
|
||||
/obj/machinery/requests_console/Initialize(mapload, var/dir, var/building = 0)
|
||||
. = ..()
|
||||
|
||||
@@ -88,21 +88,21 @@ pixel_x = 8;
|
||||
screen_overlays["bell-standby"] = make_screen_overlay(icon, "bell-standby")
|
||||
|
||||
/obj/machinery/ringer/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(!on || stat & NOPOWER)
|
||||
icon_state = initial(icon_state)
|
||||
set_light(FALSE)
|
||||
return
|
||||
if(rings_pdas || rings_pdas.len)
|
||||
add_overlay(screen_overlays["bell-active"])
|
||||
AddOverlays(screen_overlays["bell-active"])
|
||||
set_light(1.4, 1, COLOR_CYAN)
|
||||
if(pinged)
|
||||
add_overlay(screen_overlays["bell-alert"])
|
||||
AddOverlays(screen_overlays["bell-alert"])
|
||||
set_light(1.4, 1, COLOR_CYAN)
|
||||
if(on)
|
||||
add_overlay(screen_overlays["bell-scanline"])
|
||||
AddOverlays(screen_overlays["bell-scanline"])
|
||||
else
|
||||
add_overlay(screen_overlays["bell-standby"])
|
||||
AddOverlays(screen_overlays["bell-standby"])
|
||||
set_light(1.4, 1, COLOR_CYAN)
|
||||
|
||||
/obj/machinery/ringer/attackby(obj/item/attacking_item, mob/user)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/space_heater/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(!on)
|
||||
icon_state = "sheater-off"
|
||||
set_light(0)
|
||||
@@ -34,7 +34,7 @@
|
||||
icon_state = "sheater-standby"
|
||||
set_light(0)
|
||||
if(panel_open)
|
||||
add_overlay("sheater-open")
|
||||
AddOverlays("sheater-open")
|
||||
|
||||
/obj/machinery/space_heater/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
|
||||
. = ..()
|
||||
|
||||
@@ -24,18 +24,18 @@
|
||||
..()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "stargazer_off"
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
set_light(0)
|
||||
else if(!(stat & NOPOWER))
|
||||
icon_state = "stargazer_on"
|
||||
add_overlay(star_system_image)
|
||||
AddOverlays(star_system_image)
|
||||
var/stargazer_light_color = LIGHT_COLOR_HALOGEN
|
||||
if(SSatlas.current_sector.starlight_color)
|
||||
stargazer_light_color = SSatlas.current_sector.starlight_color
|
||||
set_light(6, 2, stargazer_light_color)
|
||||
else
|
||||
icon_state = "stargazer_off"
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
set_light(0)
|
||||
|
||||
/obj/machinery/stargazer/Topic(href, href_list, datum/ui_state/state)
|
||||
|
||||
@@ -71,15 +71,15 @@
|
||||
return stasis_enabled && !(stat & (NOPOWER|BROKEN))
|
||||
|
||||
/obj/machinery/stasis_bed/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "[initial(icon_state)]_broken"
|
||||
return ..()
|
||||
icon_state = initial(icon_state)
|
||||
if(panel_open || (stat & MAINT))
|
||||
add_overlay("stasis_maintenance")
|
||||
AddOverlays("stasis_maintenance")
|
||||
if(stasis_running())
|
||||
add_overlay("stasis_on")
|
||||
AddOverlays("stasis_on")
|
||||
|
||||
/obj/machinery/stasis_bed/power_change()
|
||||
. = ..()
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
/obj/machinery/status_display/proc/set_picture(state)
|
||||
remove_display()
|
||||
picture_state = state
|
||||
add_overlay(picture_state)
|
||||
AddOverlays(picture_state)
|
||||
|
||||
/obj/machinery/status_display/proc/update_display(line1, line2)
|
||||
var/new_text = {"<div style="font-size:[FONT_SIZE];color:[FONT_COLOR];font:'[FONT_STYLE]';text-align:center;" valign="top">[line1]<br>[line2]</div>"}
|
||||
@@ -210,7 +210,7 @@
|
||||
return "Launch"
|
||||
|
||||
/obj/machinery/status_display/proc/remove_display()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(maptext)
|
||||
maptext = ""
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ var/list/ai_status_emotions = list(
|
||||
/obj/machinery/ai_status_display/proc/update()
|
||||
switch (mode)
|
||||
if (0) // Blank
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if (1) // AI emoticon
|
||||
var/datum/ai_emotion/ai_emotion = ai_status_emotions[emotion]
|
||||
@@ -100,12 +100,12 @@ var/list/ai_status_emotions = list(
|
||||
|
||||
/obj/machinery/ai_status_display/proc/set_picture(var/state)
|
||||
picture_state = state
|
||||
cut_overlays()
|
||||
add_overlay(picture_state)
|
||||
ClearOverlays()
|
||||
AddOverlays(picture_state)
|
||||
|
||||
/obj/machinery/ai_status_display/power_change()
|
||||
..()
|
||||
if(stat & NOPOWER)
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
else
|
||||
update()
|
||||
|
||||
@@ -97,40 +97,40 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/suit_cycler/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(helmet)
|
||||
//copied straight from the human update_icons thing
|
||||
var/image/helmet_image = helmet.return_own_image()
|
||||
if(helmet_image)
|
||||
add_overlay(helmet_image)
|
||||
AddOverlays(helmet_image)
|
||||
if(suit)
|
||||
var/image/suit_image = suit.return_own_image()
|
||||
if(suit_image)
|
||||
add_overlay(suit_image)
|
||||
AddOverlays(suit_image)
|
||||
if(occupant)
|
||||
var/image/occupant_image = image(occupant.icon, occupant.icon_state)
|
||||
occupant_image.overlays = occupant.overlays
|
||||
add_overlay(occupant_image)
|
||||
AddOverlays(occupant_image)
|
||||
var/image/overbase = image(icon, "overbase", layer = ABOVE_HUMAN_LAYER)
|
||||
add_overlay(overbase)
|
||||
AddOverlays(overbase)
|
||||
if(locked || active)
|
||||
var/image/closed = image(icon, "closed", layer = ABOVE_HUMAN_LAYER)
|
||||
add_overlay(closed)
|
||||
AddOverlays(closed)
|
||||
else
|
||||
var/image/open = image(icon, "open", layer = ABOVE_HUMAN_LAYER)
|
||||
add_overlay(open)
|
||||
AddOverlays(open)
|
||||
if(panel_open)
|
||||
var/image/panel = image(icon, "panel", layer = ABOVE_HUMAN_LAYER)
|
||||
add_overlay(panel)
|
||||
AddOverlays(panel)
|
||||
|
||||
if(irradiating)
|
||||
var/image/irradiating_lights = make_screen_overlay(icon, "light_radiation")
|
||||
add_overlay(irradiating_lights)
|
||||
AddOverlays(irradiating_lights)
|
||||
set_light(3, 0.8, COLOR_RED_LIGHT)
|
||||
else if(active)
|
||||
var/image/active_lights = make_screen_overlay(icon, "light_active")
|
||||
add_overlay(active_lights)
|
||||
AddOverlays(active_lights)
|
||||
set_light(3, 0.8, COLOR_YELLOW)
|
||||
else
|
||||
set_light(0)
|
||||
|
||||
@@ -46,38 +46,38 @@
|
||||
MASK = new MASK_TYPE(src)
|
||||
|
||||
/obj/machinery/suit_storage_unit/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
if(panelopen)
|
||||
add_overlay("[initial(icon_state)]_panel")
|
||||
AddOverlays("[initial(icon_state)]_panel")
|
||||
if(isopen)
|
||||
add_overlay("[initial(icon_state)]_open")
|
||||
AddOverlays("[initial(icon_state)]_open")
|
||||
if(SUIT)
|
||||
add_overlay("[initial(icon_state)]_suit")
|
||||
AddOverlays("[initial(icon_state)]_suit")
|
||||
if(HELMET)
|
||||
add_overlay("[initial(icon_state)]_helm")
|
||||
AddOverlays("[initial(icon_state)]_helm")
|
||||
if(MASK)
|
||||
add_overlay("[initial(icon_state)]_storage")
|
||||
AddOverlays("[initial(icon_state)]_storage")
|
||||
if(!isbroken && ispowered)
|
||||
if(isopen)
|
||||
add_overlay("[initial(icon_state)]_lights_open")
|
||||
AddOverlays("[initial(icon_state)]_lights_open")
|
||||
else
|
||||
if(isUV)
|
||||
if(issuperUV)
|
||||
add_overlay("[initial(icon_state)]_super")
|
||||
add_overlay("[initial(icon_state)]_lights_red")
|
||||
AddOverlays("[initial(icon_state)]_super")
|
||||
AddOverlays("[initial(icon_state)]_lights_red")
|
||||
else
|
||||
add_overlay("[initial(icon_state)]_lights_closed")
|
||||
AddOverlays("[initial(icon_state)]_lights_closed")
|
||||
//top lights
|
||||
if(isUV)
|
||||
if(issuperUV)
|
||||
add_overlay("[initial(icon_state)]_uvstrong")
|
||||
AddOverlays("[initial(icon_state)]_uvstrong")
|
||||
else
|
||||
add_overlay("[initial(icon_state)]_uv")
|
||||
AddOverlays("[initial(icon_state)]_uv")
|
||||
else if(islocked)
|
||||
add_overlay("[initial(icon_state)]_locked")
|
||||
AddOverlays("[initial(icon_state)]_locked")
|
||||
else
|
||||
add_overlay("[initial(icon_state)]_ready")
|
||||
AddOverlays("[initial(icon_state)]_ready")
|
||||
|
||||
/obj/machinery/suit_storage_unit/power_change()
|
||||
..()
|
||||
|
||||
@@ -55,18 +55,18 @@
|
||||
calibration = min(calibration + 5, 100)
|
||||
|
||||
/obj/machinery/teleport/pad/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if (engaged)
|
||||
var/image/I = image(icon, src, "[initial(icon_state)]_active_overlay")
|
||||
I.plane = EFFECTS_ABOVE_LIGHTING_PLANE
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
set_light(4, 0.4)
|
||||
else
|
||||
set_light(0)
|
||||
if (operable())
|
||||
var/image/I = image(icon, src, "[initial(icon_state)]_idle_overlay")
|
||||
I.plane = EFFECTS_ABOVE_LIGHTING_PLANE
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
/obj/machinery/teleport/pad/proc/within_range(var/target)
|
||||
if(ignore_distance)
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
screen_overlays["[icon_state]-screen"] = make_screen_overlay(icon, "[icon_state]-screen")
|
||||
if ("[icon_state]-deny" in states)
|
||||
screen_overlays["[icon_state]-deny"] = make_screen_overlay(icon, "[icon_state]-deny")
|
||||
add_overlay(screen_overlays["[icon_state]-[deny ? "deny" : "screen"]"])
|
||||
AddOverlays(screen_overlays["[icon_state]-[deny ? "deny" : "screen"]"])
|
||||
reset_light()
|
||||
|
||||
/**
|
||||
@@ -295,10 +295,10 @@
|
||||
else if(attacking_item.isscrewdriver())
|
||||
src.panel_open = !src.panel_open
|
||||
to_chat(user, "You [src.panel_open ? "open" : "close"] the maintenance panel.")
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
add_screen_overlay()
|
||||
if(src.panel_open)
|
||||
add_overlay("[initial(icon_state)]-panel")
|
||||
AddOverlays("[initial(icon_state)]-panel")
|
||||
return TRUE
|
||||
else if(attacking_item.ismultitool()||attacking_item.iswirecutter())
|
||||
if(src.panel_open)
|
||||
@@ -618,10 +618,10 @@
|
||||
if((!allowed(usr)) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH
|
||||
to_chat(usr, SPAN_WARNING("Access denied.")) //Unless emagged of course
|
||||
if(exclusive_screen)
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
addtimer(CALLBACK(src, PROC_REF(add_screen_overlay)), deny_time ? deny_time : 15)
|
||||
add_screen_overlay(deny = TRUE)
|
||||
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, cut_overlay), screen_overlays["[icon_state]-deny"]), deny_time ? deny_time : 15)
|
||||
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, CutOverlays), screen_overlays["[icon_state]-deny"]), deny_time ? deny_time : 15)
|
||||
set_light(initial(light_range), initial(light_power), COLOR_RED_LIGHT)
|
||||
addtimer(CALLBACK(src, PROC_REF(reset_light)), deny_time ? deny_time : 15)
|
||||
addtimer(CALLBACK(src, PROC_REF(add_screen_overlay)), deny_time ? deny_time : 15)
|
||||
@@ -676,10 +676,10 @@
|
||||
if((!allowed(usr)) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH
|
||||
to_chat(usr, "<span class='warning'>Access denied.</span>") //Unless emagged of course)
|
||||
if(exclusive_screen)
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
addtimer(CALLBACK(src, PROC_REF(add_screen_overlay)), deny_time ? deny_time : 15)
|
||||
add_screen_overlay(deny = TRUE)
|
||||
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, cut_overlay), screen_overlays["[icon_state]-deny"]), deny_time ? deny_time : 15)
|
||||
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, CutOverlays), screen_overlays["[icon_state]-deny"]), deny_time ? deny_time : 15)
|
||||
set_light(initial(light_range), initial(light_power), COLOR_RED_LIGHT)
|
||||
addtimer(CALLBACK(src, PROC_REF(reset_light)), deny_time ? deny_time : 15)
|
||||
return
|
||||
@@ -798,14 +798,14 @@
|
||||
stat |= NOPOWER
|
||||
if(stat & BROKEN)
|
||||
icon_state = "[initial(icon_state)]-broken"
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
set_light(0)
|
||||
else if(!(stat & NOPOWER))
|
||||
icon_state = initial(icon_state)
|
||||
add_screen_overlay()
|
||||
else
|
||||
icon_state = "[initial(icon_state)]-off"
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
set_light(0)
|
||||
|
||||
//Oh no we're malfunctioning! Dump out some product and break.
|
||||
|
||||
@@ -106,11 +106,11 @@
|
||||
if(!S.blood_DNA)
|
||||
S.blood_DNA = list()
|
||||
S.blood_overlay.color = basecolor
|
||||
S.add_overlay(S.blood_overlay)
|
||||
S.AddOverlays(S.blood_overlay)
|
||||
if(S.blood_overlay && S.blood_overlay.color != basecolor)
|
||||
S.cut_overlay(S.blood_overlay, TRUE)
|
||||
S.CutOverlays(S.blood_overlay, ATOM_ICON_CACHE_PROTECTED)
|
||||
S.blood_overlay.color = basecolor
|
||||
S.add_overlay(S.blood_overlay, TRUE)
|
||||
S.AddOverlays(S.blood_overlay, ATOM_ICON_CACHE_PROTECTED)
|
||||
if(blood_DNA)
|
||||
S.blood_DNA |= blood_DNA.Copy()
|
||||
|
||||
@@ -217,8 +217,8 @@
|
||||
blood.Blend(basecolor,ICON_MULTIPLY)
|
||||
|
||||
icon = blood
|
||||
cut_overlays()
|
||||
add_overlay(giblets)
|
||||
ClearOverlays()
|
||||
AddOverlays(giblets)
|
||||
|
||||
/obj/effect/decal/cleanable/blood/gibs/up
|
||||
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gibup1","gibup1","gibup1")
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/effect/decal/cleanable/blood/tracks/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
color = "#FFFFFF"
|
||||
var/truedir = 0
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
track.fresh = 0
|
||||
track.overlay = I
|
||||
stack[stack_idx] = track
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
/obj/effect/decal/cleanable/blood/tracks/footprints
|
||||
name = "wet footprints"
|
||||
|
||||
@@ -28,6 +28,6 @@
|
||||
shadeOverlay.Blend(shade,ICON_ADD)
|
||||
SSicon_cache.crayon_cache["[type]_s"] = shadeOverlay
|
||||
|
||||
add_overlay(list(mainOverlay, shadeOverlay))
|
||||
AddOverlays(list(mainOverlay, shadeOverlay))
|
||||
|
||||
add_hiddenprint(usr)
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
var/turf/T = get_turf(src)
|
||||
var/image/I = image(icon, icon_state = icon_state, dir = dir)
|
||||
I.color = color
|
||||
T.add_overlay(I, TRUE) // Register it as priority so we don't lose it on icon update.
|
||||
T.AddOverlays(I, ATOM_ICON_CACHE_PROTECTED) // Register it as protected so we don't lose it on icon update.
|
||||
qdel(src)
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
if(prob(75))
|
||||
var/image/web_overlay = image(icon, icon_state = "[initial(icon_state)]-overlay[pick(1, 2, 3)]", layer = ABOVE_HUMAN_LAYER)
|
||||
add_overlay(web_overlay)
|
||||
AddOverlays(web_overlay)
|
||||
|
||||
/obj/effect/spider/stickyweb/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || height == 0)
|
||||
|
||||
@@ -270,11 +270,11 @@
|
||||
/obj/item/update_icon()
|
||||
. = ..()
|
||||
if(build_from_parts || has_accents)
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(build_from_parts)
|
||||
add_overlay(overlay_image(icon,"[icon_state]_[worn_overlay]", flags=RESET_COLOR)) //add the overlay w/o coloration of the original sprite
|
||||
AddOverlays(overlay_image(icon,"[icon_state]_[worn_overlay]", flags=RESET_COLOR)) //add the overlay w/o coloration of the original sprite
|
||||
if(has_accents)
|
||||
add_overlay(overlay_image(icon, "[icon_state]_acc", accent_color, accent_flags))
|
||||
AddOverlays(overlay_image(icon, "[icon_state]_acc", accent_color, accent_flags))
|
||||
|
||||
/obj/item/device
|
||||
icon = 'icons/obj/device.dmi'
|
||||
@@ -784,7 +784,7 @@ var/list/global/slot_flags_enumeration = list(
|
||||
/obj/item/clean_blood()
|
||||
. = ..()
|
||||
if(blood_overlay)
|
||||
cut_overlay(blood_overlay, TRUE)
|
||||
CutOverlays(blood_overlay, TRUE)
|
||||
if(istype(src, /obj/item/clothing/gloves))
|
||||
var/obj/item/clothing/gloves/G = src
|
||||
G.transfer_blood = 0
|
||||
@@ -815,7 +815,7 @@ var/list/global/slot_flags_enumeration = list(
|
||||
//apply the blood-splatter overlay if it isn't already in there
|
||||
if(!blood_DNA.len)
|
||||
blood_overlay.color = blood_color
|
||||
add_overlay(blood_overlay, TRUE) // Priority overlay so we don't lose it somehow.
|
||||
AddOverlays(blood_overlay, TRUE) // Priority overlay so we don't lose it somehow.
|
||||
|
||||
//if this blood isn't already in the list, add it
|
||||
if(istype(M))
|
||||
|
||||
@@ -492,15 +492,15 @@
|
||||
return contains_body
|
||||
|
||||
/obj/structure/closet/airbubble/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(ripped)
|
||||
name = "ripped air bubble"
|
||||
icon_state = "[icon_state]_ripped"
|
||||
else
|
||||
icon_state = "[initial(icon_state)][opened ? "_open" : ""]"
|
||||
if(zipped)
|
||||
add_overlay("[icon_state]_restrained")
|
||||
add_overlay("pressure_[(use_internal_tank) ?("on") : ("off") ]")
|
||||
AddOverlays("[icon_state]_restrained")
|
||||
AddOverlays("pressure_[(use_internal_tank) ?("on") : ("off") ]")
|
||||
|
||||
// Process transfer of air from the tank. Handle if it is ripped open.
|
||||
/obj/structure/closet/airbubble/proc/process_tank_give_air()
|
||||
|
||||
@@ -92,10 +92,10 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/pen/crayon/augment/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
var/image/crayon_tip = image('icons/obj/crayons.dmi', "crayonaugment_tip")
|
||||
crayon_tip.color = colour
|
||||
add_overlay(crayon_tip)
|
||||
AddOverlays(crayon_tip)
|
||||
|
||||
/obj/item/pen/crayon/augment/throw_at(atom/target, range, speed, mob/user)
|
||||
user.drop_from_inventory(src)
|
||||
|
||||
@@ -104,10 +104,10 @@
|
||||
. = TRUE
|
||||
|
||||
/obj/item/aicard/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(carded_ai)
|
||||
if (!carded_ai.control_disabled)
|
||||
add_overlay("aicard-on")
|
||||
AddOverlays("aicard-on")
|
||||
if(carded_ai.stat)
|
||||
icon_state = "aicard-404"
|
||||
else
|
||||
|
||||
@@ -65,35 +65,35 @@
|
||||
var/c_state = "battery[battery_level][contained_sprite ? slot_str_to_contained_flag(slot) : ""]"
|
||||
var/image/battery_overlay = image(c_icon, c_state)
|
||||
battery_overlay.appearance_flags = RESET_ALPHA
|
||||
I.add_overlay(battery_overlay)
|
||||
I.AddOverlays(battery_overlay)
|
||||
if(breath_mask)
|
||||
var/c_state = "mask_[mask_on ? "worn" : "idle"][contained_sprite ? slot_str_to_contained_flag(slot) : ""]"
|
||||
var/image/mask_overlay = image(c_icon, c_state)
|
||||
mask_overlay.appearance_flags = RESET_ALPHA
|
||||
I.add_overlay(mask_overlay)
|
||||
I.AddOverlays(mask_overlay)
|
||||
if(tank)
|
||||
if(tank_level)
|
||||
var/c_state = "tank_indicator[tank_level][contained_sprite ? slot_str_to_contained_flag(slot) : ""]"
|
||||
var/image/tank_level_overlay = image(c_icon, c_state)
|
||||
tank_level_overlay.appearance_flags = RESET_ALPHA
|
||||
I.add_overlay(tank_level_overlay)
|
||||
I.AddOverlays(tank_level_overlay)
|
||||
var/c_state = "tank_[tank_type][contained_sprite ? slot_str_to_contained_flag(slot) : ""]"
|
||||
var/image/tank_overlay = image(c_icon, c_state)
|
||||
tank_overlay.appearance_flags = RESET_ALPHA
|
||||
I.add_overlay(tank_overlay)
|
||||
I.AddOverlays(tank_overlay)
|
||||
if(epp_active)
|
||||
var/c_state = "epp_active[cpr_mode ? "_cpr" : ""][contained_sprite ? slot_str_to_contained_flag(slot) : ""]"
|
||||
var/image/epp_overlay = image(c_icon, c_state)
|
||||
epp_overlay.appearance_flags = RESET_ALPHA
|
||||
I.add_overlay(epp_overlay)
|
||||
I.AddOverlays(epp_overlay)
|
||||
return I
|
||||
|
||||
/obj/item/auto_cpr/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
item_state = "[cpr_mode ? "med_harness_cpr" : "[initial(item_state)]"]"
|
||||
|
||||
if(breath_mask)
|
||||
add_overlay("mask_[mask_on ? "worn" : "idle"]")
|
||||
AddOverlays("mask_[mask_on ? "worn" : "idle"]")
|
||||
if(battery)
|
||||
switch(battery.percent())
|
||||
if(90 to INFINITY) battery_level = 6
|
||||
@@ -103,7 +103,7 @@
|
||||
if(20 to 39) battery_level = 2
|
||||
if(05 to 19) battery_level = 1
|
||||
if(-INFINITY to 4) battery_level = 0
|
||||
add_overlay("battery[battery_level]")
|
||||
AddOverlays("battery[battery_level]")
|
||||
if(tank)
|
||||
switch(tank.percent())
|
||||
if(90 to INFINITY) tank_level = 6
|
||||
@@ -113,7 +113,7 @@
|
||||
if(20 to 39) tank_level = 2
|
||||
if(05 to 19) tank_level = 1
|
||||
if(-INFINITY to 4) tank_level = 0
|
||||
add_overlay("tank_indicator[tank_level]")
|
||||
AddOverlays("tank_indicator[tank_level]")
|
||||
|
||||
if(istype(tank, /obj/item/tank/emergency_oxygen/engi))
|
||||
tank_type = "engi"
|
||||
@@ -121,11 +121,11 @@
|
||||
tank_type = "oxy"
|
||||
else
|
||||
tank_type = "other"
|
||||
add_overlay("tank_[tank_type]")
|
||||
AddOverlays("tank_[tank_type]")
|
||||
if(epp_active)
|
||||
add_overlay("epp_active")
|
||||
AddOverlays("epp_active")
|
||||
if(panel_open)
|
||||
add_overlay("panel_open[battery ? "_battery" : ""]")
|
||||
AddOverlays("panel_open[battery ? "_battery" : ""]")
|
||||
|
||||
/obj/item/auto_cpr/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = 0, force = 0)
|
||||
. = ..()
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
else if(on)
|
||||
var/image/I = overlay_image(icon, "glowstick-overlay", color)
|
||||
I.blend_mode = BLEND_ADD
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
icon_state = "[initial(icon_state)]-on"
|
||||
item_state = "[initial(icon_state)]-on"
|
||||
set_light(brightness_on, flashlight_power, light_color)
|
||||
|
||||
@@ -52,10 +52,10 @@
|
||||
set_light(brightness_on, flashlight_power, light_color)
|
||||
else
|
||||
set_light(0)
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
var/image/I = image(icon = icon, icon_state = "lavalamp-[on ? "on" : "off"]")
|
||||
I.color = light_color
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
/obj/item/device/flashlight/lamp/lava/red
|
||||
light_color = COLOR_RED
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
|
||||
/obj/item/device/lightreplacer/update_icon()
|
||||
if(emagged)
|
||||
add_overlay("emagged")
|
||||
AddOverlays("emagged")
|
||||
|
||||
|
||||
/obj/item/device/lightreplacer/proc/Use(var/mob/user)
|
||||
|
||||
@@ -167,15 +167,15 @@
|
||||
if (WT.use(2, user))
|
||||
user.visible_message(SPAN_NOTICE("[user] starts welding the metal shell of [src]."), SPAN_NOTICE("You start [hacked ? "repairing" : "welding open"] the metal covering of [src]."))
|
||||
playsound(loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
add_overlay("overlay_welding")
|
||||
AddOverlays("overlay_welding")
|
||||
if(WT.use_tool(src, user, 25, volume = 50))
|
||||
to_chat(user, SPAN_NOTICE("You are able to [hacked ? "repair" : "weld through"] the metal shell of [src]."))
|
||||
if (hacked) locked = 1
|
||||
else locked = 0
|
||||
hacked = !hacked
|
||||
cut_overlay("overlay_welding")
|
||||
CutOverlays("overlay_welding")
|
||||
else
|
||||
cut_overlay("overlay_welding")
|
||||
CutOverlays("overlay_welding")
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
@@ -402,7 +402,7 @@
|
||||
update_overlays()
|
||||
|
||||
/obj/item/device/magnetic_lock/proc/update_overlays()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
switch (status)
|
||||
if (STATUS_BROKEN)
|
||||
icon_state = "broken"
|
||||
@@ -410,16 +410,16 @@
|
||||
|
||||
if (STATUS_INACTIVE to STATUS_ACTIVE)
|
||||
if (hacked)
|
||||
add_overlay("overlay_hacked")
|
||||
AddOverlays("overlay_hacked")
|
||||
else if (locked)
|
||||
add_overlay("overlay_locked")
|
||||
AddOverlays("overlay_locked")
|
||||
else
|
||||
add_overlay("overlay_unlocked")
|
||||
AddOverlays("overlay_unlocked")
|
||||
switch (constructionstate)
|
||||
if (0)
|
||||
return
|
||||
if (1 to 4)
|
||||
add_overlay("overlay_deconstruct_[constructionstate]")
|
||||
AddOverlays("overlay_deconstruct_[constructionstate]")
|
||||
|
||||
/obj/item/device/magnetic_lock/proc/takedamage(var/damage)
|
||||
if(invincible)
|
||||
@@ -453,7 +453,7 @@
|
||||
switch (status)
|
||||
if (STATUS_INACTIVE to STATUS_ACTIVE)
|
||||
if(istype(src, /obj/item/device/magnetic_lock/keypad))
|
||||
add_overlay("overlay_keypad")
|
||||
AddOverlays("overlay_keypad")
|
||||
|
||||
/obj/item/device/magnetic_lock/keypad/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
|
||||
@@ -35,13 +35,13 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/device/memorywiper/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(anchored)
|
||||
icon_state = "[initial(icon_state)]_opened"
|
||||
if(attached)
|
||||
add_overlay("wireout")
|
||||
AddOverlays("wireout")
|
||||
if(wiping)
|
||||
add_overlay("screen")
|
||||
AddOverlays("screen")
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
if(tracking_apc)
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
apc_indicator = mutable_appearance(icon, "lost")
|
||||
add_overlay(apc_indicator)
|
||||
AddOverlays(apc_indicator)
|
||||
else
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
QDEL_NULL(apc_indicator)
|
||||
@@ -169,7 +169,7 @@
|
||||
apc_indicator.icon_state = "medium"
|
||||
if(16 to INFINITY)
|
||||
apc_indicator.icon_state = "far"
|
||||
set_overlays(apc_indicator)
|
||||
SetOverlays(apc_indicator)
|
||||
|
||||
/obj/item/device/multitool/proc/wire(datum/integrated_io/io, mob/user)
|
||||
if(!io.holder.assembly)
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
/obj/item/device/paicard/Initialize()
|
||||
. = ..()
|
||||
add_overlay("pai_off")
|
||||
AddOverlays("pai_off")
|
||||
SSpai.all_pai_devices += src
|
||||
update_light()
|
||||
|
||||
@@ -389,19 +389,19 @@
|
||||
|
||||
/obj/item/device/paicard/proc/setPersonality(mob/living/silicon/pai/personality)
|
||||
src.pai = personality
|
||||
add_overlay("pai-happy")
|
||||
AddOverlays("pai-happy")
|
||||
playsound(src, 'sound/effects/pai/pai_restore.ogg', 75)
|
||||
|
||||
/obj/item/device/paicard/proc/removePersonality()
|
||||
src.pai = null
|
||||
cut_overlays()
|
||||
add_overlay("pai-off")
|
||||
ClearOverlays()
|
||||
AddOverlays("pai-off")
|
||||
|
||||
/obj/item/device/paicard
|
||||
var/current_emotion = 1
|
||||
/obj/item/device/paicard/proc/setEmotion(var/emotion)
|
||||
if(pai)
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
var/new_state
|
||||
switch(emotion)
|
||||
if(1) new_state = "pai-happy"
|
||||
@@ -420,7 +420,7 @@
|
||||
if(14) new_state = "pai-exclamation"
|
||||
if(15) new_state = "pai-question"
|
||||
if (new_state)
|
||||
add_overlay(new_state)
|
||||
AddOverlays(new_state)
|
||||
current_emotion = emotion
|
||||
|
||||
/obj/item/device/paicard/proc/alertUpdate()
|
||||
|
||||
@@ -431,19 +431,19 @@ pixel_x = 8;
|
||||
..(dest)
|
||||
|
||||
/obj/item/device/radio/intercom/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(!on)
|
||||
icon_state = initial(icon_state)
|
||||
set_light(FALSE)
|
||||
return
|
||||
else
|
||||
add_overlay(screen_overlays["intercom_screen"])
|
||||
add_overlay(screen_overlays["intercom_scanline"])
|
||||
AddOverlays(screen_overlays["intercom_screen"])
|
||||
AddOverlays(screen_overlays["intercom_scanline"])
|
||||
set_light(1.4, 1.3, COLOR_CYAN)
|
||||
if(broadcasting)
|
||||
add_overlay(screen_overlays["intercom_b"])
|
||||
AddOverlays(screen_overlays["intercom_b"])
|
||||
if(listening)
|
||||
add_overlay(screen_overlays["intercom_l"])
|
||||
AddOverlays(screen_overlays["intercom_l"])
|
||||
|
||||
/obj/item/device/radio/intercom/broadcasting/Initialize()
|
||||
SHOULD_CALL_PARENT(FALSE)
|
||||
|
||||
@@ -472,10 +472,10 @@ BREATH ANALYZER
|
||||
origin_tech = list(TECH_MAGNET = 4, TECH_BIO = 2)
|
||||
|
||||
/obj/item/device/mass_spectrometer/adv/clear_blood_overlay()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
|
||||
/obj/item/device/mass_spectrometer/adv/add_blood_overlay(var/image/I)
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
/obj/item/device/reagent_scanner
|
||||
name = "reagent scanner"
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
if(!istype(I))
|
||||
qdel(src)
|
||||
return
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
var/mutable_appearance/MA = new(I)
|
||||
MA.plane = EFFECTS_ABOVE_LIGHTING_PLANE
|
||||
MA.appearance_flags = RESET_ALPHA
|
||||
@@ -202,6 +202,6 @@
|
||||
if(!istype(P))
|
||||
qdel(src)
|
||||
return
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(P.info)
|
||||
icon_state = "text[rand(1,3)]"
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/device/suit_cooling_unit/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(cover_open)
|
||||
if(cell)
|
||||
icon_state = "suitcooler1"
|
||||
@@ -202,7 +202,7 @@
|
||||
if(-INFINITY to 17)
|
||||
battery_level = 5
|
||||
|
||||
add_overlay("battery-[battery_level]")
|
||||
AddOverlays("battery-[battery_level]")
|
||||
item_state = "coolingpack[battery_level]"
|
||||
|
||||
if(ismob(loc))
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
toggle = 1
|
||||
|
||||
/obj/item/device/transfer_valve/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
underlays = null
|
||||
|
||||
if(!tank_one && !tank_two && !attached_device)
|
||||
@@ -126,13 +126,13 @@
|
||||
icon_state = "valve"
|
||||
|
||||
if(tank_one)
|
||||
add_overlay("[tank_one.icon_state]")
|
||||
AddOverlays("[tank_one.icon_state]")
|
||||
if(tank_two)
|
||||
var/icon/J = new(icon, icon_state = "[tank_two.icon_state]")
|
||||
J.Shift(WEST, 13)
|
||||
underlays += J
|
||||
if(attached_device)
|
||||
add_overlay("device")
|
||||
AddOverlays("device")
|
||||
|
||||
/obj/item/device/transfer_valve/proc/remove_tank(obj/item/tank/T, mob/user)
|
||||
if(tank_one == T)
|
||||
|
||||
@@ -114,6 +114,6 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/box/fancy/crayons/chalkbox/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
for(var/obj/item/pen/drafting/chalk in contents)
|
||||
add_overlay("[chalk.colorName]")
|
||||
AddOverlays("[chalk.colorName]")
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
|
||||
/obj/item/glass_jar/update_icon() // Also updates name and desc
|
||||
underlays.Cut()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
switch(contains)
|
||||
if(JAR_NOTHING)
|
||||
name = initial(name)
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/holomenu/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(anchored)
|
||||
set_light(2)
|
||||
if(rave_mode)
|
||||
@@ -46,11 +46,11 @@
|
||||
holo_lights.color = null
|
||||
holo_text.color = null
|
||||
holo_border.color = null
|
||||
add_overlay(holo_lights)
|
||||
AddOverlays(holo_lights)
|
||||
if(length(menu_text))
|
||||
add_overlay(holo_text)
|
||||
AddOverlays(holo_text)
|
||||
if(border_on)
|
||||
add_overlay(holo_border)
|
||||
AddOverlays(holo_border)
|
||||
else
|
||||
set_light(0)
|
||||
|
||||
|
||||
@@ -284,12 +284,12 @@
|
||||
|
||||
/obj/item/storage/overloader/update_icon()
|
||||
. = ..()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
var/obj/item/ipc_overloader/overloader = locate() in contents
|
||||
if(overloader)
|
||||
add_overlay(image(overloader.icon, null, overloader.icon_state, sealed ? layer - 0.01 : layer + 0.01))
|
||||
AddOverlays(image(overloader.icon, null, overloader.icon_state, sealed ? layer - 0.01 : layer + 0.01))
|
||||
if(!sealed)
|
||||
add_overlay(image(icon, null, "box-overlay", layer + 0.02))
|
||||
AddOverlays(image(icon, null, "box-overlay", layer + 0.02))
|
||||
if(!sealed)
|
||||
icon_state = "box-open"
|
||||
|
||||
|
||||
@@ -46,9 +46,9 @@ var/list/mob_icon_icon_states = list()
|
||||
I = overlay_image(mob_overlay_icon, color = color, flags = RESET_COLOR|RESET_ALPHA)
|
||||
var/image/additional_parts = build_additional_parts(H, mob_icon, slot)
|
||||
if(additional_parts)
|
||||
I.add_overlay(additional_parts)
|
||||
I.AddOverlays(additional_parts)
|
||||
if(has_accents)
|
||||
I.add_overlay(overlay_image(icon, "[UNDERSCORE_OR_NULL(src.icon_species_tag)][item_state][contained_sprite ? slot_str_to_contained_flag(slot) : ""]_acc", accent_color, accent_flags))
|
||||
I.AddOverlays(overlay_image(icon, "[UNDERSCORE_OR_NULL(src.icon_species_tag)][item_state][contained_sprite ? slot_str_to_contained_flag(slot) : ""]_acc", accent_color, accent_flags))
|
||||
var/offset_x = worn_x_dimension
|
||||
var/offset_y = worn_y_dimension
|
||||
center_image(I, offset_x, offset_y)
|
||||
|
||||
@@ -59,9 +59,9 @@
|
||||
yarn_overlay.color = ball.color
|
||||
else
|
||||
yarn_overlay.appearance_flags = RESET_COLOR
|
||||
add_overlay(yarn_overlay)
|
||||
AddOverlays(yarn_overlay)
|
||||
else
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
update_held_icon()
|
||||
|
||||
/obj/item/knittingneedles/attackby(obj/item/attacking_item, mob/user)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
return TRUE
|
||||
var/obj/item/weldingtool/WT = attacking_item
|
||||
if(WT.use(0, user))
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
LAZYCLEARLIST(bullet_holes)
|
||||
icon = initial(icon)
|
||||
hp = initial(hp)
|
||||
@@ -97,7 +97,7 @@
|
||||
virtual_icon.DrawBox(null, B.b2x, B.b2y1, B.b2x, B.b2y2) // vertical line, top to bottom
|
||||
|
||||
|
||||
add_overlay(bmark) // add the decal
|
||||
AddOverlays(bmark) // add the decal
|
||||
icon = virtual_icon // apply bullet_holes over decals
|
||||
return
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
. = ..()
|
||||
if(!glow_state)
|
||||
glow_state = make_screen_overlay(icon, icon_state)
|
||||
add_overlay(glow_state)
|
||||
AddOverlays(glow_state)
|
||||
|
||||
/obj/effect/temp_visual/constellation/attackby(obj/item/attacking_item, mob/user)
|
||||
visible_message("<span class='notice'>\The [src] vanishes!</span>")
|
||||
@@ -151,10 +151,10 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/skrell_projector/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(working)
|
||||
var/image/overlay = overlay_image(icon, "projector_light", light_color, RESET_COLOR)
|
||||
add_overlay(overlay)
|
||||
AddOverlays(overlay)
|
||||
|
||||
/obj/item/skrell_projector/process()
|
||||
if(!selected_world)
|
||||
|
||||
@@ -106,7 +106,7 @@ Contains:
|
||||
if(!automatic_charge_overlays) //Checks if the item has this feature enabled
|
||||
return //If it does not, do nothing
|
||||
var/ratio = CEILING(clamp(amount / max_amount, 0, 1) * charge_sections, 1)
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
var/iconState = "[icon_state]_charge"
|
||||
if(!amount) //Checks if there are still charges left in the item
|
||||
return //If it does not, do nothing, as the overlays have been cut before this already.
|
||||
@@ -114,7 +114,7 @@ Contains:
|
||||
var/mutable_appearance/charge_overlay = mutable_appearance(icon, iconState)
|
||||
for(var/i = ratio, i >= 1, i--)
|
||||
charge_overlay.pixel_x = charge_x_offset * (i - 1)
|
||||
add_overlay(charge_overlay)
|
||||
AddOverlays(charge_overlay)
|
||||
|
||||
// Bruise Pack.
|
||||
/obj/item/stack/medical/bruise_pack
|
||||
|
||||
@@ -256,9 +256,9 @@
|
||||
..()
|
||||
if(status == BALLOON_BURST)
|
||||
worn_overlay = null
|
||||
cut_overlay()
|
||||
CutOverlays()
|
||||
if(worn_overlay)
|
||||
add_overlay(overlay_image(icon, "[initial(icon_state)]_[worn_overlay]", flags=RESET_COLOR))
|
||||
AddOverlays(overlay_image(icon, "[initial(icon_state)]_[worn_overlay]", flags=RESET_COLOR))
|
||||
|
||||
#undef BALLOON_NORMAL
|
||||
#undef BALLOON_BLOW
|
||||
|
||||
@@ -115,10 +115,10 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/skrell_projector/vaurca_projector/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(working)
|
||||
var/image/overlay = overlay_image(icon, "zora_projector_light", light_color, RESET_COLOR)
|
||||
add_overlay(overlay)
|
||||
AddOverlays(overlay)
|
||||
|
||||
/obj/item/skrell_projector/vaurca_projector/process()
|
||||
if(!selected_world || !possible_messages)
|
||||
|
||||
@@ -112,10 +112,10 @@
|
||||
check_obfuscation()
|
||||
|
||||
/obj/item/card/id/syndicate/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
if(electronic_warfare)
|
||||
var/mutable_appearance/electro_overlay = mutable_appearance(icon, "electronic_warfare")
|
||||
add_overlay(electro_overlay)
|
||||
AddOverlays(electro_overlay)
|
||||
|
||||
/obj/item/card/id/syndicate/proc/check_obfuscation()
|
||||
if(electronic_warfare)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user