public static SectionParam GetHomeWorld() { GameManager instance = MonoSingleton <GameManager> .Instance; SectionParam sectionParam = (SectionParam)null; if (!string.IsNullOrEmpty((string)GlobalVars.SelectedSection)) { sectionParam = instance.FindWorld((string)GlobalVars.SelectedSection); if (sectionParam != null && (string.IsNullOrEmpty(sectionParam.home) || sectionParam.hidden)) { sectionParam = (SectionParam)null; } } if (sectionParam == null) { QuestParam lastStoryQuest = instance.Player.FindLastStoryQuest(); if (lastStoryQuest != null) { ChapterParam area = instance.FindArea(lastStoryQuest.ChapterID); if (area != null) { sectionParam = instance.FindWorld(area.section); } } } return(sectionParam); }
public override void OnActivate(int pinID) { if (pinID != 0) { return; } SectionParam currentSectionParam = MonoSingleton <GameManager> .Instance.GetCurrentSectionParam(); string name = (string)null; if (this.Type == FlowNode_LoadShopBG.PrefabType.DirectResourcePath) { name = this.TypeString; } else if (currentSectionParam != null) { if (this.Type == FlowNode_LoadShopBG.PrefabType.SectionParamBar) { name = currentSectionParam.bar; } else if (this.Type == FlowNode_LoadShopBG.PrefabType.SectionParamShop) { name = currentSectionParam.shop; } else if (this.Type == FlowNode_LoadShopBG.PrefabType.SectionParamInn) { name = currentSectionParam.inn; } else if (this.Type == FlowNode_LoadShopBG.PrefabType.SectionParamMemberName) { FieldInfo field = currentSectionParam.GetType().GetField(this.TypeString); if ((object)field != null && (object)field.FieldType == (object)typeof(string)) { name = (string)field.GetValue((object)currentSectionParam); } } } if (name != null && !string.IsNullOrEmpty(this.BasePath)) { name = this.BasePath + "/" + name; } if (name != null && Object.op_Inequality((Object)this.Parent, (Object)null)) { GameObject gameObject1 = AssetManager.Load <GameObject>(name); if (Object.op_Inequality((Object)gameObject1, (Object)null)) { GameObject gameObject2 = (GameObject)Object.Instantiate <GameObject>((M0)gameObject1); if (Object.op_Inequality((Object)gameObject2, (Object)null)) { gameObject2.get_transform().SetParent(this.Parent, this.WorldPositionStays); } } } this.ActivateOutputLinks(1); }
public override void OnActivate(int pinID) { if (pinID != 100 || ((Behaviour)this).get_enabled()) { return; } string str = (string)null; switch (this.SceneType) { case FlowNode_LoadScene.SceneTypes.HomeTown: SectionParam homeWorld = HomeUnitController.GetHomeWorld(); if (homeWorld != null) { str = homeWorld.home; break; } break; case FlowNode_LoadScene.SceneTypes.BootScene: FlowNode_LoadScene.LoadBootScene(); this.ActivateOutputLinks(21); return; default: str = this.SceneName; break; } if (string.IsNullOrEmpty(str)) { DebugUtility.LogError("No Scene to load"); } else { ((Behaviour)this).set_enabled(true); CriticalSection.Enter(CriticalSections.SceneChange); this.ActivateOutputLinks(20); DebugUtility.Log("LoadScene [" + str + "]"); if (AssetManager.IsAssetBundle(str)) { this.StartCoroutine(this.PreLoadSceneAsync(str)); } else { this.StartSceneLoad(str); } } }
protected override void Start() { CriticalSection.Enter(CriticalSections.SceneChange); SectionParam homeWorld = HomeUnitController.GetHomeWorld(); if (homeWorld == null) { Debug.LogError((object)"home world is null."); } else { UnitData unitDataByUnitId = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUnitID(homeWorld.unit); if (unitDataByUnitId == null) { Debug.LogError((object)("ホーム画面用ユニットが存在しません '" + homeWorld.unit + "'")); } else { this.SetupUnit(unitDataByUnitId, -1); base.Start(); } } }
private void Refresh() { GameUtility.DestroyGameObjects <ListItemEvents>(this.mItems); if (Object.op_Equality((Object)this.ItemTemplate, (Object)null) || Object.op_Equality((Object)this.ItemContainer, (Object)null)) { return; } GameManager instance = MonoSingleton <GameManager> .Instance; PlayerData player = instance.Player; SectionParam[] sections = instance.Sections; List <string> stringList1 = new List <string>(); List <string> stringList2 = new List <string>(); long serverTime = Network.GetServerTime(); QuestParam[] availableQuests = player.AvailableQuests; for (int index = 0; index < availableQuests.Length; ++index) { if (!string.IsNullOrEmpty(availableQuests[index].ChapterID) && !stringList1.Contains(availableQuests[index].ChapterID) && (!availableQuests[index].IsMulti && availableQuests[index].IsDateUnlock(serverTime))) { stringList1.Add(availableQuests[index].ChapterID); } } for (int index = 0; index < stringList1.Count; ++index) { ChapterParam area = instance.FindArea(stringList1[index]); if (area != null && !stringList2.Contains(area.section)) { stringList2.Add(area.section); } } for (int index = 0; index < sections.Length; ++index) { SectionParam sectionParam = sections[index]; if (sections[index].IsDateUnlock() && stringList2.Contains(sections[index].iname)) { ListItemEvents listItemEvents1 = (ListItemEvents)null; if (!string.IsNullOrEmpty(sectionParam.prefabPath)) { StringBuilder stringBuilder = GameUtility.GetStringBuilder(); stringBuilder.Append("QuestSections/"); stringBuilder.Append(sectionParam.prefabPath); listItemEvents1 = AssetManager.Load <ListItemEvents>(stringBuilder.ToString()); } if (Object.op_Equality((Object)listItemEvents1, (Object)null)) { listItemEvents1 = this.ItemTemplate; } ListItemEvents listItemEvents2 = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)listItemEvents1); DataSource.Bind <UIQuestSectionData>(((Component)listItemEvents2).get_gameObject(), new UIQuestSectionData(sections[index])); ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false); ((Component)listItemEvents2).get_gameObject().SetActive(true); listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnItemSelect); SGWorldBannerItem component = (SGWorldBannerItem)((Component)listItemEvents2).GetComponent <SGWorldBannerItem>(); if (Object.op_Inequality((Object)component, (Object)null)) { ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter); if (area != null && area.section == sections[index].iname) { component.SetChapterText(area.name); this.currentSectionID = index; } } this.mItems.Add(listItemEvents2); } } }
private void Refresh() { if (this.isRefreshed) { return; } this.isRefreshed = true; GameUtility.DestroyGameObjects <ListItemEvents>(this.mItems); this.mItems.Clear(); if (Object.op_Equality((Object)this.ItemTemplate, (Object)null) || Object.op_Equality((Object)this.ItemContainer, (Object)null)) { return; } GameManager instance = MonoSingleton <GameManager> .Instance; SectionParam[] sections = instance.Sections; List <string> stringList1 = new List <string>(); List <string> stringList2 = new List <string>(); long serverTime = Network.GetServerTime(); foreach (QuestParam availableQuest in instance.Player.AvailableQuests) { if (!string.IsNullOrEmpty(availableQuest.ChapterID) && !availableQuest.IsMulti && (availableQuest.IsReplayDateUnlock(serverTime) && !stringList1.Contains(availableQuest.ChapterID)) && ((!string.IsNullOrEmpty(availableQuest.event_start) || !string.IsNullOrEmpty(availableQuest.event_clear)) && (availableQuest.state == QuestStates.Challenged || availableQuest.state == QuestStates.Cleared))) { stringList1.Add(availableQuest.ChapterID); } } for (int index = 0; index < stringList1.Count; ++index) { ChapterParam area = instance.FindArea(stringList1[index]); if (area != null && !stringList2.Contains(area.section) && (area.section != "WD_DAILY" && area.section != "WD_CHARA")) { stringList2.Add(area.section); } } for (int index = 0; index < sections.Length; ++index) { SectionParam sectionParam = sections[index]; if (stringList2.Contains(sections[index].iname)) { ListItemEvents listItemEvents1 = (ListItemEvents)null; if (!string.IsNullOrEmpty(sectionParam.prefabPath)) { StringBuilder stringBuilder = GameUtility.GetStringBuilder(); stringBuilder.Append("QuestSections/"); stringBuilder.Append(sectionParam.prefabPath); listItemEvents1 = AssetManager.Load <ListItemEvents>(stringBuilder.ToString()); } if (Object.op_Equality((Object)listItemEvents1, (Object)null)) { listItemEvents1 = this.ItemTemplate; } ListItemEvents listItemEvents2 = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)listItemEvents1); DataSource.Bind <UIQuestSectionData>(((Component)listItemEvents2).get_gameObject(), new UIQuestSectionData(sections[index])); ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false); ((Component)listItemEvents2).get_gameObject().SetActive(true); listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnItemSelect); this.mItems.Add(listItemEvents2); } } if (Object.op_Inequality((Object)this.ScrollRect, (Object)null)) { this.ScrollRect.set_normalizedPosition(Vector2.get_one()); } if (this.mItems.Count > 0) { FlowNode_GameObject.ActivateOutputLinks((Component)this, 10); } else { FlowNode_GameObject.ActivateOutputLinks((Component)this, 11); } }
public void Activated(int pinID) { if (99 <= pinID && pinID < 122) { TrophyState[] trophyStates = MonoSingleton <GameManager> .Instance.Player.TrophyStates; if (trophyStates != null) { for (int index = 0; index < trophyStates.Length; ++index) { if (trophyStates[index].IsCompleted) { TrophyParam trophy = MonoSingleton <GameManager> .Instance.MasterParam.GetTrophy(trophyStates[index].iname); if (trophy != null) { GameCenterManager.SendAchievementProgress(trophy.iname); } } } } if (this.mDesirdSceneSet) { return; } // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type HomeWindow.\u003CActivated\u003Ec__AnonStorey251 activatedCAnonStorey251 = new HomeWindow.\u003CActivated\u003Ec__AnonStorey251(); // ISSUE: reference to a compiler-generated field activatedCAnonStorey251.desiredSceneName = (string)null; bool flag1 = false; bool flag2 = GlobalVars.ForceSceneChange; GlobalVars.ForceSceneChange = false; if (pinID == 99) { SectionParam homeWorld = HomeUnitController.GetHomeWorld(); if (homeWorld != null) { // ISSUE: reference to a compiler-generated field activatedCAnonStorey251.desiredSceneName = homeWorld.home; flag1 = true; } } else { // ISSUE: reference to a compiler-generated field activatedCAnonStorey251.desiredSceneName = this.SceneNames[pinID - 100]; // ISSUE: reference to a compiler-generated field if (activatedCAnonStorey251.desiredSceneName == "world001") { // ISSUE: reference to a compiler-generated field activatedCAnonStorey251.desiredSceneName = "world001_sg"; } } // ISSUE: reference to a compiler-generated method if (Array.FindIndex <string>(this.IgnoreSameSceneCheck, new Predicate <string>(activatedCAnonStorey251.\u003C\u003Em__29C)) != -1) { flag2 = true; } // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field if (string.IsNullOrEmpty(activatedCAnonStorey251.desiredSceneName) || !flag2 && !(this.mLastSceneName != activatedCAnonStorey251.desiredSceneName) || !MonoSingleton <GameManager> .Instance.PrepareSceneChange()) { return; } this.mDesirdSceneSet = true; // ISSUE: reference to a compiler-generated field this.mDesiredSceneName = activatedCAnonStorey251.desiredSceneName; this.mDesiredSceneIsHome = flag1; if ((MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) == 0L) { GameManager instance = MonoSingleton <GameManager> .Instance; if (!this.mDesiredSceneIsHome) { // ISSUE: reference to a compiler-generated field if (activatedCAnonStorey251.desiredSceneName == "Home_Gacha") { if (instance.GetNextTutorialStep() != "ShowSummonButton") { this.mDesirdSceneSet = false; } } else { // ISSUE: reference to a compiler-generated field if (activatedCAnonStorey251.desiredSceneName == "Home_UnitList") { if (instance.GetNextTutorialStep() != "ShowUnitButton") { this.mDesirdSceneSet = false; } } else { // ISSUE: reference to a compiler-generated field if (activatedCAnonStorey251.desiredSceneName == "world001_sg") { if (instance.GetNextTutorialStep() != "ShowStoryButton") { this.mDesirdSceneSet = false; } } else { this.mDesirdSceneSet = false; return; } } } } } this.mIgnorePopups = !this.mDesiredSceneIsHome; if (!this.mDesiredSceneIsHome) { return; } FlowNode_PlayBGM.PlayHomeBGM(); } else { switch (pinID) { case 12: this.mFadingOut = false; break; case 30: if (this.RestoreScenes == null) { break; } GlobalVars.IsTutorialEnd = true; if (HomeWindow.mRestorePoint != RestorePoints.Home) { if (!this.IsNotHomeBGM()) { FlowNode_PlayBGM.PlayHomeBGM(); } for (int index = 0; index < this.RestoreScenes.Length; ++index) { if (this.RestoreScenes[index].Type == HomeWindow.mRestorePoint) { this.Activated(100 + this.RestoreScenes[index].Index); return; } } } this.Activated(99); break; case 1002: this.mStateMachine.GotoState <HomeWindow.State_Tutorial>(); break; } } }
private void Initialize(QuestBookmarkWindow.JSON_Item[] bookmarkItems) { GameManager instance = MonoSingleton <GameManager> .Instance; PlayerData player = instance.Player; SectionParam[] sections = instance.Sections; List <string> stringList1 = new List <string>(); List <string> stringList2 = new List <string>(); long serverTime = Network.GetServerTime(); foreach (QuestParam availableQuest in player.AvailableQuests) { if (this.IsAvailableQuest(availableQuest, serverTime) && !stringList1.Contains(availableQuest.ChapterID)) { stringList1.Add(availableQuest.ChapterID); } } using (List <string> .Enumerator enumerator = stringList1.GetEnumerator()) { while (enumerator.MoveNext()) { string current = enumerator.Current; ChapterParam area = instance.FindArea(current); if (area != null && !stringList2.Contains(area.section)) { stringList2.Add(area.section); } } } this.mAvailableSections = stringList2.ToArray(); Dictionary <string, List <QuestParam> > dictionary = new Dictionary <string, List <QuestParam> >(); foreach (QuestParam questParam in ((IEnumerable <QuestParam>)MonoSingleton <GameManager> .Instance.Quests).Where <QuestParam>((Func <QuestParam, bool>)(q => q.type == QuestTypes.Free))) { List <QuestParam> questParamList; if (!dictionary.TryGetValue(questParam.world, out questParamList)) { questParamList = new List <QuestParam>(); dictionary[questParam.world] = questParamList; } questParamList.Add(questParam); } int index1 = 0; if (bookmarkItems != null && bookmarkItems.Length > 0) { foreach (QuestBookmarkWindow.JSON_Item bookmarkItem in bookmarkItems) { ItemParam itemParam = MonoSingleton <GameManager> .Instance.MasterParam.GetItemParam(bookmarkItem.iname); List <QuestParam> itemDropQuestList = QuestDropParam.Instance.GetItemDropQuestList(itemParam, GlobalVars.GetDropTableGeneratedDateTime()); this.mBookmarkedPiecesOrigin.Add(new QuestBookmarkWindow.ItemAndQuests() { itemName = itemParam.iname, quests = itemDropQuestList }); } this.mBookmarkedPieces = this.mBookmarkedPiecesOrigin.ToList <QuestBookmarkWindow.ItemAndQuests>(); } this.mSectionToPieces[this.BookmarkSectionName] = this.mBookmarkedPieces; if (index1 < this.ButtonSections.Length) { DataSource.Bind <string>(((Component)this.ButtonSections[index1]).get_gameObject(), this.BookmarkSectionName); } int index2; for (index2 = index1 + 1; index2 < this.ButtonSections.Length; ++index2) { if (index2 - 1 < sections.Length) { SectionParam sectionParam = sections[index2 - 1]; if (sectionParam.IsDateUnlock() && stringList2.Contains(sectionParam.iname)) { SRPG_Button buttonSection = this.ButtonSections[index2]; DataSource.Bind <string>(((Component)buttonSection).get_gameObject(), sectionParam.iname); ((BookmarkToggleButton)((Component)buttonSection).GetComponent <BookmarkToggleButton>()).EnableShadow(false); List <QuestParam> questParamList1 = dictionary[sectionParam.iname]; OrderedDictionary source = new OrderedDictionary(); using (List <QuestParam> .Enumerator enumerator = questParamList1.GetEnumerator()) { while (enumerator.MoveNext()) { QuestParam current = enumerator.Current; ItemParam hardDropPiece = QuestDropParam.Instance.GetHardDropPiece(current.iname, GlobalVars.GetDropTableGeneratedDateTime()); List <QuestParam> questParamList2; if (source.Contains((object)hardDropPiece.iname)) { questParamList2 = source[(object)hardDropPiece.iname] as List <QuestParam>; } else { questParamList2 = new List <QuestParam>(); source[(object)hardDropPiece.iname] = (object)questParamList2; } questParamList2.Add(current); } } this.mSectionToPieces[sectionParam.iname] = source.Cast <DictionaryEntry>().Select <DictionaryEntry, QuestBookmarkWindow.ItemAndQuests>((Func <DictionaryEntry, QuestBookmarkWindow.ItemAndQuests>)(kv => new QuestBookmarkWindow.ItemAndQuests() { itemName = kv.Key as string, quests = kv.Value as List <QuestParam> })).ToList <QuestBookmarkWindow.ItemAndQuests>(); } else { ((BookmarkToggleButton)((Component)this.ButtonSections[index2]).GetComponent <BookmarkToggleButton>()).EnableShadow(true); } } else { ((BookmarkToggleButton)((Component)this.ButtonSections[index2]).GetComponent <BookmarkToggleButton>()).EnableShadow(true); } } foreach (SectionParam sectionParam in sections) { if (sectionParam.IsDateUnlock() && stringList2.Contains(sectionParam.iname) && index2 < this.ButtonSections.Length) { DataSource.Bind <string>(((Component)this.ButtonSections[index2]).get_gameObject(), sectionParam.iname); List <QuestParam> questParamList1 = dictionary[sectionParam.iname]; OrderedDictionary source = new OrderedDictionary(); using (List <QuestParam> .Enumerator enumerator = questParamList1.GetEnumerator()) { while (enumerator.MoveNext()) { QuestParam current = enumerator.Current; ItemParam hardDropPiece = QuestDropParam.Instance.GetHardDropPiece(current.iname, GlobalVars.GetDropTableGeneratedDateTime()); List <QuestParam> questParamList2; if (source.Contains((object)hardDropPiece.iname)) { questParamList2 = source[(object)hardDropPiece.iname] as List <QuestParam>; } else { questParamList2 = new List <QuestParam>(); source[(object)hardDropPiece.iname] = (object)questParamList2; } questParamList2.Add(current); } } this.mSectionToPieces[sectionParam.iname] = source.Cast <DictionaryEntry>().Select <DictionaryEntry, QuestBookmarkWindow.ItemAndQuests>((Func <DictionaryEntry, QuestBookmarkWindow.ItemAndQuests>)(kv => new QuestBookmarkWindow.ItemAndQuests() { itemName = kv.Key as string, quests = kv.Value as List <QuestParam> })).ToList <QuestBookmarkWindow.ItemAndQuests>(); } } foreach (SRPG_Button buttonSection in this.ButtonSections) { buttonSection.AddListener(new SRPG_Button.ButtonClickEvent(this.OnSectionSelect)); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TitleText, (UnityEngine.Object)null)) { this.TitleText.set_text(LocalizedText.Get(this.BookmarkTitle)); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DescriptionText, (UnityEngine.Object)null)) { this.DescriptionText.set_text(LocalizedText.Get(this.BookmarkDescription)); } this.RefreshSection(0); }
public void Activated(int pinID) { if (99 <= pinID && pinID < 129) { if (this.mDesirdSceneSet) { return; } string desiredSceneName = (string)null; bool flag1 = false; bool flag2 = GlobalVars.ForceSceneChange; GlobalVars.ForceSceneChange = false; if (pinID == 99) { SectionParam homeWorld = HomeUnitController.GetHomeWorld(); if (homeWorld != null) { desiredSceneName = homeWorld.home; flag1 = true; } } else { desiredSceneName = this.SceneNames[pinID - 100]; } if (Array.FindIndex <string>(this.IgnoreSameSceneCheck, (Predicate <string>)(scene => scene.Equals(desiredSceneName))) != -1) { flag2 = true; } if (!string.IsNullOrEmpty(desiredSceneName) && (flag2 || this.mLastSceneName != desiredSceneName)) { if (!MonoSingleton <GameManager> .Instance.PrepareSceneChange()) { return; } this.SceneChangeSendLog(this.mDesiredSceneName, desiredSceneName); this.mDesirdSceneSet = true; this.mDesiredSceneName = desiredSceneName; this.mDesiredSceneIsHome = flag1; this.mIgnorePopups = !this.mDesiredSceneIsHome; GlobalVars.SetDropTableGeneratedTime(); } else { if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)GameObject.Find("EventQuest"), (UnityEngine.Object)null)) { return; } GlobalEvent.Invoke("UPDATE_EVENT_LIST", (object)this); } } else { switch (pinID) { case 12: this.mFadingOut = false; break; case 30: if (this.RestoreScenes == null) { break; } GlobalVars.IsTutorialEnd = true; if (HomeWindow.mRestorePoint != RestorePoints.Home) { if (!this.IsNotHomeBGM()) { FlowNode_PlayBGM.PlayHomeBGM(); } for (int index = 0; index < this.RestoreScenes.Length; ++index) { if (this.RestoreScenes[index].Type == HomeWindow.mRestorePoint) { this.Activated(100 + this.RestoreScenes[index].Index); return; } } } this.Activated(99); break; case 1001: this.mRankmatchRewarded = true; break; case 2001: HomeWindow.BeginnerNotified = true; break; } } }