using System.Collections.Generic; using MoleMole.Config; using UnityEngine; using UnityEngine.UI; using proto; namespace MoleMole { public class EndlessMainPageContext : BasePageContext { public enum ViewStatus { ShowCurrentGroup = 0, ShowTopGroup = 1 } private const string BATTLE_REPORT_PREFAB_PATH = "UI/Menus/Widget/EndlessActivity/BattleReportRow"; private Color _groupColor; private ViewStatus _viewStatus; public EndlessMainPageContext() { config = new ContextPattern { contextName = "EndlessMainPageContext", viewPrefabPath = "UI/Menus/Page/EndlessActivity/EndlessMainPage" }; _viewStatus = ViewStatus.ShowCurrentGroup; } public override bool OnPacket(NetPacketV1 pkt) { switch (pkt.getCmdId()) { case 140: case 220: return SetupView(); case 151: return OnEndlessPlayerDataUpdateNotify(pkt.getData()); case 146: return OnGetLastEndlessRewardDataRsp(pkt.getData()); case 153: return OnEndlessWarInfoNotify(pkt.getData()); default: return false; } } public override bool OnNotify(Notify ntf) { if (ntf.type == NotifyTypes.EndlessActivityEnd) { return OnEndlessEnd(); } if (ntf.type == NotifyTypes.EndlessActivityEnd) { return OnEndlessSettlement(); } if (ntf.type == NotifyTypes.EndlessActivityEnd) { return OnEndlessBegin(); } if (ntf.type == NotifyTypes.EndlessAppliedToolChange) { return SetupRank(); } return false; } protected override void BindViewCallbacks() { BindViewCallback(base.view.transform.Find("ActionBtns/Prepare").GetComponent