Class SettingsScreen
Represents the screen in-game where WeaverCore related mods can have their settings changed. See GlobalSettings for more info
Namespace: WeaverCore.Settings
Assembly: WeaverCore.dll
Syntax
public sealed class SettingsScreen : MonoBehaviour
Properties
| Edit this page View SourceInPauseMenu
Whether the pause menu is open or not
Declaration
public static bool InPauseMenu { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Instance
The current instance of the settings menu. Is null when the settings menu is not visible
Declaration
public static SettingsScreen Instance { get; }
Property Value
| Type | Description |
|---|---|
| SettingsScreen |
Panels
A list of all the currently registered panels
Declaration
public static IEnumerable<GlobalSettings> Panels { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<GlobalSettings> |
SelectedPanel
The currently selected panel. Returns null if there is no panel selected
Declaration
public static GlobalSettings SelectedPanel { get; }
Property Value
| Type | Description |
|---|---|
| GlobalSettings |
UIElements
A list of all the UI elements currently shown
Declaration
public static ReadOnlyCollection<UIElement> UIElements { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyCollection<UIElement> |
Methods
| Edit this page View SourceGetDescriptionOfMember(MemberInfo)
Gets the description of the member
Declaration
public static string GetDescriptionOfMember(MemberInfo member)
Parameters
| Type | Name | Description |
|---|---|---|
| MemberInfo | member | The member to check |
Returns
| Type | Description |
|---|---|
| string | Returns the description of the member. Returns null if |
GetDisplayNameOfMember(MemberInfo)
Gets the display name of the member
Declaration
public static string GetDisplayNameOfMember(MemberInfo memberInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| MemberInfo | memberInfo | The member to check |
Returns
| Type | Description |
|---|---|
| string | Returns the display name of the member. Returns null if |
GetHeaderOfMember(MemberInfo)
Gets the header of the member
Declaration
public static string GetHeaderOfMember(MemberInfo member)
Parameters
| Type | Name | Description |
|---|---|---|
| MemberInfo | member | The member to check |
Returns
| Type | Description |
|---|---|
| string | Returns the header of the member, or null if the member does not have a header |
GetRangeOfNumberMember(MemberInfo, out double, out double)
If the member is numerical, this function returns whether or not it's limited to a set range of numbers
Declaration
public static bool GetRangeOfNumberMember(MemberInfo member, out double min, out double max)
Parameters
| Type | Name | Description |
|---|---|---|
| MemberInfo | member | The member to check |
| double | min | The min range |
| double | max | The max range |
Returns
| Type | Description |
|---|---|
| bool | Returns whether this member is limited to a specified range |
GetSpacingOfMember(MemberInfo)
Gets how much spacing the member should be from the previous member
Declaration
public static float GetSpacingOfMember(MemberInfo member)
Parameters
| Type | Name | Description |
|---|---|---|
| MemberInfo | member | The member to check |
Returns
| Type | Description |
|---|---|
| float | Returns how much spacing should be between this member and the previous |
Hide()
Hides the config area
Declaration
public void Hide()
IsPanelRegistered(Type)
Is the GlobalSettings of the specified type registered to the settings menu?
Declaration
public static bool IsPanelRegistered(Type panelType)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | panelType | The type to check for |
Returns
| Type | Description |
|---|---|
| bool | Returns true if the specific type of GlobalSettings is registered with the settings menu |
IsPanelRegistered<T>()
Is the GlobalSettings of the specified type registered to the settings menu?
Declaration
public static bool IsPanelRegistered<T>() where T : GlobalSettings
Returns
| Type | Description |
|---|---|
| bool | Returns true if the specific type of GlobalSettings is registered with the settings menu |
Type Parameters
| Name | Description |
|---|---|
| T | The type to check for |
RegisterPanel(GlobalSettings)
Registers a panel to the settings menu so it can be displayed in the menu
Declaration
public static void RegisterPanel(GlobalSettings panel)
Parameters
| Type | Name | Description |
|---|---|---|
| GlobalSettings | panel | The panel to register |
RegisterPanel<T>()
Registers a panel to the settings menu so it can be displayed in the menu
Declaration
public static T RegisterPanel<T>() where T : GlobalSettings
Returns
| Type | Description |
|---|---|
| T | Returns an instance to the panel |
Type Parameters
| Name | Description |
|---|---|
| T | The type of panel to register |
RemoveAllUIElements()
Removes all currently added UI Elements from the Settings Menu
Declaration
public void RemoveAllUIElements()
SetDescription(string)
Updates the description text in the Settings Area
Declaration
public static void SetDescription(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The new description to set |
ShouldBeEnabled(EnabledType)
Checks if a UI Element should be visible or not
Declaration
public static bool ShouldBeEnabled(EnabledType visibility)
Parameters
| Type | Name | Description |
|---|---|---|
| EnabledType | visibility | The visibility of the UI Element |
Returns
| Type | Description |
|---|---|
| bool | Returns whether or not the UI Element should be visible |
Show()
Shows the config area
Declaration
public void Show()
UnRegisterPanel(GlobalSettings)
Unregisters an panel from the settings menu
Declaration
public static void UnRegisterPanel(GlobalSettings panel)
Parameters
| Type | Name | Description |
|---|---|---|
| GlobalSettings | panel | The panel to unregister |
UnRegisterPanel<T>()
Unregisters an panel from the settings menu
Declaration
public static void UnRegisterPanel<T>() where T : GlobalSettings
Type Parameters
| Name | Description |
|---|---|
| T | The panel type to unregister |
Events
| Edit this page View SourceElementAdded
Called whenever a UI Element is added to the Settings Menu
Declaration
public static event Action<UIElement> ElementAdded
Event Type
| Type | Description |
|---|---|
| Action<UIElement> |
ElementRemoved
Called whenever a UI Element is removed from the Settings Menu
Declaration
public static event Action<UIElement> ElementRemoved
Event Type
| Type | Description |
|---|---|
| Action<UIElement> |