Allow AI to use custom holograms (#3114)

* Compound icon generator proc

Why didn't this exist before? Am I missing something? I need manipulatable icons of existing atoms including their overlays. Is there some easier way to get them than this...?

* Polaris Portion of AI Upgrade
This commit is contained in:
Arokha Sieyes
2017-03-22 17:09:04 -04:00
committed by Anewbe
parent 9660186dfd
commit ae68468861
2 changed files with 101 additions and 70 deletions

View File

@@ -793,6 +793,26 @@ proc // Creates a single icon from a given /atom or /image. Only the first argu
alpha_mask.Blend(image_overlay,ICON_OR)//OR so they are lumped together in a nice overlay.
return alpha_mask//And now return the mask.
//getFlatIcon but generates an icon that can face ALL four directions. The only four.
/proc/getCompoundIcon(atom/A)
var/icon/north = getFlatIcon(A,defdir=NORTH,always_use_defdir=1)
var/icon/south = getFlatIcon(A,defdir=SOUTH,always_use_defdir=1)
var/icon/east = getFlatIcon(A,defdir=EAST,always_use_defdir=1)
var/icon/west = getFlatIcon(A,defdir=WEST,always_use_defdir=1)
//Starts with a blank icon because of byond bugs.
var/icon/full = icon('icons/effects/effects.dmi', "icon_state"="nothing")
full.Insert(north,dir=NORTH)
full.Insert(south,dir=SOUTH)
full.Insert(east,dir=EAST)
full.Insert(west,dir=WEST)
qdel(north)
qdel(south)
qdel(east)
qdel(west)
return full
/mob/proc/AddCamoOverlay(atom/A)//A is the atom which we are using as the overlay.
var/icon/opacity_icon = new(A.icon, A.icon_state)//Don't really care for overlays/underlays.
//Now we need to culculate overlays+underlays and add them together to form an image for a mask.