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()); }
private void OnRadioButtonReleased(UIEvent e) { RadioButton element = e.GetElement() as RadioButton; if (element == null) { Debug.LogWarning(string.Format("RadioButtonGroup.OnRadioButtonReleased(): UIEvent {0} source is not a RadioButton!", e)); } else { bool flag = element.IsSelected(); foreach (FramedRadioButton button2 in this.m_framedRadioButtons) { RadioButton radioButton = button2.m_radioButton; bool selected = element == radioButton; radioButton.SetSelected(selected); } if (this.m_buttonSelectedCB != null) { this.m_buttonSelectedCB(element.GetButtonID(), element.GetUserData()); if (UniversalInputManager.Get().IsTouchMode() && flag) { this.OnRadioButtonDoubleClicked(e); } } } }
private void SetupRarity() { GameObject obj2 = UnityEngine.Object.Instantiate <GameObject>(this.m_rarityInfo.gameObject); if (obj2 != null) { obj2.transform.parent = this.m_CardParent.transform; this.m_rarityInfo = obj2.GetComponent <PackOpeningCardRarityInfo>(); this.m_rarityInfo.m_RarityObject.SetActive(true); this.m_rarityInfo.m_HiddenCardObject.SetActive(true); Vector3 localPosition = this.m_rarityInfo.m_HiddenCardObject.transform.localPosition; this.m_rarityInfo.m_HiddenCardObject.transform.parent = this.m_CardParent.transform; this.m_rarityInfo.m_HiddenCardObject.transform.localPosition = localPosition; this.m_rarityInfo.m_HiddenCardObject.transform.localRotation = Quaternion.identity; this.m_rarityInfo.m_HiddenCardObject.transform.localScale = new Vector3(7.646f, 7.646f, 7.646f); TransformUtil.AttachAndPreserveLocalTransform(this.m_rarityInfo.m_RarityObject.transform, this.m_CardParent.transform); this.m_spell = this.m_rarityInfo.m_RarityObject.GetComponent <Spell>(); this.m_revealButton = this.m_rarityInfo.m_RarityObject.GetComponent <PegUIElement>(); if (UniversalInputManager.Get().IsTouchMode()) { this.m_revealButton.SetReceiveReleaseWithoutMouseDown(true); } this.m_SharedHiddenCardObject.transform.parent = this.m_rarityInfo.m_HiddenCardObject.transform; TransformUtil.Identity(this.m_SharedHiddenCardObject.transform); } }
public KeywordHelpPanel ShowTooltip(string headline, string bodytext, float scale, bool enablePhoneScale = true) { if (this.m_tooltip != null) { return(this.m_tooltip.GetComponent <KeywordHelpPanel>()); } if ((UniversalInputManager.UsePhoneUI != null) && enablePhoneScale) { scale *= 2f; } this.m_tooltip = UnityEngine.Object.Instantiate <GameObject>(this.tooltipPrefab); KeywordHelpPanel component = this.m_tooltip.GetComponent <KeywordHelpPanel>(); component.Reset(); component.Initialize(headline, bodytext); component.SetScale(scale); if (UniversalInputManager.Get().IsTouchMode() && (this.touchTooltipLocation != null)) { component.transform.position = this.touchTooltipLocation.position; component.transform.rotation = this.touchTooltipLocation.rotation; } else if (this.tooltipDisplayLocation != null) { component.transform.position = this.tooltipDisplayLocation.position; component.transform.rotation = this.tooltipDisplayLocation.rotation; } component.transform.parent = base.transform; return(component); }
private void OnDestroy() { if (UniversalInputManager.Get() != null) { UniversalInputManager.Get().SetSystemDialogActive(false); } }
private void OnClosePressed(UIEvent e) { if (UniversalInputManager.Get().IsTouchMode()) { Navigation.GoBack(); } }
private void OnHeroPowerActorLoaded(string actorName, GameObject actorObject, object callbackData) { if (actorObject == null) { UnityEngine.Debug.LogWarning(string.Format("CollectionDeckInfo.OnHeroPowerActorLoaded() - FAILED to load actor \"{0}\"", actorName)); } else { this.m_heroPowerActor = actorObject.GetComponent <Actor>(); if (this.m_heroPowerActor == null) { UnityEngine.Debug.LogWarning(string.Format("CollectionDeckInfo.OnHeroPowerActorLoaded() - ERROR actor \"{0}\" has no Actor component", actorName)); } else { this.m_heroPowerActor.SetUnlit(); this.m_heroPowerActor.transform.parent = this.m_heroPowerParent.transform; this.m_heroPowerActor.transform.localScale = Vector3.one; this.m_heroPowerActor.transform.localPosition = Vector3.zero; if (UniversalInputManager.Get().IsTouchMode()) { this.m_heroPowerActor.TurnOffCollider(); } } } }
private void HandleHits() { if ((UniversalInputManager.Get().GetMouseButtonUp(0) && this.IsOver(this.m_Triangle)) && !this.m_isAnimating) { base.StartCoroutine(this.RingTheBell()); } }
private void OnEnable() { if ((!this.m_DisableOnMobile || !UniversalInputManager.Get().IsTouchMode()) && this.m_PlayOnAwake) { this.PlayAnimation(); } }
private bool CheckSwipe() { SWIPE_DIRECTION rIGHT; float f = this.m_swipeStart.x - UniversalInputManager.Get().GetMousePosition().x; float num2 = 0.09f + ((this.m_swipeElement == null) ? 0f : 0.035f); float num3 = Screen.width * num2; if (Mathf.Abs(f) <= num3) { return(false); } if (f < 0f) { rIGHT = SWIPE_DIRECTION.RIGHT; } else { rIGHT = SWIPE_DIRECTION.LEFT; } if (m_swipeListener != null) { m_swipeListener(rIGHT); } return(true); }
private void OnDestroy() { if (UniversalInputManager.Get() != null) { UniversalInputManager.Get().UnregisterMouseOnOrOffScreenListener(new UniversalInputManager.MouseOnOrOffScreenCallback(this.OnMouseOnOrOffScreen)); } }
protected override void OnRelease() { if (!UniversalInputManager.Get().IsTouchMode() || ((UnityEngine.Time.realtimeSinceStartup - this.m_mouseOverTimer) < 0.4f)) { this.ChooseThisCard(); } }
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); }
private bool OnInputPreprocess(Event e) { string cheatTextBeforeScrollingThruHistory; if (e.type != EventType.KeyDown) { return(false); } KeyCode keyCode = e.keyCode; if ((keyCode == KeyCode.BackQuote) && string.IsNullOrEmpty(UniversalInputManager.Get().GetInputText())) { UniversalInputManager.Get().CancelTextInput(base.gameObject, false); return(true); } if (this.m_cheatHistory.Count < 1) { return(false); } if (keyCode == KeyCode.UpArrow) { if (this.m_cheatHistoryIndex < (this.m_cheatHistory.Count - 1)) { string inputText = UniversalInputManager.Get().GetInputText(); if (this.m_cheatTextBeforeScrollingThruHistory == null) { this.m_cheatTextBeforeScrollingThruHistory = inputText; } string text = this.m_cheatHistory[++this.m_cheatHistoryIndex]; UniversalInputManager.Get().SetInputText(text); if (< > f__am$cacheB == null) {
private bool UpdateMouseLeftClick() { bool flag = false; if (UniversalInputManager.Get().GetMouseButtonDown(0)) { flag = true; if (this.m_currentElement.GetCursorDown() != PegCursor.Mode.NONE) { PegCursor.Get().SetMode(this.m_currentElement.GetCursorDown()); } else { PegCursor.Get().SetMode(PegCursor.Mode.DOWN); } if (UniversalInputManager.Get().IsTouchMode() && this.m_currentElement.GetReceiveOverWithMouseDown()) { this.m_currentElement.TriggerOver(); } this.m_currentElement.TriggerPress(); this.m_lastClickPosition = UniversalInputManager.Get().GetMousePosition(); this.m_mouseDownElement = this.m_currentElement; } if (UniversalInputManager.Get().GetMouseButtonUp(0)) { flag = true; if (((this.m_lastClickTimer > 0f) && (this.m_lastClickTimer <= 0.7f)) && this.m_currentElement.GetDoubleClickEnabled()) { this.m_currentElement.TriggerDoubleClick(); this.m_lastClickTimer = -1f; } else { if ((this.m_mouseDownElement == this.m_currentElement) || this.m_currentElement.GetReceiveReleaseWithoutMouseDown()) { this.m_currentElement.TriggerRelease(); } if (this.m_currentElement.GetReceiveOverWithMouseDown()) { this.m_currentElement.TriggerOut(); } if (this.m_mouseDownElement != null) { this.m_lastClickTimer = 0f; this.m_mouseDownElement.TriggerReleaseAll(this.m_currentElement == this.m_mouseDownElement); this.m_mouseDownElement = null; } } if (this.m_currentElement.GetCursorOver() != PegCursor.Mode.NONE) { PegCursor.Get().SetMode(this.m_currentElement.GetCursorOver()); } else { PegCursor.Get().SetMode(PegCursor.Mode.OVER); } this.m_lastClickPosition = Vector3.zero; } return(flag); }
private void HandleRotation() { if (!this.m_leverEffectsActive) { this.m_requestedRotationDir = 0; if (UniversalInputManager.Get().GetMouseButton(0)) { if (this.IsOver(this.m_RotateLeftButton)) { this.m_requestedRotationDir = -1; } else if (this.IsOver(this.m_RotateRightButton)) { this.m_requestedRotationDir = 1; } } if (this.ShouldStartRotating()) { this.StartRotating(this.m_requestedRotationDir); } if (this.m_rotationDir < 0) { this.RotateLeft(); } else if (this.m_rotationDir > 0) { this.RotateRight(); } } }
public void StopAnimation() { if (!this.m_DisableOnMobile || !UniversalInputManager.Get().IsTouchMode()) { this.m_Play = false; } }
private void Update() { if (this.IsDragging() && UniversalInputManager.Get().GetMouseButtonUp(0)) { this.StopDragging(); } }
private void HandleLever() { if (((this.m_rotationDir == 0) && !this.m_leverEffectsActive) && (UniversalInputManager.Get().GetMouseButtonUp(0) && this.IsOver(this.m_GunLever))) { this.PullLever(); } }
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); }
public static void AddFatal(ErrorParams parms) { Debug.LogError(string.Format("Error.AddFatal() - message={0}", parms.m_message)); if (UniversalInputManager.Get() != null) { UniversalInputManager.Get().CancelTextInput(null, true); } if (ShouldUseWarningDialogForFatalError()) { if (string.IsNullOrEmpty(parms.m_header)) { parms.m_header = "Fatal Error as Warning"; } ShowWarningDialog(parms); } else { parms.m_type = ErrorType.FATAL; FatalErrorMessage message = new FatalErrorMessage(); if (parms.m_header == null) { } message.m_id = string.Empty + parms.m_message; message.m_text = parms.m_message; message.m_ackCallback = parms.m_ackCallback; message.m_ackUserData = parms.m_ackUserData; message.m_allowClick = parms.m_allowClick; message.m_redirectToStore = parms.m_redirectToStore; message.m_delayBeforeNextReset = parms.m_delayBeforeNextReset; FatalErrorMgr.Get().Add(message); } }
private void Update() { if ((!this.m_DisableOnMobile || !UniversalInputManager.Get().IsTouchMode()) && (this.m_Play || (this.m_AnimationType == BLEND_SHAPE_ANIMATION_TYPE.Float))) { this.BlendShapeAnimate(); } }
public override void Show() { this.FadeEffectsIn(); base.Show(); base.DoShowAnimation(); UniversalInputManager.Get().SetGameDialogActive(true); SoundManager.Get().LoadAndPlay("rank_window_expand"); }
protected override void OnPress() { base.OnPress(); if (UniversalInputManager.Get().IsTouchMode()) { this.ShowTooltip(); } }
private void HandleRelease() { this.m_DragCollider.enabled = false; this.m_PressElement.GetComponent <Collider>().enabled = true; this.m_PressElement.RemoveEventListener(UIEventType.RELEASEALL, new UIEvent.Handler(this.OnPressElementReleaseAll)); UniversalInputManager.Get().UnregisterMouseOnOrOffScreenListener(new UniversalInputManager.MouseOnOrOffScreenCallback(this.OnMouseOnOrOffScreen)); this.m_dragging = false; }
private void Start() { this.m_Animator = base.GetComponent <Animator>(); this.m_UniversalInputManager = UniversalInputManager.Get(); this.m_ScreechSound = base.GetComponent <AudioSource>(); this.m_SnapWaitTime = UnityEngine.Random.Range((float)5f, (float)20f); this.m_Animator.SetLayerWeight(1, 1f); }
private bool HitTestEmotes(out RaycastHit hitInfo) { if (!UniversalInputManager.Get().GetInputHitInfo(GameLayer.CardRaycast.LayerBit(), out hitInfo)) { return(false); } return(this.IsMousedOverHero(hitInfo) || (this.IsMousedOverSelf(hitInfo) || this.IsMousedOverEmote(hitInfo))); }
public void PlayAnimation() { if ((((!this.m_DisableOnMobile || !UniversalInputManager.Get().IsTouchMode()) && (this.m_MeshFilter != null)) && (this.m_Meshes != null)) && (this.m_BlendMeshes != null)) { this.m_animTime = 0f; this.m_Play = true; } }
private void ClearInput() { if (this.m_isActive) { SoundManager.Get().LoadAndPlay("text_box_delete_text"); UniversalInputManager.Get().SetInputText(string.Empty); } }
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); }