ShaoNv
parent
a5f5894185
commit
caec443165
|
|
@ -8,18 +8,18 @@ local stage = 0
|
||||||
local enterable = false
|
local enterable = false
|
||||||
--local JoinRank = ConfigManager.GetConfigData(ConfigName.MServerArenaSetting,1).JoinRank
|
--local JoinRank = ConfigManager.GetConfigData(ConfigName.MServerArenaSetting,1).JoinRank
|
||||||
local isFirstRefresh = false
|
local isFirstRefresh = false
|
||||||
local curPos=1
|
local curPos = 1
|
||||||
--初始化组件(用于子类重写)
|
--初始化组件(用于子类重写)
|
||||||
function JumpServerHightLadderPanel:InitComponent()
|
function JumpServerHightLadderPanel:InitComponent()
|
||||||
this.spLoader = SpriteLoader.New()
|
this.spLoader = SpriteLoader.New()
|
||||||
this.timeText = Util.GetGameObject(self.gameObject, "titleObg/timeImage/Text")
|
this.timeText = Util.GetGameObject(self.gameObject, "titleObg/timeImage/Text")
|
||||||
this.helpBtn = Util.GetGameObject(self.gameObject,"HelpBtn")
|
this.helpBtn = Util.GetGameObject(self.gameObject, "HelpBtn")
|
||||||
this.helpPos = this.helpBtn:GetComponent("RectTransform").localPosition
|
this.helpPos = this.helpBtn:GetComponent("RectTransform").localPosition
|
||||||
this.sortBtn = Util.GetGameObject(self.gameObject,"rightBtns/sortBtn")
|
this.sortBtn = Util.GetGameObject(self.gameObject, "rightBtns/sortBtn")
|
||||||
this.rewardSortBtn = Util.GetGameObject(self.gameObject,"rightBtns/rewardSortBtn")
|
this.rewardSortBtn = Util.GetGameObject(self.gameObject, "rightBtns/rewardSortBtn")
|
||||||
this.recordBtn = Util.GetGameObject(self.gameObject,"rightBtns/recordBtn")
|
this.recordBtn = Util.GetGameObject(self.gameObject, "rightBtns/recordBtn")
|
||||||
this.shopBtn = Util.GetGameObject(self.gameObject,"rightBtns/shopBtn")
|
this.shopBtn = Util.GetGameObject(self.gameObject, "rightBtns/shopBtn")
|
||||||
this.formationBtn = Util.GetGameObject(self.gameObject,"rightBtns/formationBtn")
|
this.formationBtn = Util.GetGameObject(self.gameObject, "rightBtns/formationBtn")
|
||||||
this.backBtn = Util.GetGameObject(self.gameObject, "backBtn")
|
this.backBtn = Util.GetGameObject(self.gameObject, "backBtn")
|
||||||
|
|
||||||
-- this.singlePre = Util.GetGameObject(self.gameObject, "middleObg/singlePre")
|
-- this.singlePre = Util.GetGameObject(self.gameObject, "middleObg/singlePre")
|
||||||
|
|
@ -29,128 +29,123 @@ function JumpServerHightLadderPanel:InitComponent()
|
||||||
-- this.scrollView.moveTween.MomentumAmount = 1
|
-- this.scrollView.moveTween.MomentumAmount = 1
|
||||||
-- this.scrollView.moveTween.Strength = 2
|
-- this.scrollView.moveTween.Strength = 2
|
||||||
for i = 1, 4 do
|
for i = 1, 4 do
|
||||||
goList[i] = Util.GetGameObject(self.gameObject, "middleObg/rect/singlePre (".. i ..")")
|
goList[i] = Util.GetGameObject(self.gameObject, "middleObg/rect/singlePre (" .. i .. ")")
|
||||||
end
|
end
|
||||||
|
|
||||||
this.mySortText = Util.GetGameObject(self.gameObject, "endObg/mySortText")
|
this.mySortText = Util.GetGameObject(self.gameObject, "endObg/mySortText")
|
||||||
this.sdBtn = Util.GetGameObject(self.gameObject,"endObg/sdBtn")
|
this.sdBtn = Util.GetGameObject(self.gameObject, "endObg/sdBtn")
|
||||||
this.numInfo = Util.GetGameObject(self.gameObject, "endObg/numInfo")
|
this.numInfo = Util.GetGameObject(self.gameObject, "endObg/numInfo")
|
||||||
Util.GetGameObject(self.gameObject,"endObg/sdBtn/Text"):GetComponent("Text").text = "扫 荡"
|
Util.GetGameObject(self.gameObject, "endObg/sdBtn/Text"):GetComponent("Text").text = "扫 荡"
|
||||||
Util.GetGameObject(self.gameObject, "endObg/numInfo/mianfeiText"):GetComponent("Text").text = "免费次数:"
|
Util.GetGameObject(self.gameObject, "endObg/numInfo/mianfeiText"):GetComponent("Text").text = "免费次数:"
|
||||||
this.mianfeiText = Util.GetGameObject(self.gameObject, "endObg/numInfo/mianfeiText/Text"):GetComponent("Text")
|
this.mianfeiText = Util.GetGameObject(self.gameObject, "endObg/numInfo/mianfeiText/Text"):GetComponent("Text")
|
||||||
Util.GetGameObject(self.gameObject, "endObg/numInfo/buyText"):GetComponent("Text").text = "购买次数:"
|
Util.GetGameObject(self.gameObject, "endObg/numInfo/buyText"):GetComponent("Text").text = "购买次数:"
|
||||||
this.buyText = Util.GetGameObject(self.gameObject, "endObg/numInfo/buyText/Text"):GetComponent("Text")
|
this.buyText = Util.GetGameObject(self.gameObject, "endObg/numInfo/buyText/Text"):GetComponent("Text")
|
||||||
this.addNumBtn = Util.GetGameObject(self.gameObject,"endObg/numInfo/addNumBtn/click")
|
this.addNumBtn = Util.GetGameObject(self.gameObject, "endObg/numInfo/addNumBtn/click")
|
||||||
this.canPlayerTipText = Util.GetGameObject(self.gameObject, "endObg/canPlayerTipText")
|
this.canPlayerTipText = Util.GetGameObject(self.gameObject, "endObg/canPlayerTipText")
|
||||||
this.signObj = Util.GetGameObject(self.gameObject, "signObj")
|
this.signObj = Util.GetGameObject(self.gameObject, "signObj")
|
||||||
this.btn_left = Util.GetGameObject(self.gameObject, "signObj/btn_left")
|
this.btn_left = Util.GetGameObject(self.gameObject, "signObj/btn_left")
|
||||||
this.btn_right = Util.GetGameObject(self.gameObject, "signObj/btn_right")
|
this.btn_right = Util.GetGameObject(self.gameObject, "signObj/btn_right")
|
||||||
this.selectObj=Util.GetGameObject(self.gameObject, "signObj/selectBar/selectBtn")
|
this.selectObj = Util.GetGameObject(self.gameObject, "signObj/selectBar/selectBtn")
|
||||||
this.signBtnList={}
|
this.signBtnList = {}
|
||||||
for i=1,4 do
|
for i = 1, 4 do
|
||||||
local proObj={}
|
local proObj = {}
|
||||||
local btn=Util.GetGameObject(self.gameObject, "signObj/selectBar/btn"..i)
|
local btn = Util.GetGameObject(self.gameObject, "signObj/selectBar/btn" .. i)
|
||||||
proObj.img=btn:GetComponent("Image")
|
proObj.img = btn:GetComponent("Image")
|
||||||
proObj.img.sprite=this.spLoader:LoadSprite(GetProStrImageByProNum(i))
|
proObj.img.sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(i))
|
||||||
proObj.btn_sign=Util.GetGameObject(btn,"btn")
|
proObj.btn_sign = Util.GetGameObject(btn, "btn")
|
||||||
proObj.red = Util.GetGameObject(btn,"btn/red")
|
proObj.red = Util.GetGameObject(btn, "btn/red")
|
||||||
proObj.info=Util.GetGameObject(self.gameObject, "signObj/selectBar/btn"..i.."/info"):GetComponent("Text")
|
proObj.info = Util.GetGameObject(self.gameObject, "signObj/selectBar/btn" .. i .. "/info"):GetComponent("Text")
|
||||||
proObj.btn=btn
|
proObj.btn = btn
|
||||||
this.signBtnList[i]=proObj
|
this.signBtnList[i] = proObj
|
||||||
end
|
end
|
||||||
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform)
|
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform)
|
||||||
end
|
end
|
||||||
|
|
||||||
--绑定事件(用于子类重写)
|
--绑定事件(用于子类重写)
|
||||||
function JumpServerHightLadderPanel:BindEvent()
|
function JumpServerHightLadderPanel:BindEvent()
|
||||||
|
for i = 1, #this.signBtnList do
|
||||||
|
Util.AddClick(this.signBtnList[i].btn_sign, function()
|
||||||
for i=1,#this.signBtnList do
|
local sureFunc = function()
|
||||||
Util.AddClick(this.signBtnList[i].btn_sign,function()
|
NetManager.LuofuRegisterRequest(i, function()
|
||||||
local sureFunc=function()
|
|
||||||
NetManager.LuofuRegisterRequest(i,function()
|
|
||||||
this.SetSignBtnShow()
|
this.SetSignBtnShow()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
local args={}
|
local args = {}
|
||||||
args[1]="确认报名当前所选阵营?"
|
args[1] = "确认报名当前所选阵营?"
|
||||||
args[2]="确认"
|
args[2] = "确认"
|
||||||
args[3]="取消"
|
args[3] = "取消"
|
||||||
args[4]=sureFunc
|
args[4] = sureFunc
|
||||||
UIManager.OpenPanel(UIName.GMCommonConfirmPanel,args)
|
UIManager.OpenPanel(UIName.GMCommonConfirmPanel, args)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
Util.AddClick(this.btn_left,function()
|
Util.AddClick(this.btn_left, function()
|
||||||
if curPos-1<=0 then
|
if curPos - 1 <= 0 then
|
||||||
curPos=4
|
curPos = 4
|
||||||
else
|
else
|
||||||
curPos=curPos-1
|
curPos = curPos - 1
|
||||||
end
|
end
|
||||||
JumpServerManager.GetWorldArenaInfoRequest(curPos,function ()
|
JumpServerManager.GetWorldArenaInfoRequest(curPos, function()
|
||||||
this.SetSelectPos()
|
this.SetSelectPos()
|
||||||
--this.OnShowPanel()
|
--this.OnShowPanel()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Util.AddClick(this.btn_right,function()
|
Util.AddClick(this.btn_right, function()
|
||||||
if curPos+1>4 then
|
if curPos + 1 > 4 then
|
||||||
curPos=1
|
curPos = 1
|
||||||
else
|
else
|
||||||
curPos=curPos+1
|
curPos = curPos + 1
|
||||||
end
|
end
|
||||||
JumpServerManager.GetWorldArenaInfoRequest(curPos,function ()
|
JumpServerManager.GetWorldArenaInfoRequest(curPos, function()
|
||||||
this.SetSelectPos()
|
this.SetSelectPos()
|
||||||
--this.OnShowPanel()
|
--this.OnShowPanel()
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.backBtn,function()
|
Util.AddClick(this.backBtn, function()
|
||||||
self:ClosePanel()
|
self:ClosePanel()
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.helpBtn,function()
|
Util.AddClick(this.helpBtn, function()
|
||||||
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.JumpServerHeightLadder,this.helpPos.x,this.helpPos.y)
|
UIManager.OpenPanel(UIName.HelpPopup, HELP_TYPE.JumpServerHeightLadder, this.helpPos.x, this.helpPos.y)
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.sortBtn,function()
|
Util.AddClick(this.sortBtn, function()
|
||||||
JumpServerManager.SetCurPersonInfo(nil)
|
JumpServerManager.SetCurPersonInfo(nil)
|
||||||
UIManager.OpenPanel(UIName.RankingSingleListPanel,rankKingList[18])
|
UIManager.OpenPanel(UIName.RankingSingleListPanel, rankKingList[18])
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.rewardSortBtn,function()
|
Util.AddClick(this.rewardSortBtn, function()
|
||||||
UIManager.OpenPanel(UIName.JumpServerHightLadderRewardSortPanel,FUNCTION_OPEN_TYPE.JumpServer_HightLadder)
|
UIManager.OpenPanel(UIName.JumpServerHightLadderRewardSortPanel, FUNCTION_OPEN_TYPE.JumpServer_HightLadder)
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.recordBtn,function()
|
Util.AddClick(this.recordBtn, function()
|
||||||
UIManager.OpenPanel(UIName.JumpServerHightLadderRecordPopup)
|
UIManager.OpenPanel(UIName.JumpServerHightLadderRecordPopup)
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.shopBtn,function()
|
Util.AddClick(this.shopBtn, function()
|
||||||
JumpManager.GoJump(40083)
|
JumpManager.GoJump(40083)
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.formationBtn,function()
|
Util.AddClick(this.formationBtn, function()
|
||||||
-- if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.JumpServer_HightLadder) then
|
-- if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.JumpServer_HightLadder) then
|
||||||
-- PopupTipPanel.ShowTip(Language[10082])
|
-- PopupTipPanel.ShowTip(Language[10082])
|
||||||
-- return
|
-- return
|
||||||
-- end
|
-- end
|
||||||
if JumpServerManager.arenaType==0 then
|
if JumpServerManager.arenaType == 0 then
|
||||||
PopupTipPanel.ShowTip("报名后才能设置编队")
|
PopupTipPanel.ShowTip("报名后才能设置编队")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.JUMPSERVER_HIGHTLADDER)
|
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.JUMPSERVER_HIGHTLADDER)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Util.AddClick(this.sdBtn,function()
|
Util.AddClick(this.sdBtn, function()
|
||||||
--条件判断
|
--条件判断
|
||||||
this.BuyVipFun(1,2,function()
|
this.BuyVipFun(1, 2, function()
|
||||||
--直接战斗
|
--直接战斗
|
||||||
JumpServerManager.StarFightHightLadder(nil,1,function(msg)
|
JumpServerManager.StarFightHightLadder(nil, 1, function(msg)
|
||||||
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.JUMPSERVER_GIGHTLADDER_MIANFEINUM, 1)--更新特权
|
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.JUMPSERVER_GIGHTLADDER_MIANFEINUM, 1) --更新特权
|
||||||
this.RefreshBuyNum()
|
this.RefreshBuyNum()
|
||||||
this.OnShowPanel()
|
this.OnShowPanel()
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.addNumBtn,function()
|
Util.AddClick(this.addNumBtn, function()
|
||||||
this.BuyVipFun(2,nil)
|
this.BuyVipFun(2, nil)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -173,26 +168,26 @@ end
|
||||||
--跨服
|
--跨服
|
||||||
function JumpServerHightLadderPanel:OnOpen()
|
function JumpServerHightLadderPanel:OnOpen()
|
||||||
FormationManager.GetFormationByID(FormationTypeDef.JUMPSERVER_HIGHTLADDER)
|
FormationManager.GetFormationByID(FormationTypeDef.JUMPSERVER_HIGHTLADDER)
|
||||||
curPos=JumpServerManager.arenaType
|
curPos = JumpServerManager.arenaType
|
||||||
if curPos==0 then
|
if curPos == 0 then
|
||||||
curPos=1
|
curPos = 1
|
||||||
end
|
end
|
||||||
this.UpView:OnOpen({showType = UpViewOpenType.ShowLeft, panelType = PanelType.JumpServerHightLadder})
|
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.JumpServerHightLadder })
|
||||||
this.RefreshOnOpen()
|
this.RefreshOnOpen()
|
||||||
isFirstRefresh = false
|
isFirstRefresh = false
|
||||||
end
|
end
|
||||||
|
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
function JumpServerHightLadderPanel:OnShow()
|
function JumpServerHightLadderPanel:OnShow()
|
||||||
local timeStr = "后开始"
|
local timeStr = "后开始"
|
||||||
if stage == JumpServer_Stage.Attack then
|
if stage == JumpServer_Stage.Attack then
|
||||||
timeStr = "后结束"
|
timeStr = "后结束"
|
||||||
elseif stage == JumpServer_Stage.End then
|
elseif stage == JumpServer_Stage.End then
|
||||||
timeStr = "后开始"
|
timeStr = "后开始"
|
||||||
end
|
end
|
||||||
|
|
||||||
this.RemainTimeDown(this.timeText,this.timeText:GetComponent("Text"),JumpServerManager.GetHightLadderDataEndTime(),timeStr)
|
this.RemainTimeDown(this.timeText, this.timeText:GetComponent("Text"), JumpServerManager.GetHightLadderDataEndTime(),
|
||||||
|
timeStr)
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.SetSelectPos()
|
function this.SetSelectPos()
|
||||||
|
|
@ -202,11 +197,11 @@ end
|
||||||
|
|
||||||
function this.SetSignBtnShow()
|
function this.SetSignBtnShow()
|
||||||
--攻击阶段不显示膜拜信息
|
--攻击阶段不显示膜拜信息
|
||||||
this.signObj:SetActive(stage~=JumpServer_Stage.Attack)
|
this.signObj:SetActive(stage ~= JumpServer_Stage.Attack)
|
||||||
for i=1,#this.signBtnList do
|
for i = 1, #this.signBtnList do
|
||||||
this.signBtnList[i].btn_sign:SetActive(JumpServerManager.arenaType==0)
|
this.signBtnList[i].btn_sign:SetActive(JumpServerManager.arenaType == 0)
|
||||||
this.signBtnList[i].info.gameObject:SetActive(false)
|
this.signBtnList[i].info.gameObject:SetActive(false)
|
||||||
if JumpServerManager.arenaType>0 then
|
if JumpServerManager.arenaType > 0 then
|
||||||
this.signBtnList[JumpServerManager.arenaType].info.gameObject:SetActive(true)
|
this.signBtnList[JumpServerManager.arenaType].info.gameObject:SetActive(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -215,29 +210,31 @@ end
|
||||||
function JumpServerHightLadderPanel.RefreshOnOpen()
|
function JumpServerHightLadderPanel.RefreshOnOpen()
|
||||||
JumpServerManager.GetWorldArenaInfoRequest(curPos)
|
JumpServerManager.GetWorldArenaInfoRequest(curPos)
|
||||||
end
|
end
|
||||||
|
|
||||||
function this:OnSortingOrderChange()
|
function this:OnSortingOrderChange()
|
||||||
-- Util.AddParticleSortLayer(this.effect, self.sortingOrder - orginLayer)
|
-- Util.AddParticleSortLayer(this.effect, self.sortingOrder - orginLayer)
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.OnShowPanel()
|
function this.OnShowPanel()
|
||||||
stage = JumpServerManager.GetHightLadderDatastage()
|
stage = JumpServerManager.GetHightLadderDatastage()
|
||||||
datas = JumpServerManager.GetHightLadderDataArenaInfo()
|
datas = JumpServerManager.GetHightLadderDataArenaInfo()
|
||||||
enterable = JumpServerManager.GetHightLadderDataEnterable()
|
enterable = JumpServerManager.GetHightLadderDataEnterable()
|
||||||
LogError("datas.arenaEnemys "..#datas.arenaEnemys)
|
LogError("datas.arenaEnemys " .. #datas.arenaEnemys)
|
||||||
for i = 1, 4 do
|
for i = 1, 4 do
|
||||||
local curData = datas.arenaEnemys[i] or {}
|
local curData = datas.arenaEnemys[i] or {}
|
||||||
this.ShowSingleData(goList[i],curData,i)
|
this.ShowSingleData(goList[i], curData, i)
|
||||||
end
|
end
|
||||||
this.SetSignBtnShow()
|
this.SetSignBtnShow()
|
||||||
this.SetSelectPos()
|
this.SetSelectPos()
|
||||||
LogError("JumpServerManager.arenaType=="..JumpServerManager.arenaType)
|
LogError("JumpServerManager.arenaType==" .. JumpServerManager.arenaType)
|
||||||
this.canPlayerTipText:SetActive(false)
|
this.canPlayerTipText:SetActive(false)
|
||||||
this.mySortText:SetActive(false)
|
this.mySortText:SetActive(false)
|
||||||
this.sdBtn:SetActive(false)
|
this.sdBtn:SetActive(false)
|
||||||
this.numInfo:SetActive(false)
|
this.numInfo:SetActive(false)
|
||||||
local timeStr = ""
|
local timeStr = ""
|
||||||
LogPink("stage "..stage)
|
LogPink("stage " .. stage)
|
||||||
this.canPlayerTipText.transform.localPosition = Vector3.New(1.3, 46.5, 0)
|
this.canPlayerTipText.transform.localPosition = Vector3.New(1.3, 46.5, 0)
|
||||||
this.canPlayerTipText:GetComponent("Text").text =""-- "本服千战逐胜台前"..JoinRank.."名可以参加"
|
this.canPlayerTipText:GetComponent("Text").text = "" -- "本服千战逐胜台前"..JoinRank.."名可以参加"
|
||||||
timeStr = "后开始"
|
timeStr = "后开始"
|
||||||
--1 未开始 2 战斗阶段 3 膜拜阶段
|
--1 未开始 2 战斗阶段 3 膜拜阶段
|
||||||
if stage == JumpServer_Stage.NoStar then
|
if stage == JumpServer_Stage.NoStar then
|
||||||
|
|
@ -248,8 +245,9 @@ function this.OnShowPanel()
|
||||||
this.mySortText:SetActive(true)
|
this.mySortText:SetActive(true)
|
||||||
this.sdBtn:SetActive(true)
|
this.sdBtn:SetActive(true)
|
||||||
this.numInfo:SetActive(true)
|
this.numInfo:SetActive(true)
|
||||||
local myRank = JumpServerManager.GetHightLadderDataMyRank() <= 1000 and JumpServerManager.GetHightLadderDataMyRank() or "1000+"
|
local myRank = JumpServerManager.GetHightLadderDataMyRank() <= 1000 and
|
||||||
this.mySortText:GetComponent("Text").text = "我的排名:".. myRank
|
JumpServerManager.GetHightLadderDataMyRank() or "1000+"
|
||||||
|
this.mySortText:GetComponent("Text").text = "我的排名:" .. myRank
|
||||||
this.RefreshBuyNum()
|
this.RefreshBuyNum()
|
||||||
else
|
else
|
||||||
this.canPlayerTipText:SetActive(true)
|
this.canPlayerTipText:SetActive(true)
|
||||||
|
|
@ -257,12 +255,13 @@ function this.OnShowPanel()
|
||||||
elseif stage == JumpServer_Stage.End then
|
elseif stage == JumpServer_Stage.End then
|
||||||
timeStr = "后开始"
|
timeStr = "后开始"
|
||||||
if enterable then
|
if enterable then
|
||||||
if GetTimeStampCorrespondingWeekNum(GetTimeStamp()) >= 2 and GetTimeStampCorrespondingWeekNum(GetTimeStamp()) < 3 then--优化,战斗阶段结束后的下个周二零点后(本服竞技场重置),不再显示上期排名和邮件提示,改为显示:本服千战逐胜台前100名可参加
|
if GetTimeStampCorrespondingWeekNum(GetTimeStamp()) >= 2 and GetTimeStampCorrespondingWeekNum(GetTimeStamp()) < 3 then --优化,战斗阶段结束后的下个周二零点后(本服竞技场重置),不再显示上期排名和邮件提示,改为显示:本服千战逐胜台前100名可参加
|
||||||
this.canPlayerTipText:GetComponent("Text").text ="" --"本服千战逐胜台前"..JoinRank.."名可以参加"
|
this.canPlayerTipText:GetComponent("Text").text = "" --"本服千战逐胜台前"..JoinRank.."名可以参加"
|
||||||
else
|
else
|
||||||
this.canPlayerTipText.transform.localPosition = Vector3.New(1.3,11.85, 0)
|
this.canPlayerTipText.transform.localPosition = Vector3.New(1.3, 11.85, 0)
|
||||||
local myRank = JumpServerManager.GetHightLadderDataMyRank() <= 1000 and JumpServerManager.GetHightLadderDataMyRank() or "1000+"
|
local myRank = JumpServerManager.GetHightLadderDataMyRank() <= 1000 and
|
||||||
this.mySortText:GetComponent("Text").text = "我的排名:".. myRank
|
JumpServerManager.GetHightLadderDataMyRank() or "1000+"
|
||||||
|
this.mySortText:GetComponent("Text").text = "我的排名:" .. myRank
|
||||||
if JumpServerManager.GetHightLadderDataMyRank() <= 1000 then
|
if JumpServerManager.GetHightLadderDataMyRank() <= 1000 then
|
||||||
this.canPlayerTipText:GetComponent("Text").text = "已通过邮件发放排名奖励"
|
this.canPlayerTipText:GetComponent("Text").text = "已通过邮件发放排名奖励"
|
||||||
else
|
else
|
||||||
|
|
@ -274,15 +273,18 @@ function this.OnShowPanel()
|
||||||
end
|
end
|
||||||
this.canPlayerTipText:SetActive(true)
|
this.canPlayerTipText:SetActive(true)
|
||||||
end
|
end
|
||||||
this.RemainTimeDown(this.timeText,this.timeText:GetComponent("Text"),JumpServerManager.GetHightLadderDataEndTime(),timeStr)
|
this.RemainTimeDown(this.timeText, this.timeText:GetComponent("Text"), JumpServerManager.GetHightLadderDataEndTime(),
|
||||||
|
timeStr)
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.RefreshBuyNum()
|
function this.RefreshBuyNum()
|
||||||
LogGreen("JumpServerManager.GetCanBattleCount() "..JumpServerManager.GetCanBattleCount())
|
LogGreen("JumpServerManager.GetCanBattleCount() " .. JumpServerManager.GetCanBattleCount())
|
||||||
LogGreen("JumpServerManager.GetCanBuyBattleCount() "..JumpServerManager.GetCanBuyBattleCount())
|
LogGreen("JumpServerManager.GetCanBuyBattleCount() " .. JumpServerManager.GetCanBuyBattleCount())
|
||||||
this.mianfeiText.text = JumpServerManager.GetCanBattleCount()
|
this.mianfeiText.text = JumpServerManager.GetCanBattleCount()
|
||||||
this.buyText.text = JumpServerManager.GetCanBuyBattleCount()
|
this.buyText.text = JumpServerManager.GetCanBuyBattleCount()
|
||||||
end
|
end
|
||||||
function this.ShowSingleData(go,data,i)
|
|
||||||
|
function this.ShowSingleData(go, data, i)
|
||||||
if not data then return end
|
if not data then return end
|
||||||
local playerInfo = Util.GetGameObject(go, "playerInfo")
|
local playerInfo = Util.GetGameObject(go, "playerInfo")
|
||||||
local sdBtn = Util.GetGameObject(go, "sdBtn")
|
local sdBtn = Util.GetGameObject(go, "sdBtn")
|
||||||
|
|
@ -296,133 +298,144 @@ function this.ShowSingleData(go,data,i)
|
||||||
sdBtnRedPoint:SetActive(false)
|
sdBtnRedPoint:SetActive(false)
|
||||||
dianzanImage:SetActive(false)
|
dianzanImage:SetActive(false)
|
||||||
--1 未开始 2 战斗阶段 3 膜拜阶段
|
--1 未开始 2 战斗阶段 3 膜拜阶段
|
||||||
if stage == JumpServer_Stage.NoStar and data.personInfo==nil then
|
if stage == JumpServer_Stage.NoStar and data.personInfo == nil then
|
||||||
sdBtn:SetActive(true)
|
sdBtn:SetActive(true)
|
||||||
liveDef:SetActive(true)
|
liveDef:SetActive(true)
|
||||||
Util.GetGameObject(go, "sdBtn/Text"):SetActive(true)
|
Util.GetGameObject(go, "sdBtn/Text"):SetActive(true)
|
||||||
Util.GetGameObject(go, "sdBtn/Text"):GetComponent("Text").text = "虚以待位"
|
Util.GetGameObject(go, "sdBtn/Text"):GetComponent("Text").text = "虚以待位"
|
||||||
local str = "s_sanjiechumo_ren_1"--i % 2 > 0 and "s_sanjiechumo_ren_1" or "s_sanjiechumo_ren_2"
|
local str = "s_sanjiechumo_ren_1" --i % 2 > 0 and "s_sanjiechumo_ren_1" or "s_sanjiechumo_ren_2"
|
||||||
Util.GetGameObject(go, "liveDef"):GetComponent("Image").sprite = this.spLoader:LoadSprite(str)
|
Util.GetGameObject(go, "liveDef"):GetComponent("Image").sprite = this.spLoader:LoadSprite(str)
|
||||||
Util.AddOnceClick(sdBtn,function()
|
Util.AddOnceClick(sdBtn, function()
|
||||||
|
|
||||||
end)
|
end)
|
||||||
Util.AddOnceClick(cliclBtn,function()
|
Util.AddOnceClick(cliclBtn, function()
|
||||||
|
|
||||||
end)
|
end)
|
||||||
elseif stage == JumpServer_Stage.Attack and data and data.personInfo then
|
elseif stage == JumpServer_Stage.Attack and data and data.personInfo then
|
||||||
playerInfo:SetActive(true)
|
playerInfo:SetActive(true)
|
||||||
sdBtn:SetActive(true)
|
sdBtn:SetActive(true)
|
||||||
Util.GetGameObject(go, "sdBtn/Text"):SetActive(true)
|
Util.GetGameObject(go, "sdBtn/Text"):SetActive(true)
|
||||||
Util.GetGameObject(go, "sdBtn/Text"):GetComponent("Text").text = "挑 战"
|
Util.GetGameObject(go, "sdBtn/Text"):GetComponent("Text").text = "挑 战"
|
||||||
Util.GetGameObject(go, "playerInfo/name/nameText"):GetComponent("Text").text = data.personInfo.servername.." "..data.personInfo.name
|
Util.GetGameObject(go, "playerInfo/name/nameText"):GetComponent("Text").text = data.personInfo.servername ..
|
||||||
Util.GetGameObject(go, "playerInfo/warPower/powerBtn/value"):GetComponent("Text").text = data.personInfo.totalForce
|
" " .. data.personInfo.name
|
||||||
Util.GetGameObject(go, "playerInfo/warPower/Text"):GetComponent("Text").text = "第".. data.personInfo.rank .."名"
|
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")
|
local live = Util.GetGameObject(go, "playerInfo/live")
|
||||||
this.LocadPersonInfoLive(go,data.personInfo,live)--NameManager.roleSex
|
this.LocadPersonInfoLive(go, data.personInfo, live) --NameManager.roleSex
|
||||||
sdBtnRedPoint:SetActive(JumpServerManager.GetCanBattleCount() > 0 and enterable)
|
sdBtnRedPoint:SetActive(JumpServerManager.GetCanBattleCount() > 0 and enterable)
|
||||||
Util.AddOnceClick(sdBtn,function()
|
Util.AddOnceClick(sdBtn, function()
|
||||||
if not enterable then
|
if not enterable then
|
||||||
--PopupTipPanel.ShowTip("本服千战逐胜台前"..JoinRank.."名可以参加")
|
--PopupTipPanel.ShowTip("本服千战逐胜台前"..JoinRank.."名可以参加")
|
||||||
PopupTipPanel.ShowTip("本次赛季您并未报名,无法参战")
|
PopupTipPanel.ShowTip("本次赛季您并未报名,无法参战")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
this.BuyVipFun(1,1,function()
|
this.BuyVipFun(1, 1, function()
|
||||||
--直接战斗
|
--直接战斗
|
||||||
JumpServerManager.StarFightHightLadder(data.personInfo,0,function(msg)
|
JumpServerManager.StarFightHightLadder(data.personInfo, 0, function(msg)
|
||||||
if msg then
|
if msg then
|
||||||
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.JUMPSERVER_GIGHTLADDER_MIANFEINUM, 1)--更新特权
|
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.JUMPSERVER_GIGHTLADDER_MIANFEINUM, 1) --更新特权
|
||||||
this.OnShowPanel()
|
this.OnShowPanel()
|
||||||
end
|
end
|
||||||
this.RefreshBuyNum()
|
this.RefreshBuyNum()
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
Util.AddOnceClick(cliclBtn,function()
|
Util.AddOnceClick(cliclBtn, function()
|
||||||
JumpServerManager.SetCurPersonInfo(data.personInfo)
|
JumpServerManager.SetCurPersonInfo(data.personInfo)
|
||||||
local formation=FormationTypeDef.LuoFuZhengFeng1
|
local formation = FormationTypeDef.LuoFuZhengFeng1
|
||||||
if JumpServerManager.arenaType~=0 and JumpServerManager.stage==3 then
|
if JumpServerManager.arenaType ~= 0 and JumpServerManager.stage == 3 then
|
||||||
if JumpServerManager.arenaType==1 then
|
if JumpServerManager.arenaType == 1 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng1
|
formation = FormationTypeDef.LuoFuZhengFeng1
|
||||||
elseif JumpServerManager.arenaType==2 then
|
elseif JumpServerManager.arenaType == 2 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng2
|
formation = FormationTypeDef.LuoFuZhengFeng2
|
||||||
elseif JumpServerManager.arenaType==3 then
|
elseif JumpServerManager.arenaType == 3 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng3
|
formation = FormationTypeDef.LuoFuZhengFeng3
|
||||||
elseif JumpServerManager.arenaType==4 then
|
elseif JumpServerManager.arenaType == 4 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng4
|
formation = FormationTypeDef.LuoFuZhengFeng4
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if curPos==1 then
|
if curPos == 1 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng1
|
formation = FormationTypeDef.LuoFuZhengFeng1
|
||||||
elseif curPos==2 then
|
elseif curPos == 2 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng2
|
formation = FormationTypeDef.LuoFuZhengFeng2
|
||||||
elseif curPos==3 then
|
elseif curPos == 3 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng3
|
formation = FormationTypeDef.LuoFuZhengFeng3
|
||||||
elseif curPos==4 then
|
elseif curPos == 4 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng4
|
formation = FormationTypeDef.LuoFuZhengFeng4
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
LogGreen("编队Id:" .. formation)
|
LogGreen("编队Id:" .. formation)
|
||||||
JumpServerManager.showRankType=formation
|
JumpServerManager.showRankType = formation
|
||||||
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.personInfo.uid, PLAYER_INFO_VIEW_TYPE.JUPMSERVER,data.personInfo.servername,formation)
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.personInfo.uid, PLAYER_INFO_VIEW_TYPE.JUPMSERVER,
|
||||||
|
data.personInfo.servername, formation)
|
||||||
end)
|
end)
|
||||||
elseif stage == JumpServer_Stage.NoStar and data and data.personInfo then
|
elseif stage == JumpServer_Stage.NoStar and data and data.personInfo then
|
||||||
playerInfo:SetActive(true)
|
playerInfo:SetActive(true)
|
||||||
sdBtn:SetActive(true)
|
sdBtn:SetActive(true)
|
||||||
LogPink("data.personInfo.name "..data.personInfo.name.." data.personInfo.rank "..data.personInfo.rank.." data.hadProud "..tostring(data.hadProud))
|
LogPink("data.personInfo.name " ..
|
||||||
Util.GetGameObject(go, "playerInfo/name/nameText"):GetComponent("Text").text = data.personInfo.servername.." "..data.personInfo.name
|
data.personInfo.name ..
|
||||||
Util.GetGameObject(go, "playerInfo/warPower/powerBtn/value"):GetComponent("Text").text = data.personInfo.totalForce
|
" data.personInfo.rank " .. data.personInfo.rank .. " data.hadProud " .. tostring(data.hadProud))
|
||||||
Util.GetGameObject(go, "playerInfo/warPower/Text"):GetComponent("Text").text = "第".. data.personInfo.rank .."名"
|
Util.GetGameObject(go, "playerInfo/name/nameText"):GetComponent("Text").text = data.personInfo.servername ..
|
||||||
|
" " .. data.personInfo.name
|
||||||
|
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")
|
local live = Util.GetGameObject(go, "playerInfo/live")
|
||||||
this.LocadPersonInfoLive(go,data.personInfo,live)
|
this.LocadPersonInfoLive(go, data.personInfo, live)
|
||||||
sdBtnRedPoint:SetActive(not data.hadProud)
|
sdBtnRedPoint:SetActive(not data.hadProud)
|
||||||
Util.GetGameObject(go, "sdBtn/Text"):GetComponent("Text").text = "膜 拜"
|
Util.GetGameObject(go, "sdBtn/Text"):GetComponent("Text").text = "膜 拜"
|
||||||
Util.GetGameObject(go, "sdBtn/Text"):SetActive(not data.hadProud)
|
Util.GetGameObject(go, "sdBtn/Text"):SetActive(not data.hadProud)
|
||||||
Util.GetGameObject(go, "sdBtn/dianzanImage/Text"):GetComponent("Text").text = data.worshipTime
|
Util.GetGameObject(go, "sdBtn/dianzanImage/Text"):GetComponent("Text").text = data.worshipTime
|
||||||
dianzanImage:SetActive(data.hadProud)
|
dianzanImage:SetActive(data.hadProud)
|
||||||
LogError("data.hadProud==="..tostring(data.hadProud).." data.worshipTime=="..data.worshipTime.." personInfo.servername=="..data.personInfo.servername)
|
LogError("data.hadProud===" ..
|
||||||
|
tostring(data.hadProud) ..
|
||||||
|
" data.worshipTime==" .. data.worshipTime .. " personInfo.servername==" .. data.personInfo.servername)
|
||||||
if data.hadProud then
|
if data.hadProud then
|
||||||
sdBtn:GetComponent("Image").sprite = this.spLoader:LoadSprite("X1_zhanling_pata_bt_03")
|
sdBtn:GetComponent("Image").sprite = this.spLoader:LoadSprite("X1_zhanling_pata_bt_03")
|
||||||
else
|
else
|
||||||
sdBtn:GetComponent("Image").sprite = this.spLoader:LoadSprite("X1_zhanling_pata_bt_03")
|
sdBtn:GetComponent("Image").sprite = this.spLoader:LoadSprite("X1_zhanling_pata_bt_03")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
Util.AddOnceClick(sdBtn,function()
|
|
||||||
if not data.hadProud then
|
Util.AddOnceClick(sdBtn, function()
|
||||||
JumpServerManager.GetWorldArenaProudRequest(data.personInfo,function(msg)
|
if not data.hadProud then
|
||||||
|
JumpServerManager.GetWorldArenaProudRequest(data.personInfo, function(msg)
|
||||||
this.RefreshOnOpen()
|
this.RefreshOnOpen()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
Util.AddOnceClick(cliclBtn,function()
|
Util.AddOnceClick(cliclBtn, function()
|
||||||
JumpServerManager.SetCurPersonInfo(nil)
|
JumpServerManager.SetCurPersonInfo(nil)
|
||||||
local formation=FormationTypeDef.LuoFuZhengFeng1
|
local formation = FormationTypeDef.LuoFuZhengFeng1
|
||||||
if JumpServerManager.arenaType~=0 and JumpServerManager.stage==3 then
|
if JumpServerManager.arenaType ~= 0 and JumpServerManager.stage == 3 then
|
||||||
if JumpServerManager.arenaType==1 then
|
if JumpServerManager.arenaType == 1 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng1
|
formation = FormationTypeDef.LuoFuZhengFeng1
|
||||||
elseif JumpServerManager.arenaType==2 then
|
elseif JumpServerManager.arenaType == 2 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng2
|
formation = FormationTypeDef.LuoFuZhengFeng2
|
||||||
elseif JumpServerManager.arenaType==3 then
|
elseif JumpServerManager.arenaType == 3 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng3
|
formation = FormationTypeDef.LuoFuZhengFeng3
|
||||||
elseif JumpServerManager.arenaType==4 then
|
elseif JumpServerManager.arenaType == 4 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng4
|
formation = FormationTypeDef.LuoFuZhengFeng4
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if curPos==1 then
|
if curPos == 1 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng1
|
formation = FormationTypeDef.LuoFuZhengFeng1
|
||||||
elseif curPos==2 then
|
elseif curPos == 2 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng2
|
formation = FormationTypeDef.LuoFuZhengFeng2
|
||||||
elseif curPos==3 then
|
elseif curPos == 3 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng3
|
formation = FormationTypeDef.LuoFuZhengFeng3
|
||||||
elseif curPos==4 then
|
elseif curPos == 4 then
|
||||||
formation= FormationTypeDef.LuoFuZhengFeng4
|
formation = FormationTypeDef.LuoFuZhengFeng4
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.personInfo.uid, PLAYER_INFO_VIEW_TYPE.JUPMSERVER,data.personInfo.servername)
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.personInfo.uid, PLAYER_INFO_VIEW_TYPE.JUPMSERVER,
|
||||||
|
data.personInfo.servername)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function this.LocadPersonInfoLive(go,data,live)
|
|
||||||
|
function this.LocadPersonInfoLive(go, data, live)
|
||||||
-- if liveNodeList[go] then
|
-- if liveNodeList[go] then
|
||||||
-- poolManager:UnLoadLive(liveNodeList[go].name, liveNodeList[go].go, PoolManager.AssetType.GameObject)
|
-- poolManager:UnLoadLive(liveNodeList[go].name, liveNodeList[go].go, PoolManager.AssetType.GameObject)
|
||||||
-- end
|
-- end
|
||||||
|
|
@ -436,9 +449,17 @@ function this.LocadPersonInfoLive(go,data,live)
|
||||||
-- end
|
-- end
|
||||||
-- liveNodeList[go] = {name=npc, go=live2d}
|
-- liveNodeList[go] = {name=npc, go=live2d}
|
||||||
|
|
||||||
local boyIconRes = data.sex == boy and "Dragon Ball- (21)" or "Dragon Ball- (586)1"
|
--local boyIconRes = data.sex == ROLE_SEX.BOY and "Dragon Ball- (21)" or "Dragon Ball- (586)1"
|
||||||
local icon = Util.GetGameObject(live, "Image")
|
--local icon = Util.GetGameObject(live, "Image")
|
||||||
icon:GetComponent("Image").sprite = this.spLoader:LoadSprite(boyIconRes)
|
--icon:GetComponent("Image").sprite = this.spLoader:LoadSprite(boyIconRes)
|
||||||
|
local headFrame = CommonPool.CreateNode(POOL_ITEM_TYPE.PLAYER_HEAD, live)
|
||||||
|
headFrame:Reset()
|
||||||
|
headFrame:SetHead(data.head)
|
||||||
|
headFrame:SetFrame(data.headFrame)
|
||||||
|
headFrame:SetLevel(data.level)
|
||||||
|
headFrame:SetScale(Vector3.one * 1.4)
|
||||||
|
headFrame:SetLayer(this.sortingOrder)
|
||||||
|
headFrame:SetEffectScale(1.6)
|
||||||
--[[
|
--[[
|
||||||
if liveNodeList[go] then
|
if liveNodeList[go] then
|
||||||
liveNodeList[go]:OnClose()
|
liveNodeList[go]:OnClose()
|
||||||
|
|
@ -458,17 +479,18 @@ if liveNodeList[go] then
|
||||||
liveNodeList[go]:OnOpen(GetPlayerRoleSingleConFig().Scale6,Vector3.New(0,-118.65,0),WALK_DIR.IDLE_FRONT)
|
liveNodeList[go]:OnOpen(GetPlayerRoleSingleConFig().Scale6,Vector3.New(0,-118.65,0),WALK_DIR.IDLE_FRONT)
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
|
|
||||||
-- liveNodeList[go] = {name=npc, go=live2d}
|
-- liveNodeList[go] = {name=npc, go=live2d}
|
||||||
end
|
end
|
||||||
|
|
||||||
--刷新倒计时显示
|
--刷新倒计时显示
|
||||||
function this.RemainTimeDown(_timeTextExpertgo,_timeTextExpert,timeDown,str)
|
function this.RemainTimeDown(_timeTextExpertgo, _timeTextExpert, timeDown, str)
|
||||||
if timeDown - GetTimeStamp() > 0 then
|
if timeDown - GetTimeStamp() > 0 then
|
||||||
if _timeTextExpertgo then
|
if _timeTextExpertgo then
|
||||||
_timeTextExpertgo:SetActive(true)
|
_timeTextExpertgo:SetActive(true)
|
||||||
end
|
end
|
||||||
if _timeTextExpert then
|
if _timeTextExpert then
|
||||||
_timeTextExpert.text = this.TimeStampToDateString(timeDown - GetTimeStamp())..str
|
_timeTextExpert.text = this.TimeStampToDateString(timeDown - GetTimeStamp()) .. str
|
||||||
end
|
end
|
||||||
if this.timer then
|
if this.timer then
|
||||||
this.timer:Stop()
|
this.timer:Stop()
|
||||||
|
|
@ -477,7 +499,7 @@ function this.RemainTimeDown(_timeTextExpertgo,_timeTextExpert,timeDown,str)
|
||||||
this.timer = Timer.New(function()
|
this.timer = Timer.New(function()
|
||||||
if _timeTextExpert then
|
if _timeTextExpert then
|
||||||
-- LogGreen(" 跨服天梯 "..this.TimeStampToDateString(timeDown)..str)
|
-- LogGreen(" 跨服天梯 "..this.TimeStampToDateString(timeDown)..str)
|
||||||
_timeTextExpert.text = this.TimeStampToDateString(timeDown - GetTimeStamp())..str
|
_timeTextExpert.text = this.TimeStampToDateString(timeDown - GetTimeStamp()) .. str
|
||||||
end
|
end
|
||||||
if timeDown - GetTimeStamp() < 0 then
|
if timeDown - GetTimeStamp() < 0 then
|
||||||
if _timeTextExpertgo then
|
if _timeTextExpertgo then
|
||||||
|
|
@ -516,51 +538,51 @@ function this.TimeStampToDateString(second)
|
||||||
local sec = second % 60
|
local sec = second % 60
|
||||||
local hour = math.floor(math.floor(second - day * 24 * 3600 - sec - minute * 60) / 3600)
|
local hour = math.floor(math.floor(second - day * 24 * 3600 - sec - minute * 60) / 3600)
|
||||||
if day > 0 then
|
if day > 0 then
|
||||||
return string.format("%d天%02d时%02d分%02d秒",day, hour, minute, sec)
|
return string.format("%d天%02d时%02d分%02d秒", day, hour, minute, sec)
|
||||||
else
|
else
|
||||||
return string.format("%02d时%02d分%02d秒", hour, minute, sec)
|
return string.format("%02d时%02d分%02d秒", hour, minute, sec)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.BuyVipFun(type,warOrSd,fun)
|
function this.BuyVipFun(type, warOrSd, fun)
|
||||||
if type == 1 then
|
if type == 1 then
|
||||||
if JumpServerManager.GetCanBattleCount() <= 0 then --今日已无剩余次数!
|
if JumpServerManager.GetCanBattleCount() <= 0 then --今日已无剩余次数!
|
||||||
if JumpServerManager.GetCanBuyBattleCount() <= 0 then
|
if JumpServerManager.GetCanBuyBattleCount() <= 0 then
|
||||||
PopupTipPanel.ShowTip("今日已无挑战次数!")
|
PopupTipPanel.ShowTip("今日已无挑战次数!")
|
||||||
else
|
else
|
||||||
--是否花费XX妖晶购买1次挑战次数并发起挑战?
|
--是否花费XX妖晶购买1次挑战次数并发起挑战?
|
||||||
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP, JumpServerManager.shopGoodId, 1)
|
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP,
|
||||||
local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name
|
JumpServerManager.shopGoodId, 1)
|
||||||
local tipStr = warOrSd == 1 and "是否花费%s%s购买1次挑战次数并发起挑战?" or "是否花费%s%s购买1次挑战次数并进行扫荡?"
|
local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig, costId).Name
|
||||||
MsgPanel.ShowTwo(string.format( tipStr,finalNum,itemName), nil, function()
|
local tipStr = warOrSd == 1 and "是否花费%s%s购买1次挑战次数并发起挑战?" or "是否花费%s%s购买1次挑战次数并进行扫荡?"
|
||||||
--买东西
|
MsgPanel.ShowTwo(string.format(tipStr, finalNum, itemName), nil, function()
|
||||||
if finalNum > BagManager.GetItemCountById(costId) then
|
--买东西
|
||||||
PopupTipPanel.ShowTip(string.format("%s不足!",itemName))
|
if finalNum > BagManager.GetItemCountById(costId) then
|
||||||
return
|
PopupTipPanel.ShowTip(string.format("%s不足!", itemName))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
--买东西
|
||||||
|
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP, JumpServerManager.shopGoodId, 1, function()
|
||||||
|
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.JUMPSERVER_GIGHTLADDER_BUYNUM, 1) --更新特权
|
||||||
|
local tipStr2 = warOrSd == 1 and "挑战成功!" or "扫荡成功!"
|
||||||
|
if warOrSd == 2 then
|
||||||
|
PopupTipPanel.ShowTip(tipStr2)
|
||||||
|
end
|
||||||
|
if fun then
|
||||||
|
fun()
|
||||||
end
|
end
|
||||||
--买东西
|
|
||||||
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,JumpServerManager.shopGoodId,1,function()
|
|
||||||
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.JUMPSERVER_GIGHTLADDER_BUYNUM, 1)--更新特权
|
|
||||||
local tipStr2 = warOrSd == 1 and "挑战成功!" or "扫荡成功!"
|
|
||||||
if warOrSd == 2 then
|
|
||||||
PopupTipPanel.ShowTip(tipStr2)
|
|
||||||
end
|
|
||||||
if fun then
|
|
||||||
fun ()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end)
|
end)
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if warOrSd == 1 then
|
if warOrSd == 1 then
|
||||||
if fun then
|
if fun then
|
||||||
fun ()
|
fun()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
MsgPanel.ShowTwo("扫荡后可直接获得挑战奖励并保持当前排名,确定消耗一次挑战次数进行扫荡?", nil, function()
|
MsgPanel.ShowTwo("扫荡后可直接获得挑战奖励并保持当前排名,确定消耗一次挑战次数进行扫荡?", nil, function()
|
||||||
if fun then
|
if fun then
|
||||||
fun ()
|
fun()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
@ -569,23 +591,23 @@ function this.BuyVipFun(type,warOrSd,fun)
|
||||||
if JumpServerManager.GetCanBuyBattleCount() <= 0 then
|
if JumpServerManager.GetCanBuyBattleCount() <= 0 then
|
||||||
PopupTipPanel.ShowTip("今日已无购买剩余次数!")
|
PopupTipPanel.ShowTip("今日已无购买剩余次数!")
|
||||||
else
|
else
|
||||||
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP, JumpServerManager.shopGoodId, 1)
|
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP,
|
||||||
local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name
|
JumpServerManager.shopGoodId, 1)
|
||||||
|
local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig, costId).Name
|
||||||
local tipStr = "是否花费%s%s购买1次挑战次数?"
|
local tipStr = "是否花费%s%s购买1次挑战次数?"
|
||||||
MsgPanel.ShowTwo(string.format( tipStr,finalNum,itemName), nil, function()
|
MsgPanel.ShowTwo(string.format(tipStr, finalNum, itemName), nil, function()
|
||||||
--买东西
|
--买东西
|
||||||
if finalNum > BagManager.GetItemCountById(costId) then
|
if finalNum > BagManager.GetItemCountById(costId) then
|
||||||
PopupTipPanel.ShowTip(string.format(Language[11652],itemName))
|
PopupTipPanel.ShowTip(string.format(Language[11652], itemName))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,JumpServerManager.shopGoodId,1,function()
|
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP, JumpServerManager.shopGoodId, 1, function()
|
||||||
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.JUMPSERVER_GIGHTLADDER_BUYNUM, 1)--更新特权
|
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.JUMPSERVER_GIGHTLADDER_BUYNUM, 1) --更新特权
|
||||||
this.RefreshBuyNum()
|
this.RefreshBuyNum()
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--界面关闭时调用(用于子类重写)
|
--界面关闭时调用(用于子类重写)
|
||||||
|
|
@ -606,4 +628,4 @@ function JumpServerHightLadderPanel:OnDestroy()
|
||||||
this.spLoader:Destroy()
|
this.spLoader:Destroy()
|
||||||
end
|
end
|
||||||
|
|
||||||
return JumpServerHightLadderPanel
|
return JumpServerHightLadderPanel
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue