Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CopyKeysFrom()

void Terraria.GameInput.PlayerInputProfile.CopyKeysFrom ( PlayerInputProfile profile,
InputMode mode,
string[] keysToCopy )
inlineprivate

Definition at line 322 of file PlayerInputProfile.cs.

323 {
324 for (int i = 0; i < keysToCopy.Length; i++)
325 {
326 if (profile.InputModes[mode].KeyStatus.TryGetValue(keysToCopy[i], out var value))
327 {
328 InputModes[mode].KeyStatus[keysToCopy[i]].Clear();
329 InputModes[mode].KeyStatus[keysToCopy[i]].AddRange(value);
330 }
331 }
332 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
void AddRange(IEnumerable< KeyValuePair< TKey, TValue > > collection)
Dictionary< InputMode, KeyConfiguration > InputModes

References System.Collections.Generic.Dictionary< TKey, TValue >.AddRange(), System.Collections.Generic.Dictionary< TKey, TValue >.Clear(), Terraria.GameInput.PlayerInputProfile.InputModes, System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.

Referenced by Terraria.GameInput.PlayerInputProfile.CopyGamepadSettingsFrom(), Terraria.GameInput.PlayerInputProfile.CopyGameplaySettingsFrom(), Terraria.GameInput.PlayerInputProfile.CopyHotbarSettingsFrom(), and Terraria.GameInput.PlayerInputProfile.CopyMapSettingsFrom().