【云游商人】装备文字叠加、显示人名错误修改

dev_chengFeng
ZhangBiao 2021-11-24 10:18:36 +08:00 committed by zhangshanxue
parent 96a4af1532
commit eb6f41e03b
1 changed files with 26 additions and 13 deletions

View File

@ -27,6 +27,7 @@ function this:InitComponent(gameObject)
self.itemList = {}
self.maskList = {}
self.maskImageList = {}
self.heroNameList = {}--所有装备对应的英雄明list
end
function this:BindEvent()
@ -116,32 +117,43 @@ function this:ShowSingleData(item,sdata,index)
local equiped = Util.GetGameObject(item,"equiped")
maskImage:SetActive(false)
equiped:SetActive(sdata.Equiped)
if not self.itemList[index] then
self.itemList[index] = SubUIManager.Open(SubUIConfig.ItemView,itemtrans.transform)
self.itemList[index].gameObject:SetActive(false)
if not self.itemList[item] then
self.itemList[item] = SubUIManager.Open(SubUIConfig.ItemView,itemtrans.transform)
self.itemList[item].gameObject:SetActive(false)
end
self.itemList[item]:OnOpen(false, {sdata.Id,sdata.Num}, 1,true,false,false,sortingOrder)
self.itemList[item].gameObject:SetActive(true)
self.maskList[item] = itemmask
self.maskImageList[item] = maskImage
self.maskImageList[item]:SetActive(self.selectId == sdata.Id)
if not self.heroNameList[index] then
if sdata.Equiped then
local data = HeroManager.GetHeroIdListByEquipId(sdata.Id)
for i = 1, #data do
table.insert( self.heroNameList,data[i])
end
else
self.heroNameList[index] = nil
end
end
LogGreen("index:"..tostring(index))
self.itemList[index]:OnOpen(false, {sdata.Id,sdata.Num}, 1,true,false,false,sortingOrder)
self.itemList[index].gameObject:SetActive(true)
self.maskList[index] = itemmask
self.maskImageList[index] = maskImage
self.maskImageList[index]:SetActive(self.selectId == sdata.Id)
Util.AddOnceClick(self.maskList[index],function ()
Util.AddOnceClick(self.maskList[item],function ()
for i = 1, #self.maskImageList do
self.maskImageList[i]:SetActive(false)
end
if self.selectId == sdata.Id then
self.maskImageList[index]:SetActive(false)
self.maskImageList[item]:SetActive(false)
self.selectId = 0
else
self.maskImageList[index]:SetActive(true)
self.maskImageList[item]:SetActive(true)
self.selectId = sdata.Id
end
end)
Util.AddOnceClick(equiped,function ()
MsgPanel.ShowTwo(string.format("<size=45><color=#00FF66>%s</color>穿戴该装备,是否前往卸下?</size>",HeroManager.GetHeroIdListByEquipId(sdata.Id)[index]),function() end,function()
MsgPanel.ShowTwo(string.format("<size=45><color=#00FF66>%s</color>穿戴该装备,是否前往卸下?</size>",self.heroNameList[index]),function() end,function()
JumpManager.GoJump(22001)
end,"取消","确定")
end)
@ -152,6 +164,7 @@ function this:OnClose()
self.equipList={}
self.maskList = {}
self.maskImageList = {}
self.heroNameList = {}
end
function this:OnDestroy()