ID:2793091
 
Hello. Currently on my game I use this code to show the Item I'm dragging beneath the Mouse Pointer:

New()//at the parent type for the Items
var/icon/A=icon('cursor.dmi',"over")
var/icon/B=icon(src.icon, src.icon_state)
A.Blend(B,ICON_UNDERLAY)
mouse_drag_pointer = A


But I want to avoid using icon procs because they bad, specially everytime an Item is created. What could I replace this with? I can only think of making an .dmi file with an icon_state of the mouse with each and everyone of the Items.

Thanks in advance.

You could just keep a list to cache the resulting icon the first time the object is created.

If you do end up wanting to make a dmi file with each outcome, you can at least generate it with DM to save a lot of time.

var/icon/endIcon = new
for(var/x in typesof(/pathToItems))
var/obj/O = new x
endIcon.Insert(O.mouse_drag_pointer, "stateName")
fcopy(endIcon, "fileName.dmi")

Just run something like that once and it'll generate the file with every pointer icon for you.