From 4d9e4eec1e433353fa46a4edb191868fd39662ea Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期四, 20 九月 2018 20:41:44 +0800
Subject: [PATCH] 2614 【前端】神兽——强化功能
---
System/Strengthening/GodBeastReinforcementWin.cs | 60 ++++++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 48 insertions(+), 12 deletions(-)
diff --git a/System/Strengthening/GodBeastReinforcementWin.cs b/System/Strengthening/GodBeastReinforcementWin.cs
index 1d4769e..f6aa787 100644
--- a/System/Strengthening/GodBeastReinforcementWin.cs
+++ b/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);
}
- }
+ }
});
}
}
--
Gitblit v1.8.0