少年修仙传客户端代码仓库
client_Zxw
2018-09-20 4d9e4eec1e433353fa46a4edb191868fd39662ea
System/Strengthening/GodBeastReinforcementWin.cs
@@ -21,6 +21,7 @@
        public int GodBeastStar;//神兽星级
        public int LocationMarker;//位置标记
        public int EquipScore;//装备评分
        public int ItemPlace;//背包装备位置
    }
    public class GodBeastReinforcementWin : Window
    {
@@ -32,6 +33,8 @@
        DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } }
        PlayerPackModel _playerPack;
        PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
        GodBeastModel GodBeastModel;
        GodBeastModel godBeastModel { get { return GodBeastModel ?? (GodBeastModel = ModelCenter.Instance.GetModel<GodBeastModel>()); } }
        public static event Action<int> ChooseToModify;
        private List<GodBeastClass> GodBeastList = new List<GodBeastClass>();
        private int CurrentlySelected = 0;
@@ -49,13 +52,33 @@
        {
            CurrentlySelected = 0;
            GetGodBeast();//获取神兽强化装备信息
            if (GodBeastList.Count > 0)
            if (godBeastModel.ItemPlace != -1)
            {
                CurrentlySelected = GodBeastList[0].LocationMarker;
                m_ScrollerController.JumpIndex(0);
                for (int i = 0; i < GodBeastList.Count; i++)
                {
                    if (GodBeastList[i].ItemPlace == godBeastModel.ItemPlace)
                    {
                        CurrentlySelected = GodBeastList[i].LocationMarker;
                        int Index = 0;
                        Index = GodBeastList.FindIndex((x) =>
                        {
                            return x.ItemPlace == godBeastModel.ItemPlace;
                        });
                        m_ScrollerController.JumpIndex(Index);
                    }
                }
            }
            else
            {
                if (GodBeastList.Count > 0)
                {
                    CurrentlySelected = GodBeastList[0].LocationMarker;
                    m_ScrollerController.JumpIndex(0);
                }
            }
            m_ScrollerController.OnRefreshCell += OnRefreshGridCell;
            OnCreateGridLineCell(m_ScrollerController);
            OnCreateGridLineCell(m_ScrollerController);
            m_GodBeastSlidingList.Init();
            m_GodBeastAttributes.Init();
            m_GodBeastAttributes.GetGodBeastLocationMarker(CurrentlySelected);
@@ -63,20 +86,32 @@
        protected override void OnAfterOpen()
        {
            playerPack.RefreshItemCountAct += RefreshItemCountAct;
            playerPack.RefreshItemCountAct += RefreshItemCountAct;
            DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent += MakeItemAnswerEvent;
        }
        protected override void OnPreClose()
        {
            godBeastModel.ItemPlace = -1;
            playerPack.RefreshItemCountAct -= RefreshItemCountAct;
            m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
            m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
            DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent -= MakeItemAnswerEvent;
        }
        private void MakeItemAnswerEvent(HA814_tagMCMakeItemAnswer obj)
        {
            if ((int)obj.MakeType == (int)MakeType.Def_mitDogzEquipPlus)
            {
            }
        }
        private void RefreshItemCountAct(PackType arg1, int arg2, int arg3)
        {
            if (arg1 == PackType.rptDogzEquip)
            {
                OnCreateGridLineCell(m_ScrollerController);
                //OnCreateGridLineCell(m_ScrollerController);
                m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
                m_GodBeastSlidingList.Init();
                m_GodBeastAttributes.Init();
                m_GodBeastAttributes.GetGodBeastLocationMarker(CurrentlySelected);
@@ -96,7 +131,7 @@
            {
                if (DogzEquipDict[key] == 1)
                {
                    List<ItemModel> itemModel = dogz_model.GetDogzEquips(key);
                    for (int i = 0; i < itemModel.Count; i++)
                    {
@@ -106,6 +141,7 @@
                        godBeastClass.GodBeastQuality = itemModel[i].chinItemModel.ItemColor;
                        godBeastClass.GodBeastStar = itemModel[i].chinItemModel.StarLevel;
                        godBeastClass.EquipScore = itemModel[i].equipScore;
                        godBeastClass.ItemPlace = itemModel[i].itemInfo.ItemPlace;
                        var IudetDogzEquipPlus = itemModel[i].GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
                        if (IudetDogzEquipPlus == null)
                        {
@@ -116,8 +152,8 @@
                        {
                            godBeastClass.GodBeastLv = IudetDogzEquipPlus[0];
                            godBeastClass.GodBeasProficiency = IudetDogzEquipPlus[1];
                        }
                        godBeastClass.LocationMarker=itemModel[i].EquipPlace*100+key;
                        }
                        godBeastClass.LocationMarker = itemModel[i].EquipPlace * 100 + key;
                        GodBeastList.Add(godBeastClass);
                    }
                }
@@ -177,7 +213,7 @@
            int locationMarker = cell.index;
            godBeastEntry.GetGodBeastLocationMarker(locationMarker, CurrentlySelected);
            godBeastEntry.GodBeastButton.RemoveAllListeners();
            godBeastEntry.GodBeastButton.AddListener(()=>
            godBeastEntry.GodBeastButton.AddListener(() =>
            {
                if (locationMarker != CurrentlySelected)
                {
@@ -187,7 +223,7 @@
                    {
                        ChooseToModify(CurrentlySelected);
                    }
                }
                }
            });
        }
    }