Show / Hide Table of Contents

Class SettingsScreen

Represents the screen in-game where WeaverCore related mods can have their settings changed. See GlobalSettings for more info

Inheritance
object
Object
Component
Behaviour
MonoBehaviour
SettingsScreen
Namespace: WeaverCore.Settings
Assembly: WeaverCore.dll
Syntax
public sealed class SettingsScreen : MonoBehaviour

Properties

| Edit this page View Source

InPauseMenu

Whether the pause menu is open or not

Declaration
public static bool InPauseMenu { get; }
Property Value
Type Description
bool
| Edit this page View Source

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
| Edit this page View Source

Panels

A list of all the currently registered panels

Declaration
public static IEnumerable<GlobalSettings> Panels { get; }
Property Value
Type Description
IEnumerable<GlobalSettings>
| Edit this page View Source

SelectedPanel

The currently selected panel. Returns null if there is no panel selected

Declaration
public static GlobalSettings SelectedPanel { get; }
Property Value
Type Description
GlobalSettings
| Edit this page View Source

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 Source

GetDescriptionOfMember(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 memberis null

| Edit this page View Source

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 memberInfo is null.

| Edit this page View Source

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

| Edit this page View Source

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

| Edit this page View Source

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

| Edit this page View Source

Hide()

Hides the config area

Declaration
public void Hide()
| Edit this page View Source

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

| Edit this page View Source

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

| Edit this page View Source

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

| Edit this page View Source

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

| Edit this page View Source

RemoveAllUIElements()

Removes all currently added UI Elements from the Settings Menu

Declaration
public void RemoveAllUIElements()
| Edit this page View Source

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

| Edit this page View Source

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

| Edit this page View Source

Show()

Shows the config area

Declaration
public void Show()
| Edit this page View Source

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

| Edit this page View Source

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 Source

ElementAdded

Called whenever a UI Element is added to the Settings Menu

Declaration
public static event Action<UIElement> ElementAdded
Event Type
Type Description
Action<UIElement>
| Edit this page View Source

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>

Extension Methods

ReflectionUtilities.ReflectCallMethod(object, string, object[], BindingFlags)
ReflectionUtilities.ReflectGetField(object, string, BindingFlags)
ReflectionUtilities.ReflectGetMethod(object, string, BindingFlags)
ReflectionUtilities.ReflectGetProperty(object, string, BindingFlags)
ReflectionUtilities.ReflectSetField(object, string, object, BindingFlags)
ReflectionUtilities.ReflectSetProperty(object, string, object, BindingFlags)
CoroutineUtilities.RunCoroutineWhile<T>(T, IEnumerator, Func<bool>)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