using System.Collections.Generic; using MoleMole.Config; using UnityEngine; using UnityEngine.UI; using proto; namespace MoleMole { public class StorageItemDetailPageContext : BasePageContext { public const string SIGMATA_SKILL_TAB = "S_Skill_Tab"; public const string SIGMATA_SET_SKILL_TAB = "S_Suit_Skill_Tab"; public const string SIGMATA_AFFIX_SKILL_TAB = "S_Affix_Skill_Tab"; public StorageDataItemBase storageItem; public readonly bool hideActionBtns; public bool showIdentifyBtnOnly; public readonly bool unlock; private TabManager _stigmataTabManager; public AvatarDataItem uiEquipOwner; public StorageItemDetailPageContext(StorageDataItemBase storageItem, bool hideActionBtns = false, bool unlock = true) { config = new ContextPattern { contextName = "StorageItemDetailPageContext", viewPrefabPath = "UI/Menus/Page/Storage/WeaponDetailPage", cacheType = ViewCacheType.AlwaysCached }; if (storageItem is StigmataDataItem) { config.viewPrefabPath = "UI/Menus/Page/Storage/StigmataDetailPage"; } this.storageItem = storageItem; this.hideActionBtns = hideActionBtns; this.unlock = unlock; _stigmataTabManager = new TabManager(); _stigmataTabManager.onSetActive += OnTabSetActive; } public override bool OnNotify(Notify ntf) { if (ntf.type == NotifyTypes.EquipPowerupOrEvo) { SetupItemData((StorageDataItemBase)ntf.body); } else if (ntf.type == NotifyTypes.RefreshStigmataDetailView) { SetupView(); _stigmataTabManager.ShowTab("S_Affix_Skill_Tab"); TryToDoTutorial(); } else if (ntf.type == NotifyTypes.StigmataNewAffix) { SetupView(); } return false; } public override bool OnPacket(NetPacketV1 pkt) { switch (pkt.getCmdId()) { case 75: SetupItemProtectedStatus(); break; case 192: return OnIdentifyStigmataAffixRsp(pkt.getData()); case 40: case 136: return SetupView(); } return false; } protected override void BindViewCallbacks() { BindViewCallback(base.view.transform.Find("ActionBtns/PowerUpBtn").GetComponent