Game.Settings.SettingsUIMultilineTextAttribute
Assembly:
Game (typically found in the game's main assembly, e.g. Assembly-CSharp.dll)
Namespace:
Game.Settings
Type:
public class SettingsUIMultilineTextAttribute : System.Attribute
Base:
System.Attribute
Summary:
Attribute used to annotate settings properties so the settings UI renders a multiline text control for that property. An optional icon identifier can be provided which the UI may display alongside the control. The attribute is targeted at properties and is inheritable, so derived setting classes retain the attribute.
Fields
public readonly string icon
Holds the optional icon identifier (name or key) to show in the settings UI next to the multiline text field. May be null if no icon is desired.
Properties
- None
Constructors
public SettingsUIMultilineTextAttribute(string icon = null)
Creates the attribute instance. Pass an icon identifier string to request that icon be shown in the UI; omit or pass null to request no icon.
Methods
- None
Usage Example
// Mark a string setting so the settings UI displays a multiline text box.
// Optionally provide an icon name to be displayed next to the control.
public class MySettings
{
[SettingsUIMultilineText("comment-icon")]
public string Description { get; set; }
// No icon
[SettingsUIMultilineText]
public string Notes { get; set; }
}
Additional notes for modders: - The attribute itself is metadata only; the settings UI reads it (via reflection) and decides how to render the property. It does not change serialization or runtime behavior of the property. - This attribute targets properties (AttributeUsage(AttributeTargets.Property, Inherited = true)), so apply it to property declarations, not fields. - Ensure the property type is compatible with multiline text (typically string).