603 lines
		
	
	
		
			29 KiB
		
	
	
	
		
			Lua
		
	
			
		
		
	
	
			603 lines
		
	
	
		
			29 KiB
		
	
	
	
		
			Lua
		
	
require("Base/BasePanel")
 | 
						|
RankingSingleListPanel = Inherit(BasePanel)
 | 
						|
local this = RankingSingleListPanel
 | 
						|
--头像
 | 
						|
this.firsthead = nil
 | 
						|
this.playerHeadList = {}--背景前三头像
 | 
						|
this.playerScrollHead={}--滚动条头像
 | 
						|
 | 
						|
-- local mapNpc = "live2d_npc_map"
 | 
						|
-- local mapNpc2 = "live2d_npc_map_nv"
 | 
						|
local npc
 | 
						|
 | 
						|
 | 
						|
local TabBox = require("Modules/Common/TabBox")
 | 
						|
local _TabData={ [1] = { [1] = {default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "进度",RankingSData = rankKingList[15]},
 | 
						|
                         [2] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "星级",RankingSData = rankKingList[16] },
 | 
						|
                        }
 | 
						|
                }
 | 
						|
local _TabFontColor = { default = Color.New(130 / 255, 128 / 255, 120 / 255, 1),
 | 
						|
                        select = Color.New(243 / 255, 235 / 255, 202 / 255, 1)}
 | 
						|
local curIndex = 1
 | 
						|
local TabDataIndex = 1
 | 
						|
--初始化组件(用于子类重写)
 | 
						|
