Page 1 of 1

How to change custom command draw colour?

Posted: 17 Jun 2013, 13:40
by Jools
I created a custom command along with a button, but I can't configure the draw colour. Anyone knows how to do this?

I tried using Sping.SetCustomCommandDrawData, but I can't get it to work. It returns nil.

Code: Select all

local result = SetCustomCommandDrawData(CMD_AREA_GUARD, CMDTYPE.ICON_UNIT_OR_AREA, {1,0,0,0.8},true)
Am I just being stupid, using wrong fucntion or is something else wrong?

That is set in gadget:Initialize(). And I also did use gadgetHandler:RegisterCMDID(CMD_AREA_GUARD), but I'm unsure what that does, maybe calls Microsoft to activate my command :)

Re: How to change custom command draw colour?

Posted: 17 Jun 2013, 13:49
by jK
Jools wrote:I tried using Spring.SetCustomCommandDrawData, but I can't get it to work. It returns nil.
Jools wrote: local result = SetCustomCommandDrawData(CMD_AREA_GUARD, CMDTYPE.ICON_UNIT_OR_AREA, {1,0,0,0.8},true)
wiki: "number cmdIconID | string iconname | nil"

Re: How to change custom command draw colour?

Posted: 17 Jun 2013, 14:02
by Jools
Well, that's how it's used in http://imolarpg.dyndns.org/trac/balates ... attack.lua and it seems to work.