Exemple #1
0
 // Token: 0x060023BA RID: 9146 RVA: 0x0009C0BC File Offset: 0x0009A2BC
 private void Update()
 {
     if (this.requestedUserProfile != null != this.userProfileSelectionList)
     {
         if (!this.userProfileSelectionList)
         {
             GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.userProfileSelectionListPrefab, base.transform);
             this.userProfileSelectionList = gameObject.GetComponent <UserProfileListController>();
             this.userProfileSelectionList.GetComponent <MPEventSystemProvider>().eventSystem = MPEventSystemManager.FindEventSystem(this.rewiredPlayer);
             this.userProfileSelectionList.onProfileSelected += this.OnUserSelectedUserProfile;
         }
         else
         {
             UnityEngine.Object.Destroy(this.userProfileSelectionList.gameObject);
             this.userProfileSelectionList = null;
         }
     }
     if (this.rewiredPlayer == null)
     {
         this.nameLabel.gameObject.SetActive(false);
         this.promptLabel.text = "Press 'Start'";
         this.cardImage.color  = this.unselectedColor;
         this.cardImage.sprite = this.playerCardNone;
         return;
     }
     this.cardImage.color = this.selectedColor;
     this.nameLabel.gameObject.SetActive(true);
     if (this.requestedUserProfile == null)
     {
         this.cardImage.sprite = this.playerCardNone;
         this.nameLabel.text   = "";
         this.promptLabel.text = "...";
         return;
     }
     this.cardImage.sprite = this.playerCardKBM;
     this.nameLabel.text   = this.requestedUserProfile.name;
     this.promptLabel.text = "";
 }
Exemple #2
0
        // Token: 0x06002135 RID: 8501 RVA: 0x0009BDD0 File Offset: 0x00099FD0
        public void Update()
        {
            EventSystem eventSystem = MPEventSystemManager.FindEventSystem(ReInput.players.GetPlayer(0));

            if (eventSystem && eventSystem.currentSelectedGameObject == this.inputField.gameObject)
            {
                ConsoleWindow.InputFieldState inputFieldState = ConsoleWindow.InputFieldState.Neutral;
                if (this.autoCompleteDropdown && this.autoCompleteInUse)
                {
                    inputFieldState = ConsoleWindow.InputFieldState.AutoComplete;
                }
                else if (this.historyIndex != -1)
                {
                    inputFieldState = ConsoleWindow.InputFieldState.History;
                }
                bool keyDown  = Input.GetKeyDown(KeyCode.UpArrow);
                bool keyDown2 = Input.GetKeyDown(KeyCode.DownArrow);
                switch (inputFieldState)
                {
                case ConsoleWindow.InputFieldState.Neutral:
                    if (keyDown)
                    {
                        if (Console.userCmdHistory.Count > 0)
                        {
                            this.historyIndex        = Console.userCmdHistory.Count - 1;
                            this.preventHistoryReset = true;
                            this.inputField.text     = Console.userCmdHistory[this.historyIndex];
                            this.inputField.MoveToEndOfLine(false, false);
                            this.preventHistoryReset = false;
                        }
                    }
                    else if (keyDown2 && this.autoCompleteDropdown)
                    {
                        this.autoCompleteDropdown.Show();
                        this.autoCompleteDropdown.value = 0;
                        this.autoCompleteDropdown.onValueChanged.Invoke(this.autoCompleteDropdown.value);
                    }
                    break;

                case ConsoleWindow.InputFieldState.History:
                {
                    int num = 0;
                    if (keyDown)
                    {
                        num--;
                    }
                    if (keyDown2)
                    {
                        num++;
                    }
                    if (num != 0)
                    {
                        this.historyIndex += num;
                        if (this.historyIndex < 0)
                        {
                            this.historyIndex = 0;
                        }
                        if (this.historyIndex >= Console.userCmdHistory.Count)
                        {
                            this.historyIndex = -1;
                        }
                        else
                        {
                            this.preventHistoryReset = true;
                            this.inputField.text     = Console.userCmdHistory[this.historyIndex];
                            this.inputField.MoveToEndOfLine(false, false);
                            this.preventHistoryReset = false;
                        }
                    }
                    break;
                }

                case ConsoleWindow.InputFieldState.AutoComplete:
                    if (keyDown2)
                    {
                        TMP_Dropdown tmp_Dropdown = this.autoCompleteDropdown;
                        int          value        = tmp_Dropdown.value + 1;
                        tmp_Dropdown.value = value;
                    }
                    if (keyDown)
                    {
                        if (this.autoCompleteDropdown.value > 0)
                        {
                            TMP_Dropdown tmp_Dropdown2 = this.autoCompleteDropdown;
                            int          value         = tmp_Dropdown2.value - 1;
                            tmp_Dropdown2.value = value;
                        }
                        else
                        {
                            this.autoCompleteDropdown.Hide();
                        }
                    }
                    break;
                }
                eventSystem.SetSelectedGameObject(this.inputField.gameObject);
            }
        }