miduo_client/Assets/ManagedResources/~Lua/Modules/Ranking/RankingSingleListPanel.lua

527 lines
24 KiB
Lua
Raw Normal View History

2021-04-21 13:12:04 +08:00
require("Base/BasePanel")
2020-06-08 13:57:30 +08:00
RankingSingleListPanel = Inherit(BasePanel)
local this = RankingSingleListPanel
--头像
this.firsthead = nil
this.playerHeadList = {}--背景前三头像
this.playerScrollHead={}--滚动条头像
2021-03-27 20:01:39 +08:00
-- local mapNpc = "live2d_npc_map"
-- local mapNpc2 = "live2d_npc_map_nv"
local npc
2021-05-13 20:30:10 +08:00
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
2020-06-08 13:57:30 +08:00
--初始化组件(用于子类重写)
function RankingSingleListPanel:InitComponent()
2021-04-21 13:12:04 +08:00
this.spLoader = SpriteLoader.New()
2021-05-13 20:30:10 +08:00
this.tabBox = Util.GetGameObject(self.gameObject, "RankList/TabBox")
this.TabCtrl = TabBox.New()
2020-06-08 13:57:30 +08:00
this.backBtn=Util.GetGameObject(self.gameObject,"bg/btnBack")
this.firsthead=Util.GetGameObject(self.gameObject,"firstHead")
2020-06-18 20:39:29 +08:00
this.firstheadClick=Util.GetGameObject(self.gameObject,"firstHead/click")
2020-06-08 13:57:30 +08:00
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")
2021-05-13 20:30:10 +08:00
this.scrollView = nil
2020-06-08 13:57:30 +08:00
this.scrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scrollParentView.transform,this.itemPre,
2021-05-14 16:44:40 +08:00
nil,Vector2.New(903,571.1),1,1,Vector2.New(0,-10))
2020-06-08 13:57:30 +08:00
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")
2021-02-24 15:07:31 +08:00
this.info0=Util.GetGameObject(this.record,"grid/Info0"):GetComponent("Text")
this.rank0=Util.GetGameObject(this.record,"grid/Rank0"):GetComponent("Text")
2020-06-08 13:57:30 +08:00
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()
2020-08-22 13:49:47 +08:00
Game.GlobalEvent:AddEvent(GameEvent.RankingList.AllRankingList, this.SetRankingInfo)
2020-06-08 13:57:30 +08:00
end
--移除事件监听(用于子类重写)
function RankingSingleListPanel:RemoveListener()
2020-08-22 13:49:47 +08:00
Game.GlobalEvent:RemoveEvent(GameEvent.RankingList.AllRankingList, this.SetRankingInfo)
2020-06-08 13:57:30 +08:00
end
local sData = nil
--界面打开时调用(用于子类重写)
2021-05-13 20:30:10 +08:00
function RankingSingleListPanel:OnOpen(_sData,_TabDataIndex)
2020-06-08 13:57:30 +08:00
SoundManager.PlayMusic(SoundConfig.BGM_Rank)
sData = _sData
2021-05-13 20:30:10 +08:00
TabDataIndex = _TabDataIndex
2020-06-08 13:57:30 +08:00
this.name.text = sData.name
2021-05-17 14:15:55 +08:00
Log("排行榜类型:"..sData.rankType)
2021-05-13 20:30:10 +08:00
this.PanelShowChange()
this.GetRankInfo(sData.rankType,1)
2020-06-08 13:57:30 +08:00
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function RankingSingleListPanel:OnShow()
-- local asda = {}
-- this.scrollView:SetData(asda,function(index,root)
-- this.ShowTrialInfo(root,asda[index],nil)
-- end)
this.scrollParentView:SetActive(true)
2020-06-08 13:57:30 +08:00
end
2021-05-13 20:30:10 +08:00
function this.PanelShowChange()
2021-05-14 16:44:40 +08:00
-- this.scrollView = nil
if not TabDataIndex then
2021-05-20 16:12:15 +08:00
this.scrollView:SetRectTransform(Vector2.New(903,580))
this.scrollView.rectTransform.localPosition = Vector3.New(0, -53.5, 0)
2021-05-14 16:44:40 +08:00
this.record:GetComponent("RectTransform").localPosition = Vector3.New(0, 672- 339, 0)
2021-05-13 20:30:10 +08:00
this.tabBox:SetActive(false)
else
2021-05-14 16:44:40 +08:00
this.scrollView:SetRectTransform(Vector2.New(903,473.25))
2021-05-20 16:12:15 +08:00
this.scrollView.rectTransform.localPosition = Vector3.zero
2021-05-14 16:44:40 +08:00
this.record:GetComponent("RectTransform").localPosition = Vector3.New(0, 773 - 339, 0)
2021-05-13 20:30:10 +08:00
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")
Merge branch 'china/dev-c' into china/ios # Conflicts: # Assets/ManagedResources/ArtFont_en/f_fuxinggaozhao_zida_en.png.meta # Assets/ManagedResources/ArtFont_en/n_niuqichongchong_banner_en.png.meta # Assets/ManagedResources/ArtFont_en/n_niuqichongchong_niuqizhi_en.png.meta # Assets/ManagedResources/ArtFont_en/q_qinlongmibao_banner1_en.png.meta # Assets/ManagedResources/ArtFont_en/r_fabao_guiyuan_en.png.meta # Assets/ManagedResources/ArtFont_en/sl_en.png.meta # Assets/ManagedResources/ArtFont_en/x_xianshizaohuan_wujiangyulan 1_en.png.meta # Assets/ManagedResources/ArtFont_vi/c_3_1_t9_vi.png.meta # Assets/ManagedResources/ArtFont_vi/c_3_2_t9_vi.png.meta # Assets/ManagedResources/ArtFont_vi/c_3_3_t9_vi.png.meta # Assets/ManagedResources/ArtFont_vi/c_3_4_t9_vi.png.meta # Assets/ManagedResources/ArtFont_vi/c_3_6_t9_vi.png.meta # Assets/ManagedResources/ArtFont_vi/c_3_7_t9_vi.png.meta # Assets/ManagedResources/ArtFont_vi/c_3_8_t9_vi.png.meta # Assets/ManagedResources/ArtFont_vi/c_3_9_t9_vi.png.meta # Assets/ManagedResources/ArtFont_vi/n_niuqichongchong_banner_vi.png.meta # Assets/ManagedResources/ArtFont_vi/n_niuqichongchong_niuqizhi_vi.png.meta # Assets/ManagedResources/ArtFont_vi/q_qinlongmibao_banner1_vi.png.meta # Assets/ManagedResources/ArtFont_vi/r_fabao_guiyuan_vi.png.meta # Assets/ManagedResources/ArtFont_vi/sl_vi.png.meta # Assets/ManagedResources/ArtFont_vi/t_tianshumijuan_zhujiemiananniu_2_vi.png.meta # Assets/ManagedResources/ArtFont_vi/t_tianshumijuan_zhujiemiananniu_vi.png.meta # Assets/ManagedResources/ArtFont_vi/w_wj_banner_vi.png.meta # Assets/ManagedResources/Atlas/BattleAtlas/r_zhandou_leiquehei_01.png.meta # Assets/ManagedResources/Atlas/DyAct_Activity7/timelimit_putishushen2.png.meta # Assets/ManagedResources/Atlas/DyAct_XiangYaoDuoBao/ArtFont/t_tongqiangtiebi_banner_zh.jpg.meta # Assets/ManagedResources/Atlas/DynamicActivityAtlas/ArtFont/x_xianshizaohuan_wujiangyulan 1_zh.png.meta # Assets/ManagedResources/Atlas/DynamicActivityAtlas/QiKaiDeSheng/q_qikaidesheng_shenjiang2.png.meta # Assets/ManagedResources/Atlas/DynamicActivityAtlas/XiangLongFuHu/x_xianglongfuhu_shenjiang3.png.meta # Assets/ManagedResources/Atlas/DynamicActivityAtlas/YiShanDaoHai/y_yishandaohai_shenjiang2.png.meta # Assets/ManagedResources/Atlas/DynamicActivityAtlas/YongWangZhiQian/s_yongwangzhiqian_shenjiang2.png.meta # Assets/ManagedResources/Atlas/FirstRechargeAtlas/ArtFont/s_shouchong_100_zh.png.meta # Assets/ManagedResources/Atlas/MainAtlas/ArtFont/r_zjm_huodongicon-congzhi_zh.png.meta # Assets/ManagedResources/Atlas/SupremeHeroAtlas/b_baolishuchu_juesebanzi2.png.meta # Assets/ManagedResources/Atlas/SupremeHeroAtlas/b_baolishuchu_juesebanzi2_gouxuan.png.meta # Assets/ManagedResources/Atlas/TagButtonAtlas/ArtFont/r_huodong_leijichengzhianniu_01_zh.png.meta # Assets/ManagedResources/Atlas/TagButtonAtlas/ArtFont/r_huodong_leijichengzhianniu_zh.png.meta # Assets/ManagedResources/Atlas/TimeLimitSkinAtlas/ArtFont/sl_zh.png.meta # Assets/ManagedResources/BG/t_tapolingxiao_beijingtu.png.meta # Assets/ManagedResources/DynamicAtlas/b_bianhuanmoce_banner_zh.png # Assets/ManagedResources/DynamicAtlas/b_bowenduoshi_banner_zh.png # Assets/ManagedResources/DynamicAtlas/p_pozhengzhuxian_banner_zh.png # Assets/ManagedResources/DynamicAtlas/q_qikaidesheng_banner_zh.png # Assets/ManagedResources/DynamicAtlas/s_yongwangzhiqian_banner_zh.png # Assets/ManagedResources/DynamicAtlas/y_yishandaohai_banner_zh.png # Assets/ManagedResources/EffectResUI/Story/Texture/UI_fuzhou_02.png.meta # Assets/ManagedResources/EffectResUI/Story/Texture/dianjijiekai.png.meta # Assets/ManagedResources/EffectResUI/Story/Texture/star_png.png.meta # Assets/ManagedResources/ResConfigs/ResourcePathConfig.asset # Assets/ManagedResources/~Lua/Common/functions.lua # Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua # Assets/ManagedResources/~Lua/Modules/Battle/View/DamageResultPanel.lua # Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua # Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua # Assets/ManagedResources/~Lua/Modules/Chat/ChatPanel.lua # Assets/ManagedResources/~Lua/Modules/Chat/FriendChatPanel.lua # Assets/ManagedResources/~Lua/Modules/CompoundHero/view/CompoundHero_Compound.lua # Assets/ManagedResources/~Lua/Modules/DailyRecharge/DailyRechargePanel.lua # Assets/ManagedResources/~Lua/Modules/DynamicActivity/ActivityMainPanel.lua # Assets/ManagedResources/~Lua/Modules/DynamicActivity/LingShouBaoGe.lua # Assets/ManagedResources/~Lua/Modules/DynamicActivity/LingShowTeHui.lua # Assets/ManagedResources/~Lua/Modules/DynamicActivity/QianKunBox.lua # Assets/ManagedResources/~Lua/Modules/DynamicActivity/SheJiDaDian.lua # Assets/ManagedResources/~Lua/Modules/DynamicActivity/ShengYiTianJiang.lua # Assets/ManagedResources/~Lua/Modules/DynamicActivity/TimeLimitedCall.lua # Assets/ManagedResources/~Lua/Modules/DynamicActivity/XiangYaoDuoBao.lua # Assets/ManagedResources/~Lua/Modules/DynamicActivity/XinJiangLaiXi.lua # Assets/ManagedResources/~Lua/Modules/DynamicActivity/YiJingBaoKu.lua # Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua # Assets/ManagedResources/~Lua/Modules/Fight/View/FightPointMapView.lua # Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua # Assets/ManagedResources/~Lua/Modules/GeneralPanel/GeneralBigPopup.lua # Assets/ManagedResources/~Lua/Modules/HandBook/HandBookRoleInfoLayout.lua # Assets/ManagedResources/~Lua/Modules/Login/ServerListItem.lua # Assets/ManagedResources/~Lua/Modules/Login/ServerListSelectPanel.lua # Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua # Assets/ManagedResources/~Lua/Modules/Popup/RewardItemPopup.lua # Assets/ManagedResources/~Lua/Modules/Popup/SkillInfoPopup.lua # Assets/ManagedResources/~Lua/Modules/Ranking/RankingSingleListPanel.lua # Assets/ManagedResources/~Lua/Modules/Recharge/View/EveryDayGift.lua # Assets/ManagedResources/~Lua/Modules/Resolve/View/Resolve_Pokemon.lua # Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleUpStarListPanel.lua # Assets/ManagedResources/~Lua/Modules/SecretBox/SecretBoxBuyOnePanel.lua # Assets/ManagedResources/~Lua/Modules/Shop/ShopBuyPopup.lua # Assets/ManagedResources/~Lua/Modules/SoulPrint/SoulPrintPanel.lua # Assets/ManagedResources/~Lua/Modules/Vip/VipPanelV2.lua # Assets/ManagedResources/~Lua/View/PlayerInfoView.lua
2021-05-19 14:12:37 +08:00
Util.GetGameObject(tab,"Image"):GetComponent("Image").sprite = this.spLoader:LoadSprite(_TabData[TabDataIndex][index][status])
2021-05-13 20:30:10 +08:00
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
2021-05-14 16:44:40 +08:00
-- this.PanelShowChange()
2021-05-13 20:30:10 +08:00
this.GetRankInfo(sData.rankType,1)
end
2020-06-08 13:57:30 +08:00
--界面关闭时调用(用于子类重写)
function RankingSingleListPanel:OnClose()
2021-02-26 14:52:59 +08:00
this.scrollParentView:SetActive(false)
SoundManager.PlayOldMusic()
2020-06-08 13:57:30 +08:00
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()
2021-04-21 13:12:04 +08:00
this.spLoader:Destroy()
2021-03-27 20:01:39 +08:00
if npc then
npc:OnClose()
2020-06-08 13:57:30 +08:00
end
2021-03-27 20:01:39 +08:00
-- if this.liveNode then
-- --Log("==YSP== 删除立绘")
-- poolManager:UnLoadLive(npc, this.liveNode)
-- this.liveNode=nil
-- end
2020-06-08 13:57:30 +08:00
for _, playerHead in ipairs(this.playerHeadList) do
playerHead:Recycle()
end
this.playerHeadList = {}
this.scrollView=nil
end
--点击获取对应排行信息
function this.GetRankInfo(rankType,rankIndex)
2020-06-08 13:57:30 +08:00
RankingManager.CurPage=0
this.istop=true
2020-08-22 18:03:43 +08:00
local curActivity = sData.activiteId > 0 and ActivityGiftManager.GetActivityIdByType(sData.activiteId) or nil
2020-08-22 13:49:47 +08:00
RankingManager.InitData(rankType,function()
this.SetRankingInfo(true, true)
end,curActivity,rankIndex)
2020-06-08 13:57:30 +08:00
end
2020-08-22 13:49:47 +08:00
---设置排名信息
function this.SetRankingInfo(isTop, isAnim)
2020-08-22 13:49:47 +08:00
local rankingData,myRankData=RankingManager.GetRankingInfo()
-- --LogGreen("#rankingData "..#rankingData)
2020-08-22 13:49:47 +08:00
this.noneImage:SetActive(#rankingData==0)
this.firsthead:SetActive(#rankingData~=0)
this.scrollParentView:SetActive(#rankingData~=0)
2020-06-08 13:57:30 +08:00
-- 没有排行数据需要立刻刷新,只在打开界面时有用
-- this.SetNotRollingInfo("角色信息","最高战力","我的排名:","我的战力",myRankData.myRank,"未上榜",FormationManager.GetFormationPower(1),myRankData.myRank,myRankData.myForce)
2020-08-22 13:49:47 +08:00
this.SetNotRollingInfo(myRankData)
local dData
2021-05-26 14:44:22 +08:00
if sData.rankType == RANK_TYPE.FIGHT_LEVEL_RANK then--等级排行
dData = {rankInfo = {param1 = myRankData.param1},force = myRankData.param1}
elseif sData.rankType == RANK_TYPE.FORCE_CURR_RANK then--战力排行
dData = {rankInfo = {param1 = myRankData.param1},force = myRankData.param1}
elseif sData.rankType == RANK_TYPE.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 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 then--山河社稷图星星
dData = {rankInfo = {param1 = myRankData.param1},force = myRankData.param1}
2021-05-28 14:05:17 +08:00
elseif sData.rankType == RANK_TYPE.TASUILINGXIAO then--踏碎凌霄
dData = {rankInfo = {param1 = myRankData.param1},force = myRankData.param1}
2020-08-22 13:49:47 +08:00
end
2020-06-08 13:57:30 +08:00
this.SetInfoShow(this.infoGo,dData,sData.rankType)
2020-06-13 11:47:13 +08:00
--数据拆分
2020-08-22 13:49:47 +08:00
if not rankingData or (rankingData and #rankingData <= 0) then
2020-06-18 20:39:29 +08:00
return
end
2020-08-22 13:49:47 +08:00
local dt,db=RankingManager.CutDate(rankingData)
if sData.rankType == RANK_TYPE.CELEBRATION_GUILD or sData.rankType == RANK_TYPE.GUILD_FORCE_RANK then
dt[1].userName = dt[1].guildName
end
2020-06-13 11:47:13 +08:00
this.SetHeadsInfo(dt[1],this.firstHeadinfoGo,1,dt[1].userName,dt[1].level)
2020-06-08 13:57:30 +08:00
--设置滚动区信息
2020-06-13 11:47:13 +08:00
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)
2020-06-08 13:57:30 +08:00
end
--显示每条数据
function this.ShowWarPowerInfo(root,data,myRankData)
this.AddPlayerInfoClick(root,data.uid)
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"))
2020-06-18 20:39:29 +08:00
end
2020-06-08 13:57:30 +08:00
--设置前三名背景头像
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"))
2020-09-25 21:19:01 +08:00
this.playerHeadList[root]:SetLayer(this.sortingOrder)
2020-06-08 13:57:30 +08:00
if index==1 then
this.playerHeadList[root]:SetPosition(Vector3(0,0,0))
this.playerHeadList[root]:SetScale(Vector3.one*0.6)
2020-09-25 21:19:01 +08:00
this.playerHeadList[root]:SetEffectScale(0.8)
2020-06-08 13:57:30 +08:00
this.firstHeadName.text = name
this.SetInfoShow(this.firstHeadinfoGo,data,sData.rankType)
--data.sex
--加载立绘
2021-03-27 20:01:39 +08:00
-- 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
2020-06-08 13:57:30 +08:00
end
2021-03-29 16:45:04 +08:00
LogBlue("data.userSkin "..data.userSkin)
2021-03-27 20:01:39 +08:00
local curPlayerLiveViewData = {
2021-03-29 16:45:04 +08:00
skin = data.userSkin,
sex = data.sex,
ride = data.userMount,
designation = data.userTitle,
2021-03-27 20:01:39 +08:00
}
npc = PlayerLiveView:New(this.livePrefab.transform,2, curPlayerLiveViewData,this.sortingOrder)
2021-06-03 11:23:05 +08:00
npc:SetNameHeight(-2.5)
2021-03-30 10:28:03 +08:00
npc:OnOpen(GetPlayerRoleSingleConFig().Scale6,Vector3.New(0,-118.65,0),WALK_DIR.IDLE_LEFT)
2021-03-27 20:01:39 +08:00
2020-06-18 20:39:29 +08:00
Util.AddOnceClick(this.firstheadClick,function()
2021-05-29 18:37:45 +08:00
if sData.rankType == RANK_TYPE.TASUILINGXIAO then
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.uid,PLAYER_INFO_VIEW_TYPE.TSLX)
else
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.uid)
end
2020-06-18 20:39:29 +08:00
end)
2020-06-08 13:57:30 +08:00
end
end
--设置非滚动区信息
2020-08-22 13:49:47 +08:00
function this.SetNotRollingInfo(myRankData)
-- optional int32 rank = 1;
-- optional int64 param1 = 2;
-- optional int32 param2 = 3;
-- optional int32 param3 = 4;
2021-04-09 12:26:35 +08:00
this.info0.text=Language[10103]
2020-08-22 13:49:47 +08:00
if not myRankData.rank or (myRankData.rank and myRankData.rank < 1) then--排名对比 <0未上榜
2021-04-09 12:26:35 +08:00
this.rank0.text = Language[10036] --未上榜
2020-06-08 13:57:30 +08:00
else
2020-08-22 13:49:47 +08:00
this.rank0.text = myRankData.rank --上榜
2020-06-08 13:57:30 +08:00
end
end
--初始化滚动区信息
function this.InitRollingInfo(_root)
local info0= Util.GetGameObject(_root,"Value0"):GetComponent("Text")
info0.text=""
2020-08-22 13:49:47 +08:00
return info0
2020-06-08 13:57:30 +08:00
end
--玩家信息弹窗
function this.AddPlayerInfoClick(root,uid)
local clickBtn=Util.GetGameObject(root,"ClickBtn")
Util.AddOnceClick(clickBtn,function()
2021-05-29 18:37:45 +08:00
if sData.rankType == RANK_TYPE.TASUILINGXIAO then
UIManager.OpenPanel(UIName.PlayerInfoPopup, uid,PLAYER_INFO_VIEW_TYPE.TSLX)
else
UIManager.OpenPanel(UIName.PlayerInfoPopup, uid)
end
2020-06-08 13:57:30 +08:00
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)
2020-09-25 21:19:01 +08:00
this.playerScrollHead[root]:SetLayer(this.sortingOrder)
this.playerScrollHead[root]:SetEffectScale(0.8)
2020-06-08 13:57:30 +08:00
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")
2021-05-26 20:21:55 +08:00
local FightLeve = Util.GetGameObject(go,"FightLeve")
2020-06-08 13:57:30 +08:00
local warPower = Util.GetGameObject(go,"warPower")
local trial = Util.GetGameObject(go,"trial")
2020-06-18 20:39:29 +08:00
local goldExper = Util.GetGameObject(go,"goldExper")
2020-07-20 15:34:30 +08:00
local arenaScore = Util.GetGameObject(go,"arenaScore")
2021-05-13 20:30:10 +08:00
local FightLeveStar = Util.GetGameObject(go,"FightLeveStar")
2020-06-08 13:57:30 +08:00
fight:SetActive(false)
2021-05-26 20:21:55 +08:00
FightLeve:SetActive(false)
2020-06-08 13:57:30 +08:00
warPower:SetActive(false)
trial:SetActive(false)
2020-06-18 20:39:29 +08:00
goldExper:SetActive(false)
2020-07-20 15:34:30 +08:00
arenaScore:SetActive(false)
2021-05-13 20:30:10 +08:00
FightLeveStar:SetActive(false)
2020-10-24 16:18:57 +08:00
-- LogGreen("rankType "..rankType)
2021-05-26 14:44:22 +08:00
if rankType == RANK_TYPE.FIGHT_LEVEL_RANK then--等级
--LogGreen("data.rankInfo.param1 "..data.rankInfo.param1)
2020-06-08 13:57:30 +08:00
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
2021-01-26 17:08:39 +08:00
Util.GetGameObject(go,"fight"):GetComponent("Text").text = GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.MainLevelConfig,data.rankInfo.param1).Name)
2020-06-08 13:57:30 +08:00
end
2021-05-26 14:44:22 +08:00
elseif rankType == RANK_TYPE.FORCE_CURR_RANK then--战力排行
2020-06-28 17:48:49 +08:00
if data.rankInfo.param1 and data.rankInfo.param1 >0 then
2020-06-08 13:57:30 +08:00
warPower:SetActive(true)
if Value0 then
Value0:GetComponent("Text").text = "<size=40%>"..data.userName.."</size>"
end
2021-02-27 15:42:50 +08:00
Util.GetGameObject(go,"warPower/Text"):SetActive(true)
2020-06-28 17:48:49 +08:00
Util.GetGameObject(go,"warPower/Text"):GetComponent("Text").text = data.rankInfo.param1--data.force
2020-06-08 13:57:30 +08:00
end
2021-05-26 14:44:22 +08:00
elseif rankType == RANK_TYPE.GUILD_FORCE_RANK then--公会战力
2020-06-08 13:57:30 +08:00
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
2021-03-01 17:27:06 +08:00
Util.GetGameObject(go,"warPower/Text"):SetActive(true)
2020-06-08 13:57:30 +08:00
Util.GetGameObject(go,"warPower/Text"):GetComponent("Text").text = data.rankInfo.param1
end
2021-05-26 14:44:22 +08:00
elseif rankType == RANK_TYPE.MONSTER_RANK then--心魔试炼
2020-06-08 13:57:30 +08:00
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
2021-03-05 17:59:38 +08:00
Util.GetGameObject(go,"trial/Text"):SetActive(false)
2021-04-09 12:26:35 +08:00
Util.GetGameObject(go,"trial/tip"):GetComponent("Text").text = Language[11689].. data.rankInfo.param1
2020-06-18 20:39:29 +08:00
end
2021-05-26 14:44:22 +08:00
elseif rankType == RANK_TYPE.GOLD_EXPER then--达人
2021-03-04 17:37:53 +08:00
if GetCurLanguage() == 0 then
Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").fontSize = 38
else
Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").fontSize = 28
end
2020-06-18 20:39:29 +08:00
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
2020-06-08 13:57:30 +08:00
end
2021-05-26 14:44:22 +08:00
if sData.activiteId == ActivityTypeDef.GoldExper then--点金达人
2021-04-09 12:26:35 +08:00
Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").text = Language[11690]
2021-05-26 14:44:22 +08:00
elseif sData.activiteId == ActivityTypeDef.FastExplore then--急速探索
2021-04-09 12:26:35 +08:00
Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").text = Language[11691]
2021-05-26 14:44:22 +08:00
elseif sData.activiteId == ActivityTypeDef.FindTreasureExper then--寻宝达人
2021-04-09 12:26:35 +08:00
Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").text = Language[11692]
2021-05-26 14:44:22 +08:00
elseif sData.activiteId == ActivityTypeDef.ExpeditionExper then--天宫达人
2021-04-09 12:26:35 +08:00
Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").text = Language[11693]
2021-05-26 14:44:22 +08:00
elseif sData.activiteId == ActivityTypeDef.DemonSlayer then--三界降魔
2021-04-09 12:26:35 +08:00
Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").text = Language[11694]
elseif sData.activiteId == ActivityTypeDef.slhjExper then
2021-04-09 12:26:35 +08:00
Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").text = Language[11695]
2021-05-26 14:44:22 +08:00
elseif sData.activiteId == ActivityTypeDef.Celebration then--社稷大典
2021-04-09 12:26:35 +08:00
Util.GetGameObject(go,"goldExper/tip"):GetComponent("Text").text = Language[11696]
2020-08-22 18:03:43 +08:00
end
2021-05-26 14:44:22 +08:00
elseif rankType == RANK_TYPE.ARENA_RANK then--竞技场
2020-10-24 18:41:21 +08:00
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
2021-04-09 12:26:35 +08:00
str = Language[11693] .. data.rankInfo.param1--data.param1
2020-10-24 18:41:21 +08:00
else
str = ""
end
Util.GetGameObject(go,"arenaScore"):GetComponent("Text").text = str
2021-05-26 14:44:22 +08:00
elseif rankType == RANK_TYPE.CELEBRATION_GUILD then--社稷大典工会排行
2020-10-24 18:41:21 +08:00
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
trial:SetActive(true)
2020-07-20 15:34:30 +08:00
if Value0 then
Value0:GetComponent("Text").text = "<size=40%>"..data.guildName.."</size>"
2020-07-20 15:34:30 +08:00
end
2021-03-12 14:20:14 +08:00
-- Util.GetGameObject(go,"trial/Text"):GetComponent("Text").text = "贡献度:"..data.rankInfo.param1
2021-03-04 22:15:24 +08:00
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
2021-04-09 12:26:35 +08:00
Util.GetGameObject(go,"trial/tip"):GetComponent("Text").text = Language[11697]
2021-03-04 22:15:24 +08:00
Util.GetGameObject(go,"trial/Text"):GetComponent("Text").text = data.rankInfo.param1
2020-10-24 18:41:21 +08:00
end
2021-05-26 14:44:22 +08:00
elseif rankType == RANK_TYPE.FIGHTLEVEL_PROGRESS then--山河社稷图进度
2021-05-14 16:44:40 +08:00
LogYellow("data.rankInfo.param1 "..data.rankInfo.param1)
2021-05-13 20:30:10 +08:00
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
2021-05-26 20:21:55 +08:00
FightLeve:SetActive(true)
2021-05-13 20:30:10 +08:00
if Value0 then
Value0:GetComponent("Text").text = "<size=40%>"..data.userName.."</size>"
end
2021-05-26 20:21:55 +08:00
FightLeve:GetComponent("Text").text = GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.HardStage,data.rankInfo.param1).Name)
2021-05-13 20:30:10 +08:00
end
2021-05-26 14:44:22 +08:00
elseif rankType == RANK_TYPE.FIGHTLEVEL_STAR then--山河社稷图星星
2021-05-13 20:30:10 +08:00
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
2021-05-14 16:44:40 +08:00
Util.GetGameObject(FightLeveStar,"Text"):GetComponent("Text").text = data.rankInfo.param1
2021-05-13 20:30:10 +08:00
end
2021-05-28 14:05:17 +08:00
elseif rankType == RANK_TYPE.TASUILINGXIAO then--踏碎凌霄排行
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
2021-05-28 18:26:01 +08:00
fight:SetActive(true)
2021-05-28 14:05:17 +08:00
if Value0 then
Value0:GetComponent("Text").text = "<size=40%>"..data.userName.."</size>"
end
2021-05-28 18:26:01 +08:00
Util.GetGameObject(go,"fight"):GetComponent("Text").text = "伤害:"..PrintWanNum2(data.rankInfo.param1)
2021-05-28 14:05:17 +08:00
end
2020-06-08 13:57:30 +08:00
end
end
2021-04-21 13:12:04 +08:00
return RankingSingleListPanel