【物品】添加新物品类型

gaoxin 2021-12-25 07:58:30 +08:00
parent f22aa9fe80
commit 973eee4b30
4 changed files with 26 additions and 1 deletions

View File

@ -1061,6 +1061,8 @@ ItemType = {
Incarnation = 29,
ZuoQiChip = 28, -- 坐骑碎片
talismanSoulChip = 30,
TimeIsGold = 32, -- 挂机时长
}
JumpType = {
Lottery = 1, --招募

View File

@ -160,6 +160,15 @@ function BagResolveAnCompoundPanel:BindEvent()
else
PopupTipPanel.ShowTip(Language[10184])
end
elseif itemData.itemConfig.ItemType==ItemType.TimeIsGold then--挂机时长奖励
if compoundNum>0 then
local itemList = {itemData.id, compoundNum}
NetManager.UseAndPriceItemRequest(7,itemList,function (drop)
this.SendBackCompoundReCallBack(drop)
end)
else
PopupTipPanel.ShowTip(Language[10184])
end
else
if compoundNum >0 then
UIManager.ClosePanel(UIName.RewardItemSingleShowPopup)
@ -456,6 +465,8 @@ function this.ShowCompoundNumData(value)
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).."。"
elseif itemData.itemConfig.ItemType==ItemType.TimeIsGold then--挂机奖励
this.numText.text= Language[10202]..value..Language[10200]..GetLanguageStrById(itemData.itemConfig.Name).."。"
else
this.numText.text= Language[10196]..value..Language[10200]..GetLanguageStrById(itemData.itemConfig.Name).."。"
end

View File

@ -1299,7 +1299,7 @@ function this.MapSweepRequest(_mapId, _sweepCount, func)
end
--请求道具 装备 分解
function this.UseAndPriceItemRequest(_type, _items, func)
--_type 1:分解物品 2:分解装备3:分解妖灵师 4:分解法宝 5:分解魂印 6:自选宝箱
--_type 1:分解物品 2:分解装备3:分解妖灵师 4:分解法宝 5:分解魂印 6:自选宝箱 7:挂机时长奖励
local data = PlayerInfoProto_pb.UseAndPriceItemRequest()
Log("_type " .. _type)
data.type = _type
@ -1336,6 +1336,10 @@ function this.UseAndPriceItemRequest(_type, _items, func)
local itemData = data.items:add()
itemData.itemId = _items[1]
itemData.itemNum = _items[3]
elseif _type == 7 then
local itemData = data.items:add()
itemData.itemId = _items[1]
itemData.itemNum = _items[2]
end
local msg = data:SerializeToString()

View File

@ -169,6 +169,11 @@ function RewardItemSingleShowPopup:BindEvent()
else
PopupTipPanel.ShowTip("碎片不足,无法合成坐骑。")
end
elseif itemConfigData.ItemType == ItemType.TimeIsGold then -- 挂机时长奖励
local _itemData = BagManager.bagDatas[itemSid]
UIManager.OpenPanel(UIName.BagResolveAnCompoundPanel, 4, _itemData, function()
func()
end)
else
local _itemData = BagManager.bagDatas[itemSid]
UIManager.OpenPanel(UIName.BagResolveAnCompoundPanel, 3, _itemData, function()
@ -343,6 +348,9 @@ function RewardItemSingleShowPopup:OnShow()
elseif isBagPanel and itemConfigData.ItemType == 12 and func then-- 改名卡
this.btnSure:SetActive(true)
this.btnSureText.text = Language[10195]
elseif isBagPanel and itemConfigData.ItemType == 32 then -- 挂机奖励
this.btnSure:SetActive(true)
this.btnSureText.text = Language[10195]
else
this.btnSure:SetActive(false)
this.btnSureText.text = Language[10197]