Skip to content

SettingPreset

public sealed class SettingPreset

Namespace SideHustle

Added in 1.5.0

A named bundle of host-setting values a gamemode can offer as a one-click preset (e.g. “Classic Hunt”). Side Hustle shows a preset picker above the settings form; selecting one CASCADES its Values into the matching controls (matched by SettingDescriptor.Key), which the host can then still tweak. Values use the same wire format as the controls: a Slider’s number, a Toggle’s “1”/“0”, a Segmented’s stored value. Keys with no matching control are ignored (forward-compatible with not-yet-built settings).

public string Name

Added in 1.5.0

Display name shown in the picker (e.g. “Classic Hunt”). Required.

public string Hint

Added in 1.5.0

Optional one-line description shown under the picker while this preset is selected.

public System.Collections.Generic.Dictionary<string, string> Values

Added in 1.5.0

The setting values this preset applies, keyed by SettingDescriptor.Key.

Value Each value in the control’s stored form, e.g. { "len", "10" }, { "pace", "f" }. Keys with no matching setting log a warning and are ignored. Null applies nothing.

public bool Experimental

Added in 1.5.0

When true the picker marks this preset as experimental (a badge + sorted to the back) - use it for presets whose headline mechanic is not fully built yet.

public string Recommended

Added in 1.5.0

Optional human-readable player-count recommendation shown in the picker (e.g. “Best for 2-6”).

public int MinPlayers

Added in 1.5.0

Player-count range this preset suits best. When the lobby size falls in [MinPlayers, MaxPlayers] the form may auto-select it on open. 0 = unspecified.

Value Inclusive player count, e.g. 2. The auto-select needs both ends above 0 and skips experimental presets. Among several fits the narrowest range wins.

public int MaxPlayers

Added in 1.5.0

Upper end of the player-count range, inclusive, e.g. 4. 0 = unspecified. See MinPlayers.

public string Mode

Added in 1.5.0

Canonical “mode” this preset represents (e.g. “Infection”). When the host tweaks a preset, the effective mode shown to joiners becomes “Custom - {Mode}”. Defaults to Name when null.

public bool DefaultSelected

Added in 1.5.0

When true the form opens on this preset, overriding the player-count best-fit. Used for a saved “Custom” preset that should be pre-selected next time the host opens the form.