god FUCK you icons

This commit is contained in:
kevinz000
2019-12-15 17:30:30 -07:00
parent 8c27c176ca
commit 5f27103641
6 changed files with 44 additions and 18 deletions
+9
View File
@@ -22,6 +22,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/last_id
var/icon/custom_holoform_icon
var/list/cached_holoform_icons
var/last_custom_holoform = 0
//Cooldowns for saving/loading. These are four are all separate due to loading code calling these one after another
@@ -2363,3 +2364,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
return
else
custom_names[name_id] = sanitized_name
/datum/preferences/proc/get_filtered_holoform(filter_type)
if(!custom_holoform_icon)
return
LAZYINITLIST(cached_holoform_icons)
if(!cached_holoform_icons[filter_type])
cached_holoform_icons[filter_type] = process_holoform_icon_filter(custom_holoform_icon, filter_type)
return cached_holoform_icons[filter_type]
+3 -1
View File
@@ -3,16 +3,18 @@
set desc = "Clear your current custom holoform"
prefs?.custom_holoform_icon = null
prefs?.cached_holoform_icons = null
to_chat(src, "<span class='boldnotice'>Holoform removed.</span>")
/client/verb/set_custom_holoform()
set name = "Set Custom Holoform"
set desc = "Set your custom holoform using your current preferences slot and a specified set of gear."
if(prefs.last_custom_holoform < world.time + CUSTOM_HOLOFORM_DELAY)
if(prefs.last_custom_holoform > world.time - CUSTOM_HOLOFORM_DELAY)
to_chat(src, "<span class='warning'>You are attempting to change custom holoforms too fast!</span>")
var/icon/new_holoform = user_interface_custom_holoform(src)
if(new_holoform)
prefs.custom_holoform_icon = new_holoform
prefs.cached_holoform_icons = null
prefs.last_custom_holoform = world.time
to_chat(src, "<span class='boldnotice'>Holoform set.</span>")