uidata 提交
parent
21f8fa7304
commit
d7c45359bb
|
@ -515,6 +515,7 @@ UIName = {
|
|||
FaLingUpStarListPanel = 523, --法灵升级吃本体界面
|
||||
TrainBuildPanel = 524,
|
||||
TrainBuildLvUpPanel = 525,
|
||||
TrainSelectHeroPanel = 526,
|
||||
}
|
||||
|
||||
SubUIConfig = {
|
||||
|
|
|
@ -3,6 +3,7 @@ local this = TrainBuildManager
|
|||
local HomeLand = ConfigManager.GetConfig(ConfigName.TrainBuild)
|
||||
local HomeLandLevel = ConfigManager.GetConfig(ConfigName.TrainBuildLevel)
|
||||
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
local trainConfig=ConfigManager.GetConfig(ConfigName.Train)
|
||||
|
||||
function this.Initialize()
|
||||
this.BuildData = {}
|
||||
|
@ -21,9 +22,42 @@ function this.Initialize()
|
|||
this.BuildData[configData.Id].isOpen = this.CheckBuildIsOpen(configData.UnlockLevel)
|
||||
end
|
||||
end
|
||||
|
||||
--所有可以特训的英雄静态id
|
||||
this.allHeroId={}
|
||||
for _, configData in ConfigPairs(trainConfig) do
|
||||
if CheckListIsContainValue1(this.allHeroId,configData.HeroID)==false then
|
||||
table.insert(this.allHeroId,configData.HeroID)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--获取所有可以特修的英雄数据
|
||||
function this.GetAllCanTrainHero()
|
||||
local heros={}
|
||||
local list=HeroManager.GetAllHeroList()
|
||||
LogError("list len============================="..#list)
|
||||
for k, v in pairs(list) do
|
||||
local hero=v
|
||||
if CheckListIsContainValue1(this.allHeroId,hero.id) then
|
||||
table.insert(heros,v)
|
||||
end
|
||||
end
|
||||
LogError("#heros len==============="..#heros)
|
||||
if #heros>0 then
|
||||
table.sort(heros,function(a,b)
|
||||
if a.star==b.star then
|
||||
return a.lv>b.lv
|
||||
else
|
||||
return a.star>b.star
|
||||
end
|
||||
end)
|
||||
end
|
||||
return heros
|
||||
end
|
||||
|
||||
|
||||
|
||||
---检测功能开启方法
|
||||
function this.CheckBuildIsOpen(str)
|
||||
if not str then
|
||||
|
|
|
@ -7615,7 +7615,25 @@ function NetManager.TrainingArchitectureUpRequest(_id,_type,_func)
|
|||
|
||||
end)
|
||||
end
|
||||
|
||||
-- 开始/结束特训请求
|
||||
function NetManager.TrainingRequest(_id,_heroId,_type,_func)
|
||||
local data=HeroInfoProto_pb.TrainingRequest()
|
||||
data.architectureId= _id
|
||||
data.heroId=_heroId
|
||||
data.operation= _type
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.TrainingRequest,MessageTypeProto_pb.TrainingResponse,msg,function(buffer)
|
||||
local data = buffer:DataByte()
|
||||
local msg = HeroInfoProto_pb.TrainingResponse()
|
||||
msg:ParseFromString(data)
|
||||
LogError("特训请求")
|
||||
TrainBuildManager.SetBuildInfo(msg.info)
|
||||
if _func then
|
||||
_func()
|
||||
end
|
||||
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
return this
|
Loading…
Reference in New Issue