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>")
+2 -2
View File
@@ -691,9 +691,9 @@
switch(input)
if("custom")
if(client?.prefs?.custom_holoform_icon)
holo_icon = client.prefs.custom_holoform_icon
holo_icon = client.prefs.get_filtered_holoform(HOLOFORM_FILTER_AI)
else
holo_icon = getHologramIcon(icon("female", 'icons/mob/ai.dmi'))
holo_icon = getHologramIcon(icon('icons/mob/ai.dmi', "female"))
else if("xeno queen")
holo_icon = getHologramIcon(icon(icon_list[input],"alienq"))
else
@@ -82,9 +82,7 @@
if(!choice)
return FALSE
chassis = choice
icon_state = "[chassis]"
if(resting)
icon_state = "[chassis]_rest"
update_icon()
to_chat(src, "<span class='boldnotice'>You switch your holochassis projection composite to [chassis]</span>")
/mob/living/silicon/pai/lay_down()
@@ -1,7 +1,10 @@
/mob/living/silicon/pai/proc/update_icon()
if((chassis == "custom") && !custom_holoform_icon)
chassis = pick(possible_chassis - "custom")
if(chassis == "custom")
custom_holoform_icon = client?.prefs?.get_filtered_holoform(HOLOFORM_FILTER_PAI)
if(!custom_holoform_icon)
chassis = pick(possible_chassis - "custom")
if(chassis != "custom")
icon = initial(icon)
icon_state = "[chassis]_[resting]"
else
icon = custom_holoform_icon