update_appearance
This commit is contained in:
+49
-11
@@ -531,37 +531,75 @@
|
||||
if(!LAZYLEN(.)) // lol ..length
|
||||
return list("<span class='notice'><i>You examine [src] closer, but find nothing of interest...</i></span>")
|
||||
|
||||
/**
|
||||
* Updates the appearence of the icon
|
||||
*
|
||||
* Mostly delegates to update_name, update_desc, and update_icon
|
||||
*
|
||||
* Arguments:
|
||||
* - updates: A set of bitflags dictating what should be updated. Defaults to [ALL]
|
||||
*/
|
||||
/atom/proc/update_appearance(updates=ALL)
|
||||
//SHOULD_NOT_SLEEP(TRUE)
|
||||
//SHOULD_CALL_PARENT(TRUE)
|
||||
|
||||
. = NONE
|
||||
updates &= ~SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_APPEARANCE, updates)
|
||||
if(updates & UPDATE_NAME)
|
||||
. |= update_name(updates)
|
||||
if(updates & UPDATE_DESC)
|
||||
. |= update_desc(updates)
|
||||
if(updates & UPDATE_ICON)
|
||||
. |= update_icon(updates)
|
||||
|
||||
/// Updates the name of the atom
|
||||
/atom/proc/update_name(updates=ALL)
|
||||
//SHOULD_CALL_PARENT(TRUE)
|
||||
return SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_NAME, updates)
|
||||
|
||||
/// Updates the description of the atom
|
||||
/atom/proc/update_desc(updates=ALL)
|
||||
//SHOULD_CALL_PARENT(TRUE)
|
||||
return SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_DESC, updates)
|
||||
|
||||
/// Updates the icon of the atom
|
||||
/atom/proc/update_icon()
|
||||
// I expect we're going to need more return flags and options in this proc
|
||||
var/signalOut = SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON)
|
||||
. = FALSE
|
||||
/atom/proc/update_icon(updates=ALL)
|
||||
SIGNAL_HANDLER
|
||||
//SHOULD_CALL_PARENT(TRUE)
|
||||
|
||||
if(!(signalOut & COMSIG_ATOM_NO_UPDATE_ICON_STATE))
|
||||
. = NONE
|
||||
updates &= ~SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON, updates)
|
||||
if(updates & UPDATE_ICON_STATE)
|
||||
update_icon_state()
|
||||
. = TRUE
|
||||
. |= UPDATE_ICON_STATE
|
||||
|
||||
if(!(signalOut & COMSIG_ATOM_NO_UPDATE_OVERLAYS))
|
||||
var/list/new_overlays = update_overlays()
|
||||
if(updates & UPDATE_OVERLAYS)
|
||||
if(LAZYLEN(managed_vis_overlays))
|
||||
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
|
||||
|
||||
var/list/new_overlays = update_overlays(updates)
|
||||
if(managed_overlays)
|
||||
cut_overlay(managed_overlays)
|
||||
managed_overlays = null
|
||||
if(length(new_overlays))
|
||||
managed_overlays = new_overlays
|
||||
add_overlay(new_overlays)
|
||||
. = TRUE
|
||||
. |= UPDATE_OVERLAYS
|
||||
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_UPDATED_ICON, signalOut, .)
|
||||
. |= SEND_SIGNAL(src, COMSIG_ATOM_UPDATED_ICON, updates, .)
|
||||
|
||||
/// Updates the icon state of the atom
|
||||
/atom/proc/update_icon_state()
|
||||
//SHOULD_CALL_PARENT(TRUE)
|
||||
return SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON_STATE)
|
||||
|
||||
/// Updates the overlays of the atom
|
||||
/atom/proc/update_overlays()
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
//SHOULD_CALL_PARENT(TRUE)
|
||||
. = list()
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_OVERLAYS, .)
|
||||
|
||||
|
||||
/atom/proc/relaymove(mob/living/user)
|
||||
if(!istype(user))
|
||||
return //why are you buckling nonliving mobs to atoms?
|
||||
|
||||
Reference in New Issue
Block a user