公会副本提交
parent
4ed5ba896a
commit
b279baaa41
File diff suppressed because it is too large
Load Diff
|
|
@ -2021,13 +2021,13 @@ BATTLE_TYPE = {
|
||||||
Xuanyuan = 13, --轩辕宝镜
|
Xuanyuan = 13, --轩辕宝镜
|
||||||
GuildTranscript = 14, --公会副本
|
GuildTranscript = 14, --公会副本
|
||||||
}
|
}
|
||||||
rankKingList={ [1] = { bgImage = "r_zjm_paihangbang_banner04", name = Language[12164] ,Id = 26 ,rankType = RANK_TYPE.FIGHT_LEVEL_RANK,activiteId = 0,isRankingMainPanelShow = true},
|
rankKingList={ [1] = { bgImage = "r_zjm_paihangbang_banner04", name = Language[12164] ,rankType = RANK_TYPE.FIGHT_LEVEL_RANK,activiteId = 0,isRankingMainPanelShow = true},
|
||||||
[2] = { bgImage = "r_zjm_paihangbang_banner02", name = Language[12165] ,Id = 55,rankType = RANK_TYPE.FORCE_CURR_RANK,activiteId = 0,isRankingMainPanelShow = true},
|
[2] = { bgImage = "r_zjm_paihangbang_banner02", name = Language[12165] ,rankType = RANK_TYPE.FORCE_CURR_RANK,activiteId = 0,isRankingMainPanelShow = true},
|
||||||
[3] = { bgImage = "r_zjm_paihangbang_banner03", name = Language[12166] ,Id = 4,rankType = RANK_TYPE.GUILD_FORCE_RANK,activiteId = 0,isRankingMainPanelShow = true},
|
[3] = { bgImage = "r_zjm_paihangbang_banner03", name = Language[12166] ,rankType = RANK_TYPE.GUILD_FORCE_RANK,activiteId = 0,isRankingMainPanelShow = true},
|
||||||
[4] = { bgImage = "r_zjm_paihangbang_banner01", name = Language[12167] ,Id = 44,rankType = RANK_TYPE.MONSTER_RANK,activiteId = 0,isRankingMainPanelShow = true},
|
[4] = { bgImage = "r_zjm_paihangbang_banner01", name = Language[12167] ,rankType = RANK_TYPE.MONSTER_RANK,activiteId = 0,isRankingMainPanelShow = true},
|
||||||
[5] = { bgImage = "r_zjm_paihangbang_banner01", name = Language[12168] ,Id = 42,rankType = RANK_TYPE.GOLD_EXPER,activiteId = ActivityTypeDef.GoldExper,isRankingMainPanelShow = false},
|
[5] = { bgImage = "r_zjm_paihangbang_banner01", name = Language[12168] ,rankType = RANK_TYPE.GOLD_EXPER,activiteId = ActivityTypeDef.GoldExper,isRankingMainPanelShow = false},
|
||||||
[6] = { bgImage = "r_zjm_paihangbang_banner01", name = Language[12240] ,Id = 8,rankType = RANK_TYPE.ARENA_RANK,activiteId = 0,isRankingMainPanelShow = false},
|
[6] = { bgImage = "r_zjm_paihangbang_banner01", name = Language[12240] ,rankType = RANK_TYPE.ARENA_RANK,activiteId = 0,isRankingMainPanelShow = false},
|
||||||
[7] = { bgImage = "r_zjm_paihangbang_banner01", name = "极速排名" ,Id = 42,rankType = RANK_TYPE.FAST_EXPLORE,activiteId = ActivityTypeDef.FastExplore,isRankingMainPanelShow = false},
|
[7] = { bgImage = "r_zjm_paihangbang_banner01", name = "极速排名" ,rankType = RANK_TYPE.FAST_EXPLORE,activiteId = ActivityTypeDef.FastExplore,isRankingMainPanelShow = false},
|
||||||
}
|
}
|
||||||
|
|
||||||
SoulPrintSpriteByQuantity={
|
SoulPrintSpriteByQuantity={
|
||||||
|
|
|
||||||
|
|
@ -324,6 +324,7 @@ GameEvent = {
|
||||||
|
|
||||||
},
|
},
|
||||||
RankingList={
|
RankingList={
|
||||||
|
AllRankingList="RankingList.AllRankingList",
|
||||||
OnWarPowerChange="RankingList.OnWarPowerChange",
|
OnWarPowerChange="RankingList.OnWarPowerChange",
|
||||||
OnArenaChange="RankingList.OnArenaChange",
|
OnArenaChange="RankingList.OnArenaChange",
|
||||||
OnTrialChange="RankingList.OnTrialChange",
|
OnTrialChange="RankingList.OnTrialChange",
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,8 @@ function Expert:OnShowData(index)
|
||||||
this.rewardBtn:SetActive(true)
|
this.rewardBtn:SetActive(true)
|
||||||
this.sortBtn:SetActive(true)
|
this.sortBtn:SetActive(true)
|
||||||
Util.AddClick(this.sortBtn, function()
|
Util.AddClick(this.sortBtn, function()
|
||||||
if index == 5 then
|
LogGreen("index "..index)
|
||||||
|
if index == 13 then
|
||||||
UIManager.OpenPanel(UIName.RankingSingleListPanel,rankKingList[5])
|
UIManager.OpenPanel(UIName.RankingSingleListPanel,rankKingList[5])
|
||||||
elseif index == 10 then
|
elseif index == 10 then
|
||||||
UIManager.OpenPanel(UIName.RankingSingleListPanel,rankKingList[7])
|
UIManager.OpenPanel(UIName.RankingSingleListPanel,rankKingList[7])
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@ end
|
||||||
|
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
function ExpertRewardSortPanel:OnOpen(_activeId,_type)
|
function ExpertRewardSortPanel:OnOpen(_activeId,_type)
|
||||||
RankingManager.ClearData()
|
|
||||||
activeId = _activeId
|
activeId = _activeId
|
||||||
type = _type
|
type = _type
|
||||||
--设置信息方法的列表
|
--设置信息方法的列表
|
||||||
|
|
@ -157,7 +156,9 @@ function ExpertRewardSortPanel:ActivitySortRewardShow()
|
||||||
self:ActivityRewardSingleShow(expertRewardSortTabs[i],rewardTabs[i])
|
self:ActivityRewardSingleShow(expertRewardSortTabs[i],rewardTabs[i])
|
||||||
end
|
end
|
||||||
--
|
--
|
||||||
RankingManager.InitData(rankKingList[5].Id, this.SetInfoFuncList[rankKingList[5].Id])--算是半个策略模式吧
|
RankingManager.InitData(rankKingList[5].rankType, function()
|
||||||
|
this.SetGoldExperSortInfo()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
function this.SetGoldExperSortInfo()
|
function this.SetGoldExperSortInfo()
|
||||||
local sortNumTabs = {}
|
local sortNumTabs = {}
|
||||||
|
|
@ -165,7 +166,7 @@ function this.SetGoldExperSortInfo()
|
||||||
sortNumTabs[i] = Util.GetGameObject(this.myActivityRewardGo, "SortNum/SortNum ("..i..")")
|
sortNumTabs[i] = Util.GetGameObject(this.myActivityRewardGo, "SortNum/SortNum ("..i..")")
|
||||||
sortNumTabs[i]:SetActive(false)
|
sortNumTabs[i]:SetActive(false)
|
||||||
end
|
end
|
||||||
local data,myData=RankingManager.GetGoldExperSortInfo()
|
local data,myData=RankingManager.GetRankingInfo()
|
||||||
local rewardData = nil
|
local rewardData = nil
|
||||||
if not myData.myRank or myData.myRank < 0 then
|
if not myData.myRank or myData.myRank < 0 then
|
||||||
Util.GetGameObject(sortNumTabs[4], "TitleText"):GetComponent("Text").text = Language[10041]
|
Util.GetGameObject(sortNumTabs[4], "TitleText"):GetComponent("Text").text = Language[10041]
|
||||||
|
|
@ -231,8 +232,6 @@ function ExpertRewardSortPanel:ActivityRewardSingleShow(activityRewardGo,rewardD
|
||||||
end
|
end
|
||||||
--界面关闭时调用(用于子类重写)
|
--界面关闭时调用(用于子类重写)
|
||||||
function ExpertRewardSortPanel:OnClose()
|
function ExpertRewardSortPanel:OnClose()
|
||||||
RankingManager.ClearData()
|
|
||||||
RankingManager.isRequest=0
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--界面销毁时调用(用于子类重写)
|
--界面销毁时调用(用于子类重写)
|
||||||
|
|
|
||||||
|
|
@ -59,54 +59,56 @@ function GuildTranscriptMainPopup:BindEvent()
|
||||||
self:ClosePanel()
|
self:ClosePanel()
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.warbtn,function()
|
Util.AddClick(this.warbtn,function()
|
||||||
-- if GuildTranscriptManager.GetCanBattleCount() <=0 then --今日已无剩余次数!
|
if GuildTranscriptManager.GetCanBattleCount() <=0 then --今日已无剩余次数!
|
||||||
-- if GuildTranscriptManager.GetCanBuyBattleCount() <= 0 then
|
if GuildTranscriptManager.GetCanBuyBattleCount() <= 0 then
|
||||||
-- PopupTipPanel.ShowTip("今日已无剩余次数!")
|
PopupTipPanel.ShowTip("今日已无剩余次数!")
|
||||||
-- else--是否花费XX妖晶购买1次挑战次数并发起挑战?
|
else--是否花费XX妖晶购买1次挑战次数并发起挑战?
|
||||||
-- local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP, GuildTranscriptManager.shopGoodId, 1)
|
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP, GuildTranscriptManager.shopGoodId, 1)
|
||||||
-- local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name
|
local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name
|
||||||
-- if finalNum > BagManager.GetItemCountById(costId) then
|
if finalNum > BagManager.GetItemCountById(costId) then
|
||||||
-- PopupTipPanel.ShowTip(string.format("%s数量不足!",itemName) )
|
PopupTipPanel.ShowTip(string.format("%s数量不足!",itemName) )
|
||||||
-- return
|
return
|
||||||
-- end
|
end
|
||||||
-- MsgPanel.ShowTwo(string.format( "是否花费%s%s购买1次挑战次数并发起挑战?",finalNum,itemName), nil, function()
|
MsgPanel.ShowTwo(string.format( "是否花费%s%s购买1次挑战次数并发起挑战?",finalNum,itemName), nil, function()
|
||||||
-- --买东西
|
--买东西
|
||||||
-- ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,GuildTranscriptManager.shopGoodId,1,function()
|
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,GuildTranscriptManager.shopGoodId,1,function()
|
||||||
-- PopupTipPanel.ShowTip("成功购买1次挑战次数!")
|
PopupTipPanel.ShowTip("成功购买1次挑战次数!")
|
||||||
-- UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.GUILD_TRANSCRIPT)
|
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.GUILD_TRANSCRIPT)
|
||||||
-- this.ShowEndNumInfo()
|
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.GUILDTRANSCRIPT_BUY_BATTLENUM, 1)--更新特权
|
||||||
-- end)
|
this.ShowEndNumInfo()
|
||||||
-- end)
|
end)
|
||||||
-- end
|
end)
|
||||||
-- else
|
end
|
||||||
|
else
|
||||||
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.GUILD_TRANSCRIPT)
|
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.GUILD_TRANSCRIPT)
|
||||||
-- end
|
end
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.quickWarbtn,function()
|
Util.AddClick(this.quickWarbtn,function()
|
||||||
-- if GuildTranscriptManager.GetCanBattleCount() <=0 then --今日已无剩余次数!
|
if GuildTranscriptManager.GetCanBattleCount() <=0 then --今日已无剩余次数!
|
||||||
-- if GuildTranscriptManager.GetCanBuyBattleCount() <= 0 then
|
if GuildTranscriptManager.GetCanBuyBattleCount() <= 0 then
|
||||||
-- PopupTipPanel.ShowTip("今日已无剩余次数!")
|
PopupTipPanel.ShowTip("今日已无剩余次数!")
|
||||||
-- else--是否花费XX妖晶购买1次挑战次数并发起挑战?
|
else--是否花费XX妖晶购买1次挑战次数并发起挑战?
|
||||||
-- local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP, GuildTranscriptManager.shopGoodId, 1)
|
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP, GuildTranscriptManager.shopGoodId, 1)
|
||||||
-- local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name
|
local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name
|
||||||
-- if finalNum > BagManager.GetItemCountById(costId) then
|
if finalNum > BagManager.GetItemCountById(costId) then
|
||||||
-- PopupTipPanel.ShowTip(string.format("%s数量不足!",itemName) )
|
PopupTipPanel.ShowTip(string.format("%s数量不足!",itemName) )
|
||||||
-- return
|
return
|
||||||
-- end
|
end
|
||||||
-- MsgPanel.ShowTwo(string.format( "是否花费%s%s购买1次挑战次数并发起扫荡?",finalNum,itemName), nil, function()
|
MsgPanel.ShowTwo(string.format( "是否花费%s%s购买1次挑战次数并发起扫荡?",finalNum,itemName), nil, function()
|
||||||
-- --买东西
|
--买东西
|
||||||
-- ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,GuildTranscriptManager.shopGoodId,1,function()
|
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,GuildTranscriptManager.shopGoodId,1,function()
|
||||||
-- PopupTipPanel.ShowTip("成功购买1次扫荡次数!")
|
PopupTipPanel.ShowTip("成功购买1次扫荡次数!")
|
||||||
-- this.QuickWar()
|
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.GUILDTRANSCRIPT_BUY_BATTLENUM, 1)--更新特权
|
||||||
-- this.ShowEndNumInfo()
|
this.QuickWar()
|
||||||
-- end)
|
this.ShowEndNumInfo()
|
||||||
-- end)
|
end)
|
||||||
-- end
|
end)
|
||||||
-- else
|
end
|
||||||
-- MsgPanel.ShowTwo(string.format( "确定以上次挑战的%s伤害进行挑战吗?",GuildTranscriptManager.damage), nil, function()
|
else
|
||||||
|
MsgPanel.ShowTwo(string.format( "确定以上次挑战的%s伤害进行挑战吗?",GuildTranscriptManager.damage), nil, function()
|
||||||
this.QuickWar()
|
this.QuickWar()
|
||||||
-- end)
|
end)
|
||||||
-- end
|
end
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.endNumBtn,function()
|
Util.AddClick(this.endNumBtn,function()
|
||||||
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP, GuildTranscriptManager.shopGoodId, 1)
|
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP, GuildTranscriptManager.shopGoodId, 1)
|
||||||
|
|
@ -159,10 +161,16 @@ function GuildTranscriptMainPopup:BindEvent()
|
||||||
Util.AddClick(this.attackInfoBtn,function()
|
Util.AddClick(this.attackInfoBtn,function()
|
||||||
local curguildCheckpointConfig = guildCheckpointConfig[GuildTranscriptManager.GetCurBoss()]
|
local curguildCheckpointConfig = guildCheckpointConfig[GuildTranscriptManager.GetCurBoss()]
|
||||||
local nextBuyIndex = curBuyIndex + 1
|
local nextBuyIndex = curBuyIndex + 1
|
||||||
|
local itemId = curguildCheckpointConfig.AttributePromotePrice[1][1]
|
||||||
|
local buyNum = curguildCheckpointConfig.AttributePromotePrice[2][nextBuyIndex]
|
||||||
|
local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig,itemId).Name
|
||||||
|
if buyNum > BagManager.GetItemCountById(itemId) then
|
||||||
|
PopupTipPanel.ShowTip(string.format("%s数量不足!",itemName) )
|
||||||
|
return
|
||||||
|
end
|
||||||
if curguildCheckpointConfig.AttributePromotePrice[2][nextBuyIndex] then
|
if curguildCheckpointConfig.AttributePromotePrice[2][nextBuyIndex] then
|
||||||
local addNum = ConfigManager.GetConfigData(ConfigName.FoodsConfig,curguildCheckpointConfig.AttributePromote[nextBuyIndex]).EffectPara
|
local addNum = ConfigManager.GetConfigData(ConfigName.FoodsConfig,curguildCheckpointConfig.AttributePromote[nextBuyIndex]).EffectPara
|
||||||
MsgPanel.ShowTwo(string.format("是否消耗%s%s购买一次强攻效果?购买后攻击力加成提升至%s",curguildCheckpointConfig.AttributePromotePrice[2][nextBuyIndex]
|
MsgPanel.ShowTwo(string.format("是否消耗%s%s购买一次强攻效果?购买后攻击力加成提升至%s",buyNum,itemName,math.floor(addNum[1][2]/100) ).."%", nil, function()
|
||||||
,ConfigManager.GetConfigData(ConfigName.ItemConfig,curguildCheckpointConfig.AttributePromotePrice[1][1]).Name,math.floor(addNum[1][2]/100) ).."%", nil, function()
|
|
||||||
--买东西
|
--买东西
|
||||||
NetManager.GuildChallengeBuyBuffRequest()
|
NetManager.GuildChallengeBuyBuffRequest()
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ function this.SetInfoShow(go,data,rankType,nameText)
|
||||||
if nameText then
|
if nameText then
|
||||||
nameText:GetComponent("Text").text = data.userName
|
nameText:GetComponent("Text").text = data.userName
|
||||||
end
|
end
|
||||||
Util.GetGameObject(go,"fight"):GetComponent("Text").text = RankingManager.mainLevelConfig[data.rankInfo.param1].Name
|
Util.GetGameObject(go,"fight"):GetComponent("Text").text = ConfigManager.GetConfigData(ConfigName.MainLevelConfig,data.rankInfo.param1).Name
|
||||||
elseif rankType == RANK_TYPE.FORCE_CURR_RANK then
|
elseif rankType == RANK_TYPE.FORCE_CURR_RANK then
|
||||||
warPower:SetActive(true)
|
warPower:SetActive(true)
|
||||||
if nameText then
|
if nameText then
|
||||||
|
|
|
||||||
|
|
@ -1,562 +1,41 @@
|
||||||
RankingManager = {}
|
RankingManager = {}
|
||||||
local this = RankingManager
|
local this = RankingManager
|
||||||
|
|
||||||
--需要显示的排行
|
|
||||||
local NeedRanking={
|
|
||||||
--[1]={Id=53,OpenLv=0,Name="外敌",PanelType=0},
|
|
||||||
[1]={Id=8,OpenLv=0,Name=Language[11725],PanelType=0,Des=Language[11725]},
|
|
||||||
[2]={Id=30,OpenLv=0,Name=Language[11726],PanelType=0,Des=Language[11259]},
|
|
||||||
[3]={Id=55,OpenLv=0,Name=Language[11727],PanelType=0,Des=""},
|
|
||||||
[4]={Id=44,OpenLv=0,Name=Language[11728],PanelType=0,Des=Language[11728]},
|
|
||||||
[5]={Id=26,OpenLv=0,Name=Language[11729],PanelType=0,Des=""},
|
|
||||||
}
|
|
||||||
--Tab按钮显示文字
|
|
||||||
local TabTextData={
|
|
||||||
-- [1]={txt=""},
|
|
||||||
[1]={txt=""},
|
|
||||||
[2]={txt=""},
|
|
||||||
[3]={txt=""},
|
|
||||||
[4]={txt=""},
|
|
||||||
[5]={txt=""},
|
|
||||||
}
|
|
||||||
|
|
||||||
this.CurPage=0
|
this.CurPage=0
|
||||||
this.WarPowerData={}--战力排行滚动数据
|
this.curRankingData={}--战力排行滚动数据
|
||||||
this.WarPowerMyRankData={} --我的数据
|
this.curRankingMyRankData={} --我的数据
|
||||||
this.ArenaData={}--逐胜场
|
|
||||||
this.ArenaMyRankData={}
|
|
||||||
this.TrialData={}--试炼
|
|
||||||
this.TrialMyRankData={}
|
|
||||||
this.MonsterData={}--兽潮
|
|
||||||
this.MonsterMyRankData={}
|
|
||||||
this.AdventureData={}--外敌
|
|
||||||
this.AdventureMyRankData={}
|
|
||||||
this.CustomsPassData={}--关卡
|
|
||||||
this.CustomsPassMyRankData={}
|
|
||||||
this.GuildData={}--公会
|
|
||||||
this.GuildMyRankData={}
|
|
||||||
this.GoldExperData={}--点金
|
|
||||||
this.GoldExperMyRankData={}
|
|
||||||
|
|
||||||
--是否加载完成
|
|
||||||
this.LoadCompleted={
|
|
||||||
WarPower=0,
|
|
||||||
Arena=0,
|
|
||||||
Trial=0,
|
|
||||||
Monster=0,
|
|
||||||
FightAlien=0,
|
|
||||||
CustomsPass=0,
|
|
||||||
GuildForce=0,
|
|
||||||
GoldExperSort=0,
|
|
||||||
}
|
|
||||||
|
|
||||||
this.mainLevelConfig={}
|
this.mainLevelConfig={}
|
||||||
this.isRequest=0--防止连续请求
|
this.isRequest=0--防止连续请求
|
||||||
|
|
||||||
function this.Initialize()
|
function this.Initialize()
|
||||||
this.InitNeedRanking()
|
|
||||||
end
|
|
||||||
|
|
||||||
--初始化需要显示的排行
|
|
||||||
function this.InitNeedRanking()
|
|
||||||
this.mainLevelConfig=ConfigManager.GetConfig(ConfigName.MainLevelConfig)
|
|
||||||
--开启等级赋值
|
|
||||||
for i = 1, #NeedRanking do
|
|
||||||
NeedRanking[i].OpenLv=ConfigManager.GetConfigData(ConfigName.GlobalSystemConfig,NeedRanking[i].Id).OpenRules[2]
|
|
||||||
end
|
|
||||||
--排序
|
|
||||||
table.sort(NeedRanking,function(a,b)
|
|
||||||
return a.OpenLv<b.OpenLv
|
|
||||||
end)
|
|
||||||
--面板类型赋值
|
|
||||||
for i = 1, #NeedRanking do
|
|
||||||
NeedRanking[i].PanelType=i
|
|
||||||
end
|
|
||||||
--for i = 1, #NeedRanking do
|
|
||||||
-- Log(NeedRanking[i].Name)
|
|
||||||
--end
|
|
||||||
end
|
|
||||||
|
|
||||||
--根据活动开启等级,获取排序后活动名
|
|
||||||
function this.GetSortName()
|
|
||||||
local nameTable={}
|
|
||||||
for i = 1, #NeedRanking do
|
|
||||||
nameTable[i]=NeedRanking[i].Name
|
|
||||||
end
|
|
||||||
return nameTable
|
|
||||||
end
|
|
||||||
|
|
||||||
--获取Tab文字内容
|
|
||||||
function this.GetTabTextData()
|
|
||||||
local _tabTextName=RankingManager.GetSortName()
|
|
||||||
for i = 1, #_tabTextName do
|
|
||||||
TabTextData[i].txt=_tabTextName[i]
|
|
||||||
end
|
|
||||||
return TabTextData
|
|
||||||
end
|
|
||||||
|
|
||||||
--根据点击面板类型 获取当前排行信息
|
|
||||||
--type 需要的信息类型
|
|
||||||
--index 当前点击值
|
|
||||||
function this.GetCurRankingInfo(type,index)
|
|
||||||
if type=="Id" then
|
|
||||||
for i = 1, #NeedRanking do
|
|
||||||
if NeedRanking[i].PanelType==index then
|
|
||||||
return NeedRanking[i].Id
|
|
||||||
end
|
|
||||||
end
|
|
||||||
elseif type=="OpenLv" then
|
|
||||||
for i = 1, #NeedRanking do
|
|
||||||
if NeedRanking[i].PanelType==index then
|
|
||||||
return NeedRanking[i].OpenLv
|
|
||||||
end
|
|
||||||
end
|
|
||||||
elseif type=="Des" then
|
|
||||||
for i = 1, #NeedRanking do
|
|
||||||
if NeedRanking[i].PanelType==index then
|
|
||||||
return NeedRanking[i].Des
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--初始化排行数据(待优化)
|
--初始化排行数据(待优化)
|
||||||
function this.InitData(type,fun)
|
function this.InitData(rankType,fun)
|
||||||
--if type==FUNCTION_OPEN_TYPE.ALLRANKING then--如果加载为指定的功能类型
|
NetManager.RequestRankInfo(rankType, function (msg)--请求数据
|
||||||
-- if this.LoadCompleted.WarPower==0 then--当未加载该数据时
|
this.ReceiveRankingData(msg,fun)
|
||||||
-- --if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ALLRANKING) then--判断该功能是否解锁
|
end,0)
|
||||||
-- Log(Language[11730])
|
|
||||||
-- NetManager.RequestRankInfo(RANK_TYPE.FORCE_RANK, function (msg)--请求数据
|
|
||||||
-- this.ReceiveWarPowerData(msg)
|
|
||||||
-- if fun then fun() end
|
|
||||||
-- end, ActivityTypeDef.WarPowerSort)
|
|
||||||
-- --else
|
|
||||||
-- -- Log("战力未解锁")
|
|
||||||
-- -- this.warPowerData={}
|
|
||||||
-- -- this.warPowerMsg={}
|
|
||||||
-- -- if fun then fun() end
|
|
||||||
-- --end
|
|
||||||
-- else--当存在该功能数据时 执行回调
|
|
||||||
-- if fun then fun() end
|
|
||||||
-- end
|
|
||||||
--end
|
|
||||||
--实时关卡排行
|
|
||||||
if type==FUNCTION_OPEN_TYPE.ALLRANKING then--如果加载为指定的功能类型
|
|
||||||
if this.LoadCompleted.WarPower==0 then--当未加载该数据时
|
|
||||||
--if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ALLRANKING) then--判断该功能是否解锁
|
|
||||||
Log(Language[11730])
|
|
||||||
NetManager.RequestRankInfo(RANK_TYPE.FORCE_CURR_RANK, function (msg)--请求数据
|
|
||||||
this.ReceiveWarPowerData(msg)
|
|
||||||
if fun then fun() end
|
|
||||||
end,0)
|
|
||||||
--else
|
|
||||||
-- Log("战力未解锁")
|
|
||||||
-- this.warPowerData={}
|
|
||||||
-- this.warPowerMsg={}
|
|
||||||
-- if fun then fun() end
|
|
||||||
--end
|
|
||||||
else--当存在该功能数据时 执行回调
|
|
||||||
if fun then fun() end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if type==FUNCTION_OPEN_TYPE.ARENA then
|
|
||||||
if this.LoadCompleted.Arena==0 then
|
|
||||||
--if ActTimeCtrlManager.IsQualifiled(FUNCTION_OPEN_TYPE.ARENA) then --根据是否有资格开启 逐胜场排行在赛季结束时 tab不锁定 需要显示数据
|
|
||||||
Log(Language[11731])
|
|
||||||
NetManager.RequestArenaRankData(1,function(page,msg)
|
|
||||||
this.ReceiveArenaData(page,msg)
|
|
||||||
if fun then fun() end
|
|
||||||
end)
|
|
||||||
--else
|
|
||||||
-- Log("逐胜排名未解锁")
|
|
||||||
-- this.ArenaData={}
|
|
||||||
-- this.ArenaMyRankData={}
|
|
||||||
-- if fun then fun() end
|
|
||||||
--end
|
|
||||||
else
|
|
||||||
if fun then fun() end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if type==FUNCTION_OPEN_TYPE.TRIAL then
|
|
||||||
if this.LoadCompleted.Trial==0 then
|
|
||||||
--if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.TRIAL) then
|
|
||||||
Log(Language[11732])
|
|
||||||
NetManager.RequestRankInfo(RANK_TYPE.TRIAL_RANK, function(msg)
|
|
||||||
this.ReceiveTrialData(msg)
|
|
||||||
if fun then fun() end
|
|
||||||
end)
|
|
||||||
--else
|
|
||||||
-- Log("试炼排名未解锁")
|
|
||||||
-- this.TrialData={}
|
|
||||||
-- this.TrialMyRankData={}
|
|
||||||
-- if fun then fun() end
|
|
||||||
--end
|
|
||||||
else
|
|
||||||
if fun then fun() end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if type==FUNCTION_OPEN_TYPE.MONSTER_COMING then
|
|
||||||
if this.LoadCompleted.Monster==0 then
|
|
||||||
--if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.MONSTER_COMING) then
|
|
||||||
Log(Language[11733])
|
|
||||||
NetManager.RequestRankInfo(RANK_TYPE.MONSTER_RANK, function(msg)
|
|
||||||
this.ReceiveMonsterData(msg)
|
|
||||||
if fun then fun() end
|
|
||||||
end)
|
|
||||||
--else
|
|
||||||
-- Log("兽潮排名未解锁")
|
|
||||||
-- this.MonsterData={}
|
|
||||||
-- this.MonsterMyRankData={}
|
|
||||||
-- if fun then fun() end
|
|
||||||
--end
|
|
||||||
else
|
|
||||||
if fun then fun() end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if type==FUNCTION_OPEN_TYPE.FIGHT_ALIEN then
|
|
||||||
if this.LoadCompleted.FightAlien==0 then
|
|
||||||
--if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.FIGHT_ALIEN) then
|
|
||||||
Log(Language[11734])
|
|
||||||
NetManager.GetAdventureRankRequest(1,function(page,msg)
|
|
||||||
this.ReceiveAdventureData(page,msg)
|
|
||||||
if fun then fun() end
|
|
||||||
end)
|
|
||||||
--else
|
|
||||||
-- Log("外敌排名未解锁")
|
|
||||||
-- this.AdventureData={}
|
|
||||||
-- this.AdventureMyRankData={}
|
|
||||||
-- if fun then fun() end
|
|
||||||
--end
|
|
||||||
else
|
|
||||||
if fun then fun() end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if type==FUNCTION_OPEN_TYPE.CUSTOMSPASS then
|
|
||||||
if this.LoadCompleted.CustomsPass==0 then
|
|
||||||
--if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.CUSTOMSPASS) then
|
|
||||||
if this.isRequest==1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
this.isRequest=1
|
|
||||||
Log(Language[11735])
|
|
||||||
NetManager.RequestRankInfo(RANK_TYPE.FIGHT_LEVEL_RANK, function(msg)
|
|
||||||
this.ReceiveCustomsPassData(msg)
|
|
||||||
if fun then fun() end
|
|
||||||
end)
|
|
||||||
--else
|
|
||||||
-- Log("关卡排名未解锁")
|
|
||||||
-- this.CustomsPassData={}
|
|
||||||
-- this.CustomsPassMyRankData={}
|
|
||||||
-- if fun then fun() end
|
|
||||||
--end
|
|
||||||
else
|
|
||||||
if fun then fun() end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if type==FUNCTION_OPEN_TYPE.GUILD then
|
|
||||||
--this.GuildData={}--公会
|
|
||||||
--this.GuildMyRankData={}
|
|
||||||
if this.LoadCompleted.GuildForce==0 then
|
|
||||||
--if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.GUILD) then
|
|
||||||
if this.isRequest==1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
this.isRequest=1
|
|
||||||
Log(Language[11736])
|
|
||||||
NetManager.RequestRankInfo(RANK_TYPE.GUILD_FORCE_RANK, function(msg)
|
|
||||||
this.ReceiveGuildForeData(msg)
|
|
||||||
if fun then fun() end
|
|
||||||
end)
|
|
||||||
--else
|
|
||||||
-- Log("公会未解锁")
|
|
||||||
-- this.GuildData={}
|
|
||||||
-- this.GuildMyRankData={}
|
|
||||||
-- if fun then fun() end
|
|
||||||
--end
|
|
||||||
else
|
|
||||||
if fun then fun() end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if type==FUNCTION_OPEN_TYPE.EXPERT then
|
|
||||||
LogGreen("this.LoadCompleted.GoldExperSort "..this.LoadCompleted.GoldExperSort.." "..this.isRequest)
|
|
||||||
if this.LoadCompleted.GoldExperSort==0 then
|
|
||||||
if this.isRequest==1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
this.isRequest=1
|
|
||||||
NetManager.RequestRankInfo(RANK_TYPE.GOLD_EXPER, function(msg)
|
|
||||||
this.ReceiveGoldExperSortData(msg)
|
|
||||||
if fun then fun() end
|
|
||||||
end,ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.GoldExper))
|
|
||||||
else
|
|
||||||
if fun then fun() end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
--清空数据
|
|
||||||
function this.ClearData()
|
|
||||||
this.CurPage=0
|
|
||||||
this.WarPowerData={}--战力排行滚动数据
|
|
||||||
this.WarPowerMyRankData={} --我的数据
|
|
||||||
this.ArenaData={}--逐胜场
|
|
||||||
this.ArenaMyRankData={}
|
|
||||||
this.TrialData={}--试炼
|
|
||||||
this.TrialMyRankData={}
|
|
||||||
this.MonsterData={}--兽潮
|
|
||||||
this.MonsterMyRankData={}
|
|
||||||
this.AdventureData={}--外敌
|
|
||||||
this.AdventureMyRankData={}
|
|
||||||
this.CustomsPassData={}--关卡
|
|
||||||
this.CustomsPassMyRankData={}
|
|
||||||
this.GuildData={}--公会
|
|
||||||
this.GuildMyRankData={}
|
|
||||||
this.GoldExperData={}--点金
|
|
||||||
this.GoldExperMyRankData={}
|
|
||||||
this.LoadCompleted.WarPower=0
|
|
||||||
this.LoadCompleted.Arena=0
|
|
||||||
this.LoadCompleted.Trial=0
|
|
||||||
this.LoadCompleted.Monster=0
|
|
||||||
this.LoadCompleted.FightAlien=0
|
|
||||||
this.LoadCompleted.CustomsPass=0
|
|
||||||
this.LoadCompleted.GuildForce=0
|
|
||||||
this.LoadCompleted.GoldExperSort=0
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---战力战力
|
---战力战力
|
||||||
--接收服务器战力数据
|
--接收服务器战力数据
|
||||||
function this.ReceiveWarPowerData(msg)
|
function this.ReceiveRankingData(msg,fun)
|
||||||
--if this.CurPage >= page then return end
|
|
||||||
--this.CurPage=page
|
|
||||||
--if page==1 then
|
|
||||||
-- this.WarPowerData={}
|
|
||||||
--end
|
|
||||||
|
|
||||||
--自身数据
|
--自身数据
|
||||||
this.WarPowerMyRankData.myRank=msg.myRankInfo.rank
|
this.curRankingData = {}
|
||||||
this.WarPowerMyRankData.myForce=msg.myRankInfo.param1
|
this.curRankingMyRankData=msg.myRankInfo
|
||||||
--滚动数据
|
--滚动数据
|
||||||
local length=#this.WarPowerData
|
local length=#this.curRankingData
|
||||||
for i, rank in ipairs(msg.ranks) do
|
for i, rank in ipairs(msg.ranks) do
|
||||||
this.WarPowerData[length+i]=rank
|
this.curRankingData[length+i]=rank
|
||||||
end
|
end
|
||||||
this.LoadCompleted.WarPower=1
|
if fun then fun() end
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnWarPowerChange)
|
-- Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.AllRankingList)
|
||||||
end
|
|
||||||
--请求下一页数据
|
|
||||||
function this.RequestNextWarPowerPageData()
|
|
||||||
Log(Language[11738])
|
|
||||||
--if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ALLRANKING) then
|
|
||||||
-- PopupTipPanel.ShowTip("本赛季已结束")
|
|
||||||
-- return
|
|
||||||
--end
|
|
||||||
----判断是否符合刷新条件
|
|
||||||
--local rankNum = #this.WarPowerData
|
|
||||||
---- 最多显示100
|
|
||||||
--local config = ConfigManager.GetConfigData(ConfigName.SpecialConfig, 7)
|
|
||||||
--local MaxNum = config and tonumber(config.Value) or 100
|
|
||||||
--if rankNum >= MaxNum then return end
|
|
||||||
---- 上一页数据少于20条,则没有下一页数,不再刷新
|
|
||||||
--if rankNum % 20 > 0 then
|
|
||||||
-- return
|
|
||||||
--end
|
|
||||||
--
|
|
||||||
-- 请求下一页
|
|
||||||
--NetManager.RequestWarPowerSortData(this.CurPage + 1,ActivityTypeDef.WarPowerSort,function(page,msg)
|
|
||||||
-- this.ReceiveWarPowerData(page,msg)
|
|
||||||
--end)
|
|
||||||
end
|
end
|
||||||
--获取排行榜信息
|
--获取排行榜信息
|
||||||
function this.GetWarPowerInfo()
|
function this.GetRankingInfo()
|
||||||
return this.WarPowerData, this.WarPowerMyRankData
|
return this.curRankingData, this.curRankingMyRankData
|
||||||
end
|
end
|
||||||
|
|
||||||
---逐胜场
|
|
||||||
function this.ReceiveArenaData(page,msg)
|
|
||||||
if this.CurPage >= page then return end
|
|
||||||
this.CurPage=page
|
|
||||||
if page==1 then
|
|
||||||
this.ArenaData={}
|
|
||||||
end
|
|
||||||
--自身数据
|
|
||||||
this.ArenaMyRankData.myRank=msg.myRank
|
|
||||||
this.ArenaMyRankData.myScore=msg.myscore
|
|
||||||
--滚动数据
|
|
||||||
local length=#this.ArenaData
|
|
||||||
for i, rank in ipairs(msg.rankInfos) do
|
|
||||||
this.ArenaData[length+i]=rank
|
|
||||||
end
|
|
||||||
this.LoadCompleted.Arena=1 Log(Language[11739])
|
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnArenaChange)
|
|
||||||
end
|
|
||||||
function this.RequestNextArenaPageData()
|
|
||||||
if not ActTimeCtrlManager.IsQualifiled(FUNCTION_OPEN_TYPE.ARENA) then
|
|
||||||
--PopupTipPanel.ShowTip("本赛季已结束")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
--判断是否符合刷新条件
|
|
||||||
local rankNum = #this.ArenaData
|
|
||||||
-- 最多显示100
|
|
||||||
local config = ConfigManager.GetConfigData(ConfigName.SpecialConfig, 3)
|
|
||||||
local MaxNum = config and tonumber(config.Value) or 100
|
|
||||||
if rankNum >= MaxNum then return end
|
|
||||||
-- 上一页数据少于20条,则没有下一页数,不再刷新
|
|
||||||
if rankNum % 20 > 0 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- 请求下一页
|
|
||||||
NetManager.RequestArenaRankData(this.CurPage + 1,function(page,msg)
|
|
||||||
this.ReceiveArenaData(page,msg)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
function this.GetArenaInfo()
|
|
||||||
return this.ArenaData, this.ArenaMyRankData
|
|
||||||
end
|
|
||||||
|
|
||||||
---试炼
|
|
||||||
function this.ReceiveTrialData(msg)
|
|
||||||
--自身数据
|
|
||||||
this.TrialMyRankData.rank=msg.myRankInfo.rank
|
|
||||||
this.TrialMyRankData.highestTower=msg.myRankInfo.param1
|
|
||||||
--滚动数据
|
|
||||||
local length=#this.TrialData
|
|
||||||
for i, rank in ipairs(msg.ranks) do
|
|
||||||
this.TrialData[length+i]=rank
|
|
||||||
end
|
|
||||||
this.LoadCompleted.Trial=1 Log(Language[11740])
|
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnTrialChange)
|
|
||||||
end
|
|
||||||
function this.GetTrialInfo()
|
|
||||||
return this.TrialData, this.TrialMyRankData
|
|
||||||
end
|
|
||||||
|
|
||||||
---兽潮
|
|
||||||
function this.ReceiveMonsterData(msg)
|
|
||||||
--自身数据
|
|
||||||
this.MonsterMyRankData.myRank=msg.myRankInfo.rank
|
|
||||||
this.MonsterMyRankData.myScore=msg.myRankInfo.param1
|
|
||||||
--滚动数据
|
|
||||||
local length=#this.MonsterData
|
|
||||||
for i, rank in ipairs(msg.ranks) do
|
|
||||||
this.MonsterData[length+i]=rank
|
|
||||||
end
|
|
||||||
this.LoadCompleted.Monster=1
|
|
||||||
Log(Language[11741])
|
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnMonsterChange)
|
|
||||||
end
|
|
||||||
function this.GetMonsterInfo()
|
|
||||||
return this.MonsterData, this.MonsterMyRankData
|
|
||||||
end
|
|
||||||
|
|
||||||
---外敌
|
|
||||||
function this.ReceiveAdventureData(page,msg)
|
|
||||||
if this.CurPage >= page then return end
|
|
||||||
this.CurPage=page
|
|
||||||
if page==1 then
|
|
||||||
this.AdventureData={}
|
|
||||||
end
|
|
||||||
--自身数据
|
|
||||||
this.AdventureMyRankData.rank=msg.myInfo.rank
|
|
||||||
this.AdventureMyRankData.hurt=msg.myInfo.hurt
|
|
||||||
--滚动数据
|
|
||||||
local length=#this.AdventureData
|
|
||||||
for i, rank in ipairs(msg.adventureRankItemInfo) do
|
|
||||||
this.AdventureData[length+i]=rank
|
|
||||||
end
|
|
||||||
this.LoadCompleted.FightAlien=1
|
|
||||||
Log(Language[11742])
|
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnAdventureChange)
|
|
||||||
end
|
|
||||||
function this.RequestNextAdventurePageData()
|
|
||||||
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.FIGHT_ALIEN) then
|
|
||||||
PopupTipPanel.ShowTip(Language[10082])
|
|
||||||
return
|
|
||||||
end
|
|
||||||
--判断是否符合刷新条件
|
|
||||||
local rankNum = #this.AdventureData
|
|
||||||
-- 最多显示100
|
|
||||||
local config = ConfigManager.GetConfigData(ConfigName.SpecialConfig, 6)
|
|
||||||
local MaxNum = config and tonumber(config.Value) or 100
|
|
||||||
if rankNum >= MaxNum then return end
|
|
||||||
-- 上一页数据少于20条,则没有下一页数,不再刷新
|
|
||||||
if rankNum % 20 > 0 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- 请求下一页
|
|
||||||
NetManager.GetAdventureRankRequest(this.CurPage + 1,function(page,msg)
|
|
||||||
this.ReceiveAdventureData(page,msg)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
function this.GetAdventureInfo()
|
|
||||||
return this.AdventureData,this.AdventureMyRankData
|
|
||||||
end
|
|
||||||
|
|
||||||
---关卡
|
|
||||||
function this.ReceiveCustomsPassData(msg)
|
|
||||||
if this.LoadCompleted.CustomsPass==1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
--自身数据
|
|
||||||
|
|
||||||
this.CustomsPassMyRankData.myRank=msg.myRankInfo.rank
|
|
||||||
this.CustomsPassMyRankData.fightId=msg.myRankInfo.param1
|
|
||||||
--滚动数据
|
|
||||||
local length=#this.CustomsPassData
|
|
||||||
for i, rank in ipairs(msg.ranks) do
|
|
||||||
this.CustomsPassData[length+i]=rank
|
|
||||||
end
|
|
||||||
this.LoadCompleted.CustomsPass=1
|
|
||||||
Log(Language[11743])
|
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnCustomsPassChange)
|
|
||||||
end
|
|
||||||
function this.GetCustomsPassInfo()
|
|
||||||
return this.CustomsPassData,this.CustomsPassMyRankData
|
|
||||||
end
|
|
||||||
---公会
|
|
||||||
function this.ReceiveGuildForeData(msg)
|
|
||||||
--this.GuildData={}--公会
|
|
||||||
--this.GuildMyRankData={}
|
|
||||||
if this.LoadCompleted.GuildForce==1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
--自身数据
|
|
||||||
|
|
||||||
this.GuildMyRankData.myRank=msg.myRankInfo.rank
|
|
||||||
this.GuildMyRankData.myForce=msg.myRankInfo.param1
|
|
||||||
--滚动数据
|
|
||||||
local length=#this.GuildData
|
|
||||||
for i, rank in ipairs(msg.ranks) do
|
|
||||||
this.GuildData[length+i]=rank
|
|
||||||
end
|
|
||||||
this.LoadCompleted.GuildForce=1
|
|
||||||
Log(Language[11743])
|
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnGuildForceChange)
|
|
||||||
end
|
|
||||||
function this.GetGuildForeInfo()
|
|
||||||
return this.GuildData,this.GuildMyRankData
|
|
||||||
end
|
|
||||||
---点金
|
|
||||||
function this.ReceiveGoldExperSortData(msg)
|
|
||||||
if this.LoadCompleted.GoldExperSort==1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
--自身数据
|
|
||||||
|
|
||||||
this.GoldExperMyRankData.myRank=msg.myRankInfo.rank
|
|
||||||
this.GoldExperMyRankData.myNum=msg.myRankInfo.param1
|
|
||||||
--滚动数据
|
|
||||||
local length=#this.GoldExperData
|
|
||||||
for i, rank in ipairs(msg.ranks) do
|
|
||||||
this.GoldExperData[length+i]=rank
|
|
||||||
end
|
|
||||||
this.LoadCompleted.GoldExperSort=1
|
|
||||||
Log(Language[11744])
|
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnGoldExperSortChange)
|
|
||||||
end
|
|
||||||
function this.GetGoldExperSortInfo()
|
function this.GetGoldExperSortInfo()
|
||||||
return this.GoldExperData,this.GoldExperMyRankData
|
return this.GoldExperData,this.GoldExperMyRankData
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,7 @@ function RankingSingleListPanel:InitComponent()
|
||||||
this.record=Util.GetGameObject(self.gameObject,"RankList/Record")
|
this.record=Util.GetGameObject(self.gameObject,"RankList/Record")
|
||||||
this.info0=Util.GetGameObject(this.record,"Info0"):GetComponent("Text")
|
this.info0=Util.GetGameObject(this.record,"Info0"):GetComponent("Text")
|
||||||
this.rank0=Util.GetGameObject(this.record,"Rank0"):GetComponent("Text")
|
this.rank0=Util.GetGameObject(this.record,"Rank0"):GetComponent("Text")
|
||||||
this.info1=Util.GetGameObject(this.record,"Info1"):GetComponent("Text")
|
|
||||||
this.infoGo=Util.GetGameObject(this.record,"infoGo")
|
this.infoGo=Util.GetGameObject(this.record,"infoGo")
|
||||||
--this.rank1=Util.GetGameObject(this.record,"Rank1"):GetComponent("Text")
|
|
||||||
|
|
||||||
this.noneImage=Util.GetGameObject(self.gameObject,"RankList/NoneImage")--无信息图片
|
this.noneImage=Util.GetGameObject(self.gameObject,"RankList/NoneImage")--无信息图片
|
||||||
end
|
end
|
||||||
|
|
@ -53,26 +51,12 @@ end
|
||||||
|
|
||||||
--添加事件监听(用于子类重写)
|
--添加事件监听(用于子类重写)
|
||||||
function RankingSingleListPanel:AddListener()
|
function RankingSingleListPanel:AddListener()
|
||||||
Game.GlobalEvent:AddEvent(GameEvent.RankingList.OnWarPowerChange, this.SetWarPowerInfo)
|
Game.GlobalEvent:AddEvent(GameEvent.RankingList.AllRankingList, this.SetRankingInfo)
|
||||||
Game.GlobalEvent:AddEvent(GameEvent.RankingList.OnArenaChange, this.SetArenaInfo)
|
|
||||||
Game.GlobalEvent:AddEvent(GameEvent.RankingList.OnTrialChange, this.SetTrialInfo)
|
|
||||||
Game.GlobalEvent:AddEvent(GameEvent.RankingList.OnMonsterChange, this.SetMonsterInfo)
|
|
||||||
Game.GlobalEvent:AddEvent(GameEvent.RankingList.OnAdventureChange, this.SetAdventureInfo)
|
|
||||||
Game.GlobalEvent:AddEvent(GameEvent.RankingList.OnCustomsPassChange,this.SetCustomsPassInfo)
|
|
||||||
Game.GlobalEvent:AddEvent(GameEvent.RankingList.OnGuildForceChange,this.SetGuildForceInfo)
|
|
||||||
Game.GlobalEvent:AddEvent(GameEvent.RankingList.OnGoldExperSortChange,this.SetGoldExperSortInfo)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--移除事件监听(用于子类重写)
|
--移除事件监听(用于子类重写)
|
||||||
function RankingSingleListPanel:RemoveListener()
|
function RankingSingleListPanel:RemoveListener()
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.RankingList.OnWarPowerChange, this.SetWarPowerInfo)
|
Game.GlobalEvent:RemoveEvent(GameEvent.RankingList.AllRankingList, this.SetRankingInfo)
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.RankingList.OnArenaChange, this.SetArenaInfo)
|
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.RankingList.OnTrialChange, this.SetTrialInfo)
|
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.RankingList.OnMonsterChange, this.SetMonsterInfo)
|
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.RankingList.OnAdventureChange, this.SetAdventureInfo)
|
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.RankingList.OnCustomsPassChange, this.SetCustomsPassInfo)
|
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.RankingList.OnGuildForceChange,this.SetGuildForceInfo)
|
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.RankingList.OnGoldExperSortChange,this.SetGoldExperSortInfo)
|
|
||||||
end
|
end
|
||||||
local sData = nil
|
local sData = nil
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
|
|
@ -80,19 +64,7 @@ function RankingSingleListPanel:OnOpen(_sData)
|
||||||
SoundManager.PlayMusic(SoundConfig.BGM_Rank)
|
SoundManager.PlayMusic(SoundConfig.BGM_Rank)
|
||||||
sData = _sData
|
sData = _sData
|
||||||
this.name.text = sData.name
|
this.name.text = sData.name
|
||||||
--设置信息方法的列表
|
this.GetRankInfo(sData.rankType)
|
||||||
this.SetInfoFuncList ={
|
|
||||||
[FUNCTION_OPEN_TYPE.ALLRANKING] = this.SetWarPowerInfo,
|
|
||||||
[FUNCTION_OPEN_TYPE.ARENA] = this.SetArenaInfo,
|
|
||||||
[FUNCTION_OPEN_TYPE.TRIAL] = this.SetTrialInfo,
|
|
||||||
[FUNCTION_OPEN_TYPE.MONSTER_COMING] = this.SetMonsterInfo,
|
|
||||||
[FUNCTION_OPEN_TYPE.FIGHT_ALIEN] = this.SetAdventureInfo,
|
|
||||||
[FUNCTION_OPEN_TYPE.CUSTOMSPASS] = this.SetCustomsPassInfo,
|
|
||||||
[FUNCTION_OPEN_TYPE.GUILD] = this.SetGuildForceInfo,
|
|
||||||
[FUNCTION_OPEN_TYPE.EXPERT] = this.SetGoldExperSortInfo,
|
|
||||||
}
|
|
||||||
RankingManager.ClearData()
|
|
||||||
this.GetRankInfo(sData.Id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
||||||
|
|
@ -105,7 +77,6 @@ end
|
||||||
|
|
||||||
--界面关闭时调用(用于子类重写)
|
--界面关闭时调用(用于子类重写)
|
||||||
function RankingSingleListPanel:OnClose()
|
function RankingSingleListPanel:OnClose()
|
||||||
RankingManager.ClearData()
|
|
||||||
RankingManager.isRequest=0
|
RankingManager.isRequest=0
|
||||||
this.noneImage:SetActive(false)
|
this.noneImage:SetActive(false)
|
||||||
-- if this.liveNode then
|
-- if this.liveNode then
|
||||||
|
|
@ -131,368 +102,68 @@ end
|
||||||
|
|
||||||
|
|
||||||
--点击获取对应排行信息
|
--点击获取对应排行信息
|
||||||
function this.GetRankInfo(key)
|
function this.GetRankInfo(rankType)
|
||||||
RankingManager.CurPage=0
|
RankingManager.CurPage=0
|
||||||
--local key = RankingManager.GetCurRankingInfo("Id",index)
|
|
||||||
this.istop=true
|
this.istop=true
|
||||||
--LogGreen("key "..key)
|
RankingManager.InitData(rankType,function()
|
||||||
RankingManager.InitData(key, this.SetInfoFuncList[key])--算是半个策略模式吧
|
this.SetRankingInfo()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
---设置战力排名信息
|
---设置排名信息
|
||||||
function this.SetWarPowerInfo()
|
function this.SetRankingInfo()
|
||||||
local warPowerData,myRankData=RankingManager.GetWarPowerInfo()
|
local rankingData,myRankData=RankingManager.GetRankingInfo()
|
||||||
this.noneImage:SetActive(#warPowerData==0)
|
LogGreen("#rankingData "..#rankingData)
|
||||||
|
this.noneImage:SetActive(#rankingData==0)
|
||||||
|
this.firsthead:SetActive(#rankingData~=0)
|
||||||
|
this.scrollParentView:SetActive(#rankingData~=0)
|
||||||
-- 没有排行数据需要立刻刷新,只在打开界面时有用
|
-- 没有排行数据需要立刻刷新,只在打开界面时有用
|
||||||
if #warPowerData == 0 then
|
-- this.SetNotRollingInfo(Language[11713],Language[11714],Language[10104],Language[11716],myRankData.myRank,Language[10041],FormationManager.GetFormationPower(1),myRankData.myRank,myRankData.myForce)
|
||||||
this.isRefreshNow = true
|
this.SetNotRollingInfo(myRankData)
|
||||||
end
|
local dData
|
||||||
this.InitNotRollingInfo()
|
if sData.rankType == RANK_TYPE.FIGHT_LEVEL_RANK then
|
||||||
this.SetNotRollingInfo(Language[11713],Language[11714],Language[10104],Language[11716],myRankData.myRank,Language[10041],FormationManager.GetFormationPower(1),myRankData.myRank,myRankData.myForce)
|
LogGreen(" myRankData.fightId ".. myRankData.param1)
|
||||||
local dData = {
|
dData = { rankInfo = {param1 = myRankData.param1},
|
||||||
rankInfo = {param1 = myRankData.myForce},
|
force = myRankData.param1}
|
||||||
force = myRankData.myForce
|
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.myNum},
|
||||||
|
userName = PlayerManager.nickName}
|
||||||
|
elseif sData.rankType == RANK_TYPE.ARENA_RANK then
|
||||||
|
dData = { rankInfo = {param1 = myRankData.param1},
|
||||||
|
score = myRankData.param1}
|
||||||
|
end
|
||||||
this.SetInfoShow(this.infoGo,dData,sData.rankType)
|
this.SetInfoShow(this.infoGo,dData,sData.rankType)
|
||||||
--数据拆分
|
--数据拆分
|
||||||
if not warPowerData or (warPowerData and #warPowerData <= 0) then
|
if not rankingData or (rankingData and #rankingData <= 0) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local dt,db=RankingManager.CutDate(warPowerData)
|
local dt,db=RankingManager.CutDate(rankingData)
|
||||||
this.SetHeadsInfo(dt[1],this.firstHeadinfoGo,1,dt[1].userName,dt[1].level)
|
this.SetHeadsInfo(dt[1],this.firstHeadinfoGo,1,dt[1].userName,dt[1].level)
|
||||||
--设置滚动区信息
|
--设置滚动区信息
|
||||||
this.scrollView:SetData(db,function(index,root)
|
this.scrollView:SetData(db,function(index,root)
|
||||||
this.ShowWarPowerInfo(root,db[index],myRankData)
|
this.ShowWarPowerInfo(root,db[index],myRankData)
|
||||||
if index==#db then
|
-- if index==#db then
|
||||||
RankingManager.RequestNextWarPowerPageData()
|
-- RankingManager.RequestNextWarPowerPageData()
|
||||||
end
|
-- end
|
||||||
end)
|
end)
|
||||||
this.CheckIsTop()
|
|
||||||
end
|
end
|
||||||
--显示每条数据
|
--显示每条数据
|
||||||
function this.ShowWarPowerInfo(root,data,myRankData)
|
function this.ShowWarPowerInfo(root,data,myRankData)
|
||||||
--local info1,info2=this.InitRollingInfo(root)
|
|
||||||
this.AddPlayerInfoClick(root,data.uid)
|
this.AddPlayerInfoClick(root,data.uid)
|
||||||
this.SetSelfBG(root,myRankData.myRank, data.rankInfo.rank)
|
this.SetSelfBG(root,myRankData.myRank, data.rankInfo.rank)
|
||||||
this.SetRankingNum(root, data.rankInfo.rank)
|
this.SetRankingNum(root, data.rankInfo.rank)
|
||||||
this.SetHeadInfo(root,data.head, data.headFrame,data.level)
|
this.SetHeadInfo(root,data.head, data.headFrame,data.level)
|
||||||
--this.SetShowInfo(info1,info2,data.userName,data.force)
|
|
||||||
--Util.GetGameObject(root,"Value0"):GetComponent("Text").text = "<size=40%>"..data.userName.."</size>"
|
|
||||||
this.SetInfoShow(Util.GetGameObject(root,"infoGo"),data,sData.rankType,Util.GetGameObject(root,"Value0"))
|
this.SetInfoShow(Util.GetGameObject(root,"infoGo"),data,sData.rankType,Util.GetGameObject(root,"Value0"))
|
||||||
end
|
end
|
||||||
|
|
||||||
---设置逐胜场排名信息
|
|
||||||
function this.SetArenaInfo()
|
|
||||||
local arenaData,myRankData=RankingManager.GetArenaInfo()
|
|
||||||
this.noneImage:SetActive(#arenaData==0)
|
|
||||||
if #arenaData == 0 then
|
|
||||||
this.isRefreshNow = true
|
|
||||||
end
|
|
||||||
this.InitNotRollingInfo()
|
|
||||||
this.SetNotRollingInfo(Language[11713],Language[11717],Language[10104],Language[11718],myRankData.myRank,Language[10041],"",myRankData.myRank,myRankData.myScore)
|
|
||||||
local dData = {
|
|
||||||
rankInfo = {param1 = myRankData.myScore},
|
|
||||||
score = myRankData.myScore
|
|
||||||
}
|
|
||||||
this.SetInfoShow(this.infoGo,dData,sData.rankType)
|
|
||||||
--数据拆分
|
|
||||||
if not arenaData or (arenaData and #arenaData <= 0) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local dt,db=RankingManager.CutDate(arenaData)
|
|
||||||
this.SetHeadsInfo(dt[1].personInfo,this.firstHeadinfoGo,1,dt[1].personInfo.name,dt[1].personInfo.level)
|
|
||||||
--设置滚动区信息
|
|
||||||
this.scrollView:SetData(db,function(index,root)
|
|
||||||
this.ShowArenaInfo(root,db[index],myRankData)
|
|
||||||
if index==#db then
|
|
||||||
RankingManager.RequestNextArenaPageData()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
this.CheckIsTop()
|
|
||||||
end
|
|
||||||
--显示每条数据
|
|
||||||
function this.ShowArenaInfo(root,data,myRankData)
|
|
||||||
--local info1,info2=this.InitRollingInfo(root)
|
|
||||||
this.AddPlayerInfoClick(root,data.personInfo.uid)
|
|
||||||
this.SetSelfBG(root,myRankData.myRank,data.personInfo.rank)
|
|
||||||
this.SetRankingNum(root,data.personInfo.rank)
|
|
||||||
this.SetHeadInfo(root,data.personInfo.head,data.personInfo.headFrame,data.personInfo.level)
|
|
||||||
--this.SetShowInfo(info1,info2,data.personInfo.name,data.personInfo.score)
|
|
||||||
--Util.GetGameObject(root,"Value0"):GetComponent("Text").text = "<size=40%>"..data.userName.."</size>"
|
|
||||||
this.SetInfoShow(Util.GetGameObject(root,"infoGo"),data,sData.rankType,Util.GetGameObject(root,"Value0"))
|
|
||||||
--设置出战角色头像
|
|
||||||
--for i = 1, 5 do
|
|
||||||
-- local heroHeadBg = Util.GetGameObject(root, "Demons/Head_"..i)
|
|
||||||
-- local hearIcon = Util.GetGameObject(heroHeadBg, "Icon")
|
|
||||||
-- local heroTId = data.team.heroTid[i]
|
|
||||||
-- if heroTId then
|
|
||||||
-- heroHeadBg:SetActive(true)
|
|
||||||
-- local demonData = ConfigManager.GetConfigData(ConfigName.HeroConfig, heroTId)
|
|
||||||
-- heroHeadBg:GetComponent("Image").sprite = Util.LoadSprite(GetQuantityImageByquality(demonData.Star))
|
|
||||||
-- hearIcon:GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(demonData.Icon))
|
|
||||||
-- else
|
|
||||||
-- heroHeadBg:SetActive(false)
|
|
||||||
-- end
|
|
||||||
--end
|
|
||||||
end
|
|
||||||
|
|
||||||
---设置试炼排名信息
|
|
||||||
function this.SetTrialInfo()
|
|
||||||
local trialData,myRankData=RankingManager.GetTrialInfo()
|
|
||||||
this.noneImage:SetActive(#trialData==0)
|
|
||||||
if #trialData == 0 then
|
|
||||||
this.isRefreshNow = true
|
|
||||||
end
|
|
||||||
this.InitNotRollingInfo()
|
|
||||||
this.SetNotRollingInfo(Language[11713],Language[11719],Language[10104],Language[11720],myRankData.rank,Language[10041],myRankData.highestTower,myRankData.rank,myRankData.highestTower..Language[10319])
|
|
||||||
local dData = {
|
|
||||||
rankInfo = {param1 = myRankData.highestTower},
|
|
||||||
force = myRankData.highestTower
|
|
||||||
}
|
|
||||||
this.SetInfoShow(this.infoGo,dData,sData.rankType)
|
|
||||||
--数据拆分
|
|
||||||
if not trialData or (trialData and #trialData <= 0) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local dt,db=RankingManager.CutDate(trialData)
|
|
||||||
LogGreen("db "..#db)
|
|
||||||
this.SetHeadsInfo(dt[1],this.firstHeadinfoGo,1,dt[1].userName,dt[1].level)
|
|
||||||
this.scrollView:SetData(db,function(index,root)
|
|
||||||
this.ShowTrialInfo(root,db[index],myRankData)
|
|
||||||
end)
|
|
||||||
this.CheckIsTop()
|
|
||||||
end
|
|
||||||
--显示每条数据
|
|
||||||
function this.ShowTrialInfo(root,data,myRankData)
|
|
||||||
--local info1,info2=this.InitRollingInfo(root)
|
|
||||||
this.AddPlayerInfoClick(root,data.uid)
|
|
||||||
this.SetSelfBG(root,myRankData.rank,data.rankInfo.rank)
|
|
||||||
this.SetRankingNum(root,data.rankInfo.rank)
|
|
||||||
this.SetHeadInfo(root,data.head,data.headFrame,data.level)
|
|
||||||
--this.SetShowInfo(info1,info2,data.userName,data.rankInfo.param1.."层")
|
|
||||||
--Util.GetGameObject(root,"Value0"):GetComponent("Text").text = "<size=40%>"..data.userName.."</size>"
|
|
||||||
this.SetInfoShow(Util.GetGameObject(root,"infoGo"),data,sData.rankType,Util.GetGameObject(root,"Value0"))
|
|
||||||
end
|
|
||||||
|
|
||||||
---设置兽潮玩家排名信息
|
|
||||||
function this.SetMonsterInfo()
|
|
||||||
local monsterData,myRankData=RankingManager.GetMonsterInfo()
|
|
||||||
this.noneImage:SetActive(#monsterData==0)
|
|
||||||
if #monsterData == 0 then
|
|
||||||
this.isRefreshNow = true
|
|
||||||
end
|
|
||||||
this.InitNotRollingInfo()
|
|
||||||
local myScore = myRankData.myScore and myRankData.myScore or 0
|
|
||||||
this.SetNotRollingInfo(Language[11713],Language[11719],Language[10104],Language[11721],myRankData.myRank,Language[10041],"0",myRankData.myRank,Language[10311] .. myScore .. Language[10316])
|
|
||||||
local dData = {
|
|
||||||
rankInfo = {param1 = myRankData.myScore},
|
|
||||||
force = myRankData.myScore
|
|
||||||
}
|
|
||||||
this.SetInfoShow(this.infoGo,dData,sData.rankType)
|
|
||||||
--数据拆分
|
|
||||||
if not monsterData or (monsterData and #monsterData <= 0) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local dt,db=RankingManager.CutDate(monsterData)
|
|
||||||
this.SetHeadsInfo(dt[1],this.firstHeadinfoGo,1,dt[1].userName,dt[1].level)
|
|
||||||
this.scrollView:SetData(db,function(index,root)
|
|
||||||
this.ShowMonsterInfo(root,db[index],myRankData)
|
|
||||||
end)
|
|
||||||
this.CheckIsTop()
|
|
||||||
end
|
|
||||||
--显示每条数据
|
|
||||||
function this.ShowMonsterInfo(root,data,myRankData)
|
|
||||||
--local info1,info2=this.InitRollingInfo(root)
|
|
||||||
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.SetShowInfo(info1,info2,data.userName,"第"..data.rankInfo.param1.."波")
|
|
||||||
--Util.GetGameObject(root,"Value0"):GetComponent("Text").text = "<size=40%>"..data.userName.."</size>"
|
|
||||||
this.SetInfoShow(Util.GetGameObject(root,"infoGo"),data,sData.rankType,Util.GetGameObject(root,"Value0"))
|
|
||||||
end
|
|
||||||
|
|
||||||
---设置外敌排名信息
|
|
||||||
function this.SetAdventureInfo()
|
|
||||||
local adventureData,myRankData=RankingManager.GetAdventureInfo()
|
|
||||||
this.noneImage:SetActive(#adventureData==0)
|
|
||||||
if #adventureData == 0 then
|
|
||||||
this.isRefreshNow = true
|
|
||||||
end
|
|
||||||
this.InitNotRollingInfo()
|
|
||||||
this.SetNotRollingInfo(Language[11713],Language[11722],Language[10104],Language[11722],myRankData.rank,Language[10041],myRankData.hurt,myRankData.rank,myRankData.hurt)
|
|
||||||
local dData = {
|
|
||||||
rankInfo = {param1 = myRankData.hurt},
|
|
||||||
force = myRankData.hurt
|
|
||||||
}
|
|
||||||
this.SetInfoShow(this.infoGo,dData,sData.rankType)
|
|
||||||
--数据拆分
|
|
||||||
if not adventureData or (adventureData and #adventureData <= 0) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local dt,db=RankingManager.CutDate(adventureData)
|
|
||||||
this.SetHeadsInfo(dt[1],this.firstHeadinfoGo,1,dt[1].name,dt[1].level)
|
|
||||||
this.scrollView:SetData(db,function(index,root)
|
|
||||||
this.ShowAdventureInfo(root,db[index],myRankData)
|
|
||||||
if index==#db then
|
|
||||||
RankingManager.RequestNextAdventurePageData()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
this.CheckIsTop()
|
|
||||||
end
|
|
||||||
--显示每条数据
|
|
||||||
function this.ShowAdventureInfo(root,data,myRankData)
|
|
||||||
--local info1,info2=this.InitRollingInfo(root)
|
|
||||||
this.AddPlayerInfoClick(root,data.uid)
|
|
||||||
this.SetSelfBG(root,myRankData.rank,data.rank)
|
|
||||||
this.SetRankingNum(root,data.rank)
|
|
||||||
this.SetHeadInfo(root,data.head,data.headFrame,data.level)
|
|
||||||
--this.SetShowInfo(info1,info2,data.name,data.hurt)
|
|
||||||
--Util.GetGameObject(root,"Value0"):GetComponent("Text").text = "<size=40%>"..data.userName.."</size>"
|
|
||||||
this.SetInfoShow(Util.GetGameObject(root,"infoGo"),data,sData.rankType,Util.GetGameObject(root,"Value0"))
|
|
||||||
end
|
|
||||||
|
|
||||||
---设置关卡排名信息
|
|
||||||
function this.SetCustomsPassInfo()
|
|
||||||
local data,myData=RankingManager.GetCustomsPassInfo()
|
|
||||||
this.noneImage:SetActive(#data==0)
|
|
||||||
if #data==0 then
|
|
||||||
this.isRefreshNow = true
|
|
||||||
end
|
|
||||||
this.InitNotRollingInfo()
|
|
||||||
|
|
||||||
local myRankText = ""
|
|
||||||
if myData.fightId < 0 then
|
|
||||||
myRankText = Language[10041]
|
|
||||||
else
|
|
||||||
myRankText = RankingManager.mainLevelConfig[myData.fightId].Name
|
|
||||||
end
|
|
||||||
this.SetNotRollingInfo(Language[11713],Language[11723],Language[10104],Language[11724], myData.myRank,Language[10041],"",myData.myRank, myRankText)
|
|
||||||
--LogGreen("myData.fightId "..myData.fightId)
|
|
||||||
local dData = {
|
|
||||||
rankInfo = {param1 = myData.fightId},
|
|
||||||
force = myData.fightId
|
|
||||||
}
|
|
||||||
this.SetInfoShow(this.infoGo,dData,sData.rankType)
|
|
||||||
--LogGreen("data "..#data)
|
|
||||||
--local curdata = table.remove(data,1)
|
|
||||||
--LogGreen("curdata "..#curdata)
|
|
||||||
--数据拆分
|
|
||||||
if not data or (data and #data <= 0) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local dt,db=RankingManager.CutDate(data)
|
|
||||||
this.SetHeadsInfo(dt[1],this.firstHeadinfoGo,1,dt[1].userName,dt[1].level)
|
|
||||||
this.scrollView:SetData(db,function(index,root)
|
|
||||||
this.ShowCustomsPassInfo(root,db[index],myData)
|
|
||||||
end)
|
|
||||||
this.CheckIsTop()
|
|
||||||
end
|
|
||||||
--显示每条数据
|
|
||||||
function this.ShowCustomsPassInfo(root,data,myRankData)
|
|
||||||
if data.rankInfo.param1 > 0 then
|
|
||||||
--local info1,info2=this.InitRollingInfo(root)
|
|
||||||
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.SetShowInfo(info1,info2,data.userName,RankingManager.mainLevelConfig[data.rankInfo.param1].Name)
|
|
||||||
--Util.GetGameObject(root,"Value0"):GetComponent("Text").text = "<size=40%>"..data.userName.."</size>"
|
|
||||||
this.SetInfoShow(Util.GetGameObject(root,"infoGo"),data,sData.rankType,Util.GetGameObject(root,"Value0"))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
---设置公会战力信息
|
|
||||||
function this.SetGuildForceInfo()
|
|
||||||
local data,myData=RankingManager.GetGuildForeInfo()
|
|
||||||
this.noneImage:SetActive(#data==0)
|
|
||||||
if #data==0 then
|
|
||||||
this.isRefreshNow = true
|
|
||||||
end
|
|
||||||
this.InitNotRollingInfo()
|
|
||||||
|
|
||||||
local myRankText = ""
|
|
||||||
if not myData.myRank or myData.myRank < 0 then
|
|
||||||
myRankText = Language[10041]
|
|
||||||
else
|
|
||||||
myRankText = myData.myRank
|
|
||||||
end
|
|
||||||
this.SetNotRollingInfo("","",Language[10104],"", myData.myRank,Language[10041],"",myData.myRank, myRankText)
|
|
||||||
local dData = {
|
|
||||||
rankInfo = {rank = myData.myRank ,param1= myData.myForce},
|
|
||||||
guildName = PlayerManager.familyId == 0 and "" or MyGuildManager.GetMyGuildInfo().name
|
|
||||||
}
|
|
||||||
this.SetInfoShow(this.infoGo,dData,sData.rankType)
|
|
||||||
--数据拆分
|
|
||||||
if not data or (data and #data <= 0) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local dt,db=RankingManager.CutDate(data)
|
|
||||||
this.SetHeadsInfo(dt[1],this.firstHeadinfoGo,1,dt[1].guildName,dt[1].level)
|
|
||||||
this.scrollView:SetData(db,function(index,root)
|
|
||||||
this.ShowGuildForceInfo(root,db[index],myData)
|
|
||||||
end)
|
|
||||||
this.CheckIsTop()
|
|
||||||
end
|
|
||||||
--显示每条数据
|
|
||||||
function this.ShowGuildForceInfo(root,data,myRankData)
|
|
||||||
if data.rankInfo.param1 > 0 then
|
|
||||||
--local info1,info2=this.InitRollingInfo(root)
|
|
||||||
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.SetShowInfo(info1,info2,data.userName,RankingManager.mainLevelConfig[data.rankInfo.param1].Name)
|
|
||||||
--Util.GetGameObject(root,"Value0"):GetComponent("Text").text = "<size=40%>"..data.userName.."</size>"
|
|
||||||
this.SetInfoShow(Util.GetGameObject(root,"infoGo"),data,sData.rankType,Util.GetGameObject(root,"Value0"))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
--设置点金信息
|
|
||||||
function this.SetGoldExperSortInfo()
|
|
||||||
LogGreen("sssssssssssssssssssssssssss")
|
|
||||||
local data,myData=RankingManager.GetGoldExperSortInfo()
|
|
||||||
this.noneImage:SetActive(#data==0)
|
|
||||||
if #data==0 then
|
|
||||||
this.isRefreshNow = true
|
|
||||||
end
|
|
||||||
this.InitNotRollingInfo()
|
|
||||||
|
|
||||||
local myRankText = ""
|
|
||||||
if not myData.myRank or myData.myRank < 0 then
|
|
||||||
myRankText = Language[10041]
|
|
||||||
else
|
|
||||||
myRankText = myData.myRank
|
|
||||||
end
|
|
||||||
|
|
||||||
this.SetNotRollingInfo("","",Language[10104],"", myData.myRank,Language[10041],"",myData.myRank, myRankText)
|
|
||||||
local dData = {
|
|
||||||
rankInfo = {rank = myData.myRank ,param1= myData.myNum},
|
|
||||||
userName = PlayerManager.nickName
|
|
||||||
}
|
|
||||||
this.SetInfoShow(this.infoGo,dData,sData.rankType)
|
|
||||||
--数据拆分
|
|
||||||
if not data or (data and #data <= 0) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local dt,db=RankingManager.CutDate(data)
|
|
||||||
this.SetHeadsInfo(dt[1],this.firstHeadinfoGo,1,dt[1].userName,dt[1].level)
|
|
||||||
this.scrollView:SetData(db,function(index,root)
|
|
||||||
this.ShowGoldExperSortInfo(root,db[index],myData)
|
|
||||||
end)
|
|
||||||
this.CheckIsTop()
|
|
||||||
end
|
|
||||||
--显示每条数据
|
|
||||||
function this.ShowGoldExperSortInfo(root,data,myRankData)
|
|
||||||
if data.rankInfo.param1 > 0 then
|
|
||||||
--local info1,info2=this.InitRollingInfo(root)
|
|
||||||
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.SetShowInfo(info1,info2,data.userName,RankingManager.mainLevelConfig[data.rankInfo.param1].Name)
|
|
||||||
--Util.GetGameObject(root,"Value0"):GetComponent("Text").text = "<size=40%>"..data.userName.."</size>"
|
|
||||||
this.SetInfoShow(Util.GetGameObject(root,"infoGo"),data,sData.rankType,Util.GetGameObject(root,"Value0"))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
--设置前三名背景头像
|
--设置前三名背景头像
|
||||||
function this.SetHeadsInfo(data,root,index,name,level)
|
function this.SetHeadsInfo(data,root,index,name,level)
|
||||||
if not this.playerHeadList[root] then
|
if not this.playerHeadList[root] then
|
||||||
|
|
@ -529,31 +200,17 @@ function this.SetHeadsInfo(data,root,index,name,level)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--初始化非滚动区信息
|
|
||||||
function this.InitNotRollingInfo()
|
|
||||||
this.firsthead:SetActive(false)
|
|
||||||
this.firstHeadName.text=""
|
|
||||||
--this.firstHeadinfoText.text=""
|
|
||||||
--this.titleName.text=""
|
|
||||||
--this.titleInfo.text=""
|
|
||||||
this.info0.text=""
|
|
||||||
this.info1.text=""
|
|
||||||
this.rank0.text=""
|
|
||||||
--this.rank1.text=""
|
|
||||||
end
|
|
||||||
--设置非滚动区信息
|
--设置非滚动区信息
|
||||||
function this.SetNotRollingInfo(...)
|
function this.SetNotRollingInfo(myRankData)
|
||||||
local args={...}
|
-- optional int32 rank = 1;
|
||||||
--this.titleName.text=args[1]--顶部信息
|
-- optional int64 param1 = 2;
|
||||||
--this.titleInfo.text=args[2]
|
-- optional int32 param2 = 3;
|
||||||
this.info0.text=args[3]--底部信息
|
-- optional int32 param3 = 4;
|
||||||
this.info1.text=args[4]
|
this.info0.text=Language[10104]
|
||||||
if not args[5] or args[5]<1 then--排名对比 <0未上榜
|
if not myRankData.rank or (myRankData.rank and myRankData.rank < 1) then--排名对比 <0未上榜
|
||||||
this.rank0.text = args[6] --未上榜
|
this.rank0.text = Language[10041] --未上榜
|
||||||
--this.rank1.text = args[7] --显示内容
|
|
||||||
else
|
else
|
||||||
this.rank0.text = args[8] --上榜
|
this.rank0.text = myRankData.rank --上榜
|
||||||
--this.rank1.text = args[9] --显示内容
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -561,10 +218,8 @@ end
|
||||||
--初始化滚动区信息
|
--初始化滚动区信息
|
||||||
function this.InitRollingInfo(_root)
|
function this.InitRollingInfo(_root)
|
||||||
local info0= Util.GetGameObject(_root,"Value0"):GetComponent("Text")
|
local info0= Util.GetGameObject(_root,"Value0"):GetComponent("Text")
|
||||||
--local info1= Util.GetGameObject(_root,"Value1"):GetComponent("Text")
|
|
||||||
info0.text=""
|
info0.text=""
|
||||||
--info1.text=""
|
return info0
|
||||||
return info0--,info1
|
|
||||||
end
|
end
|
||||||
--玩家信息弹窗
|
--玩家信息弹窗
|
||||||
function this.AddPlayerInfoClick(root,uid)
|
function this.AddPlayerInfoClick(root,uid)
|
||||||
|
|
@ -607,11 +262,6 @@ function this.SetHeadInfo(root,head,frame,level)
|
||||||
this.playerScrollHead[root]:SetLevel(level)
|
this.playerScrollHead[root]:SetLevel(level)
|
||||||
this.playerScrollHead[root]:SetScale(Vector3.one*0.7)
|
this.playerScrollHead[root]:SetScale(Vector3.one*0.7)
|
||||||
end
|
end
|
||||||
--设置显示信息
|
|
||||||
--function this.SetShowInfo(info1,info2,str1,str2)
|
|
||||||
-- info1.text="<size=40%>"..str1.."</size>"
|
|
||||||
-- info2.text="<size=40%>"..str2.."</size>"
|
|
||||||
--end
|
|
||||||
|
|
||||||
|
|
||||||
-- tab按钮自定义显示设置
|
-- tab按钮自定义显示设置
|
||||||
|
|
@ -632,13 +282,6 @@ function this.TabAdapter(tab, index, status)
|
||||||
txt:GetComponent("Text").color = _tabFontColor[status]
|
txt:GetComponent("Text").color = _tabFontColor[status]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--检查是否显示第一页 当切换页签时切换到第一页 当请求下一页时不跳转第一页
|
|
||||||
function this.CheckIsTop()
|
|
||||||
if this.istop then
|
|
||||||
this.scrollView:SetIndex(1)
|
|
||||||
this.istop =false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
--检查Tab是否解锁
|
--检查Tab是否解锁
|
||||||
function this.CheckTabCtrlIsLockP(index)
|
function this.CheckTabCtrlIsLockP(index)
|
||||||
local type = RankingManager.GetCurRankingInfo("Id",index)
|
local type = RankingManager.GetCurRankingInfo("Id",index)
|
||||||
|
|
@ -671,13 +314,15 @@ function this.SetInfoShow(go,data,rankType,Value0)
|
||||||
trial:SetActive(false)
|
trial:SetActive(false)
|
||||||
goldExper:SetActive(false)
|
goldExper:SetActive(false)
|
||||||
arenaScore:SetActive(false)
|
arenaScore:SetActive(false)
|
||||||
|
LogGreen("rankType "..rankType)
|
||||||
if rankType == RANK_TYPE.FIGHT_LEVEL_RANK then
|
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
|
if data.rankInfo.param1 and data.rankInfo.param1 > 0 then
|
||||||
fight:SetActive(true)
|
fight:SetActive(true)
|
||||||
if Value0 then
|
if Value0 then
|
||||||
Value0:GetComponent("Text").text = "<size=40%>"..data.userName.."</size>"
|
Value0:GetComponent("Text").text = "<size=40%>"..data.userName.."</size>"
|
||||||
end
|
end
|
||||||
Util.GetGameObject(go,"fight"):GetComponent("Text").text = RankingManager.mainLevelConfig[data.rankInfo.param1].Name
|
Util.GetGameObject(go,"fight"):GetComponent("Text").text = ConfigManager.GetConfigData(ConfigName.MainLevelConfig,data.rankInfo.param1).Name
|
||||||
end
|
end
|
||||||
elseif rankType == RANK_TYPE.FORCE_CURR_RANK then
|
elseif rankType == RANK_TYPE.FORCE_CURR_RANK then
|
||||||
if data.rankInfo.param1 and data.rankInfo.param1 >0 then
|
if data.rankInfo.param1 and data.rankInfo.param1 >0 then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue