【碎片合成】神将达上限,选择合成数量时没有合理提示

dev_chengFeng
ZhangBiao 2021-05-08 11:03:46 +08:00
parent fb51497d38
commit 9fda08c7ba
2 changed files with 38 additions and 34 deletions

View File

@ -109,9 +109,13 @@ function BagResolveAnCompoundPanel:BindEvent()
this.ShowCompoundNumData(value)
end)
Util.AddClick(this.addBtn, function()
if compoundNum<compoundMaxNum then
compoundNum=compoundNum+1
this.ShowCompoundNumData(compoundNum)
if endHeroNum > 0 then
if compoundNum<compoundMaxNum then
compoundNum=compoundNum+1
this.ShowCompoundNumData(compoundNum)
end
else
PopupTipPanel.ShowTip(Language[12157])
end
end)
Util.AddClick(this.jianBtn, function()
@ -126,16 +130,12 @@ function BagResolveAnCompoundPanel:BindEvent()
local item={}
item.itemId=itemData.id
item.itemNum=compoundNum*itemData.itemConfig.UsePerCount
Log("sssssssssssssss "..item.itemId.." "..item.itemNum)
-- Log("sssssssssssssss "..item.itemId.." "..item.itemNum)
NetManager.HeroComposeRequest(item,function (drop)
this.SendBackCompoundReCallBack(drop)
end)
else
if endHeroNum > 0 then
PopupTipPanel.ShowTip(Language[10183])
else
PopupTipPanel.ShowTip(Language[12157])
end
end
elseif itemData.itemConfig.ItemType==ItemType.Box then--宝箱
if compoundNum>0 then
@ -144,7 +144,7 @@ function BagResolveAnCompoundPanel:BindEvent()
item.itemId=itemData.id
item.itemNum=compoundNum--*itemData.itemConfig.UsePerCount
table.insert(itemList,item)
Log("sssssssssssssss "..item.itemId.." "..item.itemNum)
-- Log("sssssssssssssss "..item.itemId.." "..item.itemNum)
NetManager.UseAndPriceItemRequest(0,itemList,function (drop)
this.SendBackCompoundReCallBack(drop)
end)
@ -173,7 +173,7 @@ function BagResolveAnCompoundPanel:BindEvent()
end
end
end)
end)
end
--添加事件监听(用于子类重写)
@ -234,7 +234,7 @@ function this.OnShowLayout1Data()
end
--设置单个
function this.OnShowLayout1Single(_btnGo,_index)--_index 0-7
Log("_index ".._index)
-- Log("_index ".._index)
if _index==0 then--选择全部
resolveBooleList[1] = not resolveBooleList[1]
resolveBooleList={resolveBooleList[1],false,false,false,false,false,false,false}
@ -255,7 +255,7 @@ function this.OnShowLayout1Single(_btnGo,_index)--_index 0-7
Util.GetGameObject(_btnGo, "Image"):SetActive(resolveBooleList[_index+1])
end
for k,v in pairs(curSelectQuantityList) do
Log("curSelectQuantityList k v "..k..tostring(v))
-- Log("curSelectQuantityList k v "..k..tostring(v))
end
end
@ -314,24 +314,24 @@ function this.OnShowLayout3Data()
this.btnCompoundText.text=Language[10197]
compoundMaxNum=itemData.num
end
compoundNum=1
compoundNum= compoundNum>=compoundMaxNum and compoundMaxNum or compoundNum
if compoundMaxNum > 0 then
this.Slider:GetComponent("Slider").value=1
this.Slider:GetComponent("Slider").minValue=0
else
this.Slider:GetComponent("Slider").value=0
this.Slider:GetComponent("Slider").minValue=0
end
this.Slider:GetComponent("Slider").maxValue=compoundMaxNum
--this.ShowCompoundNumData(compoundNum)
this.ShowCompoundNumData(compoundMaxNum)
compoundNum=1
compoundNum= compoundNum>=compoundMaxNum and compoundMaxNum or compoundNum
if compoundMaxNum > 0 then
this.Slider:GetComponent("Slider").value=1
this.Slider:GetComponent("Slider").minValue=0
else
this.Slider:GetComponent("Slider").value=0
this.Slider:GetComponent("Slider").minValue=0
end
this.Slider:GetComponent("Slider").maxValue=compoundMaxNum
--this.ShowCompoundNumData(compoundNum)
this.ShowCompoundNumData(compoundMaxNum)
end
--道具 和 装备分解 发送请求
function this.SendBackResolveRe()
isShowTishi=false
curResolveAllItemList={}
Log("itemResolveType "..itemResolveType)
-- Log("itemResolveType "..itemResolveType)
if itemResolveType==ItemBaseType.Equip then--装备
for i = 1, #itemList do
if resolveBooleList[1]==true and itemList[i].itemConfig.IfResolve==1 then
@ -340,9 +340,9 @@ function this.SendBackResolveRe()
end
table.insert(curResolveAllItemList,itemList[i].did)
else
Log("itemList[i].equipConfig.Quality "..itemList[i].equipConfig.Quality)
-- Log("itemList[i].equipConfig.Quality "..itemList[i].equipConfig.Quality)
if curSelectQuantityList[itemList[i].equipConfig.Quality]==true and itemList[i].itemConfig.IfResolve==1 then
Log("itemList[i].did "..itemList[i].did)
-- Log("itemList[i].did "..itemList[i].did)
if itemList[i].equipConfig.Quality>=4 then
isShowTishi=true
end
@ -436,7 +436,7 @@ function this.SendBackCompoundReCallBack(drop)
end
function this.ShowCompoundNumData(value)
Log("当前slider值 "..value)
-- Log("当前slider值 "..value)
compoundNum=value
this.Slider:GetComponent("Slider").value=value
this.numText1.text = value

View File

@ -46,12 +46,18 @@ function RewardItemSingleShowPopup:BindEvent()
end)
Util.AddClick(this.btnSure, function()
if itemConfigData.ItemType == ItemType.HeroDebris 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
if sum >= 2 then
local _itemData = BagManager.bagDatas[itemSid]
UIManager.OpenPanel(UIName.BagResolveAnCompoundPanel, 3, _itemData, function()
func()
end)
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
@ -59,8 +65,6 @@ function RewardItemSingleShowPopup:BindEvent()
local item={}
item.itemId= _itemData.id
item.itemNum=compoundNum*_itemData.itemConfig.UsePerCount
local gameSetting = ConfigManager.GetConfigData(ConfigName.GameSetting, 1)
local endHeroNum=gameSetting.HeroNumlimit-LengthOfTable(HeroManager.GetAllHeroDatas())
if endHeroNum > 0 then
NetManager.HeroComposeRequest(item,function (drop)
this.SendBackCompoundReCallBack(drop)
@ -136,7 +140,7 @@ function RewardItemSingleShowPopup:BindEvent()
end,Language[10731],Language[10732],"",false,"")
else
PopupTipPanel.ShowTip(string.format(Language[11514],GetLanguageStrById(skinConfig.ReadingName)))
end
end
end)
end
elseif itemConfigData.ItemType == ItemType.HeadFrame then