|
@@ -24,7 +24,7 @@ namespace GFGGame
|
|
|
this.viewCom.Center();
|
|
|
|
|
|
_ui.m_listParts.itemRenderer = ListPartsItemRenderer;
|
|
|
- _ui.m_listParts.onClickItem.Add(OnClickListPartsItem);
|
|
|
+ // _ui.m_listParts.onClickItem.Add(OnClickListPartsItem);
|
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
@@ -44,24 +44,18 @@ namespace GFGGame
|
|
|
base.OnHide();
|
|
|
}
|
|
|
|
|
|
- private void ListPartsItemRenderer(int index, GObject item)
|
|
|
+ private void ListPartsItemRenderer(int index, GObject obj)
|
|
|
{
|
|
|
- UI_ListSuitPartsItem listItem = UI_ListSuitPartsItem.Proxy(item);
|
|
|
int itemId = _items[index];
|
|
|
- ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
- listItem.m_txtName.text = ItemUtil.GetItemName(itemId);
|
|
|
- listItem.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
|
|
|
+ ItemData reward = ItemUtil.createItemData(itemId, 1);
|
|
|
+ if (obj.data == null)
|
|
|
+ {
|
|
|
+ obj.data = new ItemView(obj as GComponent);
|
|
|
+ }
|
|
|
+ (obj.data as ItemView).SetData(reward);
|
|
|
+ (obj.data as ItemView).TxtHasCountVisble = false;
|
|
|
bool haveItem = DressUpMenuItemDataManager.CheckHasItem(itemId);
|
|
|
- listItem.m_imgLock.visible = listItem.m_imgLockBg.visible = !haveItem;
|
|
|
- listItem.target.data = itemId;
|
|
|
- // listItem.target.onClick.Clear();
|
|
|
- // listItem.target.onClick.Add(() =>
|
|
|
- // {
|
|
|
- // if (haveItem)
|
|
|
- // {
|
|
|
- // GoodsItemTipsController.ShowItemTips(itemId);
|
|
|
- // }
|
|
|
- // });
|
|
|
+ (obj.data as ItemView).ImgNotGotVisible = !haveItem;
|
|
|
}
|
|
|
private void OnClickListPartsItem(EventContext context)
|
|
|
{
|