Skip to content

Game.UI.Tooltip.ZoningEvaluationTooltip

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

Type: class

Base: Game.UI.Widgets.Widget

Summary:
A UI Widget used to represent zoning evaluation information in tooltips. It stores a zoning evaluation factor (an enum defined in ZoneEvaluationUtils) and a numeric score, and notifies the UI system when those values change so the tooltip can update. When serialized via the UI JSON writer, it emits the factor as the enum name string and the score as a numeric property.


Fields

  • private ZoneEvaluationUtils.ZoningEvaluationFactor m_Factor
    Stores the backing value for the public factor property. Mutating the public property updates this field and triggers SetPropertiesChanged() so the UI can refresh.

  • private float m_Score
    Stores the backing value for the public score property. Mutating the public property updates this field and triggers SetPropertiesChanged() so the UI can refresh.

Properties

  • public ZoneEvaluationUtils.ZoningEvaluationFactor factor { get; set; }
    Public accessor for the zoning evaluation factor. The setter checks for value changes and calls SetPropertiesChanged() to inform the Widget/UI system that the widget needs re-rendering or a property sync.

  • public float score { get; set; }
    Public accessor for the evaluation score. The setter checks for value changes and calls SetPropertiesChanged() to inform the Widget/UI system that the widget needs re-rendering or a property sync. Typically represents the factor's numeric influence (range and semantics depend on the producer of the score).

Constructors

  • public ZoningEvaluationTooltip()
    No explicit constructors are defined in the source; the default parameterless constructor provided by C# is used. Initialization beyond default field values should be done after construction or in the owning UI code.

Methods

  • protected override void WriteProperties(IJsonWriter writer) : System.Void
    Overrides the Widget serialization hook to emit the widget's properties into the provided IJsonWriter. It writes two properties:
  • "factor": the enum name string produced via Enum.GetName(typeof(ZoneEvaluationUtils.ZoningEvaluationFactor), factor)
  • "score": the numeric score (float) This JSON output is used by the UI layer to transmit widget state to the UI renderer/binding layer.

Usage Example

// Create and populate a tooltip instance
var tooltip = new ZoningEvaluationTooltip();

// Example enum value — replace with an actual member of ZoneEvaluationUtils.ZoningEvaluationFactor
tooltip.factor = ZoneEvaluationUtils.ZoningEvaluationFactor.ProximityToServices;
tooltip.score = 0.85f;

// Changing either property will call SetPropertiesChanged() internally so the UI updates.
// Serialization example (pseudo — obtain an IJsonWriter from the UI framework you are using):
// IJsonWriter writer = ...;
// tooltip.WriteProperties(writer);

Notes: - ZoneEvaluationUtils.ZoningEvaluationFactor is defined in Game.Simulation (refer to that type for available enum values and semantics). - The widget relies on the Widget base class for property-change mechanics; ensure this is used within the game's UI context so SetPropertiesChanged() has effect.