【灵兽抽卡】增加可选灵兽

ZhangBiao 2020-11-13 12:12:06 +08:00
parent e9d984b329
commit 8185be7c27
10 changed files with 1415 additions and 146 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1892,6 +1892,7 @@ GENERAL_POPUP_TYPE={
PokemonCompound = 28,--灵兽合成
SheJiCheckGuild = 29, --社稷大典检查是否加入公会
YiJingBaoKuConfirm = 31,--易经宝库奖励确认
LingShouBaoGe = 33,--灵兽宝阁选择神兽
--大号通用弹窗
YiJingBaoKu = 30,--易经宝库

View File

@ -17,6 +17,9 @@ SELETSUBREWARDPOOLREQUEST = protobuf.Descriptor();
SELETSUBREWARDPOOLREQUEST_SELECTID_FIELD = protobuf.FieldDescriptor();
SELETSUBREWARDPOOLREQUEST_ACTIVITYID_FIELD = protobuf.FieldDescriptor();
SELETSUBREWARDPOOLRESPONSE = protobuf.Descriptor();
SPECICALMONSTERCHOOSEREQUEST = protobuf.Descriptor();
SPECICALMONSTERCHOOSEREQUEST_ACTIVITYID_FIELD = protobuf.FieldDescriptor();
SPECICALMONSTERCHOOSEREQUEST_SELECTID_FIELD = protobuf.FieldDescriptor();
COMMITSHEJIACTIVITYITEMREQUEST_ITEMID_FIELD.name = "itemId"
COMMITSHEJIACTIVITYITEMREQUEST_ITEMID_FIELD.full_name = ".com.ljsd.jieling.protocols.CommitShejiActivityItemRequest.itemId"
@ -132,6 +135,33 @@ SELETSUBREWARDPOOLRESPONSE.enum_types = {}
SELETSUBREWARDPOOLRESPONSE.fields = {}
SELETSUBREWARDPOOLRESPONSE.is_extendable = false
SELETSUBREWARDPOOLRESPONSE.extensions = {}
SPECICALMONSTERCHOOSEREQUEST_ACTIVITYID_FIELD.name = "activityId"
SPECICALMONSTERCHOOSEREQUEST_ACTIVITYID_FIELD.full_name = ".com.ljsd.jieling.protocols.SpecicalMonsterChooseRequest.activityId"
SPECICALMONSTERCHOOSEREQUEST_ACTIVITYID_FIELD.number = 1
SPECICALMONSTERCHOOSEREQUEST_ACTIVITYID_FIELD.index = 0
SPECICALMONSTERCHOOSEREQUEST_ACTIVITYID_FIELD.label = 1
SPECICALMONSTERCHOOSEREQUEST_ACTIVITYID_FIELD.has_default_value = false
SPECICALMONSTERCHOOSEREQUEST_ACTIVITYID_FIELD.default_value = 0
SPECICALMONSTERCHOOSEREQUEST_ACTIVITYID_FIELD.type = 5
SPECICALMONSTERCHOOSEREQUEST_ACTIVITYID_FIELD.cpp_type = 1
SPECICALMONSTERCHOOSEREQUEST_SELECTID_FIELD.name = "selectId"
SPECICALMONSTERCHOOSEREQUEST_SELECTID_FIELD.full_name = ".com.ljsd.jieling.protocols.SpecicalMonsterChooseRequest.selectId"
SPECICALMONSTERCHOOSEREQUEST_SELECTID_FIELD.number = 2
SPECICALMONSTERCHOOSEREQUEST_SELECTID_FIELD.index = 1
SPECICALMONSTERCHOOSEREQUEST_SELECTID_FIELD.label = 1
SPECICALMONSTERCHOOSEREQUEST_SELECTID_FIELD.has_default_value = false
SPECICALMONSTERCHOOSEREQUEST_SELECTID_FIELD.default_value = 0
SPECICALMONSTERCHOOSEREQUEST_SELECTID_FIELD.type = 5
SPECICALMONSTERCHOOSEREQUEST_SELECTID_FIELD.cpp_type = 1
SPECICALMONSTERCHOOSEREQUEST.name = "SpecicalMonsterChooseRequest"
SPECICALMONSTERCHOOSEREQUEST.full_name = ".com.ljsd.jieling.protocols.SpecicalMonsterChooseRequest"
SPECICALMONSTERCHOOSEREQUEST.nested_types = {}
SPECICALMONSTERCHOOSEREQUEST.enum_types = {}
SPECICALMONSTERCHOOSEREQUEST.fields = {SPECICALMONSTERCHOOSEREQUEST_ACTIVITYID_FIELD, SPECICALMONSTERCHOOSEREQUEST_SELECTID_FIELD}
SPECICALMONSTERCHOOSEREQUEST.is_extendable = false
SPECICALMONSTERCHOOSEREQUEST.extensions = {}
CommitShejiActivityItemRequest = protobuf.Message(COMMITSHEJIACTIVITYITEMREQUEST)
CommitShejiActivityItemResponse = protobuf.Message(COMMITSHEJIACTIVITYITEMRESPONSE)
@ -139,4 +169,5 @@ GetShejiAwardRequest = protobuf.Message(GETSHEJIAWARDREQUEST)
GetShejiAwardResponse = protobuf.Message(GETSHEJIAWARDRESPONSE)
SeletSubRewardPoolRequest = protobuf.Message(SELETSUBREWARDPOOLREQUEST)
SeletSubRewardPoolResponse = protobuf.Message(SELETSUBREWARDPOOLRESPONSE)
SpecicalMonsterChooseRequest = protobuf.Message(SPECICALMONSTERCHOOSEREQUEST)

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,7 @@
DynamicActivityManager = {}
local this = DynamicActivityManager
local SpiritAnimalSummonConfig = ConfigManager.GetConfig(ConfigName.SpiritAnimalSummon)
this.curLevel = 0--社稷大典的等级
function this.Initialize()

View File

@ -7,7 +7,6 @@ local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local artConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local SpiritAnimalConfig = ConfigManager.GetConfig(ConfigName.SpiritAnimal)
local SpiritAnimalSummonConfig = ConfigManager.GetConfig(ConfigName.SpiritAnimalSummon)
local activityId = 0
local singleRecruit = nil
@ -73,7 +72,9 @@ function LingShouBaoGe:BindEvent()
ActivityDetail.new(this.detail,3)
end)
Util.AddClick(this.change, function()
LogYellow("更改灵兽")
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.LingShouBaoGe,ActData,showData.monsterId,function()
this:Refresh()
end)
end)
Util.AddClick(this.preview, function()

View File

@ -4737,7 +4737,6 @@ end
--易经宝库选择最终奖励
function this.SelectFinalRewardRequest(id,activityId,func)
local data = ActivityProto_pb.SeletSubRewardPoolRequest()
LogPink("selectId:"..id.." activityId:"..activityId)
data.selectId = id
data.activityId = activityId
local msg = data:SerializeToString()
@ -4762,4 +4761,17 @@ function this.ChangeHeroSkin(heroId,skinId,func)
end
end)
end
--灵兽宝阁更换灵兽
function this.ChengeMonsterChooseRequest(activityId,selectId,func)
local data = ActivityProto_pb.SpecicalMonsterChooseRequest()
data.activityId = activityId
data.selectId = selectId
local msg = data:SerializeToString()
Network:SendMessageWithCallBack(MessageTypeProto_pb.SPECICAL_MONSTER_CHOOSE_REQUEST, MessageTypeProto_pb.SPECICAL_MONSTER_CHOOSE_RESPONSE, msg, function(buffer)
if func then
func()
end
end)
end
return this

