Generating Command Descriptions

Generating Command Descriptions

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Generating Command Descriptions

Post by zwzsg »

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 ...
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Generating Command Descriptions

Post by KDR_11k »

BTW, build pics are accessed with #unitDefID.
Post Reply

Return to “Feature Requests”