| | |
| | | public int GodBeastStar;//神兽星级
|
| | | public int LocationMarker;//位置标记
|
| | | public int EquipScore;//装备评分
|
| | | public int ItemPlace;//背包装备位置
|
| | | } |
| | | public class GodBeastReinforcementWin : Window |
| | | {
|
| | |
| | | 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; |
| | |
| | | {
|
| | | 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); |
| | |
| | | |
| | | 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);
|
| | |
| | | {
|
| | | if (DogzEquipDict[key] == 1)
|
| | | {
|
| | | |
| | |
|
| | | List<ItemModel> itemModel = dogz_model.GetDogzEquips(key);
|
| | | for (int i = 0; i < itemModel.Count; i++)
|
| | | {
|
| | |
| | | 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)
|
| | | {
|
| | |
| | | {
|
| | | 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);
|
| | | }
|
| | | }
|
| | |
| | | int locationMarker = cell.index;
|
| | | godBeastEntry.GetGodBeastLocationMarker(locationMarker, CurrentlySelected);
|
| | | godBeastEntry.GodBeastButton.RemoveAllListeners();
|
| | | godBeastEntry.GodBeastButton.AddListener(()=> |
| | | godBeastEntry.GodBeastButton.AddListener(() =>
|
| | | {
|
| | | if (locationMarker != CurrentlySelected)
|
| | | {
|
| | |
| | | {
|
| | | ChooseToModify(CurrentlySelected);
|
| | | }
|
| | | } |
| | | }
|
| | | });
|
| | | } |
| | | } |