Exemplo n.º 1
0
 private void OpenDescPanel(int index, HolyWeaponInfo info)
 {
     this.mIndex = index;
     this.mGoListPanel.SetActive(false);
     this.mGoDescPanel.SetActive(true);
     this.RefreshDescPanel(info);
 }
Exemplo n.º 2
0
 private void PlayEffect()
 {
     if (!this.mGoDescPanel.get_activeSelf())
     {
         int            id   = GodWeaponManager.Instance.UIPlayQueue.Dequeue();
         HolyWeaponInfo info = GodWeaponManager.Instance.WeaponList.Find((HolyWeaponInfo e) => e.Id == id);
         if (info != null)
         {
             this.SwitchGodType(info.Type);
             this.mGoListPanel.SetActive(true);
             this.mGoDescPanel.SetActive(false);
             this.mTempItem = this.mItemList.Find((GodWeaponItem e) => e.Info.Id == info.Id);
             if (this.mTempItem != null)
             {
                 int num = this.mTempItem.Index - 2;
                 if (num < 0)
                 {
                     num = 0;
                 }
                 this.mScrollRect.Move2Index(num, false);
                 if (Mathf.Abs(this.mLastIndex - num) > 2)
                 {
                     this.mDelayScrollId = TimerHeap.AddTimer(750u, 0, new Action(this.DelayPlayEffect));
                 }
                 else
                 {
                     this.DelayPlayEffect();
                 }
                 this.mLastIndex = num;
             }
         }
     }
 }
Exemplo n.º 3
0
    private void RefreshDescPanel(HolyWeaponInfo info)
    {
        if (info != null)
        {
            this.mInfo = info;
            this.mData = DataReader <Artifact> .Get(info.Id);

            GodWeaponManager.Instance.WeaponDict.TryGetValue(this.mInfo.Type, ref this.mCurList);
            if (this.mData != null)
            {
                ResourceManager.SetSprite(this.mImgTitle, ResourceManager.GetIconSprite(this.TITLE_SPR[this.mInfo.Type]));
                if (this.mData.model > 0)
                {
                    this.mImgGodWeapon.get_gameObject().SetActive(true);
                    this.mRawGodWeapon.get_gameObject().SetActive(false);
                    ResourceManager.SetSprite(this.mImgGodWeapon, GameDataUtils.GetIcon(this.mData.model));
                    this.PlaySpine(this.mData.system);
                }
                this.mTxModelName.set_text(GameDataUtils.GetChineseContent(this.mData.name, false));
                this.mTxWeaponName.set_text(GameDataUtils.GetChineseContent(this.mData.name, false));
                this.mTxWeaponDesc.set_text(GameDataUtils.GetChineseContent(this.mData.explain, false));
                this.mBtnChallenge.get_gameObject().SetActive(this.mData.acquisitionMode == 1 && this.mInfo.State == 3);
                this.RefreshBottomPanel(this.mData);
            }
        }
        this.mBtnLeftArrow.get_gameObject().SetActive(this.mIndex > 0);
        this.mBtnRightArrow.get_gameObject().SetActive(this.mIndex < this.mCurList.get_Count() - 1);
    }
Exemplo n.º 4
0
 private void FirstRefreshUI(HolyWeaponInfo info)
 {
     if (info != null)
     {
         this.SwitchGodType(info.Type);
         this.mGoDescPanel.SetActive(false);
         this.mGoListPanel.SetActive(true);
     }
 }
Exemplo n.º 5
0
    public void SetData(int index, HolyWeaponInfo info)
    {
        this.mIndex = index;
        if (info != null)
        {
            this.mInfo = info;
            this.mData = DataReader <Artifact> .Get(this.mInfo.Id);

            if (this.mData != null)
            {
                this.mTxName.set_text(GameDataUtils.GetChineseContent(this.mData.name, false));
                ResourceManager.SetSprite(this.mImgIcon, GameDataUtils.GetIcon(this.mData.model));
                this.RefreshState((GodWeaponItem.State) this.mInfo.State);
            }
        }
    }
