【坐骑碎片合成】
parent
e705049135
commit
77c3376d82
|
@ -1031,6 +1031,7 @@ ItemType = {
|
|||
heroDogFood =25,--英雄狗粮
|
||||
linglongbaojingkaimen = 26,
|
||||
likeabilityItem = 27,
|
||||
ZuoQiChip = 28, -- 坐骑碎片
|
||||
}
|
||||
JumpType = {
|
||||
Lottery = 1, --招募
|
||||
|
|
|
@ -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).."。"
|
||||
|
|
|
@ -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--是否宝箱可使用
|
||||
|
|
Loading…
Reference in New Issue