mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 19:44:46 +01:00
Sound update
This commit is contained in:
@@ -45,6 +45,14 @@
|
||||
/// A weak reference to another datum
|
||||
var/datum/weakref/weak_reference
|
||||
|
||||
/*
|
||||
* Lazy associative list of currently active cooldowns.
|
||||
*
|
||||
* cooldowns [ COOLDOWN_INDEX ] = add_timer()
|
||||
* add_timer() returns the truthy value of -1 when not stoppable, and else a truthy numeric index
|
||||
*/
|
||||
var/list/cooldowns
|
||||
|
||||
#ifdef REFERENCE_TRACKING
|
||||
var/tmp/running_find_references
|
||||
var/tmp/last_find_references = 0
|
||||
@@ -102,3 +110,33 @@
|
||||
tag = null
|
||||
SStgui.close_uis(src)
|
||||
return QDEL_HINT_QUEUE
|
||||
|
||||
/**
|
||||
* Callback called by a timer to end an associative-list-indexed cooldown.
|
||||
*
|
||||
* Arguments:
|
||||
* * source - datum storing the cooldown
|
||||
* * index - string index storing the cooldown on the cooldowns associative list
|
||||
*
|
||||
* This sends a signal reporting the cooldown end.
|
||||
*/
|
||||
/proc/end_cooldown(datum/source, index)
|
||||
if(QDELETED(source))
|
||||
return
|
||||
SEND_SIGNAL(source, COMSIG_CD_STOP(index))
|
||||
TIMER_COOLDOWN_END(source, index)
|
||||
|
||||
/**
|
||||
* Proc used by stoppable timers to end a cooldown before the time has ran out.
|
||||
*
|
||||
* Arguments:
|
||||
* * source - datum storing the cooldown
|
||||
* * index - string index storing the cooldown on the cooldowns associative list
|
||||
*
|
||||
* This sends a signal reporting the cooldown end, passing the time left as an argument.
|
||||
*/
|
||||
/proc/reset_cooldown(datum/source, index)
|
||||
if(QDELETED(source))
|
||||
return
|
||||
SEND_SIGNAL(source, COMSIG_CD_RESET(index), S_TIMER_COOLDOWN_TIMELEFT(source, index))
|
||||
TIMER_COOLDOWN_END(source, index)
|
||||
|
||||
Reference in New Issue
Block a user