Human icon key & preferences tweaks (#3274)

changes:

Reworked how human body icon keys are generated; resulting keys should be much shorter now and involve less duplication of the same string.
Players are now shown a message when they try to add markings to a species that has none available.
Admin revive for human-types will now also re-apply their organ and marking prefs.
Admin revive now also resets shock_stage (fixes rejuv'd mobs being slow for a while)
This commit is contained in:
Lohikar
2017-08-14 01:01:40 +03:00
committed by Erki
parent 7ce566f472
commit eace452b30
10 changed files with 114 additions and 68 deletions
+12
View File
@@ -52,6 +52,8 @@
var/list/human_underwear_cache = list()
var/list/human_undershirt_cache = list()
var/list/human_socks_cache = list()
var/list/organ_keymap = list()
var/current_organ_keymap_idex = 1
// This is an assoc list of all icon states in `icons/mob/collar.dmi`, used by human update-icons.
var/list/collar_states
var/list/uniform_states
@@ -64,6 +66,16 @@
for (var/i in icon_states('icons/mob/collar.dmi'))
collar_states[i] = TRUE
/datum/controller/subsystem/icon_cache/proc/get_organ_shortcode(obj/item/organ/external/organ)
if (QDELETED(organ))
return null
var/key = organ.get_mob_cache_key(FALSE)
. = organ_keymap[key]
if (!.)
organ_keymap[key] = "organ[current_organ_keymap_idex++]"
. = organ_keymap[key]
/datum/controller/subsystem/icon_cache/proc/setup_uniform_mappings()
uniform_states = list()
for (var/i in icon_states('icons/mob/uniform.dmi'))