785 lines
38 KiB
Lua
785 lines
38 KiB
Lua
require("Base/BasePanel")
|
|
RankingSingleListPanel = Inherit(BasePanel)
|
|
local this = RankingSingleListPanel
|
|
local arenaLevel = ConfigManager.GetConfig(ConfigName.ArenaLevel)
|
|
--头像
|
|
this.firsthead = nil
|
|
this.playerHeadList = {} --背景前三头像
|
|
this.playerScrollHead = {} --滚动条头像
|
|
local sData = nil
|
|
-- local mapNpc = "live2d_npc_map"
|
|
-- local mapNpc2 = "live2d_npc_map_nv"
|
|
local npc
|
|
local proType = 1
|
|
|
|
local TabBox = require("Modules/Common/TabBox")
|
|
local _TabData = {
|
|
[1] = {
|
|
[1] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[10787], RankingSData = rankKingList[15] },
|
|
[2] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[10788], RankingSData = rankKingList[16] },
|
|
}
|
|
}
|
|
local _TabFontColor = {
|
|
select = Color.New(123 / 255, 72 / 255, 34 / 255, 1),
|
|
default = Color.New(154 / 255, 176 / 255, 197 / 255, 1),
|
|
lock = Color.New(154 / 255, 176 / 255, 197 / 255, 1)
|
|
}
|
|
local curIndex = 1
|
|
local TabDataIndex = 1
|
|
--初始化组件(用于子类重写)
|
|
function RankingSingleListPanel:InitComponent()
|
|
this.spLoader = SpriteLoader.New()
|
|
this.tabBox = Util.GetGameObject(self.gameObject, "Content/RankList/TabBox")
|
|
this.Mask = Util.GetGameObject(self.gameObject, "mask")
|
|
this.TabCtrl = TabBox.New()
|
|
this.backBtn = Util.GetGameObject(self.gameObject, "Content/bg/btnBack")
|
|
this.firsthead = Util.GetGameObject(self.gameObject, "Content/firstHead")
|
|
this.firstheadClick = Util.GetGameObject(self.gameObject, "Content/firstHead/click")
|
|
this.livePrefab = Util.GetGameObject(self.gameObject, "Content/firstHead/livePrefab")
|
|
this.name = Util.GetGameObject(self.gameObject, "Content/bg/name"):GetComponent("Text")
|
|
this.firstHeadName = Util.GetGameObject(self.gameObject, "Content/firstHead/nameText"):GetComponent("Text")
|
|
this.firstHeadinfoGo = Util.GetGameObject(self.gameObject, "Content/firstHead/infoGo")
|
|
this.firstSortNum = Util.GetGameObject(self.gameObject, "Content/firstHead/SortNum")
|
|
this.scrollParentView = Util.GetGameObject(self.gameObject, "Content/RankList/ScrollParentView")
|
|
this.itemPre = Util.GetGameObject(self.gameObject, "Content/RankList/ScrollParentView/ItemPre")
|
|
this.scrollView = nil
|
|
this.scrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, this.scrollParentView.transform, this.itemPre,
|
|
nil, Vector2.New(903, 757), 1, 1, Vector2.New(0, 5))
|
|
this.scrollView.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, 0)
|
|
this.scrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
|
|
this.scrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
|
|
this.scrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
|
|
this.scrollView.moveTween.MomentumAmount = 1
|
|
this.scrollView.moveTween.Strength = 2
|
|
|
|
--this.titleName=Util.GetGameObject(self.gameObject,"Content/RankList/ScrollTitleRoot/Name"):GetComponent("Text")
|
|
--this.titleInfo=Util.GetGameObject(self.gameObject,"Content/RankList/ScrollTitleRoot/Info"):GetComponent("Text")
|
|
this.record = Util.GetGameObject(self.gameObject, "Content/RankList/Record")
|
|
this.info0 = Util.GetGameObject(this.record, "grid/Info0"):GetComponent("Text")
|
|
this.rank0 = Util.GetGameObject(this.record, "grid/Rank0"):GetComponent("Text")
|
|
this.infoGo = Util.GetGameObject(this.record, "infoGo")
|
|
|
|
this.noneImage = Util.GetGameObject(self.gameObject, "Content/RankList/NoneImage") --无信息图片
|
|
this.ProListObj = Util.GetGameObject(self.gameObject, "Content/RankList/selectBar")
|
|
this.selectObj = Util.GetGameObject(self.gameObject, "Content/RankList/selectBar/selectBtn")
|
|
this.signBtnList = {}
|
|
for i = 1, 4 do
|
|
local proObj = {}
|
|
local btn = Util.GetGameObject(self.gameObject, "Content/RankList/selectBar/btn" .. i)
|
|
proObj.img = btn:GetComponent("Image")
|
|
proObj.img.sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(i))
|
|
proObj.btn = btn
|
|
this.signBtnList[i] = proObj
|
|
end
|
|
end
|
|
|
|
--绑定事件(用于子类重写)
|
|
function RankingSingleListPanel:BindEvent()
|
|
--返回按钮
|
|
Util.AddClick(this.backBtn, function()
|
|
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
|
|
self:ClosePanel()
|
|
end)
|
|
Util.AddClick(this.Mask, function()
|
|
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
|
|
self:ClosePanel()
|
|
end)
|
|
for i = 1, #this.signBtnList do
|
|
Util.AddClick(this.signBtnList[i].btn, function()
|
|
proType = i
|
|
local formation = FormationTypeDef.LuoFuZhengFeng1
|
|
if proType == 1 then
|
|
formation = FormationTypeDef.LuoFuZhengFeng1
|
|
elseif proType == 2 then
|
|
formation = FormationTypeDef.LuoFuZhengFeng2
|
|
elseif proType == 3 then
|
|
formation = FormationTypeDef.LuoFuZhengFeng3
|
|
elseif proType == 4 then
|
|
formation = FormationTypeDef.LuoFuZhengFeng4
|
|
end
|
|
JumpServerManager.showRankType = formation
|
|
this.GetRankInfo(sData.rankType, 1, 0)
|
|
|
|
this.selectObj.transform:SetParent(this.signBtnList[i].btn.transform)
|
|
this.selectObj.transform.localPosition = Vector3.zero
|
|
end)
|
|
end
|
|
end
|
|
|
|
--添加事件监听(用于子类重写)
|
|
function RankingSingleListPanel:AddListener()
|
|
Game.GlobalEvent:AddEvent(GameEvent.RankingList.AllRankingList, this.SetRankingInfo)
|
|
end
|
|
|
|
--移除事件监听(用于子类重写)
|
|
function RankingSingleListPanel:RemoveListener()
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.RankingList.AllRankingList, this.SetRankingInfo)
|
|
end
|
|
|
|
--界面打开时调用(用于子类重写)
|
|
function RankingSingleListPanel:OnOpen(_sData, _TabDataIndex, _tabData)
|
|
_TabData = _tabData
|
|
SoundManager.PlayMusic(SoundConfig.BGM_Rank)
|
|
sData = _sData
|
|
TabDataIndex = _TabDataIndex
|
|
this.name.text = sData.name
|
|
this.PanelShowChange()
|
|
local roomId = 0
|
|
if _tabData then
|
|
roomId = _tabData.roomId
|
|
end
|
|
this.ProListObj:SetActive(sData.rankType == RANK_TYPE.JUMPSERVER_HIGHTLADDER)
|
|
if sData.rankType == RANK_TYPE.JUMPSERVER_HIGHTLADDER then
|
|
proType = JumpServerManager.arenaType
|
|
if proType == 0 then
|
|
proType = 1
|
|
end
|
|
local formation = FormationTypeDef.LuoFuZhengFeng1
|
|
if proType == 1 then
|
|
formation = FormationTypeDef.LuoFuZhengFeng1
|
|
elseif proType == 2 then
|
|
formation = FormationTypeDef.LuoFuZhengFeng2
|
|
elseif proType == 3 then
|
|
formation = FormationTypeDef.LuoFuZhengFeng3
|
|
elseif proType == 4 then
|
|
formation = FormationTypeDef.LuoFuZhengFeng4
|
|
end
|
|
JumpServerManager.showRankType = formation
|
|
this.selectObj.transform:SetParent(this.signBtnList[proType].btn.transform)
|
|
this.selectObj.transform.localPosition = Vector3.zero
|
|
end
|
|
this.GetRankInfo(sData.rankType, 1, roomId)
|
|
end
|
|
|
|
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
|
function RankingSingleListPanel:OnShow()
|
|
-- local asda = {}
|
|
-- this.scrollView:SetData(asda,function(index,root)
|
|
-- this.ShowTrialInfo(root,asda[index],nil)
|
|
-- end)
|
|
this.scrollParentView:SetActive(true)
|
|
end
|
|
|
|
function this.PanelShowChange()
|
|
-- this.scrollView = nil
|
|
if not TabDataIndex then
|
|
this.scrollView:SetRectTransform(Vector2.New(903, 757))
|
|
this.scrollView.rectTransform.localPosition = Vector3.New(0, -53.5, 0)
|
|
--this.record:GetComponent("RectTransform").localPosition = Vector3.New(0, 672- 339, 0)
|
|
this.tabBox:SetActive(false)
|
|
else
|
|
--this.scrollView:SetRectTransform(Vector2.New(903,473.25))
|
|
this.scrollView:SetRectTransform(Vector2.New(903, 757))
|
|
this.scrollView.rectTransform.localPosition = Vector3.zero
|
|
--this.record:GetComponent("RectTransform").localPosition = Vector3.New(0, 773 - 339, 0)
|
|
this.tabBox:SetActive(true)
|
|
curIndex = 1
|
|
this.TabCtrl:SetTabAdapter(this.TabAdapter)
|
|
this.TabCtrl:SetChangeTabCallBack(this.SwitchView)
|
|
this.TabCtrl:Init(this.tabBox, _TabData[TabDataIndex], curIndex)
|
|
if _TabData.roomId then
|
|
this.TabCtrl:ChangeTab(_TabData.roomId)
|
|
end
|
|
end
|
|
end
|
|
|
|
-- tab节点显示自定义
|
|
function this.TabAdapter(tab, index, status)
|
|
local tabLab = Util.GetGameObject(tab, "Text")
|
|
Util.GetGameObject(tab, "Image"):GetComponent("Image").sprite = this.spLoader:LoadSprite(_TabData[TabDataIndex]
|
|
[index][status])
|
|
tabLab:GetComponent("Text").text = GetLanguageStrById(_TabData[TabDataIndex][index].name)
|
|
tabLab:GetComponent("Text").color = _TabFontColor[status]
|
|
end
|
|
|
|
--切换视图
|
|
function this.SwitchView(index)
|
|
--先执行上一面板关闭逻辑
|
|
local oldSelect
|
|
oldSelect, curIndex = curIndex, index
|
|
sData = _TabData[TabDataIndex][index].RankingSData
|
|
this.name.text = sData.name
|
|
-- this.PanelShowChange()
|
|
this.GetRankInfo(sData.rankType, 1, _TabData[TabDataIndex][index].roomId)
|
|
end
|
|
|
|
--界面关闭时调用(用于子类重写)
|
|
function RankingSingleListPanel:OnClose()
|
|
this.scrollParentView:SetActive(false)
|
|
SoundManager.PlayOldMusic()
|
|
RankingManager.isRequest = 0
|
|
this.noneImage:SetActive(false)
|
|
-- if this.liveNode then
|
|
-- --Log("==YSP== 删除立绘")
|
|
-- poolManager:UnLoadLive(npc, this.liveNode)
|
|
-- this.liveNode=nil
|
|
-- end
|
|
end
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
function RankingSingleListPanel:OnDestroy()
|
|
this.spLoader:Destroy()
|
|
if npc then
|
|
npc:OnClose()
|
|
end
|
|
-- if this.liveNode then
|
|
-- --Log("==YSP== 删除立绘")
|
|
-- poolManager:UnLoadLive(npc, this.liveNode)
|
|
-- this.liveNode=nil
|
|
-- end
|
|
for _, playerHead in ipairs(this.playerHeadList) do
|
|
playerHead:Recycle()
|
|
end
|
|
this.playerHeadList = {}
|
|
this.scrollView = nil
|
|
end
|
|
|
|
--点击获取对应排行信息
|
|
function this.GetRankInfo(rankType, rankIndex, roomId)
|
|
RankingManager.CurPage = 0
|
|
this.istop = true
|
|
local curActivity = 0
|
|
if sData.rankType == RANK_TYPE.PERSON_CHALLENGE or sData.rankType == RANK_TYPE.GodsWayTower then
|
|
curActivity = sData.activiteId
|
|
elseif sData.rankType == RANK_TYPE.ARENA_RANK_NEW then
|
|
LogError("roomid================================" .. roomId)
|
|
curActivity = roomId
|
|
elseif sData.rankType == RANK_TYPE.JUMPSERVER_HIGHTLADDER then
|
|
curActivity = proType
|
|
--LogError("type====================================="..type)
|
|
else
|
|
curActivity = sData.activiteId > 0 and ActivityGiftManager.GetActivityIdByType(sData.activiteId) or nil
|
|
end
|
|
|
|
RankingManager.InitData(rankType, function()
|
|
this.SetRankingInfo(true, true)
|
|
end, curActivity, rankIndex)
|
|
end
|
|
|
|
---设置排名信息
|
|
function this.SetRankingInfo(isTop, isAnim)
|
|
local rankingData, myRankData = RankingManager.GetRankingInfo()
|
|
-- --LogGreen("#rankingData "..#rankingData)
|
|
this.noneImage:SetActive(#rankingData == 0)
|
|
this.firsthead:SetActive(#rankingData ~= 0)
|
|
this.scrollParentView:SetActive(#rankingData ~= 0)
|
|
-- 没有排行数据需要立刻刷新,只在打开界面时有用
|
|
-- this.SetNotRollingInfo("角色信息","最高战力","我的排名:","我的战力",myRankData.myRank,"未上榜",FormationManager.GetFormationPower(1),myRankData.myRank,myRankData.myForce)
|
|
this.SetNotRollingInfo(myRankData)
|
|
local dData
|
|
if sData.rankType == RANK_TYPE.FIGHT_LEVEL_RANK then --等级排行
|
|
dData = { rankInfo = { param1 = myRankData.param1 }, force = myRankData.param1 }
|
|
elseif sData.rankType == RANK_TYPE.WORLDARENA then
|
|
--rankingData.crossScore
|
|
dData = { rankInfo = { param1 = myRankData.param1 }, force = myRankData.param1, crossScore = myRankData.param2 }
|
|
elseif sData.rankType == RANK_TYPE.FORCE_CURR_RANK or sData.rankType == RANK_TYPE.JUMPSERVER_FORCE_CURR_RANK or sData.rankType == RANK_TYPE.POWER_RICE then --战力排行
|
|
dData = { rankInfo = { param1 = myRankData.param1 }, force = myRankData.param1 }
|
|
elseif sData.rankType == RANK_TYPE.GUILD_FORCE_RANK or sData.rankType == RANK_TYPE.JUMPSERVER_GUILD_FORCE_RANK then --公会战力
|
|
dData = {
|
|
rankInfo = { rank = myRankData.rank, param1 = myRankData.param1 },
|
|
guildName = PlayerManager.familyId ==
|
|
0 and "" or MyGuildManager.GetMyGuildInfo().name
|
|
}
|
|
elseif sData.rankType == RANK_TYPE.MONSTER_RANK or sData.rankType == RANK_TYPE.JUMPSERVER_MONSTER_RANK then --心魔试炼
|
|
dData = { rankInfo = { param1 = myRankData.param1 }, force = myRankData.param1 }
|
|
elseif sData.rankType == RANK_TYPE.GOLD_EXPER then --点金达人
|
|
dData = { rankInfo = { rank = myRankData.rank, param1 = myRankData.param1 }, userName = PlayerManager.nickName }
|
|
elseif sData.rankType == RANK_TYPE.ARENA_RANK then --排行榜
|
|
dData = { rankInfo = { param1 = myRankData.param1 }, score = myRankData.param1 }
|
|
elseif sData.rankType == RANK_TYPE.ARENA_RANK_NEW then --新排行榜
|
|
LogError("myRankData.param2==================" .. myRankData.param2)
|
|
dData = {
|
|
rankInfo = { param1 = myRankData.param1, param2 = myRankData.param2 },
|
|
score = myRankData.param1,
|
|
crossScore =
|
|
myRankData.param2
|
|
}
|
|
elseif sData.rankType == RANK_TYPE.CELEBRATION_GUILD then --社稷大典
|
|
dData = { rankInfo = { param1 = myRankData.param1 }, score = myRankData.param1 }
|
|
elseif sData.rankType == RANK_TYPE.FIGHTLEVEL_PROGRESS then --山河社稷图进度
|
|
dData = { rankInfo = { param1 = myRankData.param1 }, force = myRankData.param1 }
|
|
elseif sData.rankType == RANK_TYPE.FIGHTLEVEL_STAR or sData.rankType == RANK_TYPE.JUMPSERVER_FIGHTLEVEL_STAR then --山河社稷图星星
|
|
dData = { rankInfo = { param1 = myRankData.param1 }, force = myRankData.param1 }
|
|
elseif sData.rankType == RANK_TYPE.TASUILINGXIAO then --踏碎凌霄
|
|
dData = { rankInfo = { param1 = myRankData.param1 }, force = myRankData.param1 }
|
|
elseif sData.rankType == RANK_TYPE.JUMPSERVER_HIGHTLADDER then --跨服天梯
|
|
dData = {
|
|
rankInfo = { param1 = myRankData.param1 },
|
|
force = myRankData.param1,
|
|
}
|
|
elseif sData.rankType == RANK_TYPE.QIJIESHILIAN_RANK then --七界试炼
|
|
dData = {
|
|
rankInfo = { param1 = myRankData.param1 },
|
|
force = myRankData.param1,
|
|
}
|
|
elseif sData.rankType == RANK_TYPE.LINGMAIMIJING_RANK then --灵脉秘境
|
|
dData = {
|
|
rankInfo = { param1 = myRankData.param1 },
|
|
force = myRankData.param1,
|
|
}
|
|
elseif sData.rankType == RANK_TYPE.PERSON_CHALLENGE then --跨服天梯
|
|
dData = {
|
|
rankInfo = { param1 = myRankData.param1 },
|
|
force = myRankData.param1,
|
|
}
|
|
elseif sData.rankType == RANK_TYPE.ExploreRank then --跨服天梯
|
|
dData = {
|
|
rankInfo = { param1 = myRankData.param1 },
|
|
force = myRankData.param1,
|
|
}
|
|
elseif sData.rankType == RANK_TYPE.GodsWayTower then --多队塔
|
|
dData = { rankInfo = { param1 = myRankData.param1 }, force = myRankData.param1 }
|
|
end
|
|
this.SetInfoShow(this.infoGo, dData, sData.rankType)
|
|
--数据拆分
|
|
if not rankingData or (rankingData and #rankingData <= 0) then
|
|
return
|
|
end
|
|
local dt, db = RankingManager.CutDate(rankingData)
|
|
if sData.rankType == RANK_TYPE.CELEBRATION_GUILD or sData.rankType == RANK_TYPE.GUILD_FORCE_RANK or sData.rankType == RANK_TYPE.JUMPSERVER_GUILD_FORCE_RANK then
|
|
dt[1].userName = dt[1].guildName
|
|
end
|
|
local dtUserName = dt[1].userName
|
|
this.SetHeadsInfo(dt[1], this.firstHeadinfoGo, 1, dtUserName, dt[1].level)
|
|
--设置滚动区信息
|
|
this.scrollView:SetData(db, function(index, root)
|
|
this.ShowWarPowerInfo(root, db[index], myRankData, index)
|
|
--LogGreen("#db "..#db.." index "..index)
|
|
if index == #db then
|
|
RankingManager.RequestNextWarPowerPageData(function()
|
|
this.SetRankingInfo(false, false)
|
|
end)
|
|
end
|
|
end, not isTop, not isAnim)
|
|
end
|
|
|
|
--显示每条数据
|
|
function this.ShowWarPowerInfo(root, data, myRankData)
|
|
this.AddPlayerInfoClick(root, data.uid, data.serverName)
|
|
this.SetSelfBG(root, myRankData.myRank, data.rankInfo.rank)
|
|
this.SetRankingNum(root, data.rankInfo.rank)
|
|
this.SetHeadInfo(root, data.head, data.headFrame, data.level)
|
|
this.SetInfoShow(Util.GetGameObject(root, "infoGo"), data, sData.rankType, Util.GetGameObject(root, "Value0"))
|
|
end
|
|
|
|
--设置前三名背景头像
|
|
function this.SetHeadsInfo(data, root, index, name, level)
|
|
if not this.playerHeadList[root] then
|
|
this.playerHeadList[root] = CommonPool.CreateNode(POOL_ITEM_TYPE.PLAYER_HEAD,
|
|
Util.GetGameObject(this.firsthead, "Head"))
|
|
end
|
|
this.firsthead:SetActive(true)
|
|
this.playerHeadList[root]:Reset()
|
|
this.playerHeadList[root]:SetHead(data.head)
|
|
this.playerHeadList[root]:SetFrame(data.headFrame)
|
|
this.playerHeadList[root]:SetLevel(level)
|
|
this.playerHeadList[root]:SetParent(Util.GetGameObject(this.firsthead, "Head"))
|
|
this.playerHeadList[root]:SetLayer(this.sortingOrder)
|
|
if index == 1 then
|
|
this.playerHeadList[root]:SetPosition(Vector3(0, 0, 0))
|
|
this.playerHeadList[root]:SetScale(Vector3.one * 0.6)
|
|
this.playerHeadList[root]:SetEffectScale(0.8)
|
|
this.firstHeadName.text = name
|
|
this.SetInfoShow(this.firstHeadinfoGo, data, sData.rankType)
|
|
--在战力冲刺中所有人的第一名不一定是排行榜的第一名有战力限制
|
|
LogGreen("data.rankInfo.rank:" .. tostring(data.rankInfo.rank))
|
|
this.SetRankingNum(this.firsthead, data.rankInfo.rank)
|
|
--data.sex
|
|
--加载立绘
|
|
-- if this.liveNode then
|
|
-- --Log("==YSP== 删除立绘")
|
|
-- poolManager:UnLoadLive(npc, this.liveNode)
|
|
-- this.liveNode=nil
|
|
-- end
|
|
-- npc = data.sex == ROLE_SEX.BOY and mapNpc or mapNpc2
|
|
-- local scale = data.sex == ROLE_SEX.BOY and Vector3.one * 0.32 or Vector3.one * 0.19
|
|
-- this.liveNode = poolManager:LoadLive(npc, this.livePrefab.transform, scale, Vector3.New(0,-158.31,0))
|
|
-- local SkeletonGraphic = this.liveNode:GetComponent("SkeletonGraphic")
|
|
-- if SkeletonGraphic then
|
|
-- SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
|
-- end
|
|
if npc then
|
|
npc:OnClose()
|
|
npc = nil
|
|
end
|
|
LogBlue("data.userSkin " .. data.userSkin)
|
|
local curPlayerLiveViewData = {
|
|
skin = data.userSkin,
|
|
sex = data.sex,
|
|
ride = data.userMount,
|
|
designation = data.userTitle,
|
|
}
|
|
npc = PlayerLiveView:New(this.livePrefab.transform, 2, curPlayerLiveViewData, this.sortingOrder,
|
|
NPCPosType.smallMap)
|
|
npc:SetNameHeight(-2.5)
|
|
if data.userMount and data.userMount > 0 and data.userMount ~= PlayerRide.YUJIAN then
|
|
npc:OnOpen(GetPlayerRoleSingleConFig().Scale6, Vector3.New(0, -118.65, 0), WALK_DIR.IDLE_LEFT)
|
|
else
|
|
npc:OnOpen(GetPlayerRoleSingleConFig().Scale6, Vector3.New(0, -118.65, 0), WALK_DIR.IDLE_FRONT)
|
|
end
|
|
Util.AddOnceClick(this.firstheadClick, function()
|
|
if sData.rankType == RANK_TYPE.TASUILINGXIAO then
|
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.uid, PLAYER_INFO_VIEW_TYPE.TSLX)
|
|
elseif sData.rankType == RANK_TYPE.JUMPSERVER_HIGHTLADDER then
|
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.uid, PLAYER_INFO_VIEW_TYPE.JUPMSERVER,
|
|
data.serverName and data.serverName or nil)
|
|
elseif sData.rankType == RANK_TYPE.JUMPSERVER_FIGHTLEVEL_STAR or sData.rankType == RANK_TYPE.JUMPSERVER_FORCE_CURR_RANK or sData.rankType == RANK_TYPE.JUMPSERVER_GUILD_FORCE_RANK or sData.rankType == RANK_TYPE.JUMPSERVER_MONSTER_RANK then
|
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.uid, PLAYER_INFO_VIEW_TYPE.JUPMSERVER_NORMAL,
|
|
data.serverName and data.serverName or nil)
|
|
elseif sData.rankType == RANK_TYPE.WORLDARENA then --玉虚论道
|
|
NetManager.GetPlayerCrossYxldOneTeamInfoRequest(data.uid, 0, function(msg)
|
|
UIManager.OpenPanel(UIName.WorldArenaOtherTeamPanel, data.uid, 2, msg)
|
|
end)
|
|
elseif sData.rankType == RANK_TYPE.QIJIESHILIAN_RANK then --七界试炼
|
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.uid, PLAYER_INFO_VIEW_TYPE.QIJIESHILIAN,
|
|
data.serverName and data.serverName or nil)
|
|
elseif sData.rankType == RANK_TYPE.LINGMAIMIJING_RANK then --灵脉秘境
|
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.uid, PLAYER_INFO_VIEW_TYPE.LINGMAIMIJING,
|
|
data.serverName and data.serverName or nil)
|
|
else
|
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.uid)
|
|
end
|
|
end)
|
|
end
|
|
end
|
|
|
|
--设置非滚动区信息
|
|
function this.SetNotRollingInfo(myRankData)
|
|
-- optional int32 rank = 1;
|
|
-- optional int64 param1 = 2;
|
|
-- optional int32 param2 = 3;
|
|
-- optional int32 param3 = 4;
|
|
this.info0.text = Language[10118]
|
|
if not myRankData.rank or (myRankData.rank and myRankData.rank < 1)
|
|
or (myRankData.rank and (sData.rankType == RANK_TYPE.JUMPSERVER_HIGHTLADDER and myRankData.rank >= 9999)) then --排名对比 <0未上榜
|
|
this.rank0.text = Language[10036] --未上榜
|
|
else
|
|
this.rank0.text = myRankData.rank --上榜
|
|
end
|
|
end
|
|
|
|
--初始化滚动区信息
|
|
function this.InitRollingInfo(_root)
|
|
local info0 = Util.GetGameObject(_root, "Value0"):GetComponent("Text")
|
|
info0.text = ""
|
|
return info0
|
|
end
|
|
|
|
--玩家信息弹窗
|
|
function this.AddPlayerInfoClick(root, uid, serverName)
|
|
local clickBtn = Util.GetGameObject(root, "ClickBtn")
|
|
Util.AddOnceClick(clickBtn, function()
|
|
if sData.rankType == RANK_TYPE.TASUILINGXIAO then
|
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, uid, PLAYER_INFO_VIEW_TYPE.TSLX)
|
|
elseif sData.rankType == RANK_TYPE.JUMPSERVER_HIGHTLADDER then
|
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, uid, PLAYER_INFO_VIEW_TYPE.JUPMSERVER,
|
|
serverName and serverName or nil)
|
|
elseif sData.rankType == RANK_TYPE.JUMPSERVER_FIGHTLEVEL_STAR or sData.rankType == RANK_TYPE.JUMPSERVER_FORCE_CURR_RANK or sData.rankType == RANK_TYPE.JUMPSERVER_GUILD_FORCE_RANK or sData.rankType == RANK_TYPE.JUMPSERVER_MONSTER_RANK then
|
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, uid, PLAYER_INFO_VIEW_TYPE.JUPMSERVER_NORMAL,
|
|
serverName and serverName or nil)
|
|
elseif sData.rankType == RANK_TYPE.WORLDARENA then
|
|
NetManager.GetPlayerCrossYxldOneTeamInfoRequest(uid, 0, function(msg)
|
|
UIManager.OpenPanel(UIName.WorldArenaOtherTeamPanel, uid, 2, msg)
|
|
end)
|
|
elseif sData.rankType == RANK_TYPE.QIJIESHILIAN_RANK then --七界试炼
|
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, uid, PLAYER_INFO_VIEW_TYPE.QIJIESHILIAN,
|
|
serverName and serverName or nil)
|
|
elseif sData.rankType == RANK_TYPE.LINGMAIMIJING_RANK then --灵脉秘境
|
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, uid, PLAYER_INFO_VIEW_TYPE.LINGMAIMIJING,
|
|
serverName and serverName or nil)
|
|
else
|
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, uid)
|
|
end
|
|
end)
|
|
end
|
|
|
|
--设置自身背景
|
|
function this.SetSelfBG(root, myRank, rank)
|
|
if myRank == rank then
|
|
Util.GetGameObject(root, "SelfBG").gameObject:SetActive(true)
|
|
else
|
|
Util.GetGameObject(root, "SelfBG").gameObject:SetActive(false)
|
|
end
|
|
|
|
local rankIconBg = "BG_paihangbang_10"
|
|
if rank == 2 then
|
|
rankIconBg = "BG_paihangbang_09"
|
|
elseif rank == 3 then
|
|
rankIconBg = "BG_paihangbang_08"
|
|
else
|
|
Util.GetGameObject(root, "ImgNumBg"):GetComponent("Image").sprite = this.spLoader:LoadSprite(rankIconBg)
|
|
end
|
|
end
|
|
|
|
--设置名次
|
|
function this.SetRankingNum(root, rank)
|
|
local sortNumTabs = {}
|
|
for i = 1, 4 do
|
|
sortNumTabs[i] = Util.GetGameObject(root, "SortNum/SortNum (" .. i .. ")")
|
|
sortNumTabs[i]:SetActive(false)
|
|
end
|
|
if rank == 0 then
|
|
return
|
|
end
|
|
if rank < 4 then
|
|
sortNumTabs[rank]:SetActive(true)
|
|
else
|
|
sortNumTabs[4]:SetActive(true)
|
|
Util.GetGameObject(sortNumTabs[4], "TitleText"):GetComponent("Text").text = rank
|
|
end
|
|
end
|
|
|
|
--设置头像
|
|
function this.SetHeadInfo(root, head, frame, level)
|
|
local headObj = Util.GetGameObject(root, "Head")
|
|
if not this.playerScrollHead[root] then
|
|
this.playerScrollHead[root] = CommonPool.CreateNode(POOL_ITEM_TYPE.PLAYER_HEAD, headObj)
|
|
end
|
|
this.playerScrollHead[root]:Reset()
|
|
this.playerScrollHead[root]:SetHead(head)
|
|
this.playerScrollHead[root]:SetFrame(frame)
|
|
this.playerScrollHead[root]:SetLevel(level)
|
|
this.playerScrollHead[root]:SetScale(Vector3.one * 0.7)
|
|
this.playerScrollHead[root]:SetLayer(this.sortingOrder)
|
|
this.playerScrollHead[root]:SetEffectScale(0.8)
|
|
end
|
|
|
|
--检查Tab是否解锁
|
|
function this.CheckTabCtrlIsLockP(index)
|
|
local type = RankingManager.GetCurRankingInfo("Id", index)
|
|
local des = RankingManager.GetCurRankingInfo("Des", index)
|
|
local b, str = this.CheckTabCtrlIsLockS(type, des)
|
|
if b then
|
|
return b, str
|
|
end
|
|
return false
|
|
end
|
|
|
|
function this.CheckTabCtrlIsLockS(type, des)
|
|
if type == 8 then
|
|
if not ActTimeCtrlManager.IsQualifiled(type) then
|
|
return true, des .. ActTimeCtrlManager.GetFuncTip(type)
|
|
end
|
|
else
|
|
if not ActTimeCtrlManager.SingleFuncState(type) then
|
|
return true, des .. ActTimeCtrlManager.GetFuncTip(type)
|
|
end
|
|
end
|
|
end
|
|
|
|
function this.SetInfoShow(go, data, rankType, Value0)
|
|
local fight = Util.GetGameObject(go, "fight")
|
|
local FightLeve = Util.GetGameObject(go, "FightLeve")
|
|
local rankName = Util.GetGameObject(go, "rankName"):GetComponent("Text")
|
|
local warPower = Util.GetGameObject(go, "warPower")
|
|
local trial = Util.GetGameObject(go, "trial")
|
|
local goldExper = Util.GetGameObject(go, "goldExper")
|
|
local arenaScore = Util.GetGameObject(go, "arenaScore")
|
|
local FightLeveStar = Util.GetGameObject(go, "FightLeveStar")
|
|
local yxldImg = Util.GetGameObject(go, "yxldImage"):GetComponent("Image")
|
|
local yxldTxt = Util.GetGameObject(go, "yxldTxt"):GetComponent("Text")
|
|
|
|
fight:SetActive(false)
|
|
rankName.gameObject:SetActive(false)
|
|
FightLeve:SetActive(false)
|
|
warPower:SetActive(false)
|
|
trial:SetActive(false)
|
|
goldExper:SetActive(false)
|
|
arenaScore:SetActive(false)
|
|
FightLeveStar:SetActive(false)
|
|
yxldImg.gameObject:SetActive(false)
|
|
yxldTxt.gameObject:SetActive(false)
|
|
-- LogGreen("rankType "..rankType)
|
|
if rankType == RANK_TYPE.FIGHT_LEVEL_RANK then --等级
|
|
--LogGreen("data.rankInfo.param1 "..data.rankInfo.param1)
|
|
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
|
|
fight:SetActive(true)
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
end
|
|
Util.GetGameObject(go, "fight"):GetComponent("Text").text = GetLanguageStrById(ConfigManager.GetConfigData(
|
|
ConfigName.MainLevelConfig, data.rankInfo.param1).Name)
|
|
end
|
|
elseif rankType == RANK_TYPE.FORCE_CURR_RANK or rankType == RANK_TYPE.JUMPSERVER_FORCE_CURR_RANK or rankType == RANK_TYPE.POWER_RICE then --战力排行
|
|
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
|
|
warPower:SetActive(true)
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
end
|
|
Util.GetGameObject(go, "warPower/Text"):SetActive(true)
|
|
Util.GetGameObject(go, "warPower/Text"):GetComponent("Text").text = data.rankInfo
|
|
.param1 --data.force
|
|
end
|
|
elseif rankType == RANK_TYPE.GUILD_FORCE_RANK or rankType == RANK_TYPE.JUMPSERVER_GUILD_FORCE_RANK then --公会战力
|
|
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
|
|
warPower:SetActive(true)
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.guildName .. "</size>"
|
|
end
|
|
Util.GetGameObject(go, "warPower/Text"):SetActive(true)
|
|
Util.GetGameObject(go, "warPower/Text"):GetComponent("Text").text = data.rankInfo.param1
|
|
end
|
|
elseif rankType == RANK_TYPE.MONSTER_RANK or rankType == RANK_TYPE.JUMPSERVER_MONSTER_RANK then --心魔试炼
|
|
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
|
|
trial:SetActive(true)
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
end
|
|
Util.GetGameObject(go, "trial/Text"):SetActive(false)
|
|
Util.GetGameObject(go, "trial/tip"):GetComponent("Text").text = Language[11929] .. data.rankInfo.param1
|
|
end
|
|
elseif rankType == RANK_TYPE.GOLD_EXPER then --达人
|
|
if GetCurLanguage() == 0 then
|
|
Util.GetGameObject(go, "goldExper/tip"):GetComponent("Text").fontSize = 38
|
|
else
|
|
Util.GetGameObject(go, "goldExper/tip"):GetComponent("Text").fontSize = 28
|
|
end
|
|
|
|
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
|
|
goldExper:SetActive(true)
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
end
|
|
Util.GetGameObject(go, "goldExper/Text"):GetComponent("Text").text = data.rankInfo.param1
|
|
end
|
|
if sData.activiteId == ActivityTypeDef.GoldExper then --点金达人
|
|
Util.GetGameObject(go, "goldExper/tip"):GetComponent("Text").text = Language[12535]
|
|
elseif sData.activiteId == ActivityTypeDef.FastExplore then --急速探索
|
|
Util.GetGameObject(go, "goldExper/tip"):GetComponent("Text").text = Language[12536]
|
|
elseif sData.activiteId == ActivityTypeDef.FindTreasureExper then --寻宝达人
|
|
Util.GetGameObject(go, "goldExper/tip"):GetComponent("Text").text = Language[12537]
|
|
elseif sData.activiteId == ActivityTypeDef.ExpeditionExper then --天宫达人
|
|
Util.GetGameObject(go, "goldExper/tip"):GetComponent("Text").text = Language[10085]
|
|
elseif sData.activiteId == ActivityTypeDef.DemonSlayer then --三界降魔
|
|
Util.GetGameObject(go, "goldExper/tip"):GetComponent("Text").text = Language[12538]
|
|
elseif sData.activiteId == ActivityTypeDef.slhjExper then
|
|
Util.GetGameObject(go, "goldExper/tip"):GetComponent("Text").text = Language[12539]
|
|
elseif sData.activiteId == ActivityTypeDef.Celebration then --社稷大典
|
|
Util.GetGameObject(go, "goldExper/tip"):GetComponent("Text").text = Language[12540]
|
|
end
|
|
elseif rankType == RANK_TYPE.ARENA_RANK or rankType == RANK_TYPE.ARENA_RANK_NEW then --竞技场
|
|
arenaScore:SetActive(true)
|
|
rankName.gameObject:SetActive(true)
|
|
local str = ""
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
end
|
|
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
|
|
str = Language[10085] .. data.rankInfo.param1 --data.param1
|
|
else
|
|
str = ""
|
|
end
|
|
LogError("data.crossScore==" .. data.rankInfo.param2)
|
|
if arenaLevel[data.rankInfo.param2] then
|
|
rankName.text = GetLanguageStrById(arenaLevel[data.rankInfo.param2].ArenaLevelName)
|
|
else
|
|
rankName.text = ""
|
|
end
|
|
Util.GetGameObject(go, "arenaScore"):GetComponent("Text").text = str
|
|
elseif rankType == RANK_TYPE.CELEBRATION_GUILD then --社稷大典工会排行
|
|
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
|
|
trial:SetActive(true)
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.guildName .. "</size>"
|
|
end
|
|
-- Util.GetGameObject(go,"trial/Text"):GetComponent("Text").text = "贡献度:"..data.rankInfo.param1
|
|
Util.GetGameObject(go, "trial/Text"):SetActive(true)
|
|
if GetCurLanguage() == 2 then
|
|
Util.GetGameObject(go, "trial/tip"):GetComponent("Text").fontSize = 26
|
|
else
|
|
Util.GetGameObject(go, "trial/tip"):GetComponent("Text").fontSize = 38
|
|
end
|
|
Util.GetGameObject(go, "trial/tip"):GetComponent("Text").text = Language[12541]
|
|
Util.GetGameObject(go, "trial/Text"):GetComponent("Text").text = data.rankInfo.param1
|
|
end
|
|
elseif rankType == RANK_TYPE.FIGHTLEVEL_PROGRESS then --山河社稷图进度
|
|
--LogYellow("data.rankInfo.param1 "..data.rankInfo.param1)
|
|
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
|
|
FightLeve:SetActive(true)
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
end
|
|
FightLeve:GetComponent("Text").text = GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.HardStage,
|
|
data.rankInfo.param1).Name)
|
|
end
|
|
elseif rankType == RANK_TYPE.FIGHTLEVEL_STAR or rankType == RANK_TYPE.JUMPSERVER_FIGHTLEVEL_STAR then --山河社稷图星星
|
|
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
|
|
FightLeveStar:SetActive(true)
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
end
|
|
Util.GetGameObject(FightLeveStar, "Text"):GetComponent("Text").text = data.rankInfo.param1
|
|
end
|
|
elseif rankType == RANK_TYPE.TASUILINGXIAO then --踏碎凌霄排行
|
|
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
|
|
fight:SetActive(true)
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
end
|
|
Util.GetGameObject(go, "fight"):GetComponent("Text").text = Language[12542] ..
|
|
PrintWanNum2(data.rankInfo.param1)
|
|
end
|
|
elseif rankType == RANK_TYPE.JUMPSERVER_HIGHTLADDER then
|
|
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
|
|
warPower:SetActive(true)
|
|
if Value0 then
|
|
-- if data.serverName and data.serverName ~= "" then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
-- else
|
|
-- Value0:GetComponent("Text").text = "<size=40%>"..data.userName.."</size>"
|
|
-- end
|
|
end
|
|
Util.GetGameObject(go, "warPower/Text"):SetActive(true)
|
|
Util.GetGameObject(go, "warPower/Text"):GetComponent("Text").text = data.rankInfo.param1
|
|
end
|
|
elseif rankType == RANK_TYPE.WORLDARENA then
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
end
|
|
yxldTxt.gameObject:SetActive(true)
|
|
yxldImg.gameObject:SetActive(true)
|
|
|
|
yxldTxt.text = Language[11450] .. data.crossScore
|
|
local rate = WorldArenaManager.GetRankImgByScore(data.crossScore)
|
|
yxldImg.sprite = this.spLoader:LoadSprite("y_yuxulundao_xiaobiao_0" .. rate)
|
|
elseif rankType == RANK_TYPE.QIJIESHILIAN_RANK then --七界试炼
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
end
|
|
arenaScore:SetActive(true)
|
|
local score = data.rankInfo.param1 >= 0 and data.rankInfo.param1 or 0
|
|
arenaScore:GetComponent("Text").text = Language[12543] .. score
|
|
elseif rankType == RANK_TYPE.PERSON_CHALLENGE then
|
|
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
end
|
|
fight:SetActive(true)
|
|
fight:GetComponent("Text").text = Language[11929] .. data.rankInfo.param1
|
|
end
|
|
elseif rankType == RANK_TYPE.LINGMAIMIJING_RANK then --灵脉秘境
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
end
|
|
arenaScore:SetActive(true)
|
|
local score = data.rankInfo.param1 >= 0 and data.rankInfo.param1 or 0
|
|
arenaScore:GetComponent("Text").text = Language[12544] .. score
|
|
elseif rankType == RANK_TYPE.ExploreRank then --灵脉秘境
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
end
|
|
arenaScore:SetActive(true)
|
|
local score = data.rankInfo.param1 >= 0 and data.rankInfo.param1 or 0
|
|
arenaScore:GetComponent("Text").text = Language[12545] .. score
|
|
elseif rankType == RANK_TYPE.GodsWayTower then
|
|
trial:SetActive(true)
|
|
if Value0 then
|
|
Value0:GetComponent("Text").text = "<size=40%>" .. data.userName .. "</size>"
|
|
end
|
|
Util.GetGameObject(go, "trial/Text"):SetActive(false)
|
|
Util.GetGameObject(go, "trial/tip"):GetComponent("Text").text = Language[11929] .. data.rankInfo.param1
|
|
end
|
|
end
|
|
|
|
return RankingSingleListPanel
|