DevToolsBoard
A class in Root.Township, Alta.QuickAccessActions.
Pooled developer board showing pages of settings controls plus a runtime console toggle. Instance is set while one is enabled.
- Listed in Players and characters
- Inherits or implements
PooledObject,IQuickAccessSettingsBoard - Nested types
SettingTypeScaler
Constructors
| Member | What it is |
|---|---|
DevToolsBoard() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
| Member | What it is |
|---|---|
static DevToolsBoard Instance | The open board, or null once released. |
16 private and internal fields
| Member | What it is |
|---|---|
private readonly List<PooledObject> activeSettings | Controls spawned for the current page. |
private RuntimeConsole console | The runtime console on the board. |
private int currentPanel | Index of the shown page. |
private int currentPanelSettingsCount | Number of settings on the shown page. |
private float distanceBetweenSettings | Vertical gap between controls. |
private float enableButtonsDelay | Seconds the buttons stay off after a press. |
private HoverPickup hoverPickup | Pickup that floats the board in place. |
private TextButton nextPageButton | Button for the next page. |
private int panelCount | Number of pages. |
private TextButton previousPageButton | Button for the previous page. |
private SettingsQuickAccessMenu settings | The settings menu action that opened the board. |
private Transform settingsParent | Where the controls are spawned. |
private int settingsPerPanel | Settings per page. |
private readonly List<SettingsFieldAccess> settingsToDisplay | The valid settings to show, across all pages. |
private DevToolsBoard.SettingTypeScaler[] settingTypeScalers | Extra scale for controls of each setting type. |
private TextButton showConsoleButton | Button that toggles the console. |
Properties
| Member | What it is |
|---|---|
Transform Transform { get; } | The board's transform. |
1 private and internal property
Events
| Member | What it is |
|---|---|
event Action DistanceDisabled | Event from the board interface; this board never raises it. |
Methods
| Member | What it is |
|---|---|
void NextPanel(Button button) | Shows the next page of settings, wrapping round. |
void PreviousPanel(Button button) | Shows the previous page of settings, wrapping round. |
override void Release() | Clears the page and Instance and returns the board to its pool. |
void SetRuntimeConsoleActiveState(bool activeState, out IUseVirtualKeyboard user) | Shows or hides the console and returns its keyboard user when shown. Used by the assisted spawn command. |
void Setup(SettingsQuickAccessMenu settings) | Loads the valid settings from a settings menu action, splits them into pages and shows the first. |
13 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Hooks the hover pickup so the board floats back to its spot when let go. |
private void ClearCurrentPanel() | Releases the setting controls on the current page. |
private void DisableButtons(Button button) | Briefly disables the page and console buttons after a press. |
private void Hover(Interactable interactable, Interactor interactor) | After the hover pickup is let go, sets it to float back to the board. |
private void OnEnable() | Sets Instance to this board. |
private void OpenPanel() | Works out how many settings fit on the current page and shows them. |
private static void SafeSubscribe(TextButton button, Action<Button> action) | Subscribes a handler to a button's press without adding it twice. |
private void ScaleControl(SettingType type, Transform control) | Scales a setting control by the scaler set for its setting type. |
private void SetButtonsEnabled(bool activeState) | Turns the page and console buttons on or off. |
private void SetupButtons() | Hooks the page and console buttons. |
private void ShowSettingControls() | Spawns pooled controls for the current page's settings, filled from server or game settings. |
private IEnumerator TemporaryDisableButtons() (iterator) | Coroutine that disables the buttons for enableButtonsDelay seconds when there are several pages. |
private void ToggleConsole(Button button) | Shows or hides the runtime console. |