[MIRROR] Reverts Adds Neon Carpet (#55782) (#3040)

* reverts Adds Neon Carpet (#55782), it appears to have been causing massive amounts of maptick (#56496)

It appears to have been causing massive amounts of maptick, this'll need a testmerge so we can test my hypothesis

* Reverts Adds Neon Carpet (#55782)

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-02-03 10:22:43 +01:00
committed by GitHub
co-authored by LemonInTheDark
parent acfe254041
commit 70024ef6ad
44 changed files with 211 additions and 1110 deletions
@@ -5,18 +5,18 @@
var/description
var/mutable_appearance/pic
/datum/element/decal/Attach(atom/target, _icon, _icon_state, _dir, _cleanable=FALSE, _color, _layer=TURF_LAYER, _plane=FLOOR_PLANE, _description, _alpha=255)
/datum/element/decal/Attach(atom/target, _icon, _icon_state, _dir, _cleanable=FALSE, _color, _layer=TURF_LAYER, _description, _alpha=255)
. = ..()
if(!isatom(target) || !generate_appearance(_icon, _icon_state, _dir, _layer, _plane, _color, _alpha, target))
if(!isatom(target) || !generate_appearance(_icon, _icon_state, _dir, _layer, _color, _alpha, target))
return ELEMENT_INCOMPATIBLE
description = _description
cleanable = _cleanable
RegisterSignal(target, COMSIG_ATOM_UPDATE_OVERLAYS, .proc/apply_overlay, TRUE)
RegisterSignal(target,COMSIG_ATOM_UPDATE_OVERLAYS,.proc/apply_overlay, TRUE)
if(target.flags_1 & INITIALIZED_1)
target.update_icon() //could use some queuing here now maybe.
else
RegisterSignal(target, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE, .proc/late_update_icon, TRUE)
RegisterSignal(target,COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE,.proc/late_update_icon, TRUE)
if(isitem(target))
INVOKE_ASYNC(target, /obj/item/.proc/update_slot_icon, TRUE)
if(_dir)
@@ -26,12 +26,11 @@
if(_description)
RegisterSignal(target, COMSIG_PARENT_EXAMINE, .proc/examine,TRUE)
/datum/element/decal/proc/generate_appearance(_icon, _icon_state, _dir, _layer, _plane, _color, _alpha, source)
/datum/element/decal/proc/generate_appearance(_icon, _icon_state, _dir, _layer, _color, _alpha, source)
if(!_icon || !_icon_state)
return FALSE
var/temp_image = image(_icon, null, _icon_state, _layer, _dir)
pic = new(temp_image)
pic.plane = _plane
pic.color = _color
pic.alpha = _alpha
return TRUE
@@ -63,7 +62,7 @@
if(old_dir == new_dir)
return
Detach(source)
source.AddElement(/datum/element/decal, pic.icon, pic.icon_state, new_dir, cleanable, pic.color, pic.layer, pic.plane, description, pic.alpha)
source.AddElement(/datum/element/decal, pic.icon, pic.icon_state, new_dir, cleanable, pic.color, pic.layer, description, pic.alpha)
/datum/element/decal/proc/clean_react(datum/source, clean_types)
SIGNAL_HANDLER
+4 -2
View File
@@ -1,16 +1,18 @@
/datum/element/decal/blood
/datum/element/decal/blood/Attach(datum/target, _icon, _icon_state, _dir, _cleanable=CLEAN_TYPE_BLOOD, _color, _layer=ABOVE_OBJ_LAYER, _plane=FLOAT_PLANE, _description, _alpha=255)
/datum/element/decal/blood/Attach(datum/target, _icon, _icon_state, _dir, _cleanable=CLEAN_TYPE_BLOOD, _color, _layer=ABOVE_OBJ_LAYER)
if(!isitem(target))
return ELEMENT_INCOMPATIBLE
. = ..()
RegisterSignal(target, COMSIG_ATOM_GET_EXAMINE_NAME, .proc/get_examine_name, TRUE)
/datum/element/decal/blood/Detach(atom/source, force)
UnregisterSignal(source, COMSIG_ATOM_GET_EXAMINE_NAME)
return ..()
/datum/element/decal/blood/generate_appearance(_icon, _icon_state, _dir, _layer, _plane, _color, _alpha, source)
/datum/element/decal/blood/generate_appearance(_icon, _icon_state, _dir, _layer, _color, _alpha, source)
var/obj/item/I = source
if(!_icon)
_icon = 'icons/effects/blood.dmi'
-40
View File
@@ -1,40 +0,0 @@
/**
* Decals that support smoothing with the parent atom
*
* Currently only supports bitmask smoothing
*/
/datum/element/decal/smoothing
/// The icon state used as the base of the smoothed icon state
var/base_icon_state
/// The smoothing junction used to generate the smoothed icon state
var/smoothing_junction
/datum/element/decal/smoothing/Attach(atom/target, _icon, _icon_state, _dir, _cleanable=FALSE, _color, _layer=TURF_LAYER, _plane=FLOOR_PLANE, _description, _alpha=255, _smoothing_junction=0)
base_icon_state = _icon_state
smoothing_junction = _smoothing_junction
_icon_state = "[_icon_state]-[_smoothing_junction]"
. = ..()
if(. & ELEMENT_INCOMPATIBLE)
return
RegisterSignal(target, COMSIG_ATOM_SMOOTH_BITMASK, .proc/smooth_react)
/datum/element/decal/smoothing/Detach(atom/source, force)
UnregisterSignal(source, COMSIG_ATOM_SMOOTH_BITMASK)
return ..()
/datum/element/decal/smoothing/rotate_react(datum/source, old_dir, new_dir)
// SIGNAL_HANDLER <-- Already defined on parent. We can't define it again and we can't call parent. So we're stuck.
if(old_dir == new_dir)
return
Detach(source)
source.AddElement(/datum/element/decal/smoothing, pic.icon, base_icon_state, new_dir, cleanable, pic.color, pic.layer, pic.plane, description, pic.alpha, smoothing_junction)
/// Reacts to the source atom smoothing
/datum/element/decal/smoothing/proc/smooth_react(datum/source, old_junction, new_junction)
SIGNAL_HANDLER
if(old_junction == new_junction)
return
Detach(source)
source.AddElement(/datum/element/decal/smoothing, pic.icon, base_icon_state, pic.dir, cleanable, pic.color, pic.layer, pic.plane, description, pic.alpha, new_junction)
-33
View File
@@ -1,33 +0,0 @@
/**
* Applies an emissive blocker vis overlay to the target atom and re-applies it whenever the atom updates its vis overlays
*
* Used to make emissive blockers compatible with structures that mess with their vis overlays
* If this isn't handled neon carpets start glowing through vending machines and computer consoles
*/
/datum/element/emissive_blocker
element_flags = ELEMENT_DETACH | ELEMENT_BESPOKE
id_arg_index = 2
/// The plane used
var/blocker_plane
/datum/element/emissive_blocker/Attach(atom/target, plane)
if(!isatom(target))
return ELEMENT_INCOMPATIBLE
if(!isnum(plane))
stack_trace("Invalid plane value passed to emissive blocker element")
return ELEMENT_INCOMPATIBLE
blocker_plane = plane
RegisterSignal(target, COMSIG_ATOM_UPDATE_OVERLAYS, .proc/update_blocker)
update_blocker(target, null)
return ..()
/datum/element/emissive_blocker/Detach(datum/source, force)
UnregisterSignal(source, COMSIG_ATOM_UPDATE_OVERLAYS)
return ..()
/// Re-applies the emissive blocker vis overlay
/datum/element/emissive_blocker/proc/update_blocker(atom/source, list/overlays)
SIGNAL_HANDLER
SSvis_overlays.add_vis_overlay(source, source.icon, source.icon_state, EMISSIVE_LAYER, blocker_plane, source.dir)
return NONE