View File

@ -61,6 +61,8 @@ local contentScripts = {
[29] = {view = require("Modules/Popup/View/GeneralPopup_SheJiCheckGuild"), panelName = "GeneralPopup_SheJiCheckGuild",type=GENERAL_POPUP_TYPE.SheJiCheckGuild},
--YiJingBaoKuConfirm
[30] = {view = require("Modules/Popup/View/GeneralPopup_YiJingBaoKuConfirm"), panelName = "GeneralPopup_YiJingBaoKuConfirm",type=GENERAL_POPUP_TYPE.YiJingBaoKuConfirm},
--灵兽宝阁选择神兽
[31] = {view = require("Modules/Popup/View/GeneralPopup_LingShouBaoGe"), panelName = "GeneralPopup_LingShouBaoGe",type=GENERAL_POPUP_TYPE.LingShouBaoGe},
}
--子模块预设
local contentPrefabs={}

View File

@ -0,0 +1,127 @@
----- 灵兽宝阁选择神兽 -----
local this = {}
--传入父脚本模块
local parent
--传入特效层级
local SpiritAnimalSummonConfig = ConfigManager.GetConfig(ConfigName.SpiritAnimalSummon)
local sortingOrder=0
local itemsGrid = {}--item重复利用
local itemViewGrid = {}
local itemGoGrid = {}
local ActData=nil
local curMonsterId = nil
local oldMonsterId = nil
local curIndex = nil
function this:InitComponent(gameObject)
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
this.tip=Util.GetGameObject(gameObject,"tip"):GetComponent("Text")
this.root = Util.GetGameObject(gameObject, "Root")
this.itemPre = Util.GetGameObject(gameObject, "itemPre")
this.confirm = Util.GetGameObject(gameObject, "ConfirmBtn")
this.cancel = Util.GetGameObject(gameObject, "CancelBtn")
end
function this:BindEvent()
Util.AddClick(this.confirm,function()
if curMonsterId == oldMonsterId then
parent:ClosePanel()
return
end
NetManager.ChengeMonsterChooseRequest(ActData.activityId,curIndex,function ()
parent:ClosePanel()
end)
end)
Util.AddClick(this.cancel,function()
parent:ClosePanel()
end)
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
parent=_parent
sortingOrder = _parent.sortingOrder
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
local _args = {...}
ActData = _args[1]
oldMonsterId = _args[2]
curMonsterId = _args[2]
this.titleText.text="灵兽选择"
this.tip.text = "请在下面列表中选择一个灵兽抽取"
LogYellow("ActData.ActivityId:"..ActData.activityId)
local monsterData = ConfigManager.GetAllConfigsDataByKey(ConfigName.SpiritAnimalSummon,"ActivityID",ActData.activityId)
if not itemsGrid then
itemsGrid = {}
itemViewGrid = {}
itemGoGrid = {}
end
for k,v in ipairs(itemsGrid) do
v.gameObject:SetActive(false)
end
for k,v in ipairs(itemViewGrid) do
v.gameObject:SetActive(false)
end
for i = 1, #monsterData do
local item = itemsGrid[i]
if not item then
item = newObject(this.itemPre)
item.name = "itemPre_"..i
item.transform:SetParent(this.root.transform)
item.transform.localScale = Vector3.one
item.transform.localPosition = Vector3.zero
itemsGrid[i] = item
end
item.gameObject:SetActive(true)
this:SetSingleMonster(item,i,monsterData[i])
end
end
function this:SetSingleMonster(item,i,data)
local icon = Util.GetGameObject(item,"icon")
local btn = Util.GetGameObject(item,"btn")
local btnGo = Util.GetGameObject(item,"btn/Go")
itemGoGrid[i] = btnGo
if not itemViewGrid[i] then
itemViewGrid[i] = SubUIManager.Open(SubUIConfig.ItemView,icon.transform)
end
itemViewGrid[i].gameObject:SetActive(true)
itemViewGrid[i]:OnOpen(false, {data.FocusID,0},1.5,false,false,false,sortingOrder)
if curMonsterId == data.FocusID then
btnGo:SetActive(true)
curIndex = i
else
btnGo:SetActive(false)
end
Util.AddOnceClick(btn,function ()
for i = 1, #itemGoGrid do
if itemGoGrid[i].activeSelf then
itemGoGrid[i]:SetActive(false)
end
end
curIndex = i
curMonsterId = data.FocusID
btnGo:SetActive(true)
end)
end
function this:OnClose()
end
function this:OnDestroy()
itemsGrid = {}--item重复利用
itemViewGrid = {}
itemGoGrid = {}
end
return this

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 238140c9ea76f3f42a0c6b20dbba4c27
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: