|
@@ -12,7 +12,6 @@ namespace GFGGame
|
|
{
|
|
{
|
|
private UI_BagUI _ui;
|
|
private UI_BagUI _ui;
|
|
private ValueBarController _valueBarController;
|
|
private ValueBarController _valueBarController;
|
|
- private GComponent _imgSelected;
|
|
|
|
private List<ItemView> _listItemViews = new List<ItemView>();
|
|
private List<ItemView> _listItemViews = new List<ItemView>();
|
|
private int _curItemId = -1;
|
|
private int _curItemId = -1;
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
@@ -29,11 +28,6 @@ namespace GFGGame
|
|
_listItemViews[i] = null;
|
|
_listItemViews[i] = null;
|
|
}
|
|
}
|
|
|
|
|
|
- if (_imgSelected != null)
|
|
|
|
- {
|
|
|
|
- _imgSelected.RemoveFromParent();
|
|
|
|
- _imgSelected.Dispose();
|
|
|
|
- }
|
|
|
|
if (_ui != null)
|
|
if (_ui != null)
|
|
{
|
|
{
|
|
_ui.Dispose();
|
|
_ui.Dispose();
|
|
@@ -56,10 +50,8 @@ namespace GFGGame
|
|
_ui.m_list.itemRenderer = ListItemRender;
|
|
_ui.m_list.itemRenderer = ListItemRender;
|
|
_ui.m_list.onClickItem.Add(OnListItemClick);
|
|
_ui.m_list.onClickItem.Add(OnListItemClick);
|
|
|
|
|
|
- _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("mrqd_bjbj");
|
|
|
|
|
|
+ _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("tc_bjbj");
|
|
|
|
|
|
- _imgSelected = new GComponent();
|
|
|
|
- _imgSelected = UIPackage.CreateObject(UI_BagUI.PACKAGE_NAME, "ComSelect").asCom;
|
|
|
|
}
|
|
}
|
|
protected override void AddEventListener()
|
|
protected override void AddEventListener()
|
|
{
|
|
{
|
|
@@ -95,7 +87,6 @@ namespace GFGGame
|
|
_ui.m_list.selectedIndex = index;
|
|
_ui.m_list.selectedIndex = index;
|
|
int childIndex = _ui.m_list.ItemIndexToChildIndex(index);
|
|
int childIndex = _ui.m_list.ItemIndexToChildIndex(index);
|
|
GComponent comItem = _ui.m_list.GetChildAt(childIndex).asCom;
|
|
GComponent comItem = _ui.m_list.GetChildAt(childIndex).asCom;
|
|
- ChangeSelect(comItem);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -119,16 +110,11 @@ namespace GFGGame
|
|
GComponent comItem = (context.data as GComponent);
|
|
GComponent comItem = (context.data as GComponent);
|
|
ItemView itemData = comItem.data as ItemView;
|
|
ItemView itemData = comItem.data as ItemView;
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemData.ItemData.id);
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemData.ItemData.id);
|
|
- if (itemCfg.useType == 0)
|
|
|
|
|
|
+ if (itemCfg.subType == 0)
|
|
{
|
|
{
|
|
object[] sourceDatas = new object[] { itemCfg.id, new object[] { typeof(BagView).FullName, this.viewData } };
|
|
object[] sourceDatas = new object[] { itemCfg.id, new object[] { typeof(BagView).FullName, this.viewData } };
|
|
GoodsItemTipsController.ShowItemTips(itemCfg.id, sourceDatas);
|
|
GoodsItemTipsController.ShowItemTips(itemCfg.id, sourceDatas);
|
|
}
|
|
}
|
|
- ChangeSelect(comItem);
|
|
|
|
- }
|
|
|
|
- private void ChangeSelect(GComponent comItem)
|
|
|
|
- {
|
|
|
|
- comItem.AddChildAt(_imgSelected, 0);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private void OnBtnBackClick()
|
|
private void OnBtnBackClick()
|