private void ProcessReturn(string input, string menuName)
 {
     if (input == "KeypadEnter" || input == "Return" || input == "Enter")
     {
         if (linkedButton != "" && menuName != "")
         {
             PlayerMenus.SimulateClick(menuName, PlayerMenus.GetElementWithName(menuName, linkedButton), 1);
         }
     }
 }
Ejemplo n.º 2
0
        /**
         * Simulates the clicking of the associated MenuElement.
         */
        public void Interact()
        {
            if (element)
            {
                if (!element.isClickable)
                {
                    ACDebug.Log("Cannot click on " + elementName);
                }

                PlayerMenus.SimulateClick(menuName, element, slot);
            }
        }
Ejemplo n.º 3
0
        /**
         * Processes input entered by the player, and applies it to the text box (OnGUI-based Menus only).
         */
        public void CheckForInput(string input, bool shift, string menuName)
        {
            if (uiInput != null)
            {
                return;
            }

            bool rightToLeft = false;

            if (Options.GetLanguageName() == "Arabic" || Options.GetLanguageName() == "Hebrew")
            {
                rightToLeft = true;
            }

            isSelected = true;
            if (input == "Backspace")
            {
                if (label.Length > 1)
                {
                    if (rightToLeft)
                    {
                        label = label.Substring(1, label.Length - 1);
                    }
                    else
                    {
                        label = label.Substring(0, label.Length - 1);
                    }
                }
                else if (label.Length == 1)
                {
                    label = "";
                }
            }
            else if (input == "KeypadEnter" || input == "Return" || input == "Enter")
            {
                if (linkedButton != "" && menuName != "")
                {
                    PlayerMenus.SimulateClick(menuName, PlayerMenus.GetElementWithName(menuName, linkedButton), 1);
                }
            }
            else if ((inputType == AC_InputType.AlphaNumeric && (input.Length == 1 || input.Contains("Alpha"))) ||
                     (inputType == AC_InputType.NumbericOnly && input.Contains("Alpha")) ||
                     (inputType == AC_InputType.AlphaNumeric && allowSpaces && input == "Space"))
            {
                input = input.Replace("Alpha", "");
                input = input.Replace("Space", " ");
                if (shift)
                {
                    input = input.ToUpper();
                }
                else
                {
                    input = input.ToLower();
                }

                if (characterLimit == 1)
                {
                    label = input;
                }
                else if (label.Length < characterLimit)
                {
                    if (rightToLeft)
                    {
                        label = input + label;
                    }
                    else
                    {
                        label += input;
                    }
                }
            }
        }