Ejemplo n.º 1
0
        /// <summary>
        /// 初始化右侧tipsbutton
        /// </summary>
        /// <param name="tab">Tab.</param>
        public void InitRightTipsButton(JewelState tab)
        {
            PackBtnType[] btnTypeList = null;
            if (tab == JewelState.JewelBeset)
            {
                btnTypeList = new PackBtnType[]
                {
                    PackBtnType.Package,
                };
            }
            else if (tab == JewelState.JewelUpgrad)
            {
                btnTypeList = new PackBtnType[]
                {
                    PackBtnType.Upgrade,
                    PackBtnType.Package,
                };
            }
            m_PackRightBtnManager.PackBtnOnClick = OnButtonClick;
            StartCoroutine(m_PackRightBtnManager.AddBtn(btnTypeList));

            #region `    引导注入代码

            StartCoroutine(RegisterRightBtn());
            #endregion
        }
Ejemplo n.º 2
0
        public override void InitItemFileinfoList(JewelState tab)
        {
            SelectedItemList.Clear();
            UpdateSwallowButton();
            List <ItemFielInfo> i = ContainerInfomanager.Instance.itemFielArrayInfo.Where(p => p.severItemFielType == SeverItemFielInfoType.Jewel).ToList();

            ItemFileinfoList = new List <ItemFielInfo>();
            i.ApplyAllItem(c =>
            {
                Jewel ljewel = ItemDataManager.Instance.GetItemData(c.LocalItemData._goodID) as Jewel;
                Jewel wjewel = ItemDataManager.Instance.GetItemData(_itemFielInfo.LocalItemData._goodID) as Jewel;
                if (ljewel.StoneType == wjewel.StoneType && c != this._itemFielInfo)
                {
                    ItemFileinfoList.Add(c);
                }
            });
            if (ItemFileinfoList.Count == 0)
            {
                ShowNoneItemLable("IDS_I9_31");
            }
            else
            {
                HideNoneItemLable();
            }
        }
Ejemplo n.º 3
0
        public override void Show(params object[] value)
        {
            object defultSelectItem = null;

            IsFirst = true;
            if (value == null || value.Length == 0)
            {
                CurrentState = JewelState.JewelBeset;
            }
            else if (value.Length == 1)
            {
                CurrentState = (JewelState)value [0];
            }
            else
            {
                CurrentState     = (JewelState)value [0];
                defultSelectItem = value[1];
            }

            InitRightTipsButton(CurrentState);
            Init();
            TweenAlpha.Begin(m_PackRightBtnManager.gameObject, 0.1f, 0, 1, null);
            TweenPosition.Begin(m_PackRightBtnManager.gameObject, 0.1f, m_PackRightBtnManager.transform.localPosition, RightBtnShowPos);
            base.Show(value);
//                      StartCoroutine (HideAll ());
            Sc_Container.Init(CurrentState, defultSelectItem);
            //ChangeTab (tab);
        }
Ejemplo n.º 4
0
        public virtual IEnumerator RefreshList(JewelState tab, BtnMapId_Sub btnMapId_Sub)
        {
            ItemTable.transform.ClearChild();
            ItemList.Clear();
            InitItemFileinfoList(tab);
            int columnAmount = Mathf.CeilToInt(ItemFileinfoList.Count / 3.0f);
            int j            = 0;

            if (ItemFileinfoList.Count > 0)
            {
                m_shouldMove = ItemFileinfoList.Count > 9;
                for (int i = 0; i < ItemFileinfoList.Count(); i++)
                {
                    if (i % 3 == 0) //3项一排
                    {
                        j++;
                    }
                    Item_go      = NGUITools.AddChild(ItemTable.gameObject, JewelBeset_ContainerItemProfab);
                    Item_go.name = JewelBeset_ContainerItemProfab.name + i;
                    JewelBset_ContainerItem Sc_item = Item_go.GetComponent <JewelBset_ContainerItem>();
                    Sc_item.DragAmount = j / columnAmount;
                    Sc_item.InitItemData(ItemFileinfoList[i]);
                    Sc_item.OnItemClick = ItemSelectedEventHandle;
                    ItemList.Add(Sc_item);
                }
                if (ItemList.Count > 0)
                {
                    ItemList[0].OnBeSelected();
                }
                yield return(null);

                ItemTable.Reposition();
                yield return(null);

                //引导
                if (ItemList != null)
                {
                    ItemList.ApplyAllItem(P =>
                    {
                        if (P != null)
                        {
                            //P.gameObject.RegisterBtnMappingId(P.ItemFielInfo.LocalItemData._goodID, MainUI.UIType.Gem, BtnMapId_Sub.Gem_JewelContainerListPanel_Item, NoticeToDragSlerp, P.DragAmount);
                            P.gameObject.RegisterBtnMappingId(MainUI.UIType.Gem, BtnMapId_Sub.Gem_JewelBesetPanel_Weapon + P.ItemFielInfo.LocalItemData._GoodsSubClass - 1,
                                                              NoticeToDragSlerp, P.DragAmount);
                        }
                    });
                }
                if (m_noticeToDragAmount != 0)
                {
                    StartCoroutine(DragAmountSlerp(m_noticeToDragAmount));
                    m_noticeToDragAmount = 0;
                }
            }
        }
