private void InitAndShow(ShowRequestData showRequestData) { OverlayUI.Get().AddGameObject(base.gameObject, CanvasAnchor.CENTER, false, CanvasScaleMode.HEIGHT); this.m_showRequestData = showRequestData; if ((AchieveManager.Get().GetActiveQuests(false).Count < 1) && (!InnKeepersSpecial.Get().LoadedSuccessfully() || InnKeepersSpecial.Get().HasAlreadySeenResponse())) { this.Close(); } else { this.m_clickCatcher.gameObject.SetActive(true); this.m_clickCatcher.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.CloseWelcomeQuests)); this.ShowActiveQuests(); this.FadeEffectsIn(); base.transform.localScale = new Vector3(0.001f, 0.001f, 0.001f); iTween.ScaleTo(base.gameObject, this.m_originalScale, 0.5f); int val = Options.Get().GetInt(Option.IKS_VIEWS, 0) + 1; Options.Get().SetInt(Option.IKS_VIEWS, val); if ((showRequestData.m_fromLogin && InnKeepersSpecial.Get().LoadedSuccessfully()) && (val > 3)) { if (UniversalInputManager.UsePhoneUI != null) { Vector3 localPosition = base.transform.localPosition; localPosition.y += 2f; base.transform.localPosition = localPosition; } InnKeepersSpecial.Get().Show(true); } Navigation.PushUnique(new Navigation.NavigateBackHandler(WelcomeQuests.OnNavigateBack)); } }
private static void OnWelcomeQuestsLoaded(string name, GameObject go, object callbackData) { if ((SceneMgr.Get() != null) && SceneMgr.Get().IsInGame()) { if (s_instance != null) { s_instance.Close(); } } else if (go == null) { Debug.LogError(string.Format("WelcomeQuests.OnWelcomeQuestsLoaded() - FAILED to load \"{0}\"", name)); } else { s_instance = go.GetComponent <WelcomeQuests>(); if (s_instance == null) { Debug.LogError(string.Format("WelcomeQuests.OnWelcomeQuestsLoaded() - ERROR object \"{0}\" has no WelcomeQuests component", name)); } else { ShowRequestData showRequestData = callbackData as ShowRequestData; s_instance.InitAndShow(showRequestData); } } }
public static void Show(bool fromLogin, DelOnWelcomeQuestsClosed onCloseCallback = null, bool keepRichPresence = false) { Enum[] args = new Enum[] { PresenceStatus.WELCOMEQUESTS }; PresenceMgr.Get().SetStatus(args); ShowRequestData showRequestData = new ShowRequestData { m_fromLogin = fromLogin, m_onCloseCallback = onCloseCallback, m_keepRichPresence = keepRichPresence }; if (s_instance != null) { Debug.LogWarning("WelcomeQuests.Show(): requested to show welcome quests while it was already active!"); s_instance.InitAndShow(showRequestData); } else { AssetLoader.Get().LoadGameObject("WelcomeQuests", new AssetLoader.GameObjectCallback(WelcomeQuests.OnWelcomeQuestsLoaded), showRequestData, false); } }
public void InitAndShow(ShowRequestData showRequestData) { object[] objArray1 = new object[] { showRequestData }; base.method_8("InitAndShow", objArray1); }