Game.Settings.About
Assembly: Game
Namespace: Game.Settings
Type: class
Base: Setting
Summary:
This Setting-derived helper exposes runtime/version information about the game and several subsystems (Colossal.Core, Colossal.UI, Unity, Cohtml, ATL) for display in the settings UI. It also dynamically builds a settings page section that lists platform integrations (their reported version lines) and locally available DLCs, annotating DLCs that are present on disk but not owned.
Fields
-
public const string kName
Provides the identifier/name of this setting ("About"). -
private const string kGameGroup
Internal constant for grouping UI properties related to the game ("Game"). -
private const string kContentGroup
Internal constant for grouping content/DLC related UI properties ("Content").
Properties
-
public string gameVersion { get }
Returns the game's current full version via Version.current.fullVersion. Marked with [SettingsUISection("kGameGroup")] to put it under the Game section in the settings UI. -
public string gameConfiguration { get }
Returns "Release" when not a debug build, otherwise "Development". Marked with [SettingsUISection("kGameGroup")]. Uses UnityEngine.Debug.isDebugBuild to decide. -
public string coreVersion { get }
Returns Colossal.Core.Version.current.fullVersion (the version of Colossal.Core). -
public string uiVersion { get }
Returns Colossal.UI.Version.current.fullVersion (the version of the Colossal.UI library). -
public string unityVersion { get }
Returns UnityEngine.Application.unityVersion (the running Unity version). -
public string cohtmlVersion { get }
Returns Versioning.Build.ToString() (Cohtml/versioning info). -
public string atlVersion { get }
Returns ATL.Version.getVersion() (ATL library version).
Constructors
public About()
Default constructor (implicit if not declared). Initializes an About instance that can be used by the automatic settings system to expose the properties above and to build the dynamic Settings page.
Methods
-
public override void SetDefaults()
No-op in this implementation. Included to satisfy the Setting base contract; About does not define default-modifiable data. -
public override AutomaticSettings.SettingPageData GetPageData(string id, bool addPrefix)
Builds and returns an AutomaticSettings.SettingPageData instance for the About page. Behavior: - Calls base.GetPageData to get the default page data.
- Iterates PlatformManager.instance.platformServiceIntegrations and, for each integration:
- Calls platformServiceIntegration.LogVersion(StringBuilder) to obtain multi-line version info.
- Splits the text into lines, parses each line to find a "Name: Value" separator and creates an AutomaticSettings.ManualProperty for each parsed line.
- Each created property is annotated with SettingsUIPathAttribute and SettingsUIDisplayNameAttribute and is added as a StringField to pageData["General"].
- Adds a "Content" group to the pageData.
- Iterates PlatformManager.instance.EnumerateLocalDLCs(), and for each local DLC:
- Creates a ManualProperty that exposes dlc.version.fullVersion (read-only).
- Adds attributes SettingsUIPathAttribute, SettingsUIDisplayNameAttribute (display name includes ownership marker if not owned), and SettingsUIDescriptionAttribute (description contains version + ownership note when applicable).
- Adds each DLC entry under the "Content" simple group but still attached to the "General" page in UI layout.
- Helper local functions:
- GetOwnershipCheckString(IDlc): returns "*" if the DLC is present locally but not owned by the user.
- GetOwnershipString(IDlc): returns a multiline message explaining the "*" marker when not owned.
- The result is a pageData that shows integration-specific version lines and per-DLC version entries with ownership annotations.
Usage Example
// Example: constructing and reading About settings in code
About about = new About();
// Access basic properties
string gameVer = about.gameVersion;
string unityVer = about.unityVersion;
string cohtmlVer = about.cohtmlVersion;
// Get the prepared settings page data to integrate into the automatic settings UI
AutomaticSettings.SettingPageData page = about.GetPageData("About", true);
// The page will contain a "General" group with lines from platform integrations
// and a "Content" simple group listing local DLCs (unowned DLCs are marked with "*").