private void OnTabPressed(UIEvent e) { if (this.m_tabsActive) { ManaFilterTab element = (ManaFilterTab)e.GetElement(); if ((UniversalInputManager.UsePhoneUI == null) && !Options.Get().GetBool(Option.HAS_CLICKED_MANA_TAB, false)) { Options.Get().SetBool(Option.HAS_CLICKED_MANA_TAB, true); this.ShowManaTabHint(element); } if (element.GetManaID() == this.m_currentFilterValue) { this.UpdateCurrentFilterValue(ManaFilterTab.ALL_TAB_IDX); } else { if (UniversalInputManager.UsePhoneUI != null) { Navigation.GoBack(); } this.UpdateCurrentFilterValue(element.GetManaID()); if (element.GetManaID() == ManaFilterTab.ALL_TAB_IDX) { Network.TrackClient(Network.TrackLevel.LEVEL_INFO, Network.TrackWhat.TRACK_CM_MANA_FILTER_OFF); } else { Network.TrackClient(Network.TrackLevel.LEVEL_INFO, Network.TrackWhat.TRACK_CM_MANA_FILTER_CLICKED); } } } }
private void ShowManaTabHint(ManaFilterTab tabButton) { Notification notification = NotificationManager.Get().CreatePopupText(tabButton.transform.position + new Vector3(0f, 0f, 7f), TutorialEntity.HELP_POPUP_SCALE, GameStrings.Get("GLUE_COLLECTION_MANAGER_MANA_TAB_FIRST_CLICK"), true); notification.ShowPopUpArrow(Notification.PopUpArrowDirection.Down); NotificationManager.Get().DestroyNotification(notification, 3f); }
private void CreateNewTab(ManaFilterTab tabPrefab, int index) { ManaFilterTab item = (ManaFilterTab)GameUtils.Instantiate(tabPrefab, this.m_manaCrystalContainer.gameObject, false); item.SetManaID(index); item.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnTabPressed)); item.AddEventListener(UIEventType.ROLLOVER, new UIEvent.Handler(this.OnTabMousedOver)); item.AddEventListener(UIEventType.ROLLOUT, new UIEvent.Handler(this.OnTabMousedOut)); item.SetFilterState(ManaFilterTab.FilterState.DISABLED); if (UniversalInputManager.Get().IsTouchMode()) { item.SetReceiveReleaseWithoutMouseDown(true); } this.m_tabs.Add(item); this.m_manaCrystalContainer.AddSlice(item.gameObject); }