I could use a way to automatically get the default Command Description of a given Command.
Something like:
Spring.GenerateCmdDescs
(number cmdID) -> nil | {
"id" = number,
"type" = number,
"name" = string,
"action" = string,
"tooltip" = string,
"texture" = string,
"cursor" = string,
"hidden" = boolean,
"disabled" = boolean,
"showUnique" = boolean,
"onlyTexture" = boolean,
"params" = { [1] = string, ... }
}
So that way I could get a matching button when I wanna perform a Spring.InsertUnitCmdDesc to add a new command to a unit buttonlist.
Spring.FindUnitCmdDesc won't cut it because it needs a live unit already having that command.
Trying to fill all those fields by myself would result in command description that risk being slightly different from the engine generated one. Stuff like texture of buildbutton for instance would be particulary hard to get since the buildpics can exist in so many image format and I don't even know which priority spring use on them. And I don't want to have to recopy all the default text of all the hard coded commands, and having the update them everytime they change or risk missing some or ...
Generating Command Descriptions
Moderator: Moderators
Re: Generating Command Descriptions
BTW, build pics are accessed with #unitDefID.