Skip to content

Game.InfomodeInfo

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: public class

Base: System.Object, System.IComparable

Summary:
Represents metadata for an "infomode" (an in-game information overlay/mode). Instances hold a reference to the infomode prefab, an integer priority used for ordering, and flags indicating supplemental or optional status. Typically used by UI or mode registration systems to sort and manage available infomodes.


Fields

  • public InfomodePrefab m_Mode
    Holds a reference to the InfomodePrefab that defines the visual/functional behavior of this infomode entry. This links the metadata to the actual prefab asset used by the game.

  • public int m_Priority
    Integer priority used for ordering InfomodeInfo instances. Lower values sort before higher values when using the provided CompareTo implementation.

  • public bool m_Supplemental
    If true, indicates this infomode is supplemental (e.g., an add-on or auxiliary mode rather than a primary one). The exact interpretation depends on the caller's logic.

  • public bool m_Optional
    If true, indicates this infomode is optional and may not be presented or required in all contexts.

Properties

This class does not declare any C# properties; it exposes public fields instead (m_Mode, m_Priority, m_Supplemental, m_Optional). Access fields directly or wrap them in properties in your own code if needed.

Constructors

  • public InfomodeInfo()
    No explicit constructor is defined in the source; the compiler-provided parameterless constructor initializes the object. Create instances and assign fields manually or provide factory/helper methods in your mod code.

Methods

  • public int CompareTo(InfomodeInfo other)
    Implements IComparable. Returns the difference between this.m_Priority and other.m_Priority (m_Priority - other.m_Priority). This yields ascending order by priority when sorting (smaller priority values come first). Note: this subtraction can theoretically overflow for extreme values; for typical priority ranges this is not a concern.

Usage Example

// Create some InfomodeInfo entries and sort them by priority
var a = new InfomodeInfo { m_Mode = somePrefabA, m_Priority = 10, m_Supplemental = false, m_Optional = false };
var b = new InfomodeInfo { m_Mode = somePrefabB, m_Priority = 5,  m_Supplemental = true,  m_Optional = true };
var c = new InfomodeInfo { m_Mode = somePrefabC, m_Priority = 20, m_Supplemental = false, m_Optional = true };

var list = new List<InfomodeInfo> { a, b, c };
list.Sort(); // uses CompareTo -> order will be b (5), a (10), c (20)