【坐骑碎片合成】
parent
e705049135
commit
77c3376d82
|
@ -1031,6 +1031,7 @@ ItemType = {
|
||||||
heroDogFood =25,--英雄狗粮
|
heroDogFood =25,--英雄狗粮
|
||||||
linglongbaojingkaimen = 26,
|
linglongbaojingkaimen = 26,
|
||||||
likeabilityItem = 27,
|
likeabilityItem = 27,
|
||||||
|
ZuoQiChip = 28, -- 坐骑碎片
|
||||||
}
|
}
|
||||||
JumpType = {
|
JumpType = {
|
||||||
Lottery = 1, --招募
|
Lottery = 1, --招募
|
||||||
|
|
|
@ -133,7 +133,8 @@ function BagResolveAnCompoundPanel:BindEvent()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.btnCompound, function()
|
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
|
if compoundNum>0 then
|
||||||
local item={}
|
local item={}
|
||||||
item.itemId=itemData.id
|
item.itemId=itemData.id
|
||||||
|
@ -292,7 +293,8 @@ function this.OnShowLayout3Data()
|
||||||
this.chipFrame:SetActive(false)
|
this.chipFrame:SetActive(false)
|
||||||
this.propertyIma:SetActive(false)
|
this.propertyIma:SetActive(false)
|
||||||
local gameSetting = ConfigManager.GetConfigData(ConfigName.GameSetting, 1)
|
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:SetActive(true)
|
||||||
this.chipFrame:GetComponent("Image").sprite = this.spLoader:LoadSprite(GetHeroChipQuantityImageByquality(itemData.itemConfig.Quantity))
|
this.chipFrame:GetComponent("Image").sprite = this.spLoader:LoadSprite(GetHeroChipQuantityImageByquality(itemData.itemConfig.Quantity))
|
||||||
if itemData.itemConfig.PropertyName and itemData.itemConfig.PropertyName > 0 then
|
if itemData.itemConfig.PropertyName and itemData.itemConfig.PropertyName > 0 then
|
||||||
|
@ -305,12 +307,13 @@ function this.OnShowLayout3Data()
|
||||||
this.nameText.text=Language[10192]
|
this.nameText.text=Language[10192]
|
||||||
this.btnCompoundText.text=Language[10193]
|
this.btnCompoundText.text=Language[10193]
|
||||||
local maxCompoundValue = math.floor(itemData.num/itemData.itemConfig.UsePerCount)
|
local maxCompoundValue = math.floor(itemData.num/itemData.itemConfig.UsePerCount)
|
||||||
compoundMaxNum=maxCompoundValue > gameSetting.HeroCompoundLimit and gameSetting.HeroCompoundLimit or maxCompoundValue
|
--
|
||||||
endHeroNum=gameSetting.HeroNumlimit-LengthOfTable(HeroManager.GetAllHeroDatas())
|
if itemData.itemConfig.ItemType==ItemType.HeroDebris then -- 神将碎片
|
||||||
compoundMaxNum=compoundMaxNum >endHeroNum and endHeroNum or compoundMaxNum
|
compoundMaxNum = math.min(maxCompoundValue, gameSetting.HeroCompoundLimit, gameSetting.HeroNumlimit-LengthOfTable(HeroManager.GetAllHeroDatas()))
|
||||||
if compoundMaxNum > compoundMaxNum then
|
elseif itemData.itemConfig.ItemType==ItemType.ZuoQiChip then -- 坐骑碎片
|
||||||
compoundMaxNum = compoundMaxNum
|
compoundMaxNum = math.min(maxCompoundValue, gameSetting.HeroCompoundLimit)
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif itemData.itemConfig.ItemType==ItemType.Box then--宝箱
|
elseif itemData.itemConfig.ItemType==ItemType.Box then--宝箱
|
||||||
this.nameText.text=Language[10194]
|
this.nameText.text=Language[10194]
|
||||||
this.btnCompoundText.text=Language[10195]
|
this.btnCompoundText.text=Language[10195]
|
||||||
|
@ -448,7 +451,8 @@ function this.ShowCompoundNumData(value)
|
||||||
compoundNum=value
|
compoundNum=value
|
||||||
this.Slider:GetComponent("Slider").value=value
|
this.Slider:GetComponent("Slider").value=value
|
||||||
this.numText1.text = 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],"")
|
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--宝箱
|
elseif itemData.itemConfig.ItemType==ItemType.Box then--宝箱
|
||||||
this.numText.text= Language[10202]..value..Language[10200]..GetLanguageStrById(itemData.itemConfig.Name).."。"
|
this.numText.text= Language[10202]..value..Language[10200]..GetLanguageStrById(itemData.itemConfig.Name).."。"
|
||||||
|
|
|
@ -150,6 +150,57 @@ function RewardItemSingleShowPopup:BindEvent()
|
||||||
self:ClosePanel()
|
self:ClosePanel()
|
||||||
end)
|
end)
|
||||||
end,Language[10731],Language[10732],Language[11511],false,"")
|
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
|
else
|
||||||
local _itemData = BagManager.bagDatas[itemSid]
|
local _itemData = BagManager.bagDatas[itemSid]
|
||||||
UIManager.OpenPanel(UIName.BagResolveAnCompoundPanel, 3, _itemData, function()
|
UIManager.OpenPanel(UIName.BagResolveAnCompoundPanel, 3, _itemData, function()
|
||||||
|
@ -312,7 +363,10 @@ function RewardItemSingleShowPopup:OnShow()
|
||||||
elseif isBagPanel and itemConfigData.IfResolve == 1 and func then--是否可分解
|
elseif isBagPanel and itemConfigData.IfResolve == 1 and func then--是否可分解
|
||||||
this.btnSure:SetActive(true)
|
this.btnSure:SetActive(true)
|
||||||
this.btnSureText.text = Language[10197]
|
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.btnSureText.text = Language[10193]
|
||||||
this.btnSure:SetActive(true)
|
this.btnSure:SetActive(true)
|
||||||
elseif isBagPanel and itemConfigData.ItemType == 10 and func then--是否宝箱可使用
|
elseif isBagPanel and itemConfigData.ItemType == 10 and func then--是否宝箱可使用
|
||||||
|
|
Loading…
Reference in New Issue