private void Confirm(InputMappingAction.ConflictResolution conflictResolution) { if (conflictResolution > InputMappingAction.ConflictResolution.Pending) { if (conflictResolution == InputMappingAction.ConflictResolution.Replace) { using (IEnumerator <ElementAssignmentConflictInfo> enumerator = ReInput.controllers.conflictChecking.ElementAssignmentConflicts(this._entry.ToElementAssignmentConflictCheck()).GetEnumerator()) { while (enumerator.MoveNext()) { ElementAssignmentConflictInfo info = enumerator.Current; if (this._knownActionMaps.Any((KeyValuePair <ActionElementMap, InputActionButton> m) => m.Key.id == info.elementMapId)) { ActionElementMap elementMap = this._knownActionMaps.First((KeyValuePair <ActionElementMap, InputActionButton> m) => m.Key.id == info.elementMapId).Key; UnityEngine.Object.Destroy(this._knownActionMaps[elementMap].gameObject); this._knownActionMaps.Remove(elementMap); InputActionRow key = this._actionRowMappingCount.First((KeyValuePair <InputActionRow, int> r) => r.Key._action.id == elementMap.actionId).Key; Dictionary <InputActionRow, int> actionRowMappingCount; InputActionRow key2; (actionRowMappingCount = this._actionRowMappingCount)[key2 = key] = actionRowMappingCount[key2] - 1; } } } ReInput.controllers.conflictChecking.RemoveElementAssignmentConflicts(this._entry.ToElementAssignmentConflictCheck()); } if (this._entry.changeType != InputMappingAction.ElementAssignmentChangeType.Add) { this._entry.controllerMapPrevious.DeleteElementMap(this._entry.actionElementMapId); this._entry.controllerMapPrevious = null; this._knownActionMaps.Remove(this._entry.uiButton._actionElementMap); UnityEngine.Object.Destroy(this._entry.uiButton.gameObject); if (this._entry.uiRow) { Dictionary <InputActionRow, int> actionRowMappingCount; InputActionRow uiRow; (actionRowMappingCount = this._actionRowMappingCount)[uiRow = this._entry.uiRow] = actionRowMappingCount[uiRow] - 1; } this._entry.changeType = InputMappingAction.ElementAssignmentChangeType.Add; } this._entry.ReplaceOrCreateActionElementMap(false); if (this._entry.changeType == InputMappingAction.ElementAssignmentChangeType.Add) { ActionElementMap actionElementMap = this._entry.controllerMap.AllMaps.First((ActionElementMap m) => m.actionId == this._entry.actionId && !this._knownActionMaps.ContainsKey(m)); bool showInvert = this._entry.actionType == InputActionType.Axis && actionElementMap.axisType == AxisType.Normal && this._entry.controllerType != ControllerType.Keyboard; this.AddActionAssignmentButton(this._entry.uiRow, Input.player.id, ReInput.mapping.GetAction(this._entry.actionId), actionElementMap.axisContribution, this._entry.controllerMap, false, actionElementMap, showInvert); this.HideAddActionMapButton(this._entry.uiRow, this._entry.controllerType); } this._nextChangeTimer = Time.realtimeSinceStartup + this._interChangeDelay; this.InitializeUI(false); this.StopPollInput(); } }
private void Confirm(InputMappingAction.ConflictResolution conflictResolution) { if (conflictResolution > InputMappingAction.ConflictResolution.Pending) { if (conflictResolution == InputMappingAction.ConflictResolution.Replace) { foreach (ElementAssignmentConflictInfo info in ReInput.controllers.conflictChecking.ElementAssignmentConflicts(this._entry.ToElementAssignmentConflictCheck())) { if (this._knownActionMaps.Any((KeyValuePair <ActionElementMap, InputActionButton> m) => m.Key.id == info.elementMapId)) { ActionElementMap elementMap = this._knownActionMaps.First((KeyValuePair <ActionElementMap, InputActionButton> m) => m.Key.id == info.elementMapId).Key; UnityEngine.Object.Destroy(this._knownActionMaps[elementMap].gameObject); this._knownActionMaps.Remove(elementMap); InputActionRow key = this._actionRowMappingCount.First((KeyValuePair <InputActionRow, int> r) => r.Key._action.id == elementMap.actionId).Key; Dictionary <InputActionRow, int> actionRowMappingCount; Dictionary <InputActionRow, int> expr_F3 = actionRowMappingCount = this._actionRowMappingCount; InputActionRow key2; InputActionRow expr_F7 = key2 = key; int num = actionRowMappingCount[key2]; expr_F3[expr_F7] = num - 1; key._actionGrid.repositionNow = true; this.CheckActionMappingCount(key); } } ReInput.controllers.conflictChecking.RemoveElementAssignmentConflicts(this._entry.ToElementAssignmentConflictCheck()); } this._entry.ReplaceOrCreateActionElementMap(this._replaceElementMap); if (this._entry.changeType == InputMappingAction.ElementAssignmentChangeType.Add) { ActionElementMap actionElementMap = this._entry.controllerMap.AllMaps.First((ActionElementMap m) => m.actionId == this._entry.actionId && !this._knownActionMaps.ContainsKey(m)); bool showInvert = this._entry.actionType == InputActionType.Axis && actionElementMap.axisType == AxisType.Normal && this._entry.controllerType != ControllerType.Keyboard; this.AddActionAssignmentButton(this._entry.uiRow, Input.player.id, ReInput.mapping.GetAction(this._entry.actionId), actionElementMap.axisContribution, this._entry.controllerMap, false, actionElementMap, showInvert); this._entry.uiRow._actionGrid.repositionNow = true; this.CheckActionMappingCount(this._entry.uiRow); } else { this._entry.uiButton._label.text = this._entry.pollingInfo.elementIdentifierName; } this._selectionScreenTimer.gameObject.SetActive(false); this._mappingConflictResolutionKeyLabel.transform.parent.gameObject.SetActive(false); this._mappingSystemConflictUI.transform.parent.gameObject.SetActive(false); this._nextChangeTimer = Time.realtimeSinceStartup + this._interChangeDelay; this.ResetUI(); this.StopPollInput(); } }