|
@@ -12,6 +12,7 @@ namespace GFGGame
|
|
|
private UI_CardDetailUI _ui;
|
|
|
private const int listRoleCount = 5;
|
|
|
private bool _startInAnim;
|
|
|
+ private Dictionary<string, EffectUI> _effectUIDic = new Dictionary<string, EffectUI>();
|
|
|
|
|
|
public override void Dispose()
|
|
|
{
|
|
@@ -36,9 +37,9 @@ namespace GFGGame
|
|
|
// _ui.m_btnHome.onClick.Add(OnClickBtnHome);
|
|
|
_ui.m_btnFilter.onClick.Add(OnclickBtnFilter);
|
|
|
|
|
|
- _ui.m_listCard.itemRenderer = RenderListCardItem;
|
|
|
- _ui.m_listCard.onClickItem.Add(OnClickListCardItem);
|
|
|
- _ui.m_listCard.SetVirtual();
|
|
|
+ _ui.m_comListCard.m_listCard.itemRenderer = RenderListCardItem;
|
|
|
+ _ui.m_comListCard.m_listCard.onClickItem.Add(OnClickListCardItem);
|
|
|
+ _ui.m_comListCard.m_listCard.SetVirtual();
|
|
|
|
|
|
_ui.m_listRole.itemRenderer = RenderListRoleItem;
|
|
|
_ui.m_listRole.onClickItem.Add(OnClickListRoleItem);
|
|
@@ -68,20 +69,26 @@ namespace GFGGame
|
|
|
int listRoleSelect = this.viewData != null ? (int)this.viewData : 0;
|
|
|
_ui.m_listRole.selectedIndex = listRoleSelect;
|
|
|
_ui.m_listRole.numItems = listRoleCount;
|
|
|
- this.UpdateCardList();
|
|
|
+ UpdateCardList();
|
|
|
|
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
|
|
|
|
if (_startInAnim)
|
|
|
{
|
|
|
_startInAnim = false;
|
|
|
- _ui.m_listCard.scrollPane.ScrollTop();
|
|
|
+ _ui.m_comListCard.m_listCard.scrollPane.ScrollTop();
|
|
|
_ui.m_In.Play();
|
|
|
}
|
|
|
}
|
|
|
protected override void OnHide()
|
|
|
{
|
|
|
base.OnHide();
|
|
|
+ foreach (var v in _effectUIDic)
|
|
|
+ {
|
|
|
+ EffectUIPool.Recycle(v.Value);
|
|
|
+ }
|
|
|
+ _effectUIDic.Clear();
|
|
|
+
|
|
|
this.Clear();
|
|
|
Timers.inst.Remove(CheckGuide);
|
|
|
}
|
|
@@ -99,7 +106,7 @@ namespace GFGGame
|
|
|
private void FilterItems()
|
|
|
{
|
|
|
_ui.m_Refresh.Play();
|
|
|
- _ui.m_listCard.scrollPane.ScrollTop();
|
|
|
+ _ui.m_comListCard.m_listCard.scrollPane.ScrollTop();
|
|
|
UpdateCardList();
|
|
|
}
|
|
|
|
|
@@ -112,16 +119,21 @@ namespace GFGGame
|
|
|
cardList = CardDataManager.FilterCardList(cardList);
|
|
|
}
|
|
|
cardList = CardDataManager.SortItemList(cardList);
|
|
|
- _ui.m_listCard.data = cardList;
|
|
|
- _ui.m_listCard.numItems = cardList.Count;
|
|
|
+ foreach (var v in _effectUIDic)
|
|
|
+ {
|
|
|
+ EffectUIPool.Recycle(v.Value);
|
|
|
+ }
|
|
|
+ _effectUIDic.Clear();
|
|
|
+ _ui.m_comListCard.m_listCard.data = cardList;
|
|
|
+ _ui.m_comListCard.m_listCard.numItems = cardList.Count;
|
|
|
|
|
|
- _ui.m_txtTips.visible = _ui.m_listCard.numItems == 0 ? true : false;
|
|
|
+ _ui.m_txtTips.visible = _ui.m_comListCard.m_listCard.numItems == 0 ? true : false;
|
|
|
}
|
|
|
|
|
|
private void RenderListCardItem(int index, GObject obj)
|
|
|
{
|
|
|
UI_ListCardItem listItem = UI_ListCardItem.Proxy(obj);
|
|
|
- CardData data = (_ui.m_listCard.data as List<CardData>)[index];//CardDataManager.GetCardList(_ui.m_listRole.selectedIndex)[index];
|
|
|
+ CardData data = (_ui.m_comListCard.m_listCard.data as List<CardData>)[index];//CardDataManager.GetCardList(_ui.m_listRole.selectedIndex)[index];
|
|
|
data.index = index;
|
|
|
data.pageIndex = _ui.m_listRole.selectedIndex;
|
|
|
listItem.target.data = data;
|
|
@@ -134,6 +146,26 @@ namespace GFGGame
|
|
|
listItem.m_txtName.text = data.itemCfg.name;
|
|
|
RedDotController.Instance.SetComRedDot(listItem.target, RedDotDataManager.Instance.GetCardRed(data.id), "", 5, -10);
|
|
|
|
|
|
+ //if (data.itemCfg.rarity == 4)
|
|
|
+ //{
|
|
|
+ // listItem.m_holderGoldBg.visible = true;
|
|
|
+ // listItem.m_holderPurpleBg.visible = false;
|
|
|
+ // if (!_effectUIDic.ContainsKey("gold" + obj.id))
|
|
|
+ // _effectUIDic.Add("gold" + obj.id, EffectUIPool.CreateEffectUI(listItem.m_holderGoldBg, "ui_KP", "KP_Gold_Frame"));
|
|
|
+ //}
|
|
|
+ //else if (data.itemCfg.rarity == 3)
|
|
|
+ //{
|
|
|
+ // listItem.m_holderPurpleBg.visible = true;
|
|
|
+ // listItem.m_holderGoldBg.visible = false;
|
|
|
+ // if (!_effectUIDic.ContainsKey("purple" + obj.id))
|
|
|
+ // _effectUIDic.Add("purple" + obj.id, EffectUIPool.CreateEffectUI(listItem.m_holderPurpleBg, "ui_KP", "KP_Purple_Frame"));
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // listItem.m_holderGoldBg.visible = false;
|
|
|
+ // listItem.m_holderPurpleBg.visible = false;
|
|
|
+ //}
|
|
|
+
|
|
|
int starLevelDodge = data.star / 5;
|
|
|
listItem.m_starNumType.selectedIndex = data.itemCfg.starDescArr.Length - 1;
|
|
|
for (int i = 0; i < data.itemCfg.starDescArr.Length; i++)
|
|
@@ -165,9 +197,9 @@ namespace GFGGame
|
|
|
int index = (int)(gObject.data);
|
|
|
_ui.m_listRole.selectedIndex = index;
|
|
|
|
|
|
- this.UpdateCardList();
|
|
|
+ UpdateCardList();
|
|
|
|
|
|
- _ui.m_listCard.scrollPane.ScrollTop();
|
|
|
+ _ui.m_comListCard.m_listCard.scrollPane.ScrollTop();
|
|
|
_ui.m_Refresh.Play();
|
|
|
|
|
|
UI_Button21 button = UI_Button21.Proxy(gObject);
|
|
@@ -195,7 +227,7 @@ namespace GFGGame
|
|
|
// this._selectType = 0;
|
|
|
CardDataManager._selectList.Clear();
|
|
|
_ui.m_listRole.selectedIndex = 0;
|
|
|
- _ui.m_listCard.selectedIndex = 0;
|
|
|
+ _ui.m_comListCard.m_listCard.selectedIndex = 0;
|
|
|
}
|
|
|
|
|
|
private void CheckGuide(object param)
|
|
@@ -215,9 +247,9 @@ namespace GFGGame
|
|
|
{
|
|
|
if (!ViewManager.CheckIsTopView(this.viewCom)) return;
|
|
|
|
|
|
- GuideController.TryGuide(_ui.m_listCard, ConstGuideId.UP_CARD_LV, 3, "选择可升级的词牌。", 0);
|
|
|
+ GuideController.TryGuide(_ui.m_comListCard.m_listCard, ConstGuideId.UP_CARD_LV, 3, "选择可升级的词牌。", 0);
|
|
|
GuideController.TryGuide(_ui.m_btnBack, ConstGuideId.ENTER_CHAPTER_1, 1, "");
|
|
|
- GuideController.TryGuide(_ui.m_listCard, ConstGuideId.UP_CARD_STAR, 3, "选择可升星的词牌。", 0);
|
|
|
+ GuideController.TryGuide(_ui.m_comListCard.m_listCard, ConstGuideId.UP_CARD_STAR, 3, "选择可升星的词牌。", 0);
|
|
|
|
|
|
GuideController.TryGuide(_ui.m_btnBack, ConstGuideId.UP_CARD_STAR, 8, "");
|
|
|
GuideController.TryCompleteGuide(ConstGuideId.UP_CARD_STAR, 8);
|