I think I wasn't specific enough when I asked the question.
But I want to change the cursor to a
custom icon, one not specified by one of the existing (default or mod) commands.
As you answered this I took a look at the code when I tried this some 1~year ago now, and it's mostly similar, except I'm not sure how you got the CMD_CLEARMINES in
Code: Select all
Spring.SetCustomCommandDrawData(CMD_CLEARMINES, "Clear Mines", {1,0.5,0,.8}, false)
A running version I have is this:
gadget:
Code: Select all
CMD_RESIZE_X = 30521
local myCustomDesc = {
name = "resize-x",
action = "resize-x",
id = CMD_RESIZE_X,
type = CMDTYPE.ICON_MAP, -- or whatever is suitable
tooltip = "resizes x",
cursor = "resize-x",
}
function gadget:Initialize()
gadgetHandler:RegisterCMDID(CMD_RESIZE_X)
Spring.AssignMouseCursor("resize-x", "cursor-x", true, true)
Spring.SetCustomCommandDrawData(CMD_RESIZE_X, "resize-x", {1,1,1,0.5}, false)
end
(don't have anything anymore in the unsynced widget, but it would be something like this)