Skip to main content

ServerDetailsPanel

An abstract class in Root.Township, Alta.Meta.UI.ServerManagement.

Client: base for the create server and edit server menu panels. Holds the name, description and join type inputs and shows a summary that updates as you type.

Constructors​

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

Fields​

MemberWhat it is
protected ServerDetailsPanel.ButtonData currentTypeThe join type button picked, with its data and friendly name.
protected InputField descriptionInputThe server description field.
protected ServerDetailsPanel.ButtonData[] joinButtonDataThe join type buttons with the data each stands for.
protected ButtonCollection joinButtonsThe button group for picking a join type.
protected PanelComponent joinedServersPageThe joined servers panel.
protected InputField nameInputThe server name field.
protected SelectedGroupPanel selectedServerPanelThe panel for the selected server.
3 private and internal fields
MemberWhat it is
private Button confirmButtonButton that runs the panel's Run task when pressed.
private bool isRunningTrue while Run is in progress, so repeat presses of the confirm button are ignored.
private TextRenderer summaryTextText that shows GetSummaryText, refreshed when the name, description or join type changes.

Methods​

MemberWhat it is
protected async void ConfirmButtonPressed(Button obj)Runs Run when confirm is pressed, ignoring presses while one is running.
protected abstract string GetSummaryText()Subclasses return the summary text to show.
protected abstract Task Run()Subclasses create or update the server.
protected virtual void Start()Hooks the inputs, confirm button and join type buttons.
protected void UpdateSummary(InputField obj)Refreshes the summary text.
1 private and internal method
MemberWhat it is
private void HandleJoinTypeChanged(ButtonCollection obj)Sets currentType to the join button data matching the newly chosen button and refreshes the summary.