【云游商人】选中武器点确定,再选中护甲点取消,最后合成的是护甲

dev_chengFeng
gaoxin 2021-04-27 20:26:10 +08:00
parent a5b8dc1de9
commit 1e7142008c
1 changed files with 7 additions and 4 deletions

View File

@ -31,6 +31,7 @@ end
function this:BindEvent() function this:BindEvent()
Util.AddClick(this.confirm,function() Util.AddClick(this.confirm,function()
data.otherData.selectId = self.selectId
parent:ClosePanel() parent:ClosePanel()
if func then if func then
func() func()
@ -54,6 +55,7 @@ function this:OnShow(_parent,...)
local _args = {...} local _args = {...}
data = _args[1] data = _args[1]
func = _args[2] func = _args[2]
self.selectId = data.otherData.selectId
local list = BagManager.GetBagItemDataByItemType(ItemBaseType.Equip) local list = BagManager.GetBagItemDataByItemType(ItemBaseType.Equip)
local EquipedEquipList = HeroManager.GetEquipedEquipList() local EquipedEquipList = HeroManager.GetEquipedEquipList()
@ -119,19 +121,19 @@ function this:ShowSingleData(item,sdata,index)
self.itemList[index].gameObject:SetActive(true) self.itemList[index].gameObject:SetActive(true)
self.maskList[index] = itemmask self.maskList[index] = itemmask
self.maskImageList[index] = maskImage self.maskImageList[index] = maskImage
self.maskImageList[index]:SetActive(data.otherData.selectId == sdata.Id) self.maskImageList[index]:SetActive(self.selectId == sdata.Id)
Util.AddOnceClick(self.maskList[index],function () Util.AddOnceClick(self.maskList[index],function ()
for i = 1, #self.maskImageList do for i = 1, #self.maskImageList do
self.maskImageList[i]:SetActive(false) self.maskImageList[i]:SetActive(false)
end end
if data.otherData.selectId == sdata.Id then if self.selectId == sdata.Id then
self.maskImageList[index]:SetActive(false) self.maskImageList[index]:SetActive(false)
data.otherData.selectId = 0 self.selectId = 0
else else
self.maskImageList[index]:SetActive(true) self.maskImageList[index]:SetActive(true)
data.otherData.selectId = sdata.Id self.selectId = sdata.Id
end end
end) end)
Util.AddOnceClick(equiped,function () Util.AddOnceClick(equiped,function ()
@ -140,6 +142,7 @@ function this:ShowSingleData(item,sdata,index)
end end
function this:OnClose() function this:OnClose()
self.selectId = nil
self.equipList={} self.equipList={}
self.maskList = {} self.maskList = {}
self.maskImageList = {} self.maskImageList = {}