Exemplo n.º 6
0
    private void CreateWeaponItem(int index, HolyWeaponInfo data)
    {
        GodWeaponItem godWeaponItem = this.mItemList.Find((GodWeaponItem e) => e.get_gameObject().get_name() == "Unused");

        if (godWeaponItem == null)
        {
            GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("GodWeaponItem");
            UGUITools.SetParent(this.mListGrid.get_gameObject(), instantiate2Prefab, false);
            godWeaponItem = instantiate2Prefab.GetComponent <GodWeaponItem>();
            godWeaponItem.EventHandler = new Action <int, HolyWeaponInfo>(this.OpenDescPanel);
            this.mItemList.Add(godWeaponItem);
        }
        godWeaponItem.SetData(index, data);
        godWeaponItem.get_gameObject().set_name(data.Id.ToString());
        godWeaponItem.get_gameObject().SetActive(true);
    }
Exemplo n.º 7
0
 protected override void OnEnable()
 {
     base.OnEnable();
     CurrenciesUIViewModel.Show(true);
     CurrenciesUIViewModel.Instance.SetSubUI(true, ResourceManager.GetCodeSprite(110045), string.Empty, delegate
     {
         if (this.mGoDescPanel.get_activeSelf())
         {
             this.CloseDescPanel();
         }
         else
         {
             this.Show(false);
             SoundManager.SetBGMFade(true);
         }
     }, false);
     if (GodWeaponManager.Instance.OpenDescId > 0)
     {
         HolyWeaponInfo info = GodWeaponManager.Instance.WeaponList.Find((HolyWeaponInfo e) => e.Id == GodWeaponManager.Instance.OpenDescId);
         if (info != null)
         {
             this.SwitchGodType(info.Type);
             GodWeaponItem godWeaponItem = this.mItemList.Find((GodWeaponItem e) => e.Info.Id == info.Id);
             if (godWeaponItem != null)
             {
                 this.OpenDescPanel(godWeaponItem.Index, godWeaponItem.Info);
             }
         }
         GodWeaponManager.Instance.OpenDescId = 0;
     }
     else if (GodWeaponManager.Instance.UIPlayQueue != null && GodWeaponManager.Instance.UIPlayQueue.get_Count() > 0)
     {
         this.PlayEffect();
     }
     else
     {
         this.SwitchGodType(1);
         this.mGoDescPanel.SetActive(false);
         this.mGoListPanel.SetActive(true);
     }
     WaitUI.CloseUI(0u);
 }
Exemplo n.º 8
0
    private void OnGetHolyWeaponsInfoRes(short state, GetHolyWeaponsInfoRes down = null)
    {
        if (state != 0)
        {
            StateManager.Instance.StateShow(state, 0);
            return;
        }
        if (down == null)
        {
            return;
        }
        this.mWeaponList = down.Info;
        this.mWeaponDict = new Dictionary <int, List <HolyWeaponInfo> >();
        List <HolyWeaponInfo> list = null;

        for (int i = 0; i < this.mWeaponList.get_Count(); i++)
        {
            HolyWeaponInfo holyWeaponInfo = this.mWeaponList.get_Item(i);
            if (holyWeaponInfo.Id > 0)
            {
                if (!this.mWeaponDict.TryGetValue(holyWeaponInfo.Type, ref list))
                {
                    list = new List <HolyWeaponInfo>();
                    this.mWeaponDict.Add(holyWeaponInfo.Type, list);
                }
                list.Add(holyWeaponInfo);
            }
        }
        List <int> list2 = new List <int>(this.mWeaponDict.get_Keys());

        for (int j = 0; j < list2.get_Count(); j++)
        {
            this.mWeaponDict.get_Item(list2.get_Item(j)).Sort(new Comparison <HolyWeaponInfo>(this.SortInfo));
        }
        EventDispatcher.Broadcast(EventNames.GetGodWeaponListRes);
    }
 private void OnCurrentWeaponChange(HolyWeaponInfo info)
 {
     this.OnCurrentTaskChange();
 }