|
|
@@ -76,7 +76,7 @@ function UITipsExchangeView:Init()
|
|
|
self.type2.text2.text.text = I18N.T(Enum.EquipTypeName[cfgData.CardLocation])
|
|
|
elseif itemType == Enum.ItemType.FashionPaper then
|
|
|
local fashionData = ManagerContainer.CfgMgr:GetFashionById(cfgData.FashionId)
|
|
|
- self:RefreshJobOnly(fashionData.FashionUseJob)
|
|
|
+ --self:RefreshJobOnly(fashionData.FashionUseJob)
|
|
|
self.type2.text2.text.text = I18N.T('FashionSlot_' .. fashionData.FashionLocation)
|
|
|
elseif itemType == Enum.ItemType.Gift or itemType == Enum.ItemType.Compose or itemType == Enum.ItemType.Income or itemType == Enum.ItemType.OptionalGift then
|
|
|
local _enough, _needLevel, _level = self:JudgeItemNeedLevel(itemCfgData)
|
|
|
@@ -179,62 +179,68 @@ function UITipsExchangeView:GetCfgDataAndType(cfgId,resType,composeItem)
|
|
|
end
|
|
|
|
|
|
function UITipsExchangeView:RefreshBaseAttrs(itemType, cfgData)
|
|
|
- local needBase = itemType == Enum.ItemType.Equip
|
|
|
- or itemType == Enum.ItemType.Card
|
|
|
- or itemType == Enum.ItemType.FashionPaper
|
|
|
- or itemType == Enum.ItemType.HeadFrame
|
|
|
-
|
|
|
- self.baseAttr:SetActive(needBase)
|
|
|
- if needBase then
|
|
|
- if itemType == Enum.ItemType.Equip then
|
|
|
- local baseAttrs = {}
|
|
|
- for k,v in pairs(Enum.HeroAttrType) do
|
|
|
- if cfgData[k] and cfgData[k] ~= 0 then
|
|
|
- table.insert(baseAttrs, {Enum.HeroAttrType[k], cfgData[k]})
|
|
|
- end
|
|
|
- end
|
|
|
- local index = 0
|
|
|
- for k, v in pairs(baseAttrs) do
|
|
|
- index = index + 1
|
|
|
- CommonUtil.BatchCreateItemsLoopWithMould(self, self.attrItem, self.baseAttr.grid.transform, v, index, Enum.ItemIEnterType.Attr)
|
|
|
- end
|
|
|
- elseif itemType == Enum.ItemType.Card then
|
|
|
- local index = 0
|
|
|
- for _,v in pairs(CommonUtil.DeserializeCfgItemList(cfgData.Attribute1)) do
|
|
|
- index = index + 1
|
|
|
- CommonUtil.BatchCreateItemsLoopWithMould(self, self.attrItem, self.baseAttr.grid.transform, v, index, Enum.ItemIEnterType.Attr)
|
|
|
- end
|
|
|
- elseif itemType == Enum.ItemType.FashionPaper then
|
|
|
- local fashionData = ManagerContainer.CfgMgr:GetFashionById(cfgData.FashionId)
|
|
|
- local fashionAttrs = fashionData.FashionAttr
|
|
|
- -- 一条属性的时候
|
|
|
- if type(fashionAttrs[1]) == 'number' then
|
|
|
- fashionAttrs = {fashionAttrs}
|
|
|
- end
|
|
|
- local index = 0
|
|
|
- for _,v in pairs(fashionAttrs) do
|
|
|
- index = index + 1
|
|
|
- CommonUtil.BatchCreateItemsLoopWithMould(self, self.attrItem, self.baseAttr.grid.transform, v, index, Enum.ItemIEnterType.Attr)
|
|
|
- end
|
|
|
- elseif itemType == Enum.ItemType.HeadFrame then
|
|
|
- local baseAttrs = {}
|
|
|
- local _Attrs = cfgData.HeadFrameQuality;
|
|
|
- if _Attrs then
|
|
|
- for _k, _v in pairs(_Attrs) do
|
|
|
- if _v[1] and _v[2] then
|
|
|
- table.insert(baseAttrs, {_v[1],_v[2]});
|
|
|
- end
|
|
|
- end
|
|
|
- local index = 0
|
|
|
- for k, v in pairs(baseAttrs) do
|
|
|
- index = index + 1
|
|
|
- CommonUtil.BatchCreateItemsLoopWithMould(self, self.attrItem, self.baseAttr.grid.transform, v, index, Enum.ItemIEnterType.Attr)
|
|
|
- end
|
|
|
- end
|
|
|
- end
|
|
|
- end
|
|
|
+ local needBase = itemType == Enum.ItemType.Equip or itemType == Enum.ItemType.Card or itemType ==
|
|
|
+ Enum.ItemType.FashionPaper or itemType == Enum.ItemType.HeadFrame
|
|
|
+
|
|
|
+ self.baseAttr:SetActive(needBase)
|
|
|
+ if needBase then
|
|
|
+ if itemType == Enum.ItemType.Equip then
|
|
|
+ local baseAttrs = {}
|
|
|
+ for k, v in pairs(Enum.HeroAttrType) do
|
|
|
+ if cfgData[k] and cfgData[k] ~= 0 then
|
|
|
+ table.insert(baseAttrs, {Enum.HeroAttrType[k], cfgData[k]})
|
|
|
+ end
|
|
|
+ end
|
|
|
+ local index = 0
|
|
|
+ for k, v in pairs(baseAttrs) do
|
|
|
+ index = index + 1
|
|
|
+ CommonUtil.BatchCreateItemsLoopWithMould(self, self.attrItem, self.baseAttr.grid.transform, v, index,
|
|
|
+ Enum.ItemIEnterType.Attr)
|
|
|
+ end
|
|
|
+ elseif itemType == Enum.ItemType.Card then
|
|
|
+ local index = 0
|
|
|
+ for _, v in pairs(CommonUtil.DeserializeCfgItemList(cfgData.Attribute1)) do
|
|
|
+ index = index + 1
|
|
|
+ CommonUtil.BatchCreateItemsLoopWithMould(self, self.attrItem, self.baseAttr.grid.transform, v, index,
|
|
|
+ Enum.ItemIEnterType.Attr)
|
|
|
+ end
|
|
|
+ elseif itemType == Enum.ItemType.FashionPaper then
|
|
|
+ local fashionData = ManagerContainer.CfgMgr:GetFashionById(cfgData.FashionId)
|
|
|
+ local fashionAttrs = fashionData.FashionAttr
|
|
|
+ if fashionAttrs then
|
|
|
+ -- 一条属性的时候
|
|
|
+ if type(fashionAttrs[1]) == 'number' then
|
|
|
+ fashionAttrs = {fashionAttrs}
|
|
|
+ end
|
|
|
+ local index = 0
|
|
|
+ for _, v in pairs(fashionAttrs) do
|
|
|
+ index = index + 1
|
|
|
+ CommonUtil.BatchCreateItemsLoopWithMould(self, self.attrItem, self.baseAttr.grid.transform, v,
|
|
|
+ index, Enum.ItemIEnterType.Attr)
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ elseif itemType == Enum.ItemType.HeadFrame then
|
|
|
+ local baseAttrs = {}
|
|
|
+ local _Attrs = cfgData.HeadFrameQuality;
|
|
|
+ if _Attrs then
|
|
|
+ for _k, _v in pairs(_Attrs) do
|
|
|
+ if _v[1] and _v[2] then
|
|
|
+ table.insert(baseAttrs, {_v[1], _v[2]});
|
|
|
+ end
|
|
|
+ end
|
|
|
+ local index = 0
|
|
|
+ for k, v in pairs(baseAttrs) do
|
|
|
+ index = index + 1
|
|
|
+ CommonUtil.BatchCreateItemsLoopWithMould(self, self.attrItem, self.baseAttr.grid.transform, v,
|
|
|
+ index, Enum.ItemIEnterType.Attr)
|
|
|
+ end
|
|
|
+ end
|
|
|
+ end
|
|
|
+ end
|
|
|
end
|
|
|
|
|
|
+
|
|
|
function UITipsExchangeView:RefreshMakeMaterials(itemType)
|
|
|
local cfgId = self.controller:GetCfgId()
|
|
|
local needCost = itemType == Enum.ItemType.FashionPaper
|