Skip to main content

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.

Constructors​

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

Fields​

MemberWhat it is
static DevToolsBoard InstanceThe open board, or null once released.
16 private and internal fields
MemberWhat it is
private readonly List<PooledObject> activeSettingsControls spawned for the current page.
private RuntimeConsole consoleThe runtime console on the board.
private int currentPanelIndex of the shown page.
private int currentPanelSettingsCountNumber of settings on the shown page.
private float distanceBetweenSettingsVertical gap between controls.
private float enableButtonsDelaySeconds the buttons stay off after a press.
private HoverPickup hoverPickupPickup that floats the board in place.
private TextButton nextPageButtonButton for the next page.
private int panelCountNumber of pages.
private TextButton previousPageButtonButton for the previous page.
private SettingsQuickAccessMenu settingsThe settings menu action that opened the board.
private Transform settingsParentWhere the controls are spawned.
private int settingsPerPanelSettings per page.
private readonly List<SettingsFieldAccess> settingsToDisplayThe valid settings to show, across all pages.
private DevToolsBoard.SettingTypeScaler[] settingTypeScalersExtra scale for controls of each setting type.
private TextButton showConsoleButtonButton that toggles the console.

Properties​

MemberWhat it is
Transform Transform { get; }The board's transform.
1 private and internal property
MemberWhat it is
private int PanelSettingsOffset { get; }Index of the first setting on the current page.

Events​

MemberWhat it is
event Action DistanceDisabledEvent from the board interface; this board never raises it.

Methods​

MemberWhat 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
MemberWhat 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.