Class ConfigLayout
The complete description of an input configuration screen: its columns, the groups its rows are gathered into, and which of those groups can never be active together.
Inherited Members
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
public sealed class ConfigLayout
Remarks
Passed to Initialize(ConfigLayout). Bundling the three declarations into one object is deliberate: it means a fourth kind of declaration can be added later without changing that method's signature again.
Conflict model: the columns and groups declared here are what InputRebindManager consults when deciding whether two bindings collide. Three rules govern the result:
- Two cells on the same row are alternative routes to one action - for example the same action's binding under the "Keyboard" column versus its binding under the "Gamepad" column - and never conflict with each other, regardless of group or exclusivity.
- Two different actions that share a control and belong to the same ConfigActionGroup always conflict, because both groups' actions can be live at the same time.
- Two different actions that share a control but belong to different groups conflict unless those groups were declared mutually exclusive, in which case the modes that enable them can never both be active and the shared control is not a real collision.
That third rule can be declared two ways, and they compose. Name the groups directly with WithExclusiveGroups(params string[]), or point the builder at the game's input contexts with WithExclusiveGroupsFromContexts(IInputContextManager) and let it read the exclusivity already authored there as ConflictExclusiveTags. The second is usually the better one: the game states the relationship once, in the context configuration, instead of restating it here where the two can drift apart.
Build one through Create():
var layout = ConfigLayout.Create()
.WithColumn("Keyboard&Mouse", "Keyboard Input")
.WithColumn("Keyboard Alt", "Alt. Input")
.WithColumn("Gamepad", "Gamepad", "<Gamepad>")
.WithGroup("OnFoot", "On Foot", "On Foot")
.WithGroup("InCar", "In Car", "In Car")
.WithExclusiveGroups("OnFoot", "InCar")
.Build();
Fields
UNGROUPED_ID
Group ID given to actions that matched no declared group. Shares no exclusive set, so their overlaps are reported rather than hidden.
Declaration
public const string UNGROUPED_ID = "__ungrouped"
Field Value
| Type | Description |
|---|---|
| string |
Properties
Columns
Gets the columns, in declaration order.
Declaration
public IReadOnlyList<ConfigSchemeGroup> Columns { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<ConfigSchemeGroup> |
Exclusions
Gets the exclusion sets.
Declaration
public IReadOnlyList<ConfigGroupExclusion> Exclusions { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<ConfigGroupExclusion> |
Groups
Gets the groups, in declaration order, which is the order a table renders them.
Declaration
public IReadOnlyList<ConfigActionGroup> Groups { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<ConfigActionGroup> |
Methods
AreGroupsExclusive(string, string)
Reports whether two groups were declared mutually exclusive, meaning bindings they share are not conflicts.
Declaration
public bool AreGroupsExclusive(string groupA, string groupB)
Parameters
| Type | Name | Description |
|---|---|---|
| string | groupA | First group ID. |
| string | groupB | Second group ID. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
A group is not exclusive with itself: two rows in one group always conflict, which is rule 2. Suppression requires a single declared set containing both, and is not chained across sets.
Create()
Starts building a layout.
Declaration
public static ConfigLayout.Builder Create()
Returns
| Type | Description |
|---|---|
| ConfigLayout.Builder | A fresh builder. |