Skip to main content

AssistedSpawnCommandAction

A class in Root.Township, Alta.Menu.

Client dev tools board control for an assisted spawn command: quantity buttons plus the virtual keyboard to type a prefab name, then a submit button that sends the spawn command.

Constructors​

MemberWhat it is
AssistedSpawnCommandAction()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

4 private and internal fields
MemberWhat it is
private AssistedSpawnCommandDefinition assistedCommandDefinitionThe spawn command definition this control fills in and runs.
private IUseVirtualKeyboard baseUserThe keyboard user to hand the keyboard back to.
private TextRenderer progressTextText showing what will be spawned.
private TextButton submitButtonButton that sends the command; disabled until the arguments are valid.

Properties​

MemberWhat it is
int MaxCharactersLimit { get; }Keyboard input limit, 50 characters.

Methods​

MemberWhat it is
void HandleKeyboardInput(string input)Sets the prefab argument to the typed text and rechecks if the command can be sent.
void HandleKeyboardSubmit()Does nothing.
bool IsShowingSecret()Always false, so typed text is shown.
void LostFocus()Hands the touch screen keyboard back to the user it had before.
void Next()Does nothing.
void Previous()Does nothing.
override void SetSettings(ISettingsFieldAccess newSettingToDisplay)First call only: takes the AssistedSpawnCommandDefinition, builds the quantity buttons and hooks up the submit button.
protected override void DynamicButtonSetup(TextButton textButton, int buttonIndex)Wires each quantity button to set that quantity and then open the keyboard.
6 private and internal methods
MemberWhat it is
private void CheckCanSubmitCommand()Enables the submit button only when the command's arguments are valid, and updates the progress text.
private void ConnectKeyboard(Button button)Opens the runtime console and points the touch screen keyboard at this control, remembering the previous keyboard user.
private void OnDisable()Gives the keyboard back to its previous user.
private void SetProgressText()Shows the current quantity and prefab arguments on progressText.
private void SetQuantityForCommand(int quantity)Sets the quantity argument and rechecks if the command can be sent.
private void SubmitCommand(Button button)Runs the spawn command and closes the runtime console.