Skip to content

Game.Rendering.CinematicCamera.PhotoModeProperty

Assembly:
Assembly-CSharp (game code / modding API)
Namespace:
Game.Rendering.CinematicCamera

Type:
class

Base:
System.Object

Summary:
Represents a single adjustable property exposed to the Photo Mode / cinematic camera UI. Encapsulates identification, grouping, getter/setter delegates for the numeric value, optional min/max constraints, availability and enablement checks, an optional reset action, display precision (fraction digits), an optional enum type mapping, and a hint for override UI control. Typically used by the cinematic/photo UI to build sliders, toggles and other controls for camera/post-processing parameters.


Fields

  • This class declares no explicit instance fields; it exposes data through public auto-properties. The compiler will generate backing fields for those auto-properties.

Properties

  • public string id { get; set; }
    Identifier for the property. Used by UI/layout code to uniquely identify the setting (e.g., "exposure", "contrast").

  • public string group { get; set; }
    Optional group name used to group related properties in the UI (e.g., "Color", "Lens").

  • public Action<float> setValue { get; set; }
    Delegate invoked to set the property's numeric value. The UI calls this when the user changes the value.

  • public Func<float> getValue { get; set; }
    Delegate returning the current numeric value of the property. The UI reads this to display the current value.

  • public Func<float> min { get; set; }
    Delegate returning the minimum allowed value for the property, used to constrain UI sliders or inputs.

  • public Func<float> max { get; set; }
    Delegate returning the maximum allowed value for the property, used to constrain UI sliders or inputs.

  • public Func<bool> isAvailable { get; set; }
    Delegate used to determine whether the property should be shown (is available) in the current context (e.g., based on other settings or camera state).

  • public Func<bool> isEnabled { get; set; }
    Delegate returning whether the property is currently enabled (editable). If false, the UI can render the control disabled/grayed out.

  • public Action<bool> setEnabled { get; set; }
    Delegate used to toggle the enabled state for the property (if applicable). Invoked by UI controls that toggle enablement.

  • public Action reset { get; set; }
    Optional delegate to reset the property to a default value. The UI can call this when the user requests a reset.

  • public int fractionDigits { get; set; } = 3;
    Number of fractional digits to display for numeric values in the UI. Defaults to 3.

  • public Type enumType { get; set; }
    Optional System.Type for an enum associated with this property. When set, UI code may present an enum picker instead of/free alongside numeric controls.

  • public OverrideControl overrideControl { get; set; }
    Indicates whether and how an "override" control should be shown for this property (see OverrideControl enum). Used to present an enable/override checkbox or a color field override for properties that support it.

OverrideControl enum: - None — No override control. - Checkbox — Show a checkbox to toggle overriding this property. - ColorField — Show a color field (useful for color-related properties that accept a color override).

Constructors

  • public PhotoModeProperty()
    Default parameterless constructor. Initializes a new instance; most fields/properties should be assigned by the caller. fractionDigits defaults to 3.

Methods

  • This class does not declare any methods beyond the default constructor. Behavior is provided by the delegates assigned to its properties.

Usage Example

// Create a property for "Exposure" with min/max, get/set and reset behavior.
var exposureProp = new PhotoModeProperty
{
    id = "exposure",
    group = "Camera",
    getValue = () => currentSettings.Exposure,
    setValue = v => currentSettings.Exposure = v,
    min = () => -5f,
    max = () => 5f,
    isAvailable = () => true,
    isEnabled = () => true,
    reset = () => currentSettings.Exposure = currentSettings.DefaultExposure,
    fractionDigits = 2,
    overrideControl = PhotoModeProperty.OverrideControl.Checkbox
};

// UI code can then query exposureProp.getValue(), exposureProp.min(), etc.,
// and call exposureProp.setValue(newValue) when the user adjusts the control.

{{ This class is a lightweight data container used by the photo/cinematic UI. When adding new PhotoModeProperty instances, assign the appropriate delegates (getValue/setValue/min/max/isAvailable/isEnabled/reset) so the UI can reflect and modify the underlying camera/post-processing settings. }}