function RankingSingleListPanel:InitComponent()
 | 
						|
    this.spLoader = SpriteLoader.New()
 | 
						|
    this.tabBox = Util.GetGameObject(self.gameObject, "RankList/TabBox")
 | 
						|
    this.TabCtrl = TabBox.New()
 | 
						|
    this.backBtn=Util.GetGameObject(self.gameObject,"bg/btnBack")
 | 
						|
    this.firsthead=Util.GetGameObject(self.gameObject,"firstHead")
 | 
						|
    this.firstheadClick=Util.GetGameObject(self.gameObject,"firstHead/click")
 | 
						|
    this.livePrefab=Util.GetGameObject(self.gameObject,"firstHead/livePrefab")
 | 
						|
    this.name=Util.GetGameObject(self.gameObject,"bg/name"):GetComponent("Text")
 | 
						|
    this.firstHeadName=Util.GetGameObject(self.gameObject,"firstHead/nameText"):GetComponent("Text")
 | 
						|
    this.firstHeadinfoGo=Util.GetGameObject(self.gameObject,"firstHead/infoGo")
 | 
						|
    this.scrollParentView=Util.GetGameObject(self.gameObject,"RankList/ScrollParentView")
 | 
						|
    this.itemPre=Util.GetGameObject(self.gameObject,"RankList/ScrollParentView/ItemPre")
 | 
						|
    this.scrollView = nil
 | 
						|
    this.scrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scrollParentView.transform,this.itemPre,
 | 
						|
    nil,Vector2.New(903,571.1),1,1,Vector2.New(0,-10))
 | 
						|
    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,"RankList/ScrollTitleRoot/Name"):GetComponent("Text")
 | 
						|
    --this.titleInfo=Util.GetGameObject(self.gameObject,"RankList/ScrollTitleRoot/Info"):GetComponent("Text")
 | 
						|
    this.record=Util.GetGameObject(self.gameObject,"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,"RankList/NoneImage")--无信息图片
 | 
						|
end
 | 
						|
 | 
						|
--绑定事件(用于子类重写)
 | 
						|
function RankingSingleListPanel:BindEvent()
 | 
						|
    --返回按钮
 | 
						|
    Util.AddClick(this.backBtn,function()
 | 
						|
        PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
 | 
						|
        self:ClosePanel()
 | 
						|
    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
 | 
						|
local sData = nil
 | 
						|
--界面打开时调用(用于子类重写)
 | 
						|
function RankingSingleListPanel:OnOpen(_sData,_TabDataIndex)
 | 
						|
    SoundManager.PlayMusic(SoundConfig.BGM_Rank)
 | 
						|
    sData = _sData
 | 
						|
    TabDataIndex = _TabDataIndex
 | 
						|
    this.name.text = sData.name
 | 
						|
    this.PanelShowChange()
 | 
						|
    this.GetRankInfo(sData.rankType,1)
 | 
						|
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,580))
 | 
						|
        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.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)
 | 
						|
    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 = _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)
 | 
						|
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)
 | 
						|
    RankingManager.CurPage=0
 | 
						|
    this.istop=true
 | 
						|
    local curActivity = 0
 | 
						|
    if sData.rankType == RANK_TYPE.PERSON_CHALLENGE then
 | 
						|
        curActivity = sData.activiteId
 | 
						|
    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=WorldArenaManager.GetNewScore()}
 | 
						|
        elseif sData.rankType == RANK_TYPE.FORCE_CURR_RANK or sData.rankType == RANK_TYPE.JUMPSERVER_FORCE_CURR_RANK 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.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.PERSON_CHALLENGE 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)
 | 
						|
        --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)
 | 
						|
        npc:OnOpen(GetPlayerRoleSingleConFig().Scale6,Vector3.New(0,-118.65,0),WALK_DIR.IDLE_LEFT)
 | 
						|
 | 
						|
        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--玉虚论道
 | 
						|
                UIManager.OpenPanel(UIName.WorldArenaOtherTeamPanel, data.uid,2)
 | 
						|
            elseif sData.rankType == RANK_TYPE.QIJIESHILIAN_RANK then--七界试炼
 | 
						|
                UIManager.OpenPanel(UIName.PlayerInfoPopup, data.uid,PLAYER_INFO_VIEW_TYPE.NORMAL,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[10103]
 | 
						|
    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
 | 
						|
            UIManager.OpenPanel(UIName.WorldArenaOtherTeamPanel, uid,2)
 | 
						|
        elseif sData.rankType == RANK_TYPE.QIJIESHILIAN_RANK then--七界试炼
 | 
						|
            UIManager.OpenPanel(UIName.PlayerInfoPopup, uid,PLAYER_INFO_VIEW_TYPE.NORMAL,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
 | 
						|
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 < 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  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)
 | 
						|
    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 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[11689].. 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[11690]
 | 
						|
        elseif sData.activiteId ==  ActivityTypeDef.FastExplore then--急速探索
 | 
						|
            Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").text = Language[11691]
 | 
						|
        elseif sData.activiteId ==  ActivityTypeDef.FindTreasureExper then--寻宝达人
 | 
						|
            Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").text = Language[11692]
 | 
						|
        elseif sData.activiteId ==  ActivityTypeDef.ExpeditionExper then--天宫达人
 | 
						|
            Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").text = Language[11693]
 | 
						|
        elseif sData.activiteId ==  ActivityTypeDef.DemonSlayer then--三界降魔
 | 
						|
            Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").text = Language[11694]
 | 
						|
        elseif sData.activiteId ==  ActivityTypeDef.slhjExper then
 | 
						|
            Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").text = Language[11695]
 | 
						|
        elseif sData.activiteId ==  ActivityTypeDef.Celebration then--社稷大典
 | 
						|
            Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").text = Language[11696]
 | 
						|
        end
 | 
						|
    elseif rankType == RANK_TYPE.ARENA_RANK then--竞技场
 | 
						|
        arenaScore: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[11693] ..  data.rankInfo.param1--data.param1
 | 
						|
        else
 | 
						|
            str = ""
 | 
						|
        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[11697]
 | 
						|
            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 = "伤害:"..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 = "积分:".. 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 = "本周积分: ".. 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 = "层数:"..data.rankInfo.param1
 | 
						|
        end
 | 
						|
    end
 | 
						|
end
 | 
						|
return RankingSingleListPanel
 | 
						|
 |