mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 08:37:43 +01:00
Adds human icon helper
This commit is contained in:
@@ -915,4 +915,39 @@ The _flatIcons list is a cache for generated icon files.
|
||||
return 0
|
||||
|
||||
|
||||
var/global/list/humanoid_icon_cache = list()
|
||||
//For creating consistent icons for human looking simple animals
|
||||
/proc/get_flat_human_icon(var/icon_id,var/outfit,var/datum/preferences/prefs)
|
||||
if(!icon_id || !humanoid_icon_cache[icon_id])
|
||||
var/mob/living/carbon/human/dummy/body = new()
|
||||
|
||||
if(prefs)
|
||||
prefs.copy_to(body)
|
||||
if(outfit)
|
||||
body.equipOutfit(outfit, TRUE)
|
||||
|
||||
var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing")
|
||||
|
||||
body.dir = NORTH
|
||||
var/icon/partial = getFlatIcon(body)
|
||||
out_icon.Insert(partial,dir=NORTH)
|
||||
|
||||
body.dir = SOUTH
|
||||
partial = getFlatIcon(body)
|
||||
out_icon.Insert(partial,dir=SOUTH)
|
||||
|
||||
body.dir = WEST
|
||||
partial = getFlatIcon(body)
|
||||
out_icon.Insert(partial,dir=WEST)
|
||||
|
||||
body.dir = EAST
|
||||
partial = getFlatIcon(body)
|
||||
out_icon.Insert(partial,dir=EAST)
|
||||
|
||||
qdel(body)
|
||||
|
||||
humanoid_icon_cache[icon_id] = out_icon
|
||||
return out_icon
|
||||
else
|
||||
return humanoid_icon_cache[icon_id]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user