private void StopPollInput() { this._pollInput = false; base.enabled = false; if (LocalPlayer.Inventory) { LocalPlayer.Inventory.enabled = true; } InputMappingAction.SetJoystickMenuMap(true); }
private void StartPollInput() { if (!base.enabled && this._nextChangeTimer < Time.realtimeSinceStartup) { base.enabled = true; this._pollInput = true; if (LocalPlayer.Inventory) { LocalPlayer.Inventory.enabled = false; } if (Input.player != null) { InputMappingAction.SetJoystickMenuMap(false); } } }
private void InitializeUI(bool resetScrollView) { this.ClearUI(resetScrollView); if (!this._mappingManager) { this._mappingManager = UnityEngine.Object.FindObjectOfType <InputMapping>(); } this._actionRowMappingCount = new Dictionary <InputActionRow, int>(); this._knownActionMaps = new Dictionary <ActionElementMap, InputActionButton>(); this.ShowUserAssignableActions(); this._nextChangeTimer = Time.realtimeSinceStartup + this._interChangeDelay; base.enabled = false; ReInput.ControllerConnectedEvent -= this.OnControllerConnectedEvent; ReInput.ControllerConnectedEvent += this.OnControllerConnectedEvent; ReInput.ControllerDisconnectedEvent -= this.OnControllerConnectedEvent; ReInput.ControllerDisconnectedEvent += this.OnControllerConnectedEvent; InputMappingAction.SetJoystickMenuMap(true); if (resetScrollView) { this._scrollView.ResetPosition(); this._scrollbar.value = 0f; } }
public ElementAssignmentChange(InputMappingAction.ElementAssignmentChange source) { this.playerId = source.playerId; this.controllerId = source.controllerId; this.controllerType = source.controllerType; this.controllerMap = source.controllerMap; this.changeType = source.changeType; this.actionElementMapId = source.actionElementMapId; this.actionId = source.actionId; this.actionAxisContribution = source.actionAxisContribution; this.actionType = source.actionType; this.assignFullAxis = source.assignFullAxis; this.invert = source.invert; this.pollingInfo = source.pollingInfo; this.modifierKeyFlags = source.modifierKeyFlags; }
public ElementAssignmentChange(int playerId, InputMappingAction.ElementAssignmentChangeType changeType, int actionElementMapId, int actionId, Pole actionAxisContribution, InputActionType actionType, bool assignFullAxis, bool invert) { this.playerId = playerId; this.changeType = changeType; this.actionElementMapId = actionElementMapId; this.actionId = actionId; this.actionAxisContribution = actionAxisContribution; this.actionType = actionType; this.assignFullAxis = assignFullAxis; this.invert = invert; }
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(); } }