Merge pull request #4057 from deathride58/manualmirrors2

Manually mirrors #32838 and #32462 from upstream
This commit is contained in:
deathride58
2017-11-21 20:00:18 +00:00
committed by GitHub
6 changed files with 4 additions and 57 deletions
+1
View File
@@ -39,6 +39,7 @@
#define COMSIG_ATOM_SING_PULL "atom_sing_pull" //from base of atom/singularity_pull(): (S, current_size)
#define COMSIG_ATOM_SET_LIGHT "atom_set_light" //from base of atom/set_light(): (l_range, l_power, l_color)
#define COMSIG_ATOM_ROTATE "atom_rotate" //from base of atom/shuttleRotate(): (rotation, params)
#define COMSIG_ATOM_DIR_CHANGE "atom_dir_change" //from base of atom/setDir(): (old_dir, new_dir)
#define COMSIG_CLICK "atom_click" //from base of atom/Click(): (location, control, params)
#define COMSIG_CLICK_SHIFT "shift_click" //from base of atom/ShiftClick(): (/mob)
-51
View File
@@ -1,51 +0,0 @@
/datum/component/turf_decal
var/dir
var/icon
var/icon_state
var/layer
var/group
/datum/component/turf_decal/Initialize(_dir, _icon, _icon_state, _layer=TURF_DECAL_LAYER, _group=TURF_DECAL_PAINT)
if(!isturf(parent) || !_icon || !_icon_state)
WARNING("A turf decal was applied incorrectly to [parent]: icon:[_icon ? _icon : "none"] icon_state:[_icon_state ? _icon_state : "none"]")
return COMPONENT_INCOMPATIBLE
dir = _dir
icon = _icon
icon_state = _icon_state
layer = _layer
group = _group
apply_decal()
RegisterSignal(COMSIG_ATOM_ROTATE, .proc/rotate_react)
RegisterSignal(COMSIG_COMPONENT_CLEAN_ACT, .proc/clean_react)
/datum/component/turf_decal/Destroy()
remove_decal()
return ..()
/datum/component/turf_decal/OnTransfer(turf/newT)
remove_decal()
remove_decal(newT)
apply_decal(newT)
/datum/component/turf_decal/proc/get_decal()
return image(icon, null, icon_state, layer, dir)
/datum/component/turf_decal/proc/apply_decal(turf/overT)
var/turf/master = overT || parent
master.add_decal(get_decal(), group)
/datum/component/turf_decal/proc/remove_decal(turf/overT)
var/turf/master = overT || parent
master.remove_decal(group)
/datum/component/turf_decal/proc/rotate_react(rotation, params)
if(params & ROTATE_DIR)
dir = angle2dir(rotation+dir2angle(dir))
remove_decal()
apply_decal()
/datum/component/turf_decal/proc/clean_react(strength)
if(strength >= CLEAN_IMPRESSIVE)
qdel(src)
+1
View File
@@ -520,6 +520,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons)
//Hook for running code when a dir change occurs
/atom/proc/setDir(newdir)
SendSignal(COMSIG_ATOM_DIR_CHANGE, dir, newdir)
dir = newdir
/atom/proc/mech_melee_attack(obj/mecha/M)
+1 -1
View File
@@ -31,7 +31,7 @@
var/turf/T = loc
if(!istype(T)) //you know this will happen somehow
CRASH("Turf decal initialized in an object/nullspace")
T.AddComponent(/datum/component/turf_decal, dir, icon, icon_state)
T.AddComponent(/datum/component/decal, icon, icon_state, dir)
/obj/effect/turf_decal/stripes/line
icon_state = "warningline"
@@ -96,7 +96,6 @@
if(ismonkey(occupant)) // Monkey
occupant_overlay = image(CRYOMOBS, "monkey")
occupant_overlay.copy_overlays(occupant)
else if(isalienadult(occupant))
if(isalienroyal(occupant)) // Queen and prae
occupant_overlay = image(CRYOMOBS, "alienq")
@@ -109,9 +108,6 @@
else if(ishuman(occupant) || islarva(occupant) || (isanimal(occupant) && !ismegafauna(occupant))) // Mobs that are smaller than cryotube
occupant_overlay = image(occupant.icon, occupant.icon_state)
if(ishuman(occupant) || islarva(occupant) || (isanimal(occupant) && !ismegafauna(occupant))) // Mobs that are smaller than cryotube
occupant_overlay = image(occupant.icon, occupant.icon_state)
occupant_overlay.copy_overlays(occupant)
else
+1 -1
View File
@@ -330,6 +330,7 @@
#include "code\datums\antagonists\wizard.dm"
#include "code\datums\components\_component.dm"
#include "code\datums\components\archaeology.dm"
#include "code\datums\components\decal.dm"
#include "code\datums\components\infective.dm"
#include "code\datums\components\material_container.dm"
#include "code\datums\components\paintable.dm"
@@ -340,7 +341,6 @@
#include "code\datums\components\spooky.dm"
#include "code\datums\components\squeek.dm"
#include "code\datums\components\thermite.dm"
#include "code\datums\components\turf_decal.dm"
#include "code\datums\diseases\_disease.dm"
#include "code\datums\diseases\_MobProcs.dm"
#include "code\datums\diseases\anxiety.dm"