Ejemplo n.º 5
0
 public void Init(JewelState tab, object defultSelectItem)
 {
     if (tab == JewelState.JewelBeset)
     {
         OnBesetButtonClick(defultSelectItem);
     }
     else if (tab == JewelState.JewelUpgrad)
     {
         OnUpgradeButtonClick(defultSelectItem);
     }
     //SelectItem(itemfileInfo);
 }
Ejemplo n.º 6
0
 public override void InitItemFileinfoList(JewelState tab)
 {
     ItemFileinfoList = new List <ItemFielInfo>();
     SelectItemList.ApplyAllItem(c => { ItemFileinfoList.Add(c.ItemFielInfo); });
     if (ItemFileinfoList.Count == 0)
     {
         ShowNoneItemLable("IDS_I9_21");
     }
     else
     {
         HideNoneItemLable();
     }
 }
Ejemplo n.º 7
0
 public void UpdateContain(JewelState tab, ItemFielInfo itemfileInfo)
 {
     if (tab == JewelState.JewelBeset)
     {
         ChangeStrenType(true);
     }
     else
     {
         ChangeStrenType(false);
     }
     JewelBesetManager.GetInstance().InitContianerTab(tab);
     JewelBesetManager.GetInstance().UpdateBesetPanel(null);
     //StartCoroutine( RefreshList(tab));
     InitItemList(tab);
     SelectItem(itemfileInfo);
 }
Ejemplo n.º 8
0
 public void InitContianerTab(JewelState tab)
 {
     sc_Chose_Beset.HidePanel();
     Sc_Container.ShowAnim();
     sc_Swallow_Chose.HidePanel();
     sc_Swallow_Ensure.HidePanel();
     if (tab == JewelState.JewelBeset)
     {
         sc_Beset.ShowAnim();
         sc_upgrade.HidePanel();
     }
     else
     {
         sc_Beset.HidePanel();
         sc_upgrade.ShowAnim();
     }
 }
Ejemplo n.º 9
0
        public override void InitItemFileinfoList(JewelState tab)
        {
            EquipmentData eqitem = ItemDataManager.Instance.GetItemData(CurrentItemFileInfo.LocalItemData._goodID) as EquipmentData;
            string        pos    = eqitem._GoodsSubClass.ToString();

            //&&((Jewel)ItemDataManager.Instance.GetItemData(c.LocalItemData._goodID)).StonePosition.Contains(eqitem._GoodsSubClass.ToString())
            ItemFileinfoList = new List <ItemFielInfo>();
            List <JewelInfo> jewelInfos = PlayerDataManager.Instance.GetJewelInfo((EquiptSlotType)CurrentItemFileInfo.sSyncContainerGoods_SC.nPlace);

            foreach (var item in ContainerInfomanager.Instance.itemFielArrayInfo)
            {
                if (item.severItemFielType == SeverItemFielInfoType.Jewel)
                {
                    Jewel jewel = (Jewel)ItemDataManager.Instance.GetItemData(item.LocalItemData._goodID);
                    bool  inpos = false;
                    foreach (var s in jewel.StonePosition)
                    {
                        if (s == pos && (jewel._goodID != jewelInfos[0].JewelID && jewel._goodID != jewelInfos[1].JewelID))
                        {
                            inpos = true;
                            break;
                        }
                    }
                    if (inpos)
                    {
                        ItemFileinfoList.Add(item);
                    }
                }
            }
            ItemFileinfoList.Sort((c1, c2) => {
                return(GetJewelSortValue(c2) - GetJewelSortValue(c1));
            });
            if (ItemFileinfoList.Count == 0)
            {
                ShowNoneItemLable("IDS_I9_21");
            }
            else
            {
                HideNoneItemLable();
            }
        }
