Merge pull request #32865 from ninjanomnom/decal-examine

Lets you add examine text to component decals
This commit is contained in:
Jordie
2017-11-20 15:35:19 +11:00
committed by CitadelStationBot
parent ac4ca767d0
commit 2f8d8b8729
+9 -2
View File
@@ -2,9 +2,10 @@
dupe_mode = COMPONENT_DUPE_ALLOWED
var/cleanable
var/description
var/mutable_appearance/pic
/datum/component/decal/Initialize(_icon, _icon_state, _dir, _cleanable=CLEAN_GOD, _color, _layer=TURF_LAYER)
/datum/component/decal/Initialize(_icon, _icon_state, _dir, _cleanable=CLEAN_GOD, _color, _layer=TURF_LAYER, _description)
if(!isatom(parent) || !_icon || !_icon_state)
. = COMPONENT_INCOMPATIBLE
CRASH("A turf decal was applied incorrectly to [parent.type]: icon:[_icon ? _icon : "none"] icon_state:[_icon_state ? _icon_state : "none"]")
@@ -15,6 +16,7 @@
pic.color = _color
cleanable = _cleanable
description = _description
apply()
@@ -22,6 +24,8 @@
RegisterSignal(COMSIG_ATOM_DIR_CHANGE, .proc/rotate_react)
if(_cleanable)
RegisterSignal(COMSIG_COMPONENT_CLEAN_ACT, .proc/clean_react)
if(_description)
RegisterSignal(COMSIG_PARENT_EXAMINE, .proc/examine)
/datum/component/decal/Destroy()
remove()
@@ -50,4 +54,7 @@
/datum/component/decal/proc/clean_react(strength)
if(strength >= cleanable)
qdel(src)
qdel(src)
/datum/component/decal/proc/examine(mob/user)
to_chat(user, description)