Game.UI.Widgets.MultilineTextSettingItemData
Assembly:
Namespace: Game.UI.Widgets
Type: public class
Base: AutomaticSettings.SettingItemData
Summary:
Represents the SettingItemData that produces a MultilineText widget for the automatic settings UI. When constructed it reads any SettingsUIMultilineTextAttribute applied to the property to obtain an icon name/path, and when asked to create a widget it instantiates and configures a MultilineText widget mapping the common setting UI fields (path, display name, actions, hidden/disabled state) into the widget instance.
Fields
- (This class defines no private fields.)
{{ The class only stores its data via properties and via its base class. The icon is stored as a property (see Properties). }}
Properties
public string icon { get; set; }
{{ Holds the icon identifier (for example a sprite name or path) to use on the MultilineText widget. The constructor sets this from the SettingsUIMultilineTextAttribute if present, otherwise to an empty string. }}
Constructors
public MultilineTextSettingItemData(Setting setting, AutomaticSettings.IProxyProperty property, string prefix)
{{ Creates a new MultilineTextSettingItemData. Calls the base constructor with AutomaticSettings.WidgetType.MultilineText and the provided setting/property/prefix. It then attempts to read a SettingsUIMultilineTextAttribute from the supplied property; if found, icon is set to the attribute.icon value, otherwise icon is set to string.Empty. }}
Methods
protected override IWidget GetWidget()
{{ Creates and returns a new MultilineText widget instance, copying the following values from the SettingItemData (base) into the widget:- path <- base.path
- displayName <- base.displayName
- displayNameAction <- base.dispayNameAction (note: the code uses 'dispayNameAction' as the member name from the base class)
- icon <- this.icon
- hidden <- base.hideAction
- disabled <- base.disableAction
The method is intended to be used by the AutomaticSettings/UI system (GetWidget is protected override), not usually called directly from user code. The returned widget is ready to be inserted into the settings UI. }}
Usage Example
// Example attribute on a setting property (pseudo-signature; actual setting type depends on the mod's settings system)
[SettingsUIMultilineText(icon = "my_multiline_icon")]
public string LongDescription { get; set; }
// The AutomaticSettings system will create a MultilineTextSettingItemData for this property,
// which will read the attribute and produce a MultilineText widget with icon = "my_multiline_icon".
// You typically don't call GetWidget() directly; the UI builder invokes it when building the settings page.