mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge pull request #6304 from CHOMPStation2/upstream-merge-14936
[MIRROR] Little Weakref Refactor
This commit is contained in:
@@ -382,15 +382,15 @@ GLOBAL_LIST_EMPTY(icon_state_lists)
|
||||
|
||||
GLOBAL_LIST_EMPTY(cached_examine_icons)
|
||||
/proc/set_cached_examine_icon(var/atom/A, var/icon/I, var/expiry = 12000)
|
||||
GLOB.cached_examine_icons[weakref(A)] = I
|
||||
GLOB.cached_examine_icons[WEAKREF(A)] = I
|
||||
if(expiry)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, .proc/uncache_examine_icon, weakref(A)), expiry, TIMER_UNIQUE)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, .proc/uncache_examine_icon, WEAKREF(A)), expiry, TIMER_UNIQUE)
|
||||
|
||||
/proc/get_cached_examine_icon(var/atom/A)
|
||||
var/weakref/WR = weakref(A)
|
||||
var/datum/weakref/WR = WEAKREF(A)
|
||||
return GLOB.cached_examine_icons[WR]
|
||||
|
||||
/proc/uncache_examine_icon(var/weakref/WR)
|
||||
/proc/uncache_examine_icon(var/datum/weakref/WR)
|
||||
GLOB.cached_examine_icons -= WR
|
||||
|
||||
/proc/adjust_brightness(var/color, var/value)
|
||||
|
||||
Reference in New Issue
Block a user