private void OnGUI() { if (!this.identifyRequired) { return; } if (this.joysticksToIdentify == null || this.joysticksToIdentify.Count == 0) { this.Reset(); } else { Rect rect; ((Rect) ref rect).\u002Ector((float)((double)Screen.get_width() * 0.5 - 125.0), (float)((double)Screen.get_height() * 0.5 - 125.0), 250f, 250f); // ISSUE: method pointer GUILayout.Window(0, rect, new GUI.WindowFunction((object)this, __methodptr(DrawDialogWindow)), "Joystick Identification Required", (GUILayoutOption[])Array.Empty <GUILayoutOption>()); GUI.FocusWindow(0); if ((double)Time.get_time() < (double)this.nextInputAllowedTime || !ReInput.get_controllers().SetUnityJoystickIdFromAnyButtonOrAxisPress((int)((Controller)this.joysticksToIdentify.Peek()).id, 0.8f, false)) { return; } this.joysticksToIdentify.Dequeue(); this.SetInputDelay(); if (this.joysticksToIdentify.Count != 0) { return; } this.Reset(); } }
public void IdentifyAllJoysticks() { this.Reset(); if (ReInput.get_controllers().get_joystickCount() == 0) { return; } Joystick[] joysticks = ReInput.get_controllers().GetJoysticks(); if (joysticks == null) { return; } this.identifyRequired = true; this.joysticksToIdentify = new Queue <Joystick>((IEnumerable <Joystick>)joysticks); this.SetInputDelay(); }
private void AssignJoysticksToPlayers() { IList <Joystick> joysticks = ReInput.get_controllers().get_Joysticks(); for (int index = 0; index < ((ICollection <Joystick>)joysticks).Count; ++index) { Joystick joystick = joysticks[index]; if (!ReInput.get_controllers().IsControllerAssigned(((Controller)joystick).get_type(), (int)((Controller)joystick).id) && ((Controller)joystick).GetAnyButtonDown()) { ((Player.ControllerHelper) this.FindPlayerWithoutJoystick()?.controllers).AddController((Controller)joystick, false); } } if (!this.DoAllPlayersHaveJoysticks()) { return; } ReInput.get_configuration().set_autoAssignJoysticks(true); ((Behaviour)this).set_enabled(false); }
private void UpdateInputCheckMode() { ControllerPollingInfo _pollingInfo = ((ReInput.ControllerHelper.PollingHelper)ReInput.get_controllers().polling).PollControllerForFirstElementDown(this.selectedControllerType, this.selectedControllerId); if (!((ControllerPollingInfo) ref _pollingInfo).get_success() || ((ControllerPollingInfo) ref _pollingInfo).get_elementType() != 1) { return; } InputAction action = this.row.action; ActionElementMap _actionElementMap = !this.controllerMap.ContainsAction(action.get_id()) ? (ActionElementMap)null : this.controllerMap.GetElementMapsWithAction(action.get_id())[0]; ElementAssignment elementAssignment = this.ToElementAssignment(_pollingInfo, (ModifierKeyFlags)0, this.row.actionRange, action.get_id(), _actionElementMap); ElementAssignmentConflictCheck _conflictCheck = (ElementAssignmentConflictCheck)null; if (this.CreateConflictCheck(elementAssignment, out _conflictCheck, _actionElementMap) && !((ReInput.ControllerHelper.ConflictCheckingHelper)ReInput.get_controllers().conflictChecking).DoesElementAssignmentConflict(_conflictCheck)) { this.controllerMap.ReplaceOrCreateElementMap(elementAssignment); } this.row = (Remapping.Row)null; this.updateMode = Remapping.UpdateMode.ButtonSelectMode; ((Selectable)this.controllerSelectDropDown).set_interactable(true); this.RedrawUI(); }