Skip to content

Game.UI.Editor.DLCInfoField

Assembly: Assembly-CSharp
Namespace: Game.UI.Editor

Type: public class DLCInfoField

Base: Widget

Summary:
DLCInfoField is a small UI widget that holds DLC-related metadata (localized display name, type and an image identifier). It exposes properties for those values and overrides serialization to write them into a JSON writer. This widget is intended for use in editor UI code where DLC entries need to be displayed or serialized.


Fields

  • private LocalizedString m_DisplayName
    Stores the localized display name for the DLC. Backing field for the displayName property.

  • private LocalizedString m_Type
    Stores the localized type/category string for the DLC. Backing field for the type property.

  • private string m_Image
    Stores the image identifier/path associated with the DLC. Backing field for the image property.

Properties

  • public LocalizedString displayName { get; private set }
    Gets or sets the localized display name. On set, the widget calls SetPropertiesChanged() to mark the widget as changed so the UI/serialization system can react.

  • public LocalizedString type { get; private set }
    Gets or sets the localized type/category string. On set, the widget calls SetPropertiesChanged().

  • public string image { get; private set }
    Gets or sets the image identifier or path for the DLC. On set, the widget calls SetPropertiesChanged().

Constructors

  • public DLCInfoField()
    No explicit constructor is defined in code; the class uses the default parameterless constructor inherited from Widget. Initialization of fields should be done after construction as needed.

Methods

  • protected override void WriteProperties(IJsonWriter writer) : System.Void
    Overrides Widget.WriteProperties to serialize the DLCInfoField properties into the provided IJsonWriter. It calls base.WriteProperties(writer) first, then writes three properties:
  • "displayName" — writes the displayName value
  • "type" — writes the type value
  • "image" — writes the image value This method is used when the UI framework serializes widget state to JSON.

Usage Example

// Create the widget and populate its fields
var dlcField = new DLCInfoField();
dlcField.displayName = new LocalizedString("dlc.name.example"); // or however LocalizedString is constructed
dlcField.type = new LocalizedString("dlc.type.expansion");
dlcField.image = "Textures/DLCs/example_dlc_icon";

// When the UI system serializes the widget, WriteProperties will be invoked and the writer
// will receive "displayName", "type" and "image" properties for this widget.