Ejemplo n.º 10
0
        public override void InitItemFileinfoList(JewelState tab)
        {
            if (tab == JewelState.JewelBeset)
            {
                //第一个判断是“是装备”,第二个判断是“有一个孔是激活的”
                ItemFileinfoList = ContainerInfomanager.Instance.GetEquiptItemList().Where(c => c.LocalItemData._GoodsSubClass != 2).ToList();


                if (ItemFileinfoList.Count == 0)
                {
                    ShowNoneItemLable("IDS_I9_15");
                }
                else
                {
                    HideNoneItemLable();
                }

                ItemFileinfoList.Sort((c1, c2) => {
                    return(c2.LocalItemData._ColorLevel * 1000000 + c2.LocalItemData._AllowLevel * 10000 - c1.LocalItemData._ColorLevel * 1000000 + c1.LocalItemData._AllowLevel * 10000);
                });
            }
            else
            {
                ItemFileinfoList = ContainerInfomanager.Instance.GetPackItemList().Where(p => p.severItemFielType == SeverItemFielInfoType.Jewel).ToList();

                if (ItemFileinfoList.Count == 0)
                {
                    ShowNoneItemLable("IDS_I9_21");
                }
                else
                {
                    HideNoneItemLable();
                }
                ItemFileinfoList.Sort((c1, c2) => {
                    return(GetJewelSortValue(c2) - GetJewelSortValue(c1));
                });
            }
        }
Ejemplo n.º 11
0
 private void InitItemList(JewelState jewelState)
 {
     StartCoroutine(RefreshList(jewelState, BtnMapId_Sub.Gem_JewelContainerListPanel_Item));
 }
Ejemplo n.º 12
0
 public virtual IEnumerator RefreshList(JewelState tab)
 {
     return(RefreshList(tab, BtnMapId_Sub.Empty));
 }
Ejemplo n.º 13
0
 public abstract void InitItemFileinfoList(JewelState tab);
Ejemplo n.º 14
0
 public void UPdateContain(JewelState tab, ItemFielInfo itemFielInfo)
 {
     Sc_Container.UpdateContain(tab, itemFielInfo);
 }
Ejemplo n.º 15
0
        public void ChangeSubUistate(JewelState state)
        {
            switch (state)
            {
            case JewelState.JewelBeset:
                if (IsFirst)
                {
                    Sc_Container.ShowAnim();
                    sc_Beset.ShowAnim();
                    IsFirst = false;
                }
                else
                {
                    Sc_Container.ShowPanel();
                    sc_Beset.ShowPanel();
                }
                sc_Chose_Beset.HidePanel();
                sc_upgrade.HidePanel();
                sc_Swallow_Chose.HidePanel();
                sc_Swallow_Ensure.HidePanel();

                break;

            case JewelState.JewelUpgrad:
                if (IsFirst)
                {
                    Sc_Container.ShowAnim();
                    sc_upgrade.ShowAnim();
                    IsFirst = false;
                }
                else
                {
                    Sc_Container.ShowPanel();
                    sc_upgrade.ShowPanel();
                }
                sc_Chose_Beset.HidePanel();

                sc_Beset.HidePanel();

                sc_Swallow_Chose.HidePanel();
                sc_Swallow_Ensure.HidePanel();
                break;

            case JewelState.JewelChose_Beset:

                //sc_Chose_Beset.Init (1001052, 1);
                sc_Chose_Beset.ShowPanel();
                Sc_Container.HidePanel();
                sc_Beset.ShowPanel();
                sc_upgrade.HidePanel();
                sc_Swallow_Chose.HidePanel();
                sc_Swallow_Ensure.HidePanel();
                break;

            case JewelState.jewelChose_Upgrade:

                sc_Chose_Beset.HidePanel();
                Sc_Container.ShowPanel();
                sc_Beset.HidePanel();
                sc_upgrade.ShowPanel();
                //sc_Swallow_Chose.Init (JewelTab.jewelChose_Upgrade, 0);
                sc_Swallow_Chose.ShowPanel();
                sc_Swallow_Ensure.HidePanel();
                break;

            case JewelState.JewelChose_Upgrade_ensure:
                sc_Chose_Beset.HidePanel();
                Sc_Container.ShowPanel();
                sc_Beset.HidePanel();
                sc_upgrade.ShowPanel();
                sc_Swallow_Chose.HidePanel();
                sc_Swallow_Ensure.ShowPanel();
                break;
            }
        }