Game.Settings.SettingsUIMouseActionAttribute
Assembly:
Assembly-CSharp (inferred)
Namespace: Game.Settings
Type:
public class (Attribute)
Base:
SettingsUIInputActionAttribute
Summary:
Attribute used to declare a settings UI input action that comes from a mouse device. This attribute is targeted at classes (AttributeUsage(AttributeTargets.Class, AllowMultiple = true)). It supplies the device type (InputManager.DeviceType.Mouse) and a default input mode of Mode.DigitalNormalized. Several constructor overloads are provided to declare actions with detailed input setup (usages, interactions, processors) or with simplified custom usage strings.
Fields
- This class does not declare any fields of its own.
The attribute only configures and forwards parameters to its base class (SettingsUIInputActionAttribute); any required storage is handled by the base type.
Properties
- This class does not declare additional properties.
All properties available on instances come from the base SettingsUIInputActionAttribute (for example, properties that represent the configured name, device type, action type, mode, usages, interactions, processors, and flags such as developerOnly or allowModifiers).
Constructors
public SettingsUIMouseActionAttribute(string name, ActionType type = ActionType.Button, bool allowModifiers = true, bool developerOnly = false, string[] usages = null, string[] interactions = null, string[] processors = null)
Creates a mouse-based settings UI input action with full, explicit parameter control. Parameters:- name: logical name of the action.
- type: ActionType (default Button).
- allowModifiers: whether modifier keys are allowed (default true).
- developerOnly: whether the action is only available to developer builds (default false).
- usages: array of usage strings for the input system (optional).
- interactions: array of interaction strings (optional).
-
processors: array of processor strings (optional). This overload forwards the device type = Mouse and Mode = DigitalNormalized to the base.
-
public SettingsUIMouseActionAttribute(string name, ActionType type, params string[] customUsages)
Creates a mouse input action specifying an ActionType and a params array of custom usage strings. Uses device = Mouse and Mode = DigitalNormalized. -
public SettingsUIMouseActionAttribute(string name, params string[] customUsages)
Creates a mouse input action using the default ActionType.Button and a params array of custom usage strings. Uses device = Mouse and Mode = DigitalNormalized.
Methods
- This attribute does not declare any methods beyond the constructors. Behavior (validation, storage, integration with the settings UI) is provided/handled by the base SettingsUIInputActionAttribute and the game input system.
Usage Example
using Game.Settings;
using Game.Input;
// Simple declaration with default ActionType (Button)
[SettingsUIMouseAction("Select")]
public class MySelectSettings { }
// Declaration with explicit ActionType and allowing modifiers
[SettingsUIMouseAction("ContextClick", ActionType.Button, allowModifiers: true)]
public class MyContextSettings { }
// Declaration using custom usage strings (for mapping to specific controls/usages)
[SettingsUIMouseAction("Scroll", "ScrollWheel")]
public class MyScrollSettings { }
// Full explicit constructor with interactions/processors
[SettingsUIMouseAction(
"Drag",
ActionType.Value,
allowModifiers: false,
developerOnly: false,
usages: new[] { "position", "delta" },
interactions: new[] { "press" },
processors: new[] { "scale" })]
public class MyDragSettings { }
Notes: - The attribute must be applied to a class (AllowMultiple = true allows declaring multiple mouse actions on the same class). - The attribute forces the device to InputManager.DeviceType.Mouse and the input Mode to Mode.DigitalNormalized for consistency with the settings UI input handling.