public override void OnActivate(int pinID) { RankingQuestParam rankingQuestParam = GlobalVars.SelectedRankingQuestParam; if (GlobalVars.SelectedRankingQuestParam == null) { return; } QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(rankingQuestParam.iname); switch (pinID) { case 50: this.ExecRequest((WebAPI) new FlowNode_ReqQuestRanking.API_ReqQuestRanking(rankingQuestParam.schedule_id, rankingQuestParam.type, quest.iname, 0, false, new Network.ResponseCallback(this.ResponseCallback_RequestRankingTopOwn))); break; case 100: this.ExecRequest((WebAPI) new FlowNode_ReqQuestRanking.API_ReqQuestRanking(rankingQuestParam.schedule_id, rankingQuestParam.type, quest.iname, 0, false, new Network.ResponseCallback(this.ResponseCallback_RequestRankingTop))); break; case 200: this.ExecRequest((WebAPI) new FlowNode_ReqQuestRanking.API_ReqQuestRanking(rankingQuestParam.schedule_id, rankingQuestParam.type, quest.iname, 0, true, new Network.ResponseCallback(this.ResponseCallback_RequestRankingOwn))); break; } }
public static RankingQuestParam CompareOpenOrLatest(ref DateTime now, RankingQuestParam param1, RankingQuestParam param2) { long num1 = param1.scheduleParam.endAt.Ticks - now.Ticks; long num2 = param2.scheduleParam.endAt.Ticks - now.Ticks; return(!param1.scheduleParam.IsAvailablePeriod(now) ? (!param1.scheduleParam.IsAvailableVisiblePeriod(now) ? (!param2.scheduleParam.IsAvailablePeriod(now) ? (!param2.scheduleParam.IsAvailableVisiblePeriod(now) ? (num1 <= num2 ? param2 : param1) : param2) : param2) : (!param2.scheduleParam.IsAvailablePeriod(now) ? (!param2.scheduleParam.IsAvailableVisiblePeriod(now) ? param1 : (num1 <= num2 ? param2 : param1)) : param2)) : (!param2.scheduleParam.IsAvailablePeriod(now) ? param1 : (num1 >= num2 ? param2 : param1))); }
private void Refresh() { RankingQuestParam rankingQuestParam = GlobalVars.SelectedRankingQuestParam; RankingQuestUserData dataOfClass = DataSource.FindDataOfClass <RankingQuestUserData>(((Component)this).get_gameObject(), (RankingQuestUserData)null); if (Object.op_Inequality((Object)this.m_MainScoreText, (Object)null) && rankingQuestParam != null && rankingQuestParam.type == RankingQuestType.ActionCount) { this.m_MainScoreText.set_text(LocalizedText.Get("sys.RANKING_QUEST_WND_TYPE_ACTION")); } if (Object.op_Inequality((Object)this.m_MainScoreValueSuffix, (Object)null) && rankingQuestParam != null) { if (rankingQuestParam.type == RankingQuestType.ActionCount) { ((Component)this.m_MainScoreValueSuffix).get_gameObject().SetActive(true); this.m_MainScoreValueSuffix.set_text(LocalizedText.Get("sys.RANKING_QUEST_PARTY_ACTION_SUFFIX")); } else { ((Component)this.m_MainScoreValueSuffix).get_gameObject().SetActive(false); } } if (Object.op_Inequality((Object)this.m_SubScoreText, (Object)null)) { this.m_SubScoreText.set_text(LocalizedText.Get("sys.RANKING_QUEST_WND_UNIT_TOTAL")); } if (Object.op_Inequality((Object)this.m_MainScoreValue, (Object)null)) { this.m_MainScoreValue.set_text(dataOfClass.m_MainScore.ToString()); } if (!Object.op_Inequality((Object)this.m_SubScoreValue, (Object)null)) { return; } this.m_SubScoreValue.set_text(dataOfClass.m_SubScore.ToString()); }
private void RefreshItems() { Transform transform = ((Component)this).get_transform(); this.ClearItems(); if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null)) { return; } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AreaInfo, (UnityEngine.Object)null) && !string.IsNullOrEmpty((string)GlobalVars.SelectedSection)) { DataSource.Bind <ChapterParam>(this.AreaInfo, MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedSection)); } QuestParam[] array = this.mQuests.ToArray(); if (this.Descending) { Array.Reverse((Array)array); } for (int index = 0; index < array.Length; ++index) { QuestParam questParam = array[index]; if (questParam.difficulty == this.mDifficultyFilter) { GameObject gameObject1 = (GameObject)null; if (!string.IsNullOrEmpty(questParam.ItemLayout)) { gameObject1 = this.LoadQuestListItem(questParam); } if (UnityEngine.Object.op_Equality((UnityEngine.Object)gameObject1, (UnityEngine.Object)null)) { gameObject1 = questParam.difficulty != QuestDifficulties.Elite ? (questParam.difficulty != QuestDifficulties.Extra ? (!questParam.IsScenario ? (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SpecialQuestItem, (UnityEngine.Object)null) || !this.HasEliteQuest(questParam) ? (questParam.GetChallangeLimit() <= 0 ? (!questParam.IsExtra ? this.ItemTemplate : this.ExtraQuestItem) : this.EventTemplateLimit) : this.SpecialQuestItem) : this.ScenarioQuestItem) : (!questParam.CheckEnableChallange() ? this.StoryExtraQuestDisableItem : this.StoryExtraQuestItem)) : (!questParam.CheckEnableChallange() ? this.EliteQuestDisAbleItem : this.EliteQuestItem); } if (!UnityEngine.Object.op_Equality((UnityEngine.Object)gameObject1, (UnityEngine.Object)null)) { GameObject gameObject2 = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)gameObject1); ((UnityEngine.Object)gameObject2).set_hideFlags((HideFlags)52); DataSource.Bind <QuestParam>(gameObject2, questParam); RankingQuestParam availableRankingQuest = MonoSingleton <GameManager> .Instance.FindAvailableRankingQuest(questParam.iname); DataSource.Bind <RankingQuestParam>(gameObject2, availableRankingQuest); DataSource.Bind <QuestParam>(gameObject2, questParam); QuestCampaignData[] questCampaigns = MonoSingleton <GameManager> .Instance.FindQuestCampaigns(questParam); DataSource.Bind <QuestCampaignData[]>(gameObject2, questCampaigns.Length != 0 ? questCampaigns : (QuestCampaignData[])null); ListItemEvents component = (ListItemEvents)gameObject2.GetComponent <ListItemEvents>(); component.OnSelect = new ListItemEvents.ListItemEvent(this.OnSelectItem); component.OnOpenDetail = new ListItemEvents.ListItemEvent(this.OnOpenItemDetail); component.OnCloseDetail = new ListItemEvents.ListItemEvent(this.OnCloseItemDetail); gameObject2.get_transform().SetParent(transform, false); gameObject2.get_gameObject().SetActive(true); this.AddItem(component); } } } }
public void Activated(int pinID) { if (pinID != 0) { return; } RankingQuestParam dataOfClass = DataSource.FindDataOfClass <RankingQuestParam>(((Component)this).get_gameObject(), (RankingQuestParam)null); if (dataOfClass == null) { return; } GlobalVars.SelectedQuestID = dataOfClass.iname; GlobalVars.SelectedRankingQuestParam = dataOfClass; FlowNode_GameObject.ActivateOutputLinks((Component)this, 100); }
public static RankingQuestParam FindRankingQuestParam(string targetQuestID, int scheduleID, RankingQuestType type) { RankingQuestParam rankingQuestParam = (RankingQuestParam)null; GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect(); if (UnityEngine.Object.op_Equality((UnityEngine.Object)instanceDirect, (UnityEngine.Object)null) || instanceDirect.RankingQuestParams == null) { return(rankingQuestParam); } return(instanceDirect.RankingQuestParams.Find((Predicate <RankingQuestParam>)(param => { if (param.schedule_id == scheduleID && param.type == type) { return param.iname == targetQuestID; } return false; }))); }
public static List <RankingQuestParam> FilterDuplicateRankingQuestIDs(List <RankingQuestParam> list) { DateTime serverTime = TimeManager.ServerTime; List <RankingQuestParam> rankingQuestParamList = new List <RankingQuestParam>(); for (int i = 0; i < list.Count; ++i) { int index = rankingQuestParamList.FindIndex((Predicate <RankingQuestParam>)(p => p.iname == list[i].iname)); RankingQuestParam rankingQuestParam = index == -1 ? (RankingQuestParam)null : rankingQuestParamList[index]; if (rankingQuestParam != null) { rankingQuestParamList[index] = RankingQuestScheduleParam.CompareOpenOrLatest(ref serverTime, rankingQuestParam, list[i]); } else { rankingQuestParamList.Add(list[i]); } } return(rankingQuestParamList); }
public static List <RankingQuestParam> FilterDuplicateRankingQuestIDs(List <RankingQuestParam> list) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type RankingQuestScheduleParam.\u003CFilterDuplicateRankingQuestIDs\u003Ec__AnonStorey2F3 idsCAnonStorey2F3 = new RankingQuestScheduleParam.\u003CFilterDuplicateRankingQuestIDs\u003Ec__AnonStorey2F3(); // ISSUE: reference to a compiler-generated field idsCAnonStorey2F3.list = list; DateTime serverTime = TimeManager.ServerTime; List <RankingQuestParam> rankingQuestParamList = new List <RankingQuestParam>(); // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type RankingQuestScheduleParam.\u003CFilterDuplicateRankingQuestIDs\u003Ec__AnonStorey2F4 idsCAnonStorey2F4 = new RankingQuestScheduleParam.\u003CFilterDuplicateRankingQuestIDs\u003Ec__AnonStorey2F4(); // ISSUE: reference to a compiler-generated field idsCAnonStorey2F4.\u003C\u003Ef__ref\u0024755 = idsCAnonStorey2F3; // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field for (idsCAnonStorey2F4.i = 0; idsCAnonStorey2F4.i < idsCAnonStorey2F3.list.Count; ++idsCAnonStorey2F4.i) { // ISSUE: reference to a compiler-generated method int index = rankingQuestParamList.FindIndex(new Predicate <RankingQuestParam>(idsCAnonStorey2F4.\u003C\u003Em__2F5)); RankingQuestParam rankingQuestParam = index == -1 ? (RankingQuestParam)null : rankingQuestParamList[index]; if (rankingQuestParam != null) { // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field rankingQuestParamList[index] = RankingQuestScheduleParam.CompareOpenOrLatest(ref serverTime, rankingQuestParam, idsCAnonStorey2F3.list[idsCAnonStorey2F4.i]); } else { // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field rankingQuestParamList.Add(idsCAnonStorey2F3.list[idsCAnonStorey2F4.i]); } } return(rankingQuestParamList); }
public void Activated(int pinID) { if (pinID != 100) { return; } RankingQuestParam rankingQuestParam = GlobalVars.SelectedRankingQuestParam; if (GlobalVars.SelectedRankingQuestParam == null) { return; } QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(rankingQuestParam.iname); if (quest != null && Object.op_Inequality((Object)this.m_WindowTitleText, (Object)null)) { this.m_WindowTitleText.set_text(quest.name); } this.m_RankingQuestParam = rankingQuestParam; ((Behaviour)this.m_ScrollListController).set_enabled(true); this.m_TargetList.OnSetUpItems(); this.m_ScrollListController.Refresh(); FlowNode_GameObject.ActivateOutputLinks((Component)this, 200); }
public ReqBtlComReq(string iname, string fuid, SupportData support, Network.ResponseCallback response, bool multi, int partyIndex, bool isHost = false, int plid = 0, int seat = 0, [Optional] Vector2 location, RankingQuestParam rankingQuestParam = null) { StringBuilder stringBuilder = WebAPI.GetStringBuilder(); this.name = !multi ? "btl/com/req" : "btl/multi/req"; stringBuilder.Append("\"iname\":\""); stringBuilder.Append(iname); stringBuilder.Append("\","); if (partyIndex >= 0) { stringBuilder.Append("\"partyid\":"); stringBuilder.Append(partyIndex); stringBuilder.Append(","); } if (multi) { stringBuilder.Append("\"token\":\""); stringBuilder.Append(JsonEscape.Escape(GlobalVars.SelectedMultiPlayRoomName)); stringBuilder.Append("\","); stringBuilder.Append("\"host\":\""); stringBuilder.Append(!isHost ? "0" : "1"); stringBuilder.Append("\","); stringBuilder.Append("\"plid\":\""); stringBuilder.Append(plid); stringBuilder.Append("\","); stringBuilder.Append("\"seat\":\""); stringBuilder.Append(seat); stringBuilder.Append("\","); } else { stringBuilder.Append("\"req_at\":"); stringBuilder.Append(Network.GetServerTime()); stringBuilder.Append(","); } stringBuilder.Append("\"btlparam\":{\"help\":{\"fuid\":"); stringBuilder.Append("\"" + fuid + "\""); if (support != null && support.Unit != null) { stringBuilder.Append(",\"elem\":" + (object)support.Unit.SupportElement); stringBuilder.Append(",\"iname\":\"" + support.Unit.UnitID + "\""); } stringBuilder.Append("}"); if (!multi && rankingQuestParam != null) { stringBuilder.Append(",\"quest_ranking\":{"); stringBuilder.Append("\"schedule_id\":"); stringBuilder.Append(rankingQuestParam.schedule_id); stringBuilder.Append(","); stringBuilder.Append("\"type\":"); stringBuilder.Append((int)rankingQuestParam.type); stringBuilder.Append("}"); } stringBuilder.Append("},"); stringBuilder.Append("\"location\":{"); stringBuilder.Append("\"lat\":" + (object)(float)location.x + ","); stringBuilder.Append("\"lng\":" + (object)(float)location.y); stringBuilder.Append("}"); DebugMenu.Log("APIReq", stringBuilder.ToString()); this.body = WebAPI.GetRequestString(stringBuilder.ToString()); this.callback = response; }
public void UpdateValue() { RankingQuestParam dataOfClass = DataSource.FindDataOfClass <RankingQuestParam>(((Component)this).get_gameObject(), (RankingQuestParam)null); if (dataOfClass == null) { ((Component)this).get_gameObject().SetActive(false); } else { DateTime serverTime = TimeManager.ServerTime; ((Component)this).get_gameObject().SetActive(true); if (dataOfClass.scheduleParam.IsAvailablePeriod(serverTime)) { if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_PeriodStateIcon, (UnityEngine.Object)null)) { this.m_PeriodStateIcon.ImageIndex = 0; } TimeSpan timeSpan = dataOfClass.scheduleParam.endAt - serverTime; if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_Time, (UnityEngine.Object)null)) { return; } if (timeSpan.TotalDays >= 1.0) { this.m_Time.set_text(LocalizedText.Get("sys.RANKING_QUEST_QUEST_BANNER_DAY", new object[1] { (object)timeSpan.Days })); } else if (timeSpan.TotalHours >= 1.0) { this.m_Time.set_text(LocalizedText.Get("sys.RANKING_QUEST_QUEST_BANNER_HOUR", new object[1] { (object)timeSpan.Hours })); } else { this.m_Time.set_text(LocalizedText.Get("sys.RANKING_QUEST_QUEST_BANNER_MINUTE", new object[1] { (object)Mathf.Max(timeSpan.Minutes, 0) })); } ((Component)this.m_Time).get_gameObject().SetActive(true); } else if (dataOfClass.scheduleParam.IsAvailableVisiblePeriod(serverTime)) { if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_PeriodStateIcon, (UnityEngine.Object)null)) { this.m_PeriodStateIcon.ImageIndex = 2; } if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_Time, (UnityEngine.Object)null)) { return; } ((Component)this.m_Time).get_gameObject().SetActive(false); } else { ((Component)this).get_gameObject().SetActive(false); } } }
private void RefreshItems() { Transform transform = ((Component)this).get_transform(); this.ClearItems(); if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null)) { return; } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AreaInfo, (UnityEngine.Object)null) && !string.IsNullOrEmpty((string)GlobalVars.SelectedSection)) { DataSource.Bind <ChapterParam>(this.AreaInfo, MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedSection)); } QuestParam[] array = this.mQuests.ToArray(); if (this.Descending) { Array.Reverse((Array)array); } bool flag = false; GameManager instance = MonoSingleton <GameManager> .Instance; if (this.isTriggeredRefresh && (instance.Player.TutorialFlags & 1L) == 0L) { flag = instance.GetNextTutorialStep() == "ShowQuestItem"; } for (int index = 0; index < array.Length; ++index) { QuestParam questParam = array[index]; if (questParam.difficulty == this.mDifficultyFilter) { GameObject gameObject1 = (GameObject)null; if (!string.IsNullOrEmpty(questParam.ItemLayout)) { gameObject1 = this.LoadQuestListItem(questParam); } if (UnityEngine.Object.op_Equality((UnityEngine.Object)gameObject1, (UnityEngine.Object)null)) { gameObject1 = questParam.difficulty != QuestDifficulties.Elite ? (questParam.difficulty != QuestDifficulties.Extra ? (!questParam.IsScenario ? (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SpecialQuestItem, (UnityEngine.Object)null) || !this.HasEliteQuest(questParam) ? (questParam.GetChallangeLimit() <= 0 ? (!questParam.IsExtra ? this.ItemTemplate : this.ExtraQuestItem) : this.EventTemplateLimit) : this.SpecialQuestItem) : this.ScenarioQuestItem) : (!questParam.CheckEnableChallange() ? this.StoryExtraQuestDisableItem : this.StoryExtraQuestItem)) : (!questParam.CheckEnableChallange() ? this.EliteQuestDisAbleItem : this.EliteQuestItem); } if (!UnityEngine.Object.op_Equality((UnityEngine.Object)gameObject1, (UnityEngine.Object)null)) { GameObject gameObject2 = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)gameObject1); ((UnityEngine.Object)gameObject2).set_hideFlags((HideFlags)52); DataSource.Bind <QuestParam>(gameObject2, questParam); RankingQuestParam availableRankingQuest = MonoSingleton <GameManager> .Instance.FindAvailableRankingQuest(questParam.iname); DataSource.Bind <RankingQuestParam>(gameObject2, availableRankingQuest); DataSource.Bind <QuestParam>(gameObject2, questParam); QuestCampaignData[] questCampaigns = MonoSingleton <GameManager> .Instance.FindQuestCampaigns(questParam); DataSource.Bind <QuestCampaignData[]>(gameObject2, questCampaigns.Length != 0 ? questCampaigns : (QuestCampaignData[])null); ListItemEvents component = (ListItemEvents)gameObject2.GetComponent <ListItemEvents>(); component.OnSelect = new ListItemEvents.ListItemEvent(this.OnSelectItem); component.OnOpenDetail = new ListItemEvents.ListItemEvent(this.OnOpenItemDetail); component.OnCloseDetail = new ListItemEvents.ListItemEvent(this.OnCloseItemDetail); gameObject2.get_transform().SetParent(transform, false); gameObject2.get_gameObject().SetActive(true); this.AddItem(component); if (flag && questParam.iname == "QE_ST_NO_010001") { SGHighlightObject.Instance().highlightedObject = ((Component)component).get_gameObject(); SGHighlightObject.Instance().Highlight(string.Empty, "sg_tut_1.034", (SGHighlightObject.OnActivateCallback)null, EventDialogBubble.Anchors.BottomRight, true, false, false); component.OnOpenDetail = (ListItemEvents.ListItemEvent)null; } } } } }