コード例 #1
0
    private void ShowInput(bool fromActivate = true)
    {
        Bounds bounds = this.m_searchText.GetBounds();

        this.m_searchText.gameObject.SetActive(false);
        Rect  rect     = CameraUtils.CreateGUIViewportRect(Box.Get().GetCamera(), bounds.min, bounds.max);
        Color?nullable = null;

        if (W8Touch.Get().IsVirtualKeyboardVisible())
        {
            nullable = new Color?(this.m_altSearchColor);
        }
        UniversalInputManager.TextInputParams parms = new UniversalInputManager.TextInputParams {
            m_owner             = base.gameObject,
            m_rect              = rect,
            m_updatedCallback   = new UniversalInputManager.TextInputUpdatedCallback(this.OnInputUpdated),
            m_completedCallback = new UniversalInputManager.TextInputCompletedCallback(this.OnInputComplete),
            m_canceledCallback  = new UniversalInputManager.TextInputCanceledCallback(this.OnInputCanceled),
            m_font              = this.m_searchText.GetLocalizedFont(),
            m_text              = this.m_text,
            m_color             = nullable
        };
        parms.m_showVirtualKeyboard = fromActivate;
        UniversalInputManager.Get().UseTextInput(parms, false);
    }
コード例 #2
0
    public bool HandleKeyboardInput()
    {
        if (ApplicationMgr.IsPublic())
        {
            return(false);
        }
        if (!Input.GetKeyUp(KeyCode.BackQuote))
        {
            return(false);
        }
        Rect rect = new Rect(0f, 0f, 1f, 0.05f);

        this.m_cheatInputBackground         = rect;
        this.m_cheatInputBackground.x      *= Screen.width * 0.95f;
        this.m_cheatInputBackground.y      *= Screen.height;
        this.m_cheatInputBackground.width  *= Screen.width;
        this.m_cheatInputBackground.height *= Screen.height * 1.03f;
        this.m_inputActive       = true;
        this.m_cheatHistoryIndex = -1;
        this.ReadCheatHistoryOption();
        this.m_cheatTextBeforeScrollingThruHistory = null;
        UniversalInputManager.TextInputParams parms = new UniversalInputManager.TextInputParams {
            m_owner = base.gameObject,
            m_preprocessCallback = new UniversalInputManager.TextInputPreprocessCallback(this.OnInputPreprocess),
            m_rect              = rect,
            m_color             = new Color?(Color.white),
            m_completedCallback = new UniversalInputManager.TextInputCompletedCallback(this.OnInputComplete)
        };
        UniversalInputManager.Get().UseTextInput(parms, false);
        return(true);
    }
コード例 #3
0
 private static PluginRect ActivateTextField(string name, PluginRect bounds, int autocorrect, uint keyboardType, uint returnKeyType)
 {
     Log.Cameron.Print(string.Concat(new object[] { "activate text field ", name, " ", bounds }), new object[0]);
     if (UseNativeKeyboard())
     {
         return(Plugin_ActivateTextField(name, bounds, autocorrect, keyboardType, returnKeyType));
     }
     if (UniversalInputManager.Get() != null)
     {
         UniversalInputManager.TextInputParams @params = new UniversalInputManager.TextInputParams {
             m_owner = instance.gameObject,
             m_preprocessCallback = new UniversalInputManager.TextInputPreprocessCallback(instance.OnPreprocess),
             m_completedCallback  = new UniversalInputManager.TextInputCompletedCallback(instance.OnSubmitted),
             m_updatedCallback    = new UniversalInputManager.TextInputUpdatedCallback(instance.OnChanged),
             m_canceledCallback   = new UniversalInputManager.TextInputCanceledCallback(instance.InputCanceled),
             m_font                         = instance.m_InputFont,
             m_maxCharacters                = instance.maxCharacters,
             m_inputKeepFocusOnComplete     = instance.inputKeepFocusOnComplete,
             m_touchScreenKeyboardHideInput = instance.hideInput,
             m_useNativeKeyboard            = UseNativeKeyboard()
         };
         instance.inputParams = @params;
         UniversalInputManager.Get().UseTextInput(instance.inputParams, false);
         SetTextFieldBounds(bounds);
         if (instance.Active)
         {
             return(new Rect(0f, (float)Screen.height, (float)Screen.width, Screen.height * 0.5f));
         }
     }
     return(new PluginRect());
 }
コード例 #4
0
    private void ShowInput(bool fromAwake)
    {
        Rect rect = CameraUtils.CreateGUIViewportRect(BaseUI.Get().GetBnetCamera(), (Component)this.m_Bones.m_InputTopLeft, (Component)this.m_Bones.m_InputBottomRight);

        UniversalInputManager.TextInputParams parms = new UniversalInputManager.TextInputParams {
            m_owner = base.gameObject,
            m_rect  = rect,
            m_preprocessCallback = new UniversalInputManager.TextInputPreprocessCallback(this.OnInputPreprocess),
            m_completedCallback  = new UniversalInputManager.TextInputCompletedCallback(this.OnInputComplete),
            m_canceledCallback   = new UniversalInputManager.TextInputCanceledCallback(this.OnInputCanceled),
            m_font          = this.m_localizedInputFont,
            m_maxCharacters = 0x200,
            m_touchScreenKeyboardHideInput  = true,
            m_showVirtualKeyboard           = fromAwake,
            m_hideVirtualKeyboardOnComplete = !fromAwake ? false : true
        };
        UniversalInputManager.Get().UseTextInput(parms, false);
    }
コード例 #5
0
    private void ShowInput()
    {
        this.m_inputText.gameObject.SetActive(false);
        Camera camera = CameraUtils.FindFirstByLayer(base.gameObject.layer);
        Bounds bounds = this.m_inputText.GetBounds();
        Rect   rect   = CameraUtils.CreateGUIViewportRect(camera, bounds.min, bounds.max);

        UniversalInputManager.TextInputParams parms = new UniversalInputManager.TextInputParams {
            m_owner             = base.gameObject,
            m_password          = true,
            m_rect              = rect,
            m_updatedCallback   = new UniversalInputManager.TextInputUpdatedCallback(this.OnInputUpdated),
            m_completedCallback = new UniversalInputManager.TextInputCompletedCallback(this.OnInputComplete),
            m_canceledCallback  = new UniversalInputManager.TextInputCanceledCallback(this.OnInputCanceled),
            m_font              = this.m_inputText.TrueTypeFont,
            m_alignment         = 4,
            m_maxCharacters     = (this.m_challengeType != ChallengeType.CVV) ? 0 : 4
        };
        UniversalInputManager.Get().UseTextInput(parms, false);
    }
コード例 #6
0
    private void ShowInput()
    {
        this.m_quantityText.gameObject.SetActive(false);
        Camera camera = CameraUtils.FindFirstByLayer(base.gameObject.layer);
        Bounds bounds = this.m_quantityText.GetBounds();
        Rect   rect   = CameraUtils.CreateGUIViewportRect(camera, bounds.min, bounds.max);

        UniversalInputManager.TextInputParams parms = new UniversalInputManager.TextInputParams {
            m_owner                        = base.gameObject,
            m_number                       = true,
            m_rect                         = rect,
            m_updatedCallback              = new UniversalInputManager.TextInputUpdatedCallback(this.OnInputUpdated),
            m_completedCallback            = new UniversalInputManager.TextInputCompletedCallback(this.OnInputComplete),
            m_canceledCallback             = new UniversalInputManager.TextInputCanceledCallback(this.OnInputCanceled),
            m_font                         = this.m_quantityText.GetLocalizedFont(),
            m_alignment                    = 4,
            m_maxCharacters                = 2,
            m_touchScreenKeyboardHideInput = true
        };
        UniversalInputManager.Get().UseTextInput(parms, false);
    }