【云游商人】优化

dev_chengFeng
ZhangBiao 2021-12-30 16:29:37 +08:00
parent f500bc9ed1
commit 5672203920
3 changed files with 20 additions and 5 deletions

View File

@ -646,20 +646,21 @@ end
--红点检测(云游商人)
function this.CheckSingleRed(data)
local NeedCost = ConfigManager.GetConfigData(ConfigName.ComposeBook,data.otherData.needItems[1]).NeedCost
local ComposeBook = ConfigManager.GetConfig(ConfigName.ComposeBook)
if data.progress > 0 then
if BagManager.GetTotalItemNum(NeedCost[1][1]) >= NeedCost[1][2] then
local list = BagManager.GetBagItemDataByItemType(ItemBaseType.Equip)
local EquipedEquipList = HeroManager.GetEquipedEquipList()
for i = 1, #data.otherData.needItems do
for j = 1, #list do
if data.otherData.needItems[i] == list[j].itemConfig.Id then
if ComposeBook[data.otherData.needItems[i]].NeedItems[1][1] == list[j].itemConfig.Id then
return true
end
end
end
for i = 1, #data.otherData.needItems do
for j = 1, #EquipedEquipList do
if data.otherData.needItems[i] == EquipedEquipList[j] then
if ComposeBook[data.otherData.needItems[i]].NeedItems[1][1] == EquipedEquipList[j] then
return true
end
end

View File

@ -1,5 +1,6 @@
ItemUpstarPre = {}
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local ComposeBook = ConfigManager.GetConfig(ConfigName.ComposeBook)
function ItemUpstarPre:New(gameObject)
local b = {}
b.gameObject = gameObject
@ -67,11 +68,12 @@ function ItemUpstarPre:SetData(_data,_parent,_sortingOrder,_actData,_actConfig)
self:Refresh()
end
function ItemUpstarPre:Refresh()
function ItemUpstarPre:Refresh()--ComposeBook[data.otherData.needItems[i]].NeedItems[1][1]
-- LogPink("self.data.missionId.:"..tostring(self.data.missionId).." #self.data.otherData.needItems:"..tostring(#self.data.otherData.needItems))
local needItemId = self.data.otherData.selectId == 0 and self.data.otherData.needItems[1] or self.data.otherData.selectId
local configData = ConfigManager.GetConfigData(ConfigName.ComposeBook,needItemId)
local rewardList = {configData.NeedItems[1],configData.NeedCost[1],configData.GoalItems[1]}
-- LogGreen(tostring(configData.NeedItems[1][1]).." "..tostring(configData.NeedCost[1][1]).." "..tostring(configData.GoalItems[1][1]).." "..tostring(self.data.otherData.selectId))
--设置内容
if not self.itemList then
self.itemList = {}

View File

@ -33,7 +33,16 @@ end
function this:BindEvent()
Util.AddClick(this.confirm,function()
data.otherData.selectId = self.selectId
if self.selectId == 0 then
data.otherData.selectId = 0
else
for _, configInfo in ConfigPairs(ConfigManager.GetConfig(ConfigName.ComposeBook)) do
if configInfo.NeedItems[1][1] == self.selectId and configInfo.Type == data.otherData.composeType then
data.otherData.selectId = configInfo.Id
break
end
end
end
parent:ClosePanel()
if func then
func()
@ -57,7 +66,10 @@ function this:OnShow(_parent,...)
local _args = {...}
data = _args[1]
func = _args[2]
self.selectId = data.otherData.selectId
self.selectId = 0
if data.otherData.selectId > 0 then
self.selectId = ComposeBook[data.otherData.selectId].NeedItems[1][1]
end
local list = BagManager.GetBagItemDataByItemType(ItemBaseType.Equip)
local EquipedEquipList = HeroManager.GetEquipedEquipList()