【命格】提交
parent
e304f2136b
commit
bab62f274c
File diff suppressed because it is too large
Load Diff
|
@ -2295,6 +2295,7 @@ GENERAL_POPUP_TYPE={
|
|||
YuJianXingBetSelectNum = 53,--御剑行竞猜数量界面
|
||||
LingMaiJump = 56,--灵脉跳转界面
|
||||
GemOneKey = 60, --命石一键合成
|
||||
GemMoreCom = 61, --命石批量合成
|
||||
|
||||
--大号通用弹窗
|
||||
YiJingBaoKu = 30,--易经宝库
|
||||
|
|
|
@ -279,6 +279,7 @@ LIFESTONEUPREQUEST_CURGEMID_FIELD = protobuf.FieldDescriptor();
|
|||
LIFESTONEUPREQUEST_SELECTNUM_FIELD = protobuf.FieldDescriptor();
|
||||
LIFESTONEUPRESPONSE = protobuf.Descriptor();
|
||||
LIFESTONEUPRESPONSE_LIFEGRIDINFO_FIELD = protobuf.FieldDescriptor();
|
||||
LIFESTONEUPRESPONSE_DROP_FIELD = protobuf.FieldDescriptor();
|
||||
LIFEGRIDCHANGEREQUEST = protobuf.Descriptor();
|
||||
LIFEGRIDCHANGEREQUEST_TYPE_FIELD = protobuf.FieldDescriptor();
|
||||
LIFEGRIDCHANGEREQUEST_POSITION_FIELD = protobuf.FieldDescriptor();
|
||||
|
@ -2779,11 +2780,22 @@ LIFESTONEUPRESPONSE_LIFEGRIDINFO_FIELD.message_type = CommonProto_pb.LIFEGRIDINF
|
|||
LIFESTONEUPRESPONSE_LIFEGRIDINFO_FIELD.type = 11
|
||||
LIFESTONEUPRESPONSE_LIFEGRIDINFO_FIELD.cpp_type = 10
|
||||
|
||||
LIFESTONEUPRESPONSE_DROP_FIELD.name = "drop"
|
||||
LIFESTONEUPRESPONSE_DROP_FIELD.full_name = ".rpc.protocols.LifeStoneUpResponse.drop"
|
||||
LIFESTONEUPRESPONSE_DROP_FIELD.number = 2
|
||||
LIFESTONEUPRESPONSE_DROP_FIELD.index = 1
|
||||
LIFESTONEUPRESPONSE_DROP_FIELD.label = 1
|
||||
LIFESTONEUPRESPONSE_DROP_FIELD.has_default_value = false
|
||||
LIFESTONEUPRESPONSE_DROP_FIELD.default_value = nil
|
||||
LIFESTONEUPRESPONSE_DROP_FIELD.message_type = CommonProto_pb.DROP
|
||||
LIFESTONEUPRESPONSE_DROP_FIELD.type = 11
|
||||
LIFESTONEUPRESPONSE_DROP_FIELD.cpp_type = 10
|
||||
|
||||
LIFESTONEUPRESPONSE.name = "LifeStoneUpResponse"
|
||||
LIFESTONEUPRESPONSE.full_name = ".rpc.protocols.LifeStoneUpResponse"
|
||||
LIFESTONEUPRESPONSE.nested_types = {}
|
||||
LIFESTONEUPRESPONSE.enum_types = {}
|
||||
LIFESTONEUPRESPONSE.fields = {LIFESTONEUPRESPONSE_LIFEGRIDINFO_FIELD}
|
||||
LIFESTONEUPRESPONSE.fields = {LIFESTONEUPRESPONSE_LIFEGRIDINFO_FIELD, LIFESTONEUPRESPONSE_DROP_FIELD}
|
||||
LIFESTONEUPRESPONSE.is_extendable = false
|
||||
LIFESTONEUPRESPONSE.extensions = {}
|
||||
LIFEGRIDCHANGEREQUEST_TYPE_FIELD.name = "type"
|
||||
|
|
|
@ -97,7 +97,7 @@ function GemCompound:SetCost(bool)
|
|||
local list2 = {}
|
||||
if not bool then--普通合成
|
||||
bool1 = BagManager.GetTotalItemNum(14) > gemConfig[args[1]].UpgradeCost[2]
|
||||
bool2 = BagManager.GetTotalItemNum(args[1]) > 0
|
||||
bool2 = BagManager.GetTotalItemNum(args[1]) > 1
|
||||
list[args[1]] = 1
|
||||
money = gemConfig[args[1]].UpgradeCost[2]
|
||||
else--快速合成
|
||||
|
@ -138,10 +138,10 @@ function GemCompound:SetCost(bool)
|
|||
NetManager.LifeStoneUpRequest(type,gemConfig[args[1]].Type,args[2],args[1],1,function ()
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Gem.RefreshPanel)
|
||||
PopupTipPanel.ShowTip("命石升级成功!")
|
||||
parent:ClosePanel()
|
||||
if args[3] then
|
||||
args[3]()
|
||||
end
|
||||
parent:ClosePanel()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
|
|
@ -6270,6 +6270,9 @@ function this.LifeStoneUpRequest(_type,_gridId,_gridIndex,_curGemId,_selectNum,f
|
|||
NetManager.RequestUserForceChange(FormationTypeDef.FORMATION_NORMAL)
|
||||
local tempPower = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
|
||||
UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldWarPower,newValue = tempPower})
|
||||
if msg.drop then
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1)
|
||||
end
|
||||
if func then
|
||||
func(msg)
|
||||
end
|
||||
|
|
|
@ -86,6 +86,8 @@ local contentScripts = {
|
|||
[GENERAL_POPUP_TYPE.LingMaiJump] = {view = require("Modules/Popup/View/GeneralPopup_LingMaiJump"), panelName = "GeneralPopup_LingMaiJump"},
|
||||
--命石一键合成
|
||||
[GENERAL_POPUP_TYPE.GemOneKey] = {view = require("Modules/Popup/View/GeneralPopup_GemOneKey"), panelName = "GeneralPopup_GemOneKey"},
|
||||
--命石批量合成
|
||||
[GENERAL_POPUP_TYPE.GemMoreCom] = {view = require("Modules/Popup/View/GeneralPopup_GemMoreCom"), panelName = "GeneralPopup_GemMoreCom"},
|
||||
}
|
||||
--子模块预设
|
||||
local contentPrefabs={}
|
||||
|
@ -165,7 +167,7 @@ end
|
|||
|
||||
function GeneralPopup:OnShow()
|
||||
if index == GENERAL_POPUP_TYPE.RecruitBox then--临时接的参数 需要onshow刷新的调用
|
||||
contentScripts[index].view:OnShow(this,onOpenArgs)
|
||||
contentScripts[index].view:OnShow(this,unpack(onOpenArgs, 1, table.maxn(onOpenArgs)))
|
||||
end
|
||||
this.backBtn:SetActive(index ~= GENERAL_POPUP_TYPE.SheJiCheckGuild)
|
||||
end
|
||||
|
|
|
@ -70,7 +70,7 @@ function RewardGemSingleShowPopup:BindEvent()
|
|||
end)
|
||||
end)
|
||||
Util.AddClick(this.btnJump, function()--合成
|
||||
if this.openType == 2 then
|
||||
if this.openType == 2 then--命格界面中
|
||||
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.GemCompound,itemSid,this.position,function ()
|
||||
self:ClosePanel()
|
||||
end)
|
||||
|
@ -82,6 +82,17 @@ function RewardGemSingleShowPopup:BindEvent()
|
|||
-- LogGreen("key:"..tostring(key).." value:"..tostring(value))
|
||||
-- end
|
||||
-- end
|
||||
elseif this.openType == 1 then--背包中
|
||||
local num = BagManager.GetTotalItemNum(itemSid)
|
||||
if num/gemConfig[itemSid].UpgradeNum >= 2 then
|
||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.GemMoreCom,itemSid,num,function ()
|
||||
self:ClosePanel()
|
||||
end)
|
||||
else
|
||||
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.GemCompound,itemSid,nil,function ()
|
||||
self:ClosePanel()
|
||||
end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
|
|
@ -0,0 +1,112 @@
|
|||
----- 批量合成命石 -----
|
||||
local MoreGemCompound = {}
|
||||
--传入父脚本模块
|
||||
local parent
|
||||
--传入特效层级
|
||||
local sortingOrder=0
|
||||
local args=nil
|
||||
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
local gemConfig=ConfigManager.GetConfig(ConfigName.GemConfig)
|
||||
local PropertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
|
||||
function MoreGemCompound:InitComponent(gameObject)
|
||||
self.spLoader = SpriteLoader.New()
|
||||
|
||||
self.curGem = Util.GetGameObject(gameObject,"Gems/curGem")
|
||||
self.targetGem = Util.GetGameObject(gameObject,"Gems/targetGem")
|
||||
self.money = Util.GetGameObject(gameObject, "Content/Money/Text"):GetComponent("Text")
|
||||
self.num = Util.GetGameObject(gameObject, "Content/Num"):GetComponent("Text")
|
||||
self.BtnDo = Util.GetGameObject(gameObject, "BtnSure")
|
||||
|
||||
|
||||
self.addBtn = Util.GetGameObject(gameObject,"add")
|
||||
self.reduceBtn = Util.GetGameObject(gameObject,"reduce")
|
||||
self.slider = Util.GetGameObject(gameObject,"Slider"):GetComponent("Slider")
|
||||
|
||||
end
|
||||
|
||||
function MoreGemCompound:BindEvent()
|
||||
Util.AddOnceClick(self.BtnDo,function ()
|
||||
if BagManager.GetTotalItemNum(gemConfig[args[1]].UpgradeCost[1]) < gemConfig[args[1]].UpgradeCost[2] then
|
||||
PopupTipPanel.ShowTip("金币不足!")
|
||||
return
|
||||
end
|
||||
NetManager.LifeStoneUpRequest(1,nil,nil,args[1],self.curCost,function ()
|
||||
PopupTipPanel.ShowTip("命石合成成功!")
|
||||
if args[3] then
|
||||
args[3]()
|
||||
end
|
||||
parent:ClosePanel()
|
||||
end)
|
||||
end)
|
||||
|
||||
Util.AddClick(self.addBtn,function()
|
||||
if self.curComNum < self.maxCanComNum then
|
||||
self:SetCount(self.curComNum + 1)
|
||||
else
|
||||
PopupTipPanel.ShowTip(Language[12144])
|
||||
end
|
||||
end)
|
||||
Util.AddClick(self.reduceBtn,function()
|
||||
if self.curComNum > 1 then
|
||||
self:SetCount(self.curComNum - 1)
|
||||
else
|
||||
PopupTipPanel.ShowTip(Language[12145])
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function MoreGemCompound:AddListener()
|
||||
end
|
||||
|
||||
function MoreGemCompound:RemoveListener()
|
||||
end
|
||||
|
||||
function MoreGemCompound:OnShow(_parent,...)
|
||||
args = {...}
|
||||
parent=_parent
|
||||
sortingOrder =_parent.sortingOrder
|
||||
self.maxCanComNum = math.floor(args[2]/gemConfig[args[1]].UpgradeNum)
|
||||
self.curComNum = self.maxCanComNum
|
||||
self.slider.minValue = 1
|
||||
self.slider.maxValue = self.maxCanComNum
|
||||
self.slider.value = self.maxCanComNum
|
||||
self.slider.onValueChanged:AddListener(function()
|
||||
self:SetCount(self.slider.value)
|
||||
end)
|
||||
|
||||
MoreGemCompound:Refresh()
|
||||
end
|
||||
function MoreGemCompound:Refresh()
|
||||
--设置当前和目标命石
|
||||
if not self.curGemObj then
|
||||
self.curGemObj = SubUIManager.Open(SubUIConfig.ItemView,self.curGem.transform)
|
||||
self.targetGemObj = SubUIManager.Open(SubUIConfig.ItemView,self.targetGem.transform)
|
||||
end
|
||||
Util.GetGameObject(self.curGem,"Name"):GetComponent("Text").text = gemConfig[args[1]].Name
|
||||
Util.GetGameObject(self.targetGem,"Name"):GetComponent("Text").text = gemConfig[args[1]+1].Name
|
||||
self:SetCount(self.curComNum)
|
||||
end
|
||||
|
||||
function MoreGemCompound:SetCount(value)
|
||||
self.curCost = value*gemConfig[args[1]].UpgradeNum
|
||||
self.slider.value = value
|
||||
self.num.text = value
|
||||
self.curGemObj:OnOpen(false, {args[1],value*gemConfig[args[1]].UpgradeNum}, 1.1, false,false,false,sortingOrder + 1)
|
||||
self.targetGemObj:OnOpen(false, {args[1] + 1,value}, 1.1, false,false,false,sortingOrder + 1)
|
||||
self.money.text = self.curComNum*gemConfig[args[1]].UpgradeCost[2]
|
||||
if BagManager.GetTotalItemNum(gemConfig[args[1]].UpgradeCost[1]) < gemConfig[args[1]].UpgradeCost[2] then
|
||||
self.money.text = string.format("<color=red>%s</color>",value*gemConfig[args[1]].UpgradeCost[2])
|
||||
end
|
||||
end
|
||||
|
||||
function MoreGemCompound:OnClose()
|
||||
args=nil
|
||||
end
|
||||
|
||||
function MoreGemCompound:OnDestroy()
|
||||
self.spLoader:Destroy()
|
||||
self.curGemObj = nil
|
||||
self.targetGemObj = nil
|
||||
end
|
||||
|
||||
return MoreGemCompound
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f44588de2e713bf489ec33864cfe4c41
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -35,8 +35,8 @@ end
|
|||
function this:RemoveListener()
|
||||
end
|
||||
|
||||
function this:OnShow(_parent,_args)
|
||||
self.args = _args
|
||||
function this:OnShow(_parent,...)
|
||||
self.args = {...}
|
||||
self.parent = _parent
|
||||
self:Refresh()
|
||||
end
|
||||
|
@ -74,14 +74,13 @@ function this:Refresh()
|
|||
end
|
||||
end
|
||||
for i = 1, #list do
|
||||
local go = self.itemList2[i]
|
||||
local go = itemList[i]
|
||||
if not go then
|
||||
go = SubUIManager.Open(SubUIConfig.ItemView,grid.transform)
|
||||
itemList[i] = go
|
||||
end
|
||||
go:SetActive(true)
|
||||
self.itemList[i]:OnOpen(false, {list[i].id,list[i].num}, 1, false,false,false,self.parent.sortingOrder + 1)
|
||||
self.itemList[i].gameObject:SetActive(true)
|
||||
go:OnOpen(false, {list[i].id,list[i].num}, 1, false,false,false,self.parent.sortingOrder + 1)
|
||||
go.gameObject:SetActive(true)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue