|
@@ -33,6 +33,7 @@ namespace GFGGame
|
|
|
|
|
|
private int _selectedItemId;//打开界面时选中的物品id
|
|
private int _selectedItemId;//打开界面时选中的物品id
|
|
private int _selectedType = 0;//打开界面时选中的物品类型
|
|
private int _selectedType = 0;//打开界面时选中的物品类型
|
|
|
|
+ private int _selectedItemCount;
|
|
private int _selectedItemClothingId;
|
|
private int _selectedItemClothingId;
|
|
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
@@ -96,13 +97,14 @@ namespace GFGGame
|
|
|
|
|
|
_storeId = ConstStoreId.CLOTHING_STORE_ID;
|
|
_storeId = ConstStoreId.CLOTHING_STORE_ID;
|
|
_scoreType = 0;
|
|
_scoreType = 0;
|
|
- _selectedItemId = -1;
|
|
|
|
|
|
+ _selectedItemId = 0;
|
|
_selectedType = 0;
|
|
_selectedType = 0;
|
|
if (this.viewData != null)
|
|
if (this.viewData != null)
|
|
{
|
|
{
|
|
//this.viewData[0]=storeId(商店Id)
|
|
//this.viewData[0]=storeId(商店Id)
|
|
//this.viewData[1]=_scoreType(服装属性:风花雪月)
|
|
//this.viewData[1]=_scoreType(服装属性:风花雪月)
|
|
//this.viewData[2]=_selectedItemId
|
|
//this.viewData[2]=_selectedItemId
|
|
|
|
+ //this.viewData[2]=_selectedItemCount
|
|
object[] objs = this.viewData as object[];
|
|
object[] objs = this.viewData as object[];
|
|
if (objs.Length > 0 && objs[0] != null)
|
|
if (objs.Length > 0 && objs[0] != null)
|
|
{
|
|
{
|
|
@@ -115,6 +117,7 @@ namespace GFGGame
|
|
if (objs.Length > 2 && objs[2] != null)
|
|
if (objs.Length > 2 && objs[2] != null)
|
|
{
|
|
{
|
|
_selectedItemId = (int)objs[2];//从物品来源面板跳转到商店,需要物品id方便打开界面时做选中处理
|
|
_selectedItemId = (int)objs[2];//从物品来源面板跳转到商店,需要物品id方便打开界面时做选中处理
|
|
|
|
+ _selectedItemCount = (int)objs[3];
|
|
ClothingShopCfg[] dataArray = ClothingShopCfgArray.Instance.dataArray;
|
|
ClothingShopCfg[] dataArray = ClothingShopCfgArray.Instance.dataArray;
|
|
for (int i = 0; i < dataArray.Length; i++)
|
|
for (int i = 0; i < dataArray.Length; i++)
|
|
{
|
|
{
|
|
@@ -154,7 +157,10 @@ namespace GFGGame
|
|
{
|
|
{
|
|
_valueBarController.Controller(3);
|
|
_valueBarController.Controller(3);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if (_selectedItemId > 0)
|
|
|
|
+ {
|
|
|
|
+ BuyItemConteoller.Show(_cfgSelected.itemID, _cfgSelected.costID, INIT_COUNT, _cfgSelected.costNum, _selectedItemCount, null, true, false, MAX_COUNT);
|
|
|
|
+ }
|
|
GuideController.TryGuideClothingShopViewBtnBug(_ui.m_compItemInfo.m_btnBuy);
|
|
GuideController.TryGuideClothingShopViewBtnBug(_ui.m_compItemInfo.m_btnBuy);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -171,6 +177,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
_wrapper.wrapTarget = null;
|
|
_wrapper.wrapTarget = null;
|
|
}
|
|
}
|
|
|
|
+ _selectedItemId = 0;
|
|
EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, UpdateSelectedItemInfo);
|
|
EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, UpdateSelectedItemInfo);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -186,7 +193,8 @@ namespace GFGGame
|
|
private void OnclickBtnBuy()
|
|
private void OnclickBtnBuy()
|
|
{
|
|
{
|
|
GuideController.HideGuide();
|
|
GuideController.HideGuide();
|
|
- BuyItemConteoller.Show(_cfgSelected.itemID, _cfgSelected.costID, INIT_COUNT, _cfgSelected.costNum, INIT_COUNT, null, true, false, MAX_COUNT);
|
|
|
|
|
|
+ int count = _selectedItemId > 0 && _cfgSelected.itemID == _selectedItemId ? _selectedItemCount : INIT_COUNT;
|
|
|
|
+ BuyItemConteoller.Show(_cfgSelected.itemID, _cfgSelected.costID, INIT_COUNT, _cfgSelected.costNum, count, null, true, false, MAX_COUNT);
|
|
|
|
|
|
}
|
|
}
|
|
private void UpdateItemChange()
|
|
private void UpdateItemChange()
|
|
@@ -268,7 +276,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
itemIndex = _dataList.IndexOf(clothingShopCfg);
|
|
itemIndex = _dataList.IndexOf(clothingShopCfg);
|
|
_ui.m_listShop.ScrollToView(itemIndex < 0 ? 0 : itemIndex);
|
|
_ui.m_listShop.ScrollToView(itemIndex < 0 ? 0 : itemIndex);
|
|
- _selectedItemId = 0;
|
|
|
|
|
|
+ // _selectedItemId = 0;
|
|
}
|
|
}
|
|
UpdateSelectedItemInfo(_ui.m_listShop.GetChildAt(itemIndex) as GComponent, tween);
|
|
UpdateSelectedItemInfo(_ui.m_listShop.GetChildAt(itemIndex) as GComponent, tween);
|
|
}
|
|
}
|
|
@@ -283,6 +291,7 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickListShopItem(EventContext context)
|
|
private void OnClickListShopItem(EventContext context)
|
|
{
|
|
{
|
|
|
|
+ _selectedItemId = 0;
|
|
UpdateSelectedItemInfo(context.data as GComponent, true);
|
|
UpdateSelectedItemInfo(context.data as GComponent, true);
|
|
}
|
|
}
|
|
|
|
|