Nucleus handler tools › Docs › Game › AddOption
Game.AddOption
Open in the workbench (search, and try it in a handler)
Game.AddOption(
name: string | number | boolean,
desc: string | number | boolean,
key: string | number | boolean,
value: any,
defaultValue: any
): void
Game.AddOption(
name: string | number | boolean,
desc: string | number | boolean,
key: string | number | boolean,
value: any
): void
Adds a user-selectable option to the game profile. Read it back in Game.Play with Context.Options["key"].
✎ AI-written, based on Nucleus GenericGameInfo.cs and GenericGameHandler.cs. Not from the official docs. Is it wrong? Tell us
name: Title of the option shown to the player in Nucleus' options list.desc: Description shown under the title.key: Name the handler reads the chosen value with: Context.Options[key].value: Default value or choices: an array of choices shows a drop-down (first item preselected); an empty array shows a text box.defaultValue: Stored on the option, but no Nucleus code reads it; a drop-down starts on the first item of value.
✎ Parameters: AI-written from the Nucleus source.
Is this right?
Tell us what's wrong