Beispiel #1
0
 protected void UpdateEventList()
 {
     RemoveEndedEvents();
     if (eventList == null || eventList.Count == 0)
     {
         SetActive((Enum)UI.STR_EVENT_NON_LIST, true);
     }
     else
     {
         SetActive((Enum)UI.STR_EVENT_NON_LIST, false);
         SetDynamicList((Enum)UI.GRD_EVENT_QUEST, "QuestEventListSelectItem", eventList.Count, false, (Func <int, bool>) null, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle)
         {
             Network.EventData eventData = eventList[i];
             Texture2D val = null;
             if (bannerTable.TryGetValue(eventData.bannerId, out LoadObject value))
             {
                 val = (value.loadedObject as Texture2D);
                 if (val != null)
                 {
                     Transform t2 = FindCtrl(t, UI.TEX_EVENT_BANNER);
                     SetActive(t2, true);
                     SetTexture(t2, val);
                     SetActive(t, UI.LBL_NO_BANNER, false);
                 }
                 else
                 {
                     SetActive(t, UI.TEX_EVENT_BANNER, false);
                     SetActive(t, UI.LBL_NO_BANNER, true);
                     string name = eventData.name;
                     SetLabelText(t, UI.LBL_NO_BANNER, name);
                 }
             }
             if (!string.IsNullOrEmpty(eventData.endDate.date))
             {
                 Transform t3 = FindCtrl(t, UI.LBL_LEFT);
                 SetActive(t3, true);
                 SetLabelText(t3, StringTable.Get(STRING_CATEGORY.TIME, 4u));
                 t3 = FindCtrl(t, UI.LBL_LEFT_TIME);
                 SetActive(t3, true);
                 SetLabelText(t3, UIUtility.TimeFormatWithUnit(eventData.GetRest()));
             }
             else
             {
                 SetActive(t, UI.LBL_LEFT, false);
                 SetActive(t, UI.LBL_LEFT_TIME, false);
             }
             SetEvent(t, "SELECT_EXPLORE", eventData);
             Version nativeVersionFromName = NetworkNative.getNativeVersionFromName();
             bool flag       = eventData.IsPlayableWith(nativeVersionFromName);
             bool flag2      = IsClearedEvent(eventData) && flag;
             bool is_visible = !flag2 && !eventData.readPrologueStory;
             SetActive(t, UI.SPR_NEW, is_visible);
             SetActive(t, UI.SPR_CLEARED, flag2);
             SetBadge(FindCtrl(t, UI.TEX_EVENT_BANNER), MonoBehaviourSingleton <DeliveryManager> .I.GetCompletableEventDeliveryNum(eventData.eventId), 1, 16, -3, false);
         });
     }
 }
	private void OnQuery_SELECT_ARENA()
	{
		Network.EventData ev = GameSection.GetEventData() as Network.EventData;
		if (ev != null)
		{
			if (ev.HasEndDate() && ev.GetRest() < 0)
			{
				GameSection.ChangeEvent("SELECT_ENDED", null);
			}
			else
			{
				Version nativeVersionFromName = NetworkNative.getNativeVersionFromName();
				if (!ev.IsPlayableWith(nativeVersionFromName))
				{
					string event_data = string.Format(base.sectionData.GetText("REQUIRE_HIGHER_VERSION"), ev.minVersion);
					GameSection.ChangeEvent("SELECT_VERSION", event_data);
				}
				else if (!ev.readPrologueStory)
				{
					GameSection.StayEvent();
					MonoBehaviourSingleton<QuestManager>.I.SendQuestReadEventStory(ev.eventId, delegate(bool success, Error error)
					{
						if (success)
						{
							if (ev.prologueStoryId > 0)
							{
								GameSceneTables.EventData eventData = base.sectionData.GetEventData("STORY");
								if (eventData != null)
								{
									string name = (!MonoBehaviourSingleton<LoungeMatchingManager>.I.IsInLounge()) ? "MAIN_MENU_HOME" : "MAIN_MENU_LOUNGE";
									EventData[] array = new EventData[3]
									{
										new EventData(name, null),
										new EventData("TO_EVENT", null),
										new EventData("SELECT_ARENA", ev)
									};
									GameSection.ChangeStayEvent("STORY", new object[4]
									{
										ev.prologueStoryId,
										string.Empty,
										string.Empty,
										array
									});
								}
							}
							ev.readPrologueStory = true;
						}
						GameSection.ResumeEvent(true, null);
					});
				}
			}
		}
	}
    private bool IsPlayableVersion(out Network.EventData notPlayableEventData)
    {
        notPlayableEventData = null;
        if (cardDataList == null || cardDataList.Count <= 0)
        {
            return(true);
        }
        Version nativeVersionFromName = NetworkNative.getNativeVersionFromName();
        int     i = 0;

        for (int count = cardDataList.Count; i < count; i++)
        {
            Network.EventData eventData = cardDataList[i].eventData;
            if (eventData != null && !eventData.IsPlayableWith(nativeVersionFromName))
            {
                notPlayableEventData = eventData;
                return(false);
            }
        }
        return(true);
    }