【灵脉秘境】提交

dev_chengFeng
ZhangBiao 2021-11-15 18:38:53 +08:00
parent 336ea6b8d3
commit a4151f51b2
3 changed files with 59 additions and 7 deletions

View File

@ -7,7 +7,7 @@ function this.Initialize()
this.startTime = 1637942400
this.endTime = 1638115200
this.myPlaceId = 3
this.rankData = {
this.recordData = {
[1] = {playerId = 1,playerName = "我叫1",placeId = 1},
[2] = {playerId = 2,playerName = "我叫2",placeId = 2},
[3] = {playerId = 3,playerName = "我叫3",placeId = 3},
@ -48,15 +48,20 @@ end
--获取服务器发来的信息
function this.GetLingMaiServerData(msg,func)
this.state = msg.state
this.startTime = msg.state.startTime
this.endTime = msg.state.endTime
this.myPlaceId = msg.myPlaceId
this.rankData = msg.rankData
this.curPage = lodeConfig[msg.myPlaceId].PageNo
this.startTime = msg.myOccupyTime
-- this.endTime = msg.state.endTime
this.myPlaceId = msg.myOccupyId
this.curPage = lodeConfig[this.myPlaceId].PageNo
-- Game.GlobalEvent:DispatchEvent(GameEvent.LingMaiMiJing.RefreshPanel)
if func then
func()
end
end
function this.OpenRecord()
NetManager.LingMaiRecordRequest(function ()
PopupTipPanel.ShowTip("打开纪录")
end)
end
return LingMaiMiJingManager

View File

@ -46,6 +46,9 @@ function LingMaiMiJingPanel:BindEvent()
Util.AddOnceClick(self.helpBtn, function()
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.LingMaiMiJing,self.helpPosition.x,self.helpPosition.y)
end)
Util.AddOnceClick(self.recordBtn, function()
LingMaiMiJingManager.OpenRecord()
end)
end
--添加事件监听(用于子类重写)
@ -94,7 +97,7 @@ end
function LingMaiMiJingPanel:SetVeins()
for i = 1, 5 do
local go = self.veinList[i]
local data = self.data.rankData[i]
local data = self.data.recordData[i]
local title = Util.GetGameObject(go,"title/Name"):GetComponent("Text")
local num = Util.GetGameObject(go,"title/Num"):GetComponent("Text")
local name = Util.GetGameObject(go,"obtain/name"):GetComponent("Text")

View File

@ -6078,5 +6078,49 @@ function NetManager.GetWeekCardReward(id, func)
end)
end
-- 灵脉秘境请求界面信息
function NetManager.GetLingMaiInfoRequest(_page, func)
local data = ArenaInfoProto_pb.CrossLingmaiSecretAreaInfoRequest()
data.page = _page
local msg = data:SerializeToString()
Network:SendMessageWithCallBack(MessageTypeProto_pb.CrossLingmaiSecretAreaInfoRequest, MessageTypeProto_pb.CrossLingmaiSecretAreaInfoResponse, msg, function(buffer)
local data = buffer:DataByte()
local msg = ArenaInfoProto_pb.CrossLingmaiSecretAreaInfoResponse()
msg:ParseFromString(data)
LingMaiMiJingManager.GetLingMaiServerData(msg,function ()
if func then
func(msg)
end
end)
end)
end
-- 灵脉秘境请求战斗
function NetManager.LingMaiBattleRequest(_id, func)
local data = ArenaInfoProto_pb.CrossLingmaiSecretAreaRequest()
data.id = _id
local msg = data:SerializeToString()
Network:SendMessageWithCallBack(MessageTypeProto_pb.CrossLingmaiSecretAreaRequest, MessageTypeProto_pb.CrossLingmaiSecretAreaResponse, msg, function(buffer)
local data = buffer:DataByte()
local msg = ArenaInfoProto_pb.CrossLingmaiSecretAreaResponse()
msg:ParseFromString(data)
if func then
func(msg)
end
end)
end
-- 灵脉秘境请求纪录
function NetManager.LingMaiRecordRequest(func)
Network:SendMessageWithCallBack(MessageTypeProto_pb.CrossLingmaiSecretAreaRecordRequest, MessageTypeProto_pb.CrossLingmaiSecretAreaRecordResponse, nil, function(buffer)
local data = buffer:DataByte()
local msg = ArenaInfoProto_pb.CrossLingmaiSecretAreaRecordResponse()
msg:ParseFromString(data)
LingMaiMiJingManager.recordData = msg.recordData
if func then
func(msg)
end
end)
end
return this