From 77c3376d826bb53c52aaf636d348945cd10efa96 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 18 Nov 2021 16:03:34 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=9D=90=E9=AA=91=E7=A2=8E=E7=89=87?= =?UTF-8?q?=E5=90=88=E6=88=90=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Common/GlobalDefine.lua | 1 + .../Modules/Bag/BagResolveAnCompoundPanel.lua | 20 ++++--- .../Popup/RewardItemSingleShowPopup.lua | 56 ++++++++++++++++++- 3 files changed, 68 insertions(+), 9 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua index feee310805..31e3205d2b 100644 --- a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua +++ b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua @@ -1031,6 +1031,7 @@ ItemType = { heroDogFood =25,--英雄狗粮 linglongbaojingkaimen = 26, likeabilityItem = 27, + ZuoQiChip = 28, -- 坐骑碎片 } JumpType = { Lottery = 1, --招募 diff --git a/Assets/ManagedResources/~Lua/Modules/Bag/BagResolveAnCompoundPanel.lua b/Assets/ManagedResources/~Lua/Modules/Bag/BagResolveAnCompoundPanel.lua index 32c4fcbc88..0a7e5b4fc4 100644 --- a/Assets/ManagedResources/~Lua/Modules/Bag/BagResolveAnCompoundPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Bag/BagResolveAnCompoundPanel.lua @@ -133,7 +133,8 @@ function BagResolveAnCompoundPanel:BindEvent() end end) Util.AddClick(this.btnCompound, function() - if itemData.itemConfig.ItemType==ItemType.HeroDebris then--碎片 + if itemData.itemConfig.ItemType==ItemType.HeroDebris + or itemData.itemConfig.ItemType==ItemType.ZuoQiChip then--碎片 if compoundNum>0 then local item={} item.itemId=itemData.id @@ -292,7 +293,8 @@ function this.OnShowLayout3Data() this.chipFrame:SetActive(false) this.propertyIma:SetActive(false) local gameSetting = ConfigManager.GetConfigData(ConfigName.GameSetting, 1) - if itemData.itemConfig.ItemType==ItemType.HeroDebris then--碎片 + if itemData.itemConfig.ItemType==ItemType.HeroDebris + or itemData.itemConfig.ItemType==ItemType.ZuoQiChip then--碎片 this.chipFrame:SetActive(true) this.chipFrame:GetComponent("Image").sprite = this.spLoader:LoadSprite(GetHeroChipQuantityImageByquality(itemData.itemConfig.Quantity)) if itemData.itemConfig.PropertyName and itemData.itemConfig.PropertyName > 0 then @@ -305,12 +307,13 @@ function this.OnShowLayout3Data() this.nameText.text=Language[10192] this.btnCompoundText.text=Language[10193] local maxCompoundValue = math.floor(itemData.num/itemData.itemConfig.UsePerCount) - compoundMaxNum=maxCompoundValue > gameSetting.HeroCompoundLimit and gameSetting.HeroCompoundLimit or maxCompoundValue - endHeroNum=gameSetting.HeroNumlimit-LengthOfTable(HeroManager.GetAllHeroDatas()) - compoundMaxNum=compoundMaxNum >endHeroNum and endHeroNum or compoundMaxNum - if compoundMaxNum > compoundMaxNum then - compoundMaxNum = compoundMaxNum + -- + if itemData.itemConfig.ItemType==ItemType.HeroDebris then -- 神将碎片 + compoundMaxNum = math.min(maxCompoundValue, gameSetting.HeroCompoundLimit, gameSetting.HeroNumlimit-LengthOfTable(HeroManager.GetAllHeroDatas())) + elseif itemData.itemConfig.ItemType==ItemType.ZuoQiChip then -- 坐骑碎片 + compoundMaxNum = math.min(maxCompoundValue, gameSetting.HeroCompoundLimit) end + elseif itemData.itemConfig.ItemType==ItemType.Box then--宝箱 this.nameText.text=Language[10194] this.btnCompoundText.text=Language[10195] @@ -448,7 +451,8 @@ function this.ShowCompoundNumData(value) compoundNum=value this.Slider:GetComponent("Slider").value=value this.numText1.text = value - if itemData.itemConfig.ItemType==ItemType.HeroDebris then--碎片 + if itemData.itemConfig.ItemType==ItemType.HeroDebris + or itemData.itemConfig.ItemType==ItemType.ZuoQiChip then--碎片 this.numText.text= Language[10198]..value*itemData.itemConfig.UsePerCount..Language[10199]..value..Language[10200].. string.gsub(GetLanguageStrById(itemData.itemConfig.Name),Language[10201],"") elseif itemData.itemConfig.ItemType==ItemType.Box then--宝箱 this.numText.text= Language[10202]..value..Language[10200]..GetLanguageStrById(itemData.itemConfig.Name).."。" diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua b/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua index 0e6dec6aa1..795ae5a5a0 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua @@ -150,6 +150,57 @@ function RewardItemSingleShowPopup:BindEvent() self:ClosePanel() end) end,Language[10731],Language[10732],Language[11511],false,"") + elseif itemConfigData.ItemType == ItemType.ZuoQiChip then + -- local gameSetting = ConfigManager.GetConfigData(ConfigName.GameSetting, 1) + -- local endHeroNum=gameSetting.HeroNumlimit-LengthOfTable(HeroManager.GetAllHeroDatas()) + local sum = BagManager.GetItemCountById(itemSid) / BagManager.bagDatas[itemSid].itemConfig.UsePerCount + sum = math.floor(sum) + if sum >= 2 then + local _itemData = BagManager.bagDatas[itemSid] + UIManager.OpenPanel(UIName.BagResolveAnCompoundPanel, 3, _itemData, function() + func() + end) + elseif sum >= 1 then + local _itemData = BagManager.bagDatas[itemSid] + local item={} + item.itemId= _itemData.id + item.itemNum= sum * _itemData.itemConfig.UsePerCount + NetManager.HeroComposeRequest(item,function (drop) + this.SendBackCompoundReCallBack(drop) + end) + else + PopupTipPanel.ShowTip(Language[11509]) + end + + -- if sum >= 2 then + -- local _itemData = BagManager.bagDatas[itemSid] + -- if endHeroNum > 0 then + -- UIManager.OpenPanel(UIName.BagResolveAnCompoundPanel, 3, _itemData, function() + -- func() + -- end) + -- else + -- PopupTipPanel.ShowTip(Language[12157]) + -- end + -- elseif sum >= 1 and sum < 2 then + -- -- body + -- local compoundNum = 1 + -- local _itemData = BagManager.bagDatas[itemSid] + -- local item={} + -- item.itemId= _itemData.id + -- item.itemNum=compoundNum*_itemData.itemConfig.UsePerCount + -- if endHeroNum > 0 then + -- NetManager.HeroComposeRequest(item,function (drop) + -- this.SendBackCompoundReCallBack(drop) + -- end) + -- if compoundNum<=0 then + -- PopupTipPanel.ShowTip(Language[10183]) + -- end + -- else + -- PopupTipPanel.ShowTip(Language[12157]) + -- end + -- else + -- PopupTipPanel.ShowTip(Language[11509]) + -- end else local _itemData = BagManager.bagDatas[itemSid] UIManager.OpenPanel(UIName.BagResolveAnCompoundPanel, 3, _itemData, function() @@ -312,7 +363,10 @@ function RewardItemSingleShowPopup:OnShow() elseif isBagPanel and itemConfigData.IfResolve == 1 and func then--是否可分解 this.btnSure:SetActive(true) this.btnSureText.text = Language[10197] - elseif isBagPanel and itemConfigData.ItemType == 2 and func then--是否是碎片可合成 + elseif isBagPanel and func --是否是碎片可合成 + and (itemConfigData.ItemType == ItemType.HeroDebris + or itemConfigData.ItemType == ItemType.ZuoQiChip) + then this.btnSureText.text = Language[10193] this.btnSure:SetActive(true) elseif isBagPanel and itemConfigData.ItemType == 10 and func then--是否宝箱可使用