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.
- Listed in Menus, UI and platforms
- Inherits or implements
ServerMultiCommandAction,IUseVirtualKeyboard
Constructors
| Member | What it is |
|---|---|
AssistedSpawnCommandAction() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|---|
private AssistedSpawnCommandDefinition assistedCommandDefinition | The spawn command definition this control fills in and runs. |
private IUseVirtualKeyboard baseUser | The keyboard user to hand the keyboard back to. |
private TextRenderer progressText | Text showing what will be spawned. |
private TextButton submitButton | Button that sends the command; disabled until the arguments are valid. |
Properties
| Member | What it is |
|---|---|
int MaxCharactersLimit { get; } | Keyboard input limit, 50 characters. |
Methods
| Member | What 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
| Member | What 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. |