-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Saline drips have a valid icon again (#605)
Update Icon Blocker can now specify what to block specifically.
- Loading branch information
Showing
4 changed files
with
21 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
//Prevents calling anything in update_icon() like update_icon_state() or update_overlays() | ||
|
||
/datum/element/update_icon_blocker/Attach(datum/target) | ||
/datum/element/update_icon_blocker | ||
element_flags = ELEMENT_BESPOKE | ||
id_arg_index = 2 | ||
|
||
/// Set of COMSIG_ATOM_UPDATE_ICON to return. See [signals_atom_main.dm] | ||
var/blocking_flags | ||
|
||
/datum/element/update_icon_blocker/Attach(datum/target, blocking_flags = COMSIG_ATOM_NO_UPDATE_ICON_STATE | COMSIG_ATOM_NO_UPDATE_OVERLAYS) | ||
. = ..() | ||
if(!istype(target, /atom)) | ||
if(!isatom(target)) | ||
return ELEMENT_INCOMPATIBLE | ||
if(!blocking_flags) | ||
CRASH("Attempted to block icon updates with a null blocking_flags argument. Why?") | ||
src.blocking_flags = blocking_flags | ||
RegisterSignal(target, COMSIG_ATOM_UPDATE_ICON, PROC_REF(block_update_icon)) | ||
|
||
/datum/element/update_icon_blocker/proc/block_update_icon() | ||
SIGNAL_HANDLER | ||
|
||
return COMSIG_ATOM_NO_UPDATE_ICON_STATE | COMSIG_ATOM_NO_UPDATE_OVERLAYS | ||
return blocking_flags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.