void Start() { InitWindow(); m_AllStr = PELocalization.GetString(10055); //lz-2016.07.08 “All” 的语言映射 mRootType = ItemLabel.Root.all; AfterLeftMeunChecked(); }
private void Init() { if (m_Init) { return; } m_BuyItemList = new List <ItemObject>(); m_RepurchaseList = new List <ItemObject>(); m_ItemGridList = new List <Grid_N>(); m_CurPackTab = 0; m_CurPageIndex = 0; m_Currency = 0; m_CurType = ItemLabel.Root.all; m_PageCount = m_Row * m_Column; for (int i = 0; i < m_PageCount; i++) { Grid_N grid = Instantiate(m_GridPrefab) as Grid_N; grid.transform.parent = m_ItemGrid.transform; grid.transform.localPosition = Vector3.zero; grid.transform.localRotation = Quaternion.identity; grid.transform.localScale = Vector3.one; grid.onLeftMouseClicked = OnLeftMouseCliked; grid.onRightMouseClicked = OnRightMouseCliked; m_ItemGridList.Add(grid); } ShowOpPanel(false); m_CanUseThis = true; m_NewUseState = true; ShowMeshGo(false); //lz-2016.10.24 贸易站不能工作的时候点击遮罩提示不能工作的原因 UIEventListener.Get(m_MeshGo).onClick = (go) => { CheckCantWorkTip(); }; m_Init = true; }
void UpdateBuyItemList(ItemLabel.Root _type) { //lz-2016.01.03 crash bug 错误 #8074 if (mTypeOfBuyItemList == null || null == mBuyItemList || null == m_TypeShopIDList || null == m_ShopIDList) { return; } mTypeOfBuyItemList.Clear(); for (int i = 0; i < mBuyItemList.Count; i++) { if (_type == ItemLabel.Root.all) { mTypeOfBuyItemList.Add(mBuyItemList[i]); } else { //lz-2017.02.27 错误 #9323 crash bug if (null != mBuyItemList[i] && null != mBuyItemList[i].protoData && null != mBuyItemList[i].protoData) { ItemLabel.Root roottype = mBuyItemList[i].protoData.rootItemLabel; if (roottype == _type) { mTypeOfBuyItemList.Add(mBuyItemList[i]); } } } } m_TypeShopIDList.Clear(); for (int i = 0; i < m_ShopIDList.Count; i++) { if (_type == ItemLabel.Root.all) { m_TypeShopIDList.Add(m_ShopIDList[i]); } else { ShopData sd = ShopRespository.GetShopData(m_ShopIDList[i]); if (sd == null) { continue; } ItemProto data = ItemProto.GetItemData(sd.m_ItemID); if (null != data) { ItemLabel.Root roottype = data.rootItemLabel; if (roottype == _type) { m_TypeShopIDList.Add(m_ShopIDList[i]); } } } } }
private void Ck6ResoureOnClick() { if (Input.GetMouseButtonUp(0)) { if (mRootType != ItemLabel.Root.resoure) { mRootType = ItemLabel.Root.resoure; AfterLeftMeunChecked(); } } }
private void Ck3ToolOnClick() { if (Input.GetMouseButtonUp(0)) { if (mRootType != ItemLabel.Root.tool) { mRootType = ItemLabel.Root.tool; AfterLeftMeunChecked(); } } }
private void Ck2EquipmentOnClick() { if (Input.GetMouseButtonUp(0)) { if (mRootType != ItemLabel.Root.equipment) { mRootType = ItemLabel.Root.equipment; AfterLeftMeunChecked(); } } }
private void Ck1WeaponOnClick() { if (Input.GetMouseButtonUp(0)) { if (mRootType != ItemLabel.Root.weapon) { mRootType = ItemLabel.Root.weapon; AfterLeftMeunChecked(); } } }
private void Ck9IsoOnClick() { if (Input.GetMouseButtonUp(0)) { if (mRootType != ItemLabel.Root.ISO) { mRootType = ItemLabel.Root.ISO; AfterLeftMeunChecked(); } } }
private void Ck7PartOnClick() { if (Input.GetMouseButtonUp(0)) { if (mRootType != ItemLabel.Root.part) { mRootType = ItemLabel.Root.part; AfterLeftMeunChecked(); } } }
void BtnDecorationOnClick() { if (mSellOpLayer.gameObject.activeSelf) { return; } shopSelectItemType = ItemLabel.Root.decoration; mCurrentPickTab = 0; ResetItem(mCurrentPickTab, 0); }
private void Ck5ConsumablesOnClick() { if (Input.GetMouseButtonUp(0)) { if (mRootType != ItemLabel.Root.consumables) { mRootType = ItemLabel.Root.consumables; AfterLeftMeunChecked(); } } }
void BtnResoureOnClick() { if (mSellOpLayer.gameObject.activeSelf) { return; } shopSelectItemType = ItemLabel.Root.resoure; mCurrentPickTab = 0; ResetItem(mCurrentPickTab, 0); }
void BtnConsumOnClick() { if (mSellOpLayer.gameObject.activeSelf) { return; } shopSelectItemType = ItemLabel.Root.consumables; mCurrentPickTab = 0; ResetItem(mCurrentPickTab, 0); }
void BtnWeaponOnClick() { if (mSellOpLayer.gameObject.activeSelf) { return; } m_CurType = ItemLabel.Root.weapon; m_CurPackTab = 0; m_CurPageIndex = 0; UpdateGridsInfo(); }
private void Ck0AllOnClick() { //bool ok = Input.GetMouseButtonUp(0); if (Input.GetMouseButtonUp(0)) { if (mRootType != ItemLabel.Root.all) { mRootType = ItemLabel.Root.all; AfterLeftMeunChecked(); } } }
void NewOnQuerySearchBtnClick() { if (FactoryReplicator.IsQueryInputValid()) { m_RootType = ItemLabel.Root.all; FactoryReplicator.SetMenuCBChecked(0, true); SetPopuplistItem(); } else { //lz-2016.07.01 如果搜索内容为空,直接显示全部 UpdateLeftList(); } }
// --------------------------------- // Call back // --------------------------------- // Replicator --- Menu void OnLeftMenuClick(GameObject go, int index) { if (go == null) { Debug.LogError("Gamobject is miss for Replicator menu"); return; } bool ok = Input.GetMouseButtonUp(0); if (ok) { switch (index) { case 0: { if (m_RootType != ItemLabel.Root.all) { m_RootType = ItemLabel.Root.all; SetPopuplistItem(); } } break; case 1: { if (m_RootType != ItemLabel.Root.weapon) { m_RootType = ItemLabel.Root.weapon; SetPopuplistItem(); } } break; case 2: { if (m_RootType != ItemLabel.Root.equipment) { m_RootType = ItemLabel.Root.equipment; SetPopuplistItem(); } } break; case 3: { if (m_RootType != ItemLabel.Root.tool) { m_RootType = ItemLabel.Root.tool; SetPopuplistItem(); } } break; case 4: { if (m_RootType != ItemLabel.Root.turret) { m_RootType = ItemLabel.Root.turret; SetPopuplistItem(); } } break; case 5: { if (m_RootType != ItemLabel.Root.consumables) { m_RootType = ItemLabel.Root.consumables; SetPopuplistItem(); } } break; case 6: { if (m_RootType != ItemLabel.Root.resoure) { m_RootType = ItemLabel.Root.resoure; SetPopuplistItem(); } } break; case 7: { if (m_RootType != ItemLabel.Root.part) { m_RootType = ItemLabel.Root.part; SetPopuplistItem(); } } break; case 8: { if (m_RootType != ItemLabel.Root.decoration) { m_RootType = ItemLabel.Root.decoration; SetPopuplistItem(); } } break; case 9: { if (m_RootType != ItemLabel.Root.ISO) { m_RootType = ItemLabel.Root.ISO; SetPopuplistItem(); } } break; } } }
public override void Show() { mSellOpLayer.gameObject.SetActive(false); mOpItem.mShowNum = false; mBtnAll.isChecked = true; shopSelectItemType = ItemLabel.Root.all; mCurrentPickTab = 0; ResetItem(mCurrentPickTab, 0); npc = EntityMgr.Instance.Get(m_CurNpcID); EntityInfoCmpt info = npc.GetCmpt <EntityInfoCmpt>(); if (npc != null) { //npc.CmdIdle = true; if (info != null) { SetNpcName(info.characterName.fullName); } NpcPackageCmpt npcpc = npc.GetCmpt <NpcPackageCmpt>(); if (npcpc == null) { return; } SetNpcMoney(npcpc.money.current); Texture icon_tex = null; string icon_str = ""; if (EntityCreateMgr.Instance.IsRandomNpc(npc)) { icon_tex = npc.ExtGetFaceTex(); if (icon_tex == null) { icon_str = npc.ExtGetFaceIcon(); } } else { icon_str = npc.ExtGetFaceIcon(); } if (icon_tex != null) { SetNpcICO(icon_tex); } else { SetNpcICO(icon_str); } StroyManager.Instance.SetTalking(EntityMgr.Instance.Get(m_CurNpcID)); isShopping = true; //Invoke("ShopSetTalking", 0.25f); } if (!GameUI.Instance.mItemPackageCtrl.isShow) { GameUI.Instance.mItemPackageCtrl.Show(); } prePos = GameUI.Instance.mItemPackageCtrl.transform.localPosition; GameUI.Instance.mItemPackageCtrl.transform.localPosition = UIDefaultPostion.Instance.pos_ItemPackge; transform.localPosition = UIDefaultPostion.Instance.pos_Shop; base.Show(); }