private void HandleGUIInputActive() { if (this.m_inputActive && this.PreprocessGUITextInput()) { Vector2 screenSize = new Vector2((float)Screen.width, (float)Screen.height); Rect inputScreenRect = this.ComputeTextInputRect(screenSize); this.SetupTextInput(screenSize, inputScreenRect); string str = this.ShowTextInput(inputScreenRect); if ((this.IsTouchMode() && !W8Touch.Get().IsVirtualKeyboardVisible()) && (this.GetMouseButtonDown(0) && inputScreenRect.Contains(W8Touch.Get().GetTouchPositionForGUI()))) { W8Touch.Get().ShowKeyboard(); } this.UpdateTextInputFocus(); if (this.m_inputFocused && (this.m_inputText != str)) { if (this.m_inputNumber) { str = StringUtils.StripNonNumbers(str); } if (!this.m_inputMultiLine) { str = StringUtils.StripNewlines(str); } this.m_inputText = str; if (this.m_inputUpdatedCallback != null) { this.m_inputUpdatedCallback(str); } } } }
private void OnApplicationQuit() { UberText.StoreCachedData(); Network.AppQuit(); W8Touch.AppQuit(); this.UnloadUnusedAssets(); }
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); }
private void Awake() { s_instance = this; this.m_DisableLowQualityObjects = new List <GameObject>(); if (!Options.Get().HasOption(Option.GFX_QUALITY)) { string intelDeviceName = W8Touch.Get().GetIntelDeviceName(); object[] args = new object[] { intelDeviceName }; Log.Yim.Print("Intel Device Name = {0}", args); if (((intelDeviceName != null) && intelDeviceName.Contains("Haswell")) && intelDeviceName.Contains("U28W")) { if (Screen.currentResolution.height > 0x438) { Options.Get().SetInt(Option.GFX_QUALITY, 0); } } else if ((intelDeviceName != null) && intelDeviceName.Contains("Crystal-Well")) { Options.Get().SetInt(Option.GFX_QUALITY, 2); } else if ((intelDeviceName != null) && intelDeviceName.Contains("BayTrail")) { Options.Get().SetInt(Option.GFX_QUALITY, 0); } } this.m_GraphicsQuality = (GraphicsQuality)Options.Get().GetInt(Option.GFX_QUALITY); this.InitializeScreen(); this.UpdateQualitySettings(); this.m_lastWidth = Screen.width; this.m_lastHeight = Screen.height; }
protected override void OnPress() { W8Touch.Get().ShowKeyboard(); foreach (OnKeyboardPressed pressed in this.m_keyboardPressedListeners.ToArray()) { pressed(); } }
public Vector3 GetMousePosition() { if (this.IsTouchMode()) { return(W8Touch.Get().GetTouchPosition()); } return(Input.mousePosition); }
public bool GetMouseButtonUp(int button) { if (Get().IsTouchMode()) { return(W8Touch.Get().GetTouchUp(button)); } return(Input.GetMouseButtonUp(button)); }
private void Awake() { s_instance = this; if (this.LoadW8TouchDLL()) { s_isWindows8OrGreater = DLL_W8IsWindows8OrGreater(); } }
private void OnDestroy() { W8Touch.Get().VirtualKeyboardDidShow -= new System.Action(this.OnKeyboardShown); W8Touch.Get().VirtualKeyboardDidHide -= new System.Action(this.OnKeyboardHidden); if (UniversalInputManager.Get() != null) { UniversalInputManager.Get().CancelTextInput(base.gameObject, false); } }
private void Start() { this.m_background.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnBackgroundReleased)); this.m_clearButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnClearReleased)); W8Touch.Get().VirtualKeyboardDidShow += new System.Action(this.OnKeyboardShown); W8Touch.Get().VirtualKeyboardDidHide += new System.Action(this.OnKeyboardHidden); if (this.m_background.GetComponent <Renderer>() != null) { this.m_origSearchMaterial = this.m_background.GetComponent <Renderer>().material; } this.m_origSearchPos = base.transform.localPosition; this.UpdateSearchText(); }
private void InitializeScreen() { int @int; int num2; bool @bool = Options.Get().GetBool(Option.GFX_FULLSCREEN, Screen.fullScreen); if (@bool) { @int = Options.Get().GetInt(Option.GFX_WIDTH, Screen.currentResolution.width); num2 = Options.Get().GetInt(Option.GFX_HEIGHT, Screen.currentResolution.height); if (!Options.Get().HasOption(Option.GFX_WIDTH) || !Options.Get().HasOption(Option.GFX_HEIGHT)) { string intelDeviceName = W8Touch.Get().GetIntelDeviceName(); if (((intelDeviceName != null) && ((intelDeviceName.Contains("Haswell") && intelDeviceName.Contains("Y6W")) || (intelDeviceName.Contains("Haswell") && intelDeviceName.Contains("U15W")))) && (Screen.currentResolution.height >= 0x438)) { @int = 0x780; num2 = 0x438; } } if (((@int == Screen.currentResolution.width) && (num2 == Screen.currentResolution.height)) && (@bool == Screen.fullScreen)) { return; } } else { if (!Options.Get().HasOption(Option.GFX_WIDTH) || !Options.Get().HasOption(Option.GFX_HEIGHT)) { return; } @int = Options.Get().GetInt(Option.GFX_WIDTH); num2 = Options.Get().GetInt(Option.GFX_HEIGHT); } this.SetScreenResolution(@int, num2, @bool); if (!@bool && (Options.Get().HasOption(Option.GFX_WIN_POSX) && Options.Get().HasOption(Option.GFX_WIN_POSY))) { int x = Options.Get().GetInt(Option.GFX_WIN_POSX); int y = Options.Get().GetInt(Option.GFX_WIN_POSY); if (x < 0) { x = 0; } if (y < 0) { y = 0; } base.StartCoroutine(this.SetPos(x, y, 0.6f)); } }
private void TouchKeyboardSearchDisplay(bool fromActivate = false) { if (!this.m_isTouchKeyboardDisplayMode) { this.m_isTouchKeyboardDisplayMode = true; if (this.m_background.GetComponent <Renderer>() != null) { this.m_background.GetComponent <Renderer>().material = this.m_altSearchMaterial; } base.transform.localPosition = CollectionManagerDisplay.Get().m_activeSearchBone_Win8.transform.localPosition; this.HideInput(); this.ShowInput(fromActivate || W8Touch.Get().IsVirtualKeyboardVisible()); this.m_xMesh.GetComponent <Renderer>().material.SetColor("_Color", this.m_altSearchColor); } }
public void UseTextInput(TextInputParams parms, bool force = false) { if (force || (parms.m_owner != this.m_inputOwner)) { if ((this.m_inputOwner != null) && (this.m_inputOwner != parms.m_owner)) { this.ObjectCancelTextInput(parms.m_owner); } this.m_inputOwner = parms.m_owner; this.m_inputUpdatedCallback = parms.m_updatedCallback; this.m_inputPreprocessCallback = parms.m_preprocessCallback; this.m_inputCompletedCallback = parms.m_completedCallback; this.m_inputCanceledCallback = parms.m_canceledCallback; this.m_inputPassword = parms.m_password; this.m_inputNumber = parms.m_number; this.m_inputMultiLine = parms.m_multiLine; this.m_inputActive = true; this.m_inputFocused = false; if (parms.m_text == null) { } this.m_inputText = string.Empty; this.m_inputNormalizedRect = parms.m_rect; this.m_inputInitialScreenSize.x = Screen.width; this.m_inputInitialScreenSize.y = Screen.height; this.m_inputMaxCharacters = parms.m_maxCharacters; this.m_inputColor = parms.m_color; TextAnchor?alignment = parms.m_alignment; this.m_inputAlignment = !alignment.HasValue ? this.m_defaultInputAlignment : alignment.Value; if (parms.m_font == null) { } this.m_inputFont = this.m_defaultInputFont; this.m_inputNeedsFocus = true; this.m_inputIgnoreState = TextInputIgnoreState.INVALID; this.m_inputKeepFocusOnComplete = parms.m_inputKeepFocusOnComplete; if (this.IsTextInputPassword()) { Input.imeCompositionMode = IMECompositionMode.Off; } this.m_hideVirtualKeyboardOnComplete = parms.m_hideVirtualKeyboardOnComplete; if (Get().IsTouchMode() && parms.m_showVirtualKeyboard) { W8Touch.Get().ShowKeyboard(); } } }
private void CompleteTextInput() { if (this.IsTextInputPassword()) { Input.imeCompositionMode = IMECompositionMode.Auto; } TextInputCompletedCallback inputCompletedCallback = this.m_inputCompletedCallback; if (!this.m_inputKeepFocusOnComplete) { this.ClearTextInputVars(); } if (inputCompletedCallback != null) { inputCompletedCallback(this.m_inputText); } this.m_inputText = string.Empty; if (this.IsTouchMode() && this.m_hideVirtualKeyboardOnComplete) { W8Touch.Get().HideKeyboard(); } }
private void CancelTextInput(bool userRequested, GameObject requester) { if (this.IsTextInputPassword()) { Input.imeCompositionMode = IMECompositionMode.Auto; } if ((requester != null) && (requester == this.m_inputOwner)) { this.ClearTextInputVars(); } else { TextInputCanceledCallback inputCanceledCallback = this.m_inputCanceledCallback; this.ClearTextInputVars(); if (inputCanceledCallback != null) { inputCanceledCallback(userRequested, requester); } } if (this.IsTouchMode()) { W8Touch.Get().HideKeyboard(); } }
public void Activate(bool ignoreTouchMode = false) { if (!this.m_isActive) { this.MoveToActiveLayer(true); this.m_isActive = true; this.m_prevText = this.m_text; foreach (ActivatedListener listener in this.m_activatedListeners.ToArray()) { listener(); } if (!ignoreTouchMode && ((UniversalInputManager.Get().IsTouchMode() && W8Touch.s_isWindows8OrGreater) || W8Touch.Get().IsVirtualKeyboardVisible())) { this.TouchKeyboardSearchDisplay(true); } else { this.ShowInput(true); } } }
private Vector2 GetTouchPosition() { Vector3 touchPosition = W8Touch.Get().GetTouchPosition(); return new Vector2(touchPosition.x, touchPosition.y); }
private void ShowChatLogFrame() { this.m_chatLogFrame = UnityEngine.Object.Instantiate <ChatLogFrame>(this.m_Prefabs.m_ChatLogFrame); bool flag = base.transform.localScale == BaseUI.Get().m_Bones.m_QuickChatVirtualKeyboard.localScale; if ((((UniversalInputManager.Get().IsTouchMode() && W8Touch.s_isWindows8OrGreater) || W8Touch.Get().IsVirtualKeyboardVisible()) && flag) || flag) { this.DefaultChatTransform(); } this.m_chatLogFrame.transform.parent = base.transform; this.m_chatLogFrame.transform.position = this.m_Bones.m_ChatLog.position; if ((((UniversalInputManager.Get().IsTouchMode() && W8Touch.s_isWindows8OrGreater) || W8Touch.Get().IsVirtualKeyboardVisible()) && flag) || flag) { this.TransformChatForKeyboard(); } ChatMgr.Get().OnChatLogFrameShown(); }
private void InitTransform() { base.transform.parent = BaseUI.Get().transform; this.DefaultChatTransform(); if ((UniversalInputManager.Get().IsTouchMode() && W8Touch.s_isWindows8OrGreater) || W8Touch.Get().IsVirtualKeyboardVisible()) { this.TransformChatForKeyboard(); } }
public Transform GetQuickChatBone() { if ((!UniversalInputManager.Get().IsTouchMode() || !W8Touch.s_isWindows8OrGreater) && !W8Touch.Get().IsVirtualKeyboardVisible()) { return(this.m_Bones.m_QuickChat); } return(this.m_Bones.m_QuickChatVirtualKeyboard); }
private void Destroy() { s_instance = null; }
public void ClearFilter(bool updateVisuals = true) { this.m_text = string.Empty; this.UpdateSearchText(); this.ClearInput(); foreach (ClearedListener listener in this.m_clearedListeners.ToArray()) { listener(updateVisuals); } if ((UniversalInputManager.Get().IsTouchMode() && W8Touch.s_isWindows8OrGreater) || W8Touch.Get().IsVirtualKeyboardVisible()) { this.Deactivate(); } }
private void Layout() { base.transform.parent = BaseUI.Get().transform; base.transform.position = BaseUI.Get().GetAddFriendBone().position; if ((UniversalInputManager.Get().IsTouchMode() && W8Touch.s_isWindows8OrGreater) || W8Touch.Get().IsVirtualKeyboardVisible()) { Vector3 vector = new Vector3(base.transform.position.x, base.transform.position.y + 100f, base.transform.position.z); base.transform.position = vector; } }