rebindRows function
The rows a RebindList shows for player: every rebindable action in
maps, each binding in their scheme, a composite as its parts.
Implementation
List<RebindRow> rebindRows(PlayerInput player, {List<String>? maps}) {
final asset = player.manager.service.asset;
final group = player.actions.group;
return [
for (final m in asset.maps)
if (maps == null || maps.contains(m.name))
for (final a in m.actions)
if (a.rebindable)
for (final b in a.bindings)
if (b.inGroup(group))
...switch (b) {
ControlBindingDef() => [RebindRow(a.label, b.id)],
CompositeBindingDef() => [
for (final p in b.parts)
RebindRow(
a.type == ActionValueType.vector2 ||
b.composite == CompositeKinds.axis1D
? '${a.label} ${prettifyName(p.part)}'
: a.label,
p.id,
),
],
},
];
}