zhangjiannan 2024-11-12 16:57:51 +08:00
parent a5f5894185
commit caec443165
1 changed files with 224 additions and 202 deletions

View File

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