|
@@ -39,7 +39,7 @@ namespace GFGGame
|
|
|
private GoWrapper _wrapper;
|
|
|
private DressUpObjDataCache _dressUpObjDataCache;
|
|
|
private ValueBarController _valueBarController;
|
|
|
- private GComponent _imgSelected;
|
|
|
+ private GImage _imgSelected;
|
|
|
private int _suitId;
|
|
|
private int _itemId;
|
|
|
private int[] _items;
|
|
@@ -102,12 +102,13 @@ namespace GFGGame
|
|
|
_scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneDressUpSynthetic"));
|
|
|
_dressUpObjDataCache = new DressUpObjDataCache();
|
|
|
|
|
|
- _imgSelected = new GComponent();
|
|
|
- _imgSelected = UIPackage.CreateObject(UI_ClothingSyntheticUI.PACKAGE_NAME, "ComSelect").asCom;
|
|
|
+ _imgSelected = new GImage();
|
|
|
+ _imgSelected = UIPackage.CreateObject(UI_ClothingSyntheticUI.PACKAGE_NAME, "hc_kuang_4").asImage;
|
|
|
|
|
|
_ui.m_listClothing.itemRenderer = ListClothingItemRender;
|
|
|
_ui.m_listClothing.onClickItem.Add(OnClickListClothingItem);
|
|
|
|
|
|
+ _ui.m_listMaterias.itemRenderer = RenderListMateriasItem;
|
|
|
|
|
|
_ui.m_btnBack.onClick.Add(OnClickBtnBack);
|
|
|
_ui.m_btnProduction.onClick.Add(OnClickBtnProcuction);
|
|
@@ -146,6 +147,7 @@ namespace GFGGame
|
|
|
{
|
|
|
_wrapper.wrapTarget = null;
|
|
|
}
|
|
|
+ _ui.m_listMaterias.selectedIndex = 0;
|
|
|
Timers.inst.Remove(CheckGuide);
|
|
|
|
|
|
}
|
|
@@ -317,7 +319,7 @@ namespace GFGGame
|
|
|
private void UpdateSelectedItemInfo(GComponent listItem, bool tween)
|
|
|
{
|
|
|
_selectedListItem = listItem;
|
|
|
- listItem.AddChild(_imgSelected);
|
|
|
+ listItem.AddChildAt(_imgSelected, 1);
|
|
|
_selectedItemId = (int)listItem.data;
|
|
|
UpdateRole(tween);
|
|
|
UpdateSelectedItemInfo();
|
|
@@ -338,42 +340,39 @@ namespace GFGGame
|
|
|
UI_ClothingListItem.ProxyEnd();
|
|
|
//合成显示
|
|
|
ItemCfg clothingSyntheticCfg = ItemCfgArray.Instance.GetCfg(_selectedItemId);
|
|
|
- string costName = ItemUtil.GetItemName(clothingSyntheticCfg.syntheticCostID);
|
|
|
- _ui.m_txtCost.SetVar("v1", "" + clothingSyntheticCfg.syntheticCostNum).SetVar("v2", costName).FlushVars();
|
|
|
+ // string costName = ItemUtil.GetItemName(clothingSyntheticCfg.syntheticCostID);
|
|
|
+ // _ui.m_txtCost.SetVar("v1", "" + clothingSyntheticCfg.syntheticCostNum).SetVar("v2", costName).FlushVars();
|
|
|
+ ItemUtil.SetItemNeedNum(_ui.m_comCostCurrency, clothingSyntheticCfg.syntheticCostID, clothingSyntheticCfg.syntheticCostNum);
|
|
|
_materiarsOfSelectedItem = ItemUtil.CreateItemDataList(clothingSyntheticCfg.syntheticMateriarsArr);
|
|
|
- int count = _ui.m_listMaterias.numChildren;
|
|
|
- for (int i = 0; i < count; i++)
|
|
|
- {
|
|
|
- UI_MateriasListItem listItem = UI_MateriasListItem.Proxy(_ui.m_listMaterias.GetChildAt(i));
|
|
|
- if (i < _materiarsOfSelectedItem.Count)
|
|
|
- {
|
|
|
- ItemData itemData = _materiarsOfSelectedItem[i];
|
|
|
- ItemCfg materiasItemCfg = ItemCfgArray.Instance.GetCfg(itemData.id);
|
|
|
- listItem.m_txtName.text = ItemUtil.GetItemName(itemData.id);
|
|
|
- listItem.m_loaderIcon.url = ResPathUtil.GetIconPath(materiasItemCfg);
|
|
|
- int num = ItemDataManager.GetItemNum(itemData.id);
|
|
|
- ItemCfg materialCfg = ItemCfgArray.Instance.GetCfg(itemData.id);
|
|
|
- bool isDressUp = materialCfg.itemType == ConstItemType.DRESS_UP;
|
|
|
- int numSynthetic = Mathf.Max(num, 0);
|
|
|
- listItem.m_txtProgess.text = numSynthetic + "/" + itemData.num;
|
|
|
- listItem.m_loaderIcon.visible = true;
|
|
|
- listItem.m_txtProgess.visible = true;
|
|
|
- listItem.target.onClick.Clear();
|
|
|
- listItem.target.onClick.Add(OnClickMateriasItemPlus);
|
|
|
- listItem.target.data = itemData;
|
|
|
+ _ui.m_listMaterias.numItems = _materiarsOfSelectedItem.Count;
|
|
|
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- listItem.m_txtName.text = "";
|
|
|
- listItem.m_loaderIcon.visible = false;
|
|
|
- listItem.m_txtProgess.visible = false;
|
|
|
- }
|
|
|
- UI_MateriasListItem.ProxyEnd();
|
|
|
- }
|
|
|
+
|
|
|
+ _ui.m_listMaterias.selectedIndex = 0;
|
|
|
_ui.m_btnProduction.grayed = ItemDataManager.GetItemNum(_selectedItemId) > 0;
|
|
|
}
|
|
|
-
|
|
|
+ private void RenderListMateriasItem(int index, GObject obj)
|
|
|
+ {
|
|
|
+ UI_MateriasListItem listItem = UI_MateriasListItem.Proxy(obj);
|
|
|
+
|
|
|
+ ItemData itemData = _materiarsOfSelectedItem[index];
|
|
|
+ ItemCfg materiasItemCfg = ItemCfgArray.Instance.GetCfg(itemData.id);
|
|
|
+ listItem.m_txtName.text = ItemUtil.GetItemName(itemData.id);
|
|
|
+ listItem.m_loaderIcon.url = ResPathUtil.GetIconPath(materiasItemCfg);
|
|
|
+ int num = ItemDataManager.GetItemNum(itemData.id);
|
|
|
+ ItemCfg materialCfg = ItemCfgArray.Instance.GetCfg(itemData.id);
|
|
|
+ bool isDressUp = materialCfg.itemType == ConstItemType.DRESS_UP;
|
|
|
+ int numSynthetic = Mathf.Max(num, 0);
|
|
|
+ listItem.m_txtProgess.text = numSynthetic + "/" + itemData.num;
|
|
|
+ listItem.m_loaderIcon.visible = true;
|
|
|
+ listItem.m_txtProgess.visible = true;
|
|
|
+ listItem.target.onClick.Clear();
|
|
|
+ if (listItem.target.data == null)
|
|
|
+ {
|
|
|
+ listItem.target.onClick.Add(OnClickMateriasItemPlus);
|
|
|
+ }
|
|
|
+ listItem.target.data = index;
|
|
|
+ UI_MateriasListItem.ProxyEnd();
|
|
|
+ }
|
|
|
private void OnClickMateriasItemPlus(EventContext context)
|
|
|
{
|
|
|
GuideCfg cfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.CLOTHING_SYNTHETIC);
|
|
@@ -381,16 +380,11 @@ namespace GFGGame
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
- // UI_Component3 groupCount = UI_Component3.Proxy(context.sender as GObject);
|
|
|
- UI_MateriasListItem listItem = UI_MateriasListItem.Proxy(context.sender as GObject);
|
|
|
- ItemData itemData = listItem.target.data as ItemData;
|
|
|
- // int num = ItemDataManager.GetItemNum(itemData.id);
|
|
|
- // int needCount = (itemData.num - num) > 0 ? itemData.num - num : 1;
|
|
|
- // ViewManager.Show(ViewName.APPROACH_OF_ITEM_VIEW, new object[] { itemData.id, new object[] { ViewName.CLOTHING_SYNTHETIC_VIEW, new object[] { _suitId, _selectedItemId } }, itemData.num });
|
|
|
+ int index = (int)(context.sender as GObject).data;
|
|
|
+ _ui.m_listMaterias.selectedIndex = index;
|
|
|
+ ItemData itemData = _materiarsOfSelectedItem[index];
|
|
|
object[] sourceDatas = new object[] { itemData.id, new object[] { ViewName.CLOTHING_SYNTHETIC_VIEW, new object[] { _suitId, _selectedItemId } }, itemData.num };
|
|
|
GoodsItemTipsController.ShowItemTips(itemData.id, sourceDatas);
|
|
|
- // UI_Component3.ProxyEnd();
|
|
|
- UI_MateriasListItem.ProxyEnd();
|
|
|
}
|
|
|
|
|
|
private void OnItemNumChanged()
|