2020-11-19 18:30:19 +08:00
|
|
|
|
require("Base/BasePanel")
|
|
|
|
|
|
JumpServerHightLadderPanel = Inherit(BasePanel)
|
|
|
|
|
|
local this = JumpServerHightLadderPanel
|
|
|
|
|
|
local datas = {}
|
|
|
|
|
|
local liveNodeList = {}
|
|
|
|
|
|
local goList = {}
|
|
|
|
|
|
local stage = 0
|
2020-12-16 17:04:17 +08:00
|
|
|
|
local enterable = false
|
|
|
|
|
|
local JoinRank = ConfigManager.GetConfigData(ConfigName.MServerArenaSetting,1).JoinRank
|
|
|
|
|
|
local isFirstRefresh = false
|
2020-11-19 18:30:19 +08:00
|
|
|
|
--初始化组件(用于子类重写)
|
|
|
|
|
|
function JumpServerHightLadderPanel:InitComponent()
|
|
|
|
|
|
this.timeText = Util.GetGameObject(self.gameObject, "titleObg/timeImage/Text")
|
2020-12-16 17:04:17 +08:00
|
|
|
|
this.helpBtn = Util.GetGameObject(self.gameObject,"HelpBtn")
|
2020-11-19 18:30:19 +08:00
|
|
|
|
this.helpPos = this.helpBtn:GetComponent("RectTransform").localPosition
|
|
|
|
|
|
this.sortBtn = Util.GetGameObject(self.gameObject,"rightBtns/sortBtn")
|
|
|
|
|
|
this.rewardSortBtn = Util.GetGameObject(self.gameObject,"rightBtns/rewardSortBtn")
|
|
|
|
|
|
this.recordBtn = Util.GetGameObject(self.gameObject,"rightBtns/recordBtn")
|
|
|
|
|
|
this.shopBtn = Util.GetGameObject(self.gameObject,"rightBtns/shopBtn")
|
|
|
|
|
|
this.formationBtn = Util.GetGameObject(self.gameObject,"rightBtns/formationBtn")
|
|
|
|
|
|
this.backBtn = Util.GetGameObject(self.gameObject, "backBtn")
|
|
|
|
|
|
|
|
|
|
|
|
-- this.singlePre = Util.GetGameObject(self.gameObject, "middleObg/singlePre")
|
|
|
|
|
|
-- this.rect = Util.GetGameObject(self.gameObject, "middleObg/rect")
|
|
|
|
|
|
-- this.scrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.rect.transform,this.singlePre,
|
|
|
|
|
|
-- nil,Vector2.New(1079.9,1533.4),1,1,Vector2.New(0,0))
|
|
|
|
|
|
-- this.scrollView.moveTween.MomentumAmount = 1
|
|
|
|
|
|
-- this.scrollView.moveTween.Strength = 2
|
|
|
|
|
|
for i = 1, 4 do
|
|
|
|
|
|
goList[i] = Util.GetGameObject(self.gameObject, "middleObg/rect/singlePre (".. i ..")")
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
this.mySortText = Util.GetGameObject(self.gameObject, "endObg/mySortText")
|
|
|
|
|
|
this.sdBtn = Util.GetGameObject(self.gameObject,"endObg/sdBtn")
|
|
|
|
|
|
this.numInfo = Util.GetGameObject(self.gameObject, "endObg/numInfo")
|
|
|
|
|
|
Util.GetGameObject(self.gameObject,"endObg/sdBtn/Text"):GetComponent("Text").text = "扫 荡"
|
2020-11-19 20:51:19 +08:00
|
|
|
|
Util.GetGameObject(self.gameObject, "endObg/numInfo/mianfeiText"):GetComponent("Text").text = "免费次数:"
|
2020-11-19 18:30:19 +08:00
|
|
|
|
this.mianfeiText = Util.GetGameObject(self.gameObject, "endObg/numInfo/mianfeiText/Text"):GetComponent("Text")
|
|
|
|
|
|
Util.GetGameObject(self.gameObject, "endObg/numInfo/buyText"):GetComponent("Text").text = "购买次数:"
|
|
|
|
|
|
this.buyText = Util.GetGameObject(self.gameObject, "endObg/numInfo/buyText/Text"):GetComponent("Text")
|
|
|
|
|
|
this.addNumBtn = Util.GetGameObject(self.gameObject,"endObg/numInfo/addNumBtn/click")
|
|
|
|
|
|
this.canPlayerTipText = Util.GetGameObject(self.gameObject, "endObg/canPlayerTipText")
|
|
|
|
|
|
|
|
|
|
|
|
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--绑定事件(用于子类重写)
|
|
|
|
|
|
function JumpServerHightLadderPanel:BindEvent()
|
|
|
|
|
|
Util.AddClick(this.backBtn,function()
|
2020-11-20 15:00:08 +08:00
|
|
|
|
self:ClosePanel()
|
|
|
|
|
|
end)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
Util.AddClick(this.helpBtn,function()
|
2020-11-19 20:51:19 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.JumpServerHeightLadder,this.helpPos.x,this.helpPos.y)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end)
|
|
|
|
|
|
Util.AddClick(this.sortBtn,function()
|
|
|
|
|
|
UIManager.OpenPanel(UIName.RankingSingleListPanel,rankKingList[15])
|
|
|
|
|
|
end)
|
|
|
|
|
|
Util.AddClick(this.rewardSortBtn,function()
|
2020-12-18 10:57:29 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.JumpServerHightLadderRewardSortPanel,FUNCTION_OPEN_TYPE.JumpServer_HightLadder)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end)
|
|
|
|
|
|
Util.AddClick(this.recordBtn,function()
|
|
|
|
|
|
UIManager.OpenPanel(UIName.JumpServerHightLadderRecordPopup)
|
|
|
|
|
|
end)
|
|
|
|
|
|
Util.AddClick(this.shopBtn,function()
|
2020-12-16 17:04:17 +08:00
|
|
|
|
JumpManager.GoJump(3005)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end)
|
|
|
|
|
|
Util.AddClick(this.formationBtn,function()
|
2020-12-18 10:57:29 +08:00
|
|
|
|
-- if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.JumpServer_HightLadder) then
|
2020-11-20 15:00:08 +08:00
|
|
|
|
-- PopupTipPanel.ShowTip(Language[10082])
|
|
|
|
|
|
-- return
|
|
|
|
|
|
-- end
|
2020-11-19 18:30:19 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.JUMPSERVER_HIGHTLADDER)
|
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
Util.AddClick(this.sdBtn,function()
|
|
|
|
|
|
--条件判断
|
2020-12-16 17:04:17 +08:00
|
|
|
|
this.BuyVipFun(1,2,function()
|
2020-11-20 15:00:08 +08:00
|
|
|
|
--直接战斗
|
2020-12-05 13:13:19 +08:00
|
|
|
|
JumpServerManager.StarFightHightLadder(nil,1,function(msg)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.JUMPSERVER_GIGHTLADDER_MIANFEINUM, 1)--更新特权
|
2020-11-20 15:00:08 +08:00
|
|
|
|
this.RefreshBuyNum()
|
|
|
|
|
|
this.OnShowPanel()
|
|
|
|
|
|
end)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end)
|
2020-11-20 15:00:08 +08:00
|
|
|
|
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end)
|
|
|
|
|
|
Util.AddClick(this.addNumBtn,function()
|
2020-12-16 17:04:17 +08:00
|
|
|
|
this.BuyVipFun(2,nil)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--添加事件监听(用于子类重写)
|
|
|
|
|
|
function JumpServerHightLadderPanel:AddListener()
|
2020-11-20 15:00:08 +08:00
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.JumpServerHeightLadder.UpdateHeightLadderPanel, this.OnShowPanel)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
-- Game.GlobalEvent:AddEvent(GameEvent.JumpServerHeightLadder.UpdateHeightLadderNum, this.RefreshBuyNum)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--移除事件监听(用于子类重写)
|
|
|
|
|
|
function JumpServerHightLadderPanel:RemoveListener()
|
2020-11-20 15:00:08 +08:00
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.JumpServerHeightLadder.UpdateHeightLadderPanel, this.OnShowPanel)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
-- Game.GlobalEvent:AddEvent(GameEvent.JumpServerHeightLadder.UpdateHeightLadderNum, this.RefreshBuyNum)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--跨服
|
|
|
|
|
|
function JumpServerHightLadderPanel:OnOpen()
|
2020-12-22 15:39:32 +08:00
|
|
|
|
FormationManager.GetFormationByID(FormationTypeDef.JUMPSERVER_HIGHTLADDER)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
this.UpView:OnOpen({showType = UpViewOpenType.ShowLeft, panelType = PanelType.JumpServerHightLadder})
|
2020-12-17 19:24:43 +08:00
|
|
|
|
this.RefreshOnOpen()
|
2020-12-16 17:04:17 +08:00
|
|
|
|
isFirstRefresh = false
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--界面打开时调用(用于子类重写)
|
2020-12-05 13:13:19 +08:00
|
|
|
|
function JumpServerHightLadderPanel:OnShow()
|
2020-12-23 19:53:32 +08:00
|
|
|
|
local timeStr = "后开始"
|
|
|
|
|
|
if stage == JumpServer_Stage.Attack then
|
|
|
|
|
|
timeStr = "后结束"
|
|
|
|
|
|
elseif stage == JumpServer_Stage.End then
|
|
|
|
|
|
timeStr = "后开始"
|
|
|
|
|
|
end
|
|
|
|
|
|
this.RemainTimeDown(this.timeText,this.timeText:GetComponent("Text"),JumpServerManager.GetHightLadderDataEndTime(),timeStr)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end
|
2020-12-11 14:08:57 +08:00
|
|
|
|
function JumpServerHightLadderPanel.RefreshOnOpen()
|
|
|
|
|
|
JumpServerManager.GetWorldArenaInfoRequest()
|
|
|
|
|
|
end
|
2020-11-19 18:30:19 +08:00
|
|
|
|
function this:OnSortingOrderChange()
|
|
|
|
|
|
-- Util.AddParticleSortLayer(this.effect, self.sortingOrder - orginLayer)
|
|
|
|
|
|
end
|
|
|
|
|
|
function this.OnShowPanel()
|
2020-12-05 13:13:19 +08:00
|
|
|
|
stage = JumpServerManager.GetHightLadderDatastage()
|
2020-11-19 18:30:19 +08:00
|
|
|
|
datas = JumpServerManager.GetHightLadderDataArenaInfo()
|
2020-12-16 17:04:17 +08:00
|
|
|
|
enterable = JumpServerManager.GetHightLadderDataEnterable()
|
2020-12-05 13:13:19 +08:00
|
|
|
|
LogPink("datas.arenaEnemys "..#datas.arenaEnemys)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
for i = 1, 4 do
|
2020-12-05 13:13:19 +08:00
|
|
|
|
this.ShowSingleData(goList[i],datas.arenaEnemys[i],i)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.canPlayerTipText:SetActive(false)
|
|
|
|
|
|
this.mySortText:SetActive(false)
|
|
|
|
|
|
this.sdBtn:SetActive(false)
|
|
|
|
|
|
this.numInfo:SetActive(false)
|
|
|
|
|
|
local timeStr = ""
|
2020-12-11 11:59:33 +08:00
|
|
|
|
LogPink("stage "..stage)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
this.canPlayerTipText:GetComponent("Text").text = "本服千战主胜台前"..JoinRank.."名可以参加"
|
|
|
|
|
|
timeStr = "后开始"
|
2020-11-19 18:30:19 +08:00
|
|
|
|
--1 未开始 2 战斗阶段 3 膜拜阶段
|
|
|
|
|
|
if stage == JumpServer_Stage.NoStar then
|
|
|
|
|
|
this.canPlayerTipText:SetActive(true)
|
|
|
|
|
|
elseif stage == JumpServer_Stage.Attack then
|
2020-12-23 19:53:32 +08:00
|
|
|
|
timeStr = "后结束"
|
2020-12-16 17:04:17 +08:00
|
|
|
|
if enterable then
|
|
|
|
|
|
this.mySortText:SetActive(true)
|
|
|
|
|
|
this.sdBtn:SetActive(true)
|
|
|
|
|
|
this.numInfo:SetActive(true)
|
|
|
|
|
|
local myRank = JumpServerManager.GetHightLadderDataMyRank() <= 1000 and JumpServerManager.GetHightLadderDataMyRank() or "1000+"
|
|
|
|
|
|
this.mySortText:GetComponent("Text").text = "我的排名:".. myRank
|
|
|
|
|
|
this.RefreshBuyNum()
|
|
|
|
|
|
else
|
|
|
|
|
|
this.canPlayerTipText:SetActive(true)
|
|
|
|
|
|
end
|
2020-11-19 18:30:19 +08:00
|
|
|
|
elseif stage == JumpServer_Stage.End then
|
2020-12-23 19:53:32 +08:00
|
|
|
|
timeStr = "后开始"
|
2020-12-16 17:04:17 +08:00
|
|
|
|
if enterable then
|
2020-12-23 19:53:32 +08:00
|
|
|
|
this.canPlayerTipText:GetComponent("Text").text = "已通过邮件发放排名奖励"
|
2020-12-16 17:04:17 +08:00
|
|
|
|
local myRank = JumpServerManager.GetHightLadderDataMyRank() <= 1000 and JumpServerManager.GetHightLadderDataMyRank() or "1000+"
|
|
|
|
|
|
this.mySortText:GetComponent("Text").text = "我的排名:".. myRank
|
2020-12-17 19:24:43 +08:00
|
|
|
|
this.mySortText:SetActive(true)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
else
|
|
|
|
|
|
end
|
2020-12-23 19:53:32 +08:00
|
|
|
|
this.canPlayerTipText:SetActive(true)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end
|
|
|
|
|
|
this.RemainTimeDown(this.timeText,this.timeText:GetComponent("Text"),JumpServerManager.GetHightLadderDataEndTime(),timeStr)
|
|
|
|
|
|
end
|
|
|
|
|
|
function this.RefreshBuyNum()
|
2020-12-16 17:04:17 +08:00
|
|
|
|
LogGreen("JumpServerManager.GetCanBattleCount() "..JumpServerManager.GetCanBattleCount())
|
|
|
|
|
|
LogGreen("JumpServerManager.GetCanBuyBattleCount() "..JumpServerManager.GetCanBuyBattleCount())
|
2020-12-05 13:13:19 +08:00
|
|
|
|
this.mianfeiText.text = JumpServerManager.GetCanBattleCount()
|
2020-11-19 18:30:19 +08:00
|
|
|
|
this.buyText.text = JumpServerManager.GetCanBuyBattleCount()
|
|
|
|
|
|
end
|
|
|
|
|
|
function this.ShowSingleData(go,data,i)
|
2020-12-17 19:24:43 +08:00
|
|
|
|
if not data then return end
|
2020-11-19 18:30:19 +08:00
|
|
|
|
local playerInfo = Util.GetGameObject(go, "playerInfo")
|
|
|
|
|
|
local sdBtn = Util.GetGameObject(go, "sdBtn")
|
2020-12-16 17:04:17 +08:00
|
|
|
|
local cliclBtn = Util.GetGameObject(go, "click")
|
2020-11-20 15:00:08 +08:00
|
|
|
|
local sdBtnRedPoint = Util.GetGameObject(go, "sdBtn/redPoint")
|
2020-11-19 18:30:19 +08:00
|
|
|
|
local liveDef = Util.GetGameObject(go, "liveDef")
|
|
|
|
|
|
playerInfo:SetActive(false)
|
|
|
|
|
|
sdBtn:SetActive(false)
|
|
|
|
|
|
liveDef:SetActive(false)
|
2020-11-20 15:00:08 +08:00
|
|
|
|
sdBtnRedPoint:SetActive(false)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
--1 未开始 2 战斗阶段 3 膜拜阶段
|
|
|
|
|
|
if stage == JumpServer_Stage.NoStar then
|
|
|
|
|
|
sdBtn:SetActive(true)
|
|
|
|
|
|
liveDef:SetActive(true)
|
|
|
|
|
|
Util.GetGameObject(go, "sdBtn/Text"):GetComponent("Text").text = "虚以待位"
|
|
|
|
|
|
local str = i % 2 > 0 and "s_sanjiechumo_ren_1" or "s_sanjiechumo_ren_2"
|
|
|
|
|
|
Util.GetGameObject(go, "liveDef"):GetComponent("Image").sprite = Util.LoadSprite(str)
|
|
|
|
|
|
Util.AddOnceClick(sdBtn,function()
|
|
|
|
|
|
|
2020-12-16 17:04:17 +08:00
|
|
|
|
end)
|
|
|
|
|
|
Util.AddOnceClick(cliclBtn,function()
|
|
|
|
|
|
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end)
|
|
|
|
|
|
elseif stage == JumpServer_Stage.Attack and data then
|
|
|
|
|
|
playerInfo:SetActive(true)
|
|
|
|
|
|
sdBtn:SetActive(true)
|
|
|
|
|
|
Util.GetGameObject(go, "sdBtn/Text"):GetComponent("Text").text = "挑 战"
|
2020-12-16 17:04:17 +08:00
|
|
|
|
Util.GetGameObject(go, "playerInfo/name/nameText"):GetComponent("Text").text = data.personInfo.servername.." "..data.personInfo.name
|
2020-11-19 18:30:19 +08:00
|
|
|
|
Util.GetGameObject(go, "playerInfo/warPower/powerBtn/value"):GetComponent("Text").text = data.personInfo.totalForce
|
|
|
|
|
|
Util.GetGameObject(go, "playerInfo/warPower/Text"):GetComponent("Text").text = "第".. data.personInfo.rank .."名"
|
|
|
|
|
|
local live = Util.GetGameObject(go, "playerInfo/live")
|
2020-12-17 19:24:43 +08:00
|
|
|
|
this.LocadPersonInfoLive(go,0,live.transform)--NameManager.roleSex
|
|
|
|
|
|
sdBtnRedPoint:SetActive(JumpServerManager.GetCanBattleCount() > 0 and enterable)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
Util.AddOnceClick(sdBtn,function()
|
2020-12-16 17:04:17 +08:00
|
|
|
|
if not enterable then
|
|
|
|
|
|
PopupTipPanel.ShowTip("本服千战主胜台前"..JoinRank.."名可以参加")
|
|
|
|
|
|
return
|
|
|
|
|
|
end
|
|
|
|
|
|
this.BuyVipFun(1,1,function()
|
2020-11-20 15:00:08 +08:00
|
|
|
|
--直接战斗
|
2020-12-05 13:13:19 +08:00
|
|
|
|
JumpServerManager.StarFightHightLadder(data.personInfo,0,function(msg)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.JUMPSERVER_GIGHTLADDER_MIANFEINUM, 1)--更新特权
|
2020-11-20 15:00:08 +08:00
|
|
|
|
this.RefreshBuyNum()
|
|
|
|
|
|
this.OnShowPanel()
|
|
|
|
|
|
end)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end)
|
|
|
|
|
|
end)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
Util.AddOnceClick(cliclBtn,function()
|
2020-12-22 21:04:16 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.personInfo.uid, PLAYER_INFO_VIEW_TYPE.JUPMSERVER,data.personInfo.servername)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
end)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
elseif stage == JumpServer_Stage.End and data then
|
|
|
|
|
|
playerInfo:SetActive(true)
|
|
|
|
|
|
sdBtn:SetActive(true)
|
2020-12-22 16:15:20 +08:00
|
|
|
|
LogPink("data.personInfo.name "..data.personInfo.name.." data.personInfo.rank "..data.personInfo.rank.." data.hadProud "..tostring(data.hadProud))
|
2020-12-11 11:59:33 +08:00
|
|
|
|
Util.GetGameObject(go, "sdBtn/Text"):GetComponent("Text").text = not data.hadProud and "膜 拜" or data.worshipTime
|
2020-12-16 17:04:17 +08:00
|
|
|
|
Util.GetGameObject(go, "playerInfo/name/nameText"):GetComponent("Text").text = data.personInfo.servername.." "..data.personInfo.name
|
2020-11-19 18:30:19 +08:00
|
|
|
|
Util.GetGameObject(go, "playerInfo/warPower/powerBtn/value"):GetComponent("Text").text = data.personInfo.totalForce
|
|
|
|
|
|
Util.GetGameObject(go, "playerInfo/warPower/Text"):GetComponent("Text").text = "第".. data.personInfo.rank .."名"
|
|
|
|
|
|
local live = Util.GetGameObject(go, "playerInfo/live")
|
2020-12-26 11:40:56 +08:00
|
|
|
|
this.LocadPersonInfoLive(go,data.personInfo.gender,live.transform)--NameManager.roleSex
|
2020-12-11 11:59:33 +08:00
|
|
|
|
sdBtnRedPoint:SetActive(not data.hadProud)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
Util.AddOnceClick(sdBtn,function()
|
2020-12-11 11:59:33 +08:00
|
|
|
|
if not data.hadProud then
|
2020-12-05 13:13:19 +08:00
|
|
|
|
JumpServerManager.GetWorldArenaProudRequest(data.personInfo,function(msg)
|
2020-12-11 14:08:57 +08:00
|
|
|
|
this.RefreshOnOpen()
|
2020-11-20 15:00:08 +08:00
|
|
|
|
end)
|
|
|
|
|
|
end
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
Util.AddOnceClick(cliclBtn,function()
|
2020-12-22 21:04:16 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.personInfo.uid, PLAYER_INFO_VIEW_TYPE.JUPMSERVER,data.personInfo.servername)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
end)
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
function this.LocadPersonInfoLive(go,roleSex,live)
|
|
|
|
|
|
if liveNodeList[go] then
|
|
|
|
|
|
poolManager:UnLoadLive(liveNodeList[go].name, liveNodeList[go].go, PoolManager.AssetType.GameObject)
|
|
|
|
|
|
end
|
|
|
|
|
|
local npc = roleSex == ROLE_SEX.BOY and "live2d_npc_map" or "live2d_npc_map_nv"
|
|
|
|
|
|
local scale = roleSex == ROLE_SEX.BOY and Vector3.one * 0.26 or Vector3.one * 0.16
|
2020-12-05 13:13:19 +08:00
|
|
|
|
local live2d = poolManager:LoadLive(npc, live,scale, Vector3.zero)
|
|
|
|
|
|
local SkeletonGraphic = live2d:GetComponent("SkeletonGraphic")
|
2020-11-19 18:30:19 +08:00
|
|
|
|
if SkeletonGraphic then
|
|
|
|
|
|
SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
|
|
|
|
|
SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 0, 0)
|
|
|
|
|
|
end
|
|
|
|
|
|
liveNodeList[go] = {name=npc, go=live2d}
|
|
|
|
|
|
end
|
|
|
|
|
|
--刷新倒计时显示
|
|
|
|
|
|
function this.RemainTimeDown(_timeTextExpertgo,_timeTextExpert,timeDown,str)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
if timeDown - GetTimeStamp() > 0 then
|
2020-11-19 18:30:19 +08:00
|
|
|
|
if _timeTextExpertgo then
|
|
|
|
|
|
_timeTextExpertgo:SetActive(true)
|
|
|
|
|
|
end
|
|
|
|
|
|
if _timeTextExpert then
|
2020-12-16 17:04:17 +08:00
|
|
|
|
_timeTextExpert.text = this.TimeStampToDateString(timeDown - GetTimeStamp())..str
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end
|
|
|
|
|
|
if this.timer then
|
|
|
|
|
|
this.timer:Stop()
|
|
|
|
|
|
this.timer = nil
|
|
|
|
|
|
end
|
|
|
|
|
|
this.timer = Timer.New(function()
|
|
|
|
|
|
if _timeTextExpert then
|
2020-12-16 20:18:46 +08:00
|
|
|
|
-- LogGreen(" 跨服天梯 "..this.TimeStampToDateString(timeDown)..str)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
_timeTextExpert.text = this.TimeStampToDateString(timeDown - GetTimeStamp())..str
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end
|
2020-12-16 17:04:17 +08:00
|
|
|
|
if timeDown - GetTimeStamp() < 0 then
|
2020-11-19 18:30:19 +08:00
|
|
|
|
if _timeTextExpertgo then
|
|
|
|
|
|
_timeTextExpertgo:SetActive(false)
|
|
|
|
|
|
end
|
|
|
|
|
|
this.timer:Stop()
|
|
|
|
|
|
this.timer = nil
|
2020-12-16 17:04:17 +08:00
|
|
|
|
if not isFirstRefresh then
|
2020-12-16 20:18:46 +08:00
|
|
|
|
Timer.New(function()
|
|
|
|
|
|
LogError("跨服天梯前端刷新")
|
|
|
|
|
|
JumpServerManager.GetWorldArenaInfoRequest()
|
|
|
|
|
|
isFirstRefresh = true
|
|
|
|
|
|
end, 2):Start()
|
2020-12-16 17:04:17 +08:00
|
|
|
|
end
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end
|
2020-12-16 20:18:46 +08:00
|
|
|
|
-- timeDown = timeDown - 1
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end, 1, -1, true)
|
|
|
|
|
|
this.timer:Start()
|
|
|
|
|
|
else
|
|
|
|
|
|
if _timeTextExpertgo then
|
|
|
|
|
|
_timeTextExpertgo:SetActive(false)
|
|
|
|
|
|
end
|
2020-12-16 17:04:17 +08:00
|
|
|
|
if not isFirstRefresh then
|
2020-12-16 20:18:46 +08:00
|
|
|
|
Timer.New(function()
|
|
|
|
|
|
LogError("跨服天梯前端刷新")
|
|
|
|
|
|
JumpServerManager.GetWorldArenaInfoRequest()
|
|
|
|
|
|
isFirstRefresh = true
|
|
|
|
|
|
end, 2):Start()
|
2020-12-16 17:04:17 +08:00
|
|
|
|
end
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function this.TimeStampToDateString(second)
|
|
|
|
|
|
local day = math.floor(second / (24 * 3600))
|
|
|
|
|
|
local minute = math.floor(second / 60) % 60
|
|
|
|
|
|
local sec = second % 60
|
|
|
|
|
|
local hour = math.floor(math.floor(second - day * 24 * 3600 - sec - minute * 60) / 3600)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
if day > 0 then
|
2020-12-22 21:04:16 +08:00
|
|
|
|
return string.format("%d天%02d时%02d分%02d秒",day, hour, minute, sec)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
else
|
2020-12-22 21:04:16 +08:00
|
|
|
|
return string.format("%02d时%02d分%02d秒", hour, minute, sec)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
end
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
2020-12-16 17:04:17 +08:00
|
|
|
|
function this.BuyVipFun(type,warOrSd,fun)
|
|
|
|
|
|
if type == 1 then
|
|
|
|
|
|
if JumpServerManager.GetCanBattleCount() <= 0 then --今日已无剩余次数!
|
|
|
|
|
|
if JumpServerManager.GetCanBuyBattleCount() <= 0 then
|
|
|
|
|
|
PopupTipPanel.ShowTip(Language[12326])
|
|
|
|
|
|
else
|
|
|
|
|
|
--是否花费XX妖晶购买1次挑战次数并发起挑战?
|
|
|
|
|
|
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP, JumpServerManager.shopGoodId, 1)
|
|
|
|
|
|
local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name
|
|
|
|
|
|
if finalNum > BagManager.GetItemCountById(costId) then
|
|
|
|
|
|
PopupTipPanel.ShowTip(string.format(Language[11652],itemName))
|
|
|
|
|
|
return
|
|
|
|
|
|
end
|
|
|
|
|
|
local tipStr = warOrSd == 1 and Language[12327] or "是否花费%s%s购买1次挑战次数并进行扫荡?"
|
|
|
|
|
|
MsgPanel.ShowTwo(string.format( tipStr,finalNum,itemName), nil, function()
|
|
|
|
|
|
--买东西
|
|
|
|
|
|
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,JumpServerManager.shopGoodId,1,function()
|
2020-12-21 19:25:53 +08:00
|
|
|
|
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.JUMPSERVER_GIGHTLADDER_BUYNUM, 1)--更新特权
|
2020-12-16 17:04:17 +08:00
|
|
|
|
local tipStr2 = warOrSd == 1 and Language[12328] or "扫荡成功!"
|
|
|
|
|
|
PopupTipPanel.ShowTip(tipStr2)
|
|
|
|
|
|
if fun then
|
|
|
|
|
|
fun ()
|
|
|
|
|
|
end
|
|
|
|
|
|
end)
|
2020-11-24 10:40:56 +08:00
|
|
|
|
end)
|
2020-12-16 17:04:17 +08:00
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
2020-12-23 19:53:32 +08:00
|
|
|
|
if warOrSd == 1 then
|
|
|
|
|
|
if fun then
|
|
|
|
|
|
fun ()
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
MsgPanel.ShowTwo("扫荡后可直接获得挑战奖励并保持当前排名,确定消耗一次挑战次数进行扫荡?", nil, function()
|
|
|
|
|
|
if fun then
|
|
|
|
|
|
fun ()
|
|
|
|
|
|
end
|
|
|
|
|
|
end)
|
2020-11-24 10:40:56 +08:00
|
|
|
|
end
|
2020-11-20 15:00:08 +08:00
|
|
|
|
end
|
2020-12-16 17:04:17 +08:00
|
|
|
|
elseif type == 2 then
|
2020-12-23 19:53:32 +08:00
|
|
|
|
if JumpServerManager.GetCanBuyBattleCount() <= 0 then
|
|
|
|
|
|
PopupTipPanel.ShowTip("今日已无购买剩余次数!")
|
|
|
|
|
|
else
|
2020-12-24 10:59:34 +08:00
|
|
|
|
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP, JumpServerManager.shopGoodId, 1)
|
|
|
|
|
|
local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name
|
|
|
|
|
|
local tipStr = "是否花费%s%s购买1次挑战次数?"
|
|
|
|
|
|
MsgPanel.ShowTwo(string.format( tipStr,finalNum,itemName), nil, function()
|
|
|
|
|
|
--买东西
|
|
|
|
|
|
if finalNum > BagManager.GetItemCountById(costId) then
|
|
|
|
|
|
PopupTipPanel.ShowTip(string.format(Language[11652],itemName))
|
|
|
|
|
|
return
|
|
|
|
|
|
end
|
|
|
|
|
|
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,JumpServerManager.shopGoodId,1,function()
|
|
|
|
|
|
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.JUMPSERVER_GIGHTLADDER_BUYNUM, 1)--更新特权
|
|
|
|
|
|
this.RefreshBuyNum()
|
|
|
|
|
|
end)
|
2020-12-23 19:53:32 +08:00
|
|
|
|
end)
|
|
|
|
|
|
end
|
2020-11-20 15:00:08 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2020-11-19 18:30:19 +08:00
|
|
|
|
--界面关闭时调用(用于子类重写)
|
|
|
|
|
|
function JumpServerHightLadderPanel:OnClose()
|
2020-12-17 19:24:43 +08:00
|
|
|
|
if this.timer then
|
|
|
|
|
|
this.timer:Stop()
|
|
|
|
|
|
this.timer = nil
|
|
|
|
|
|
end
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
|
|
|
|
function JumpServerHightLadderPanel:OnDestroy()
|
|
|
|
|
|
for key, value in pairs(liveNodeList) do
|
|
|
|
|
|
poolManager:UnLoadLive(value.name, value.go, PoolManager.AssetType.GameObject)
|
2020-12-17 19:24:43 +08:00
|
|
|
|
liveNodeList = {}
|
2020-11-19 18:30:19 +08:00
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return JumpServerHightLadderPanel
|