using System.Collections; using MoleMole.Config; using UnityEngine; using UnityEngine.UI; using proto; namespace MoleMole { public class PlayerStatusWidgetContext : BaseWidgetContext { private CanvasTimer _timer; private bool teamProfileActive = true; private SequenceDialogManager _achieveDialogManager; public PlayerStatusWidgetContext() { config = new ContextPattern { contextName = "PlayerStatusWidgetContext", viewPrefabPath = "UI/Menus/Widget/PlayerStatusPanel", cacheType = ViewCacheType.AlwaysCached }; findViewSavedInScene = true; uiType = UIType.SuspendBar; _achieveDialogManager = new SequenceDialogManager(delegate { _achieveDialogManager.ClearDialogs(); }); } public override bool OnPacket(NetPacketV1 pkt) { switch (pkt.getCmdId()) { case 11: return SetupView(); case 15: return OnScoinExchangeRsp(pkt.getData()); case 19: return OnStaminaExchangeRsp(pkt.getData()); default: return false; } } public override bool OnNotify(Notify ntf) { if (ntf.type == NotifyTypes.ShowScoinExchangeInfo) { return ShowSCoinExchangeDialog(); } if (ntf.type == NotifyTypes.ShowStaminaExchangeInfo) { return ShowStaminaExchangeDialog(); } if (ntf.type == NotifyTypes.SetBackButtonActive) { return OnSetBackButtonActive((bool)ntf.body); } if (ntf.type == NotifyTypes.SetPlayerStatusWidgetDisplay) { return OnSetPlayerStatusWidgetDisplay((bool)ntf.body); } if (ntf.type == NotifyTypes.MissionUpdated) { return OnMissionUpdated((uint)ntf.body); } return false; } protected override void BindViewCallbacks() { BindViewCallback(base.view.transform.Find("TeamBriefPanel/Button").GetComponent