miduo_client/Assets/ManagedResources/~Lua/Modules/Guild/Transcript/GuildTranscriptMainPopup.lua

555 lines
26 KiB
Lua
Raw Normal View History

2021-04-21 13:12:04 +08:00
require("Base/BasePanel")
2020-08-18 19:33:31 +08:00
GuildTranscriptMainPopup = Inherit(BasePanel)
local this = GuildTranscriptMainPopup
2020-08-19 17:28:17 +08:00
local guildCheckpointConfig = ConfigManager.GetConfig(ConfigName.GuildCheckpointConfig)
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
local cutOpenIndex = 0
local cutOpenIndexConFig
local cutOpenIndexMonsterConFig
local itemList = {}--优化itemView使用
local sorting = 0
2020-08-21 15:52:49 +08:00
local curBuyIndex = 0
2020-08-25 18:24:17 +08:00
local oldSelceParent
2020-08-22 15:34:02 +08:00
this.playerScrollHead={}--滚动条头像
2021-01-26 17:08:39 +08:00
local isplayAnim = true
2020-08-18 19:33:31 +08:00
--初始化组件(用于子类重写)
function GuildTranscriptMainPopup:InitComponent()
2021-04-21 13:12:04 +08:00
this.spLoader = SpriteLoader.New()
2021-01-26 17:08:39 +08:00
this.m_go = Util.GetGameObject(self.gameObject, "Panel")
2020-08-18 19:33:31 +08:00
--btn
2021-01-26 17:08:39 +08:00
this.backBtn = Util.GetGameObject(this.m_go, "btnBack")
this.helpBtn = Util.GetGameObject(this.m_go,"HelpBtn")
2020-08-18 19:33:31 +08:00
this.helpPos = this.helpBtn:GetComponent("RectTransform").localPosition
2021-01-26 17:08:39 +08:00
this.quickWarbtn = Util.GetGameObject(this.m_go,"quickWarbtn")
this.warbtn = Util.GetGameObject(this.m_go,"warbtn")
this.rankBun = Util.GetGameObject(this.m_go,"middleGo/rankBun")
this.sendBtn = Util.GetGameObject(this.m_go,"middleGo/sendBtn")
this.endNumBtn = Util.GetGameObject(this.m_go,"middleGo/endNumBtn")
2020-08-18 19:33:31 +08:00
--text
this.name = Util.GetGameObject(self.gameObject,"name"):GetComponent("Text")--军团副本
2021-03-02 16:53:12 +08:00
this.name.text = Language[11065]
2020-08-18 19:33:31 +08:00
this.rewardGoText1 = Util.GetGameObject(self.gameObject,"middleGo/rewardGo/tip/Text1"):GetComponent("Text")--单次奖励
this.rewardGoText2 = Util.GetGameObject(self.gameObject,"middleGo/rewardGo/tip/Text2"):GetComponent("Text")--击杀奖励
2020-08-21 15:52:49 +08:00
2021-01-26 17:08:39 +08:00
this.attackInfoBtn = Util.GetGameObject(this.m_go,"middleGo/attackInfo")
this.attackInfoText = Util.GetGameObject(this.m_go,"middleGo/attackInfo/attackInfoText"):GetComponent("Text")--全军团成员攻击力+16%
this.attackInfoTime = Util.GetGameObject(this.m_go,"middleGo/attackInfo/attackInfoTime"):GetComponent("Text")--08:52:24后失效
this.attackInfoTextGo = Util.GetGameObject(this.m_go,"middleGo/attackInfo/attackInfoText")
2020-08-21 15:52:49 +08:00
2021-01-26 17:08:39 +08:00
this.attackInfoTimeGO = Util.GetGameObject(this.m_go,"middleGo/attackInfo/attackInfoTime")
this.endNumText = Util.GetGameObject(this.m_go,"middleGo/endNumBtn/endNumBuyText"):GetComponent("Text")--剩余购买次数:3
this.endNumBuyText = Util.GetGameObject(this.m_go,"middleGo/endNumBtn/endNumText"):GetComponent("Text")--剩余次数:22
2020-08-18 19:33:31 +08:00
--boss
2021-01-26 17:08:39 +08:00
this.boss = Util.GetGameObject(this.m_go,"middleGo/boss")
2020-08-18 19:33:31 +08:00
this.bossHerobg=Util.GetGameObject(this.boss,"Bg1"):GetComponent("Image")
this.bossHerolive = Util.GetGameObject(this.boss, "Mask/icon"):GetComponent("RawImage")
this.bossHerohpPass = Util.GetGameObject(this.boss,"hpPass"):GetComponent("Image")
this.bossHerohpPassText = Util.GetGameObject(this.boss,"hpText"):GetComponent("Text")
2020-08-19 17:28:17 +08:00
--titlechapter
2021-01-26 17:08:39 +08:00
this.SelectImage = Util.GetGameObject(this.m_go, "upChapterGo/SelectImage")
local v2 = Util.GetGameObject(this.m_go, "upChapterGo/upChapter"):GetComponent("RectTransform").rect
this.titleScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(this.m_go, "upChapterGo/upChapter").transform,
Util.GetGameObject(this.m_go, "upChapterGo/singleChapterPre"), nil, Vector2.New(-v2.x*2, -v2.y*2), 2, 1, Vector2.New(10,10))
2020-08-19 17:28:17 +08:00
this.titleScrollView.moveTween.MomentumAmount = 1
this.titleScrollView.moveTween.Strength = 1
this.reward1 = Util.GetGameObject(self.gameObject, "middleGo/rewardGo/reward1")
this.reward2 = Util.GetGameObject(self.gameObject, "middleGo/rewardGo/reward2")
2020-08-20 20:05:38 +08:00
this.Empty = Util.GetGameObject(self.gameObject, "endGo/Empty")
2021-03-02 16:53:12 +08:00
Util.GetGameObject(self.gameObject, "endGo/Empty/Bg/Text"):GetComponent("Text").text = Language[11066]
2020-08-22 15:34:02 +08:00
--rank
2021-01-26 17:08:39 +08:00
local v2New = Util.GetGameObject(this.m_go, "endGo/rankList"):GetComponent("RectTransform").rect
this.rankScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(this.m_go, "endGo/rankList").transform,
Util.GetGameObject(this.m_go, "endGo/ItemPre"), nil, Vector2.New(906.8, 545.4), 1, 1, Vector2.New(0,0))
2020-08-22 15:34:02 +08:00
this.rankScrollView.moveTween.MomentumAmount = 1
this.rankScrollView.moveTween.Strength = 1
2021-04-21 13:12:04 +08:00
Util.GetGameObject(self.gameObject,"middleGo/rankBun"):GetComponent("Image").sprite=this.spLoader:LoadSprite("g_gonghui_paihangjianglianniu_zh")
Util.GetGameObject(self.gameObject,"middleGo/sendBtn"):GetComponent("Image").sprite=this.spLoader:LoadSprite("r_gonghui_jijiehaojiaoanniu_zh")
2021-01-26 17:08:39 +08:00
2020-08-19 17:28:17 +08:00
end
2020-08-18 19:33:31 +08:00
--绑定事件(用于子类重写)
function GuildTranscriptMainPopup:BindEvent()
Util.AddClick(this.helpBtn,function()
2020-08-20 20:05:38 +08:00
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.GuildTranscripe,this.helpPos.x,this.helpPos.y)
2020-08-18 19:33:31 +08:00
end)
Util.AddClick(this.backBtn,function()
2021-01-26 17:08:39 +08:00
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
2020-08-18 19:33:31 +08:00
self:ClosePanel()
end)
2020-08-19 17:28:17 +08:00
Util.AddClick(this.warbtn,function()
2020-08-22 13:49:47 +08:00
if GuildTranscriptManager.GetCanBattleCount() <=0 then --今日已无剩余次数!
if GuildTranscriptManager.GetCanBuyBattleCount() <= 0 then
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(Language[11067])
2020-08-22 13:49:47 +08:00
else--是否花费XX妖晶购买1次挑战次数并发起挑战
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP, GuildTranscriptManager.shopGoodId, 1)
2021-01-26 17:08:39 +08:00
local itemName = GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name)
2020-08-22 13:49:47 +08:00
if finalNum > BagManager.GetItemCountById(costId) then
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(string.format(Language[11068],itemName) )
2020-08-22 13:49:47 +08:00
return
end
2021-03-02 16:53:12 +08:00
MsgPanel.ShowTwo(string.format( Language[11069],finalNum,itemName), nil, function()
2020-08-22 13:49:47 +08:00
--买东西
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,GuildTranscriptManager.shopGoodId,1,function()
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(Language[10517])
2020-08-22 13:49:47 +08:00
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.GUILD_TRANSCRIPT)
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.GUILDTRANSCRIPT_BUY_BATTLENUM, 1)--更新特权
this.ShowEndNumInfo()
end)
end)
end
else
2020-08-20 20:05:38 +08:00
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.GUILD_TRANSCRIPT)
2020-08-22 13:49:47 +08:00
end
2020-08-19 17:28:17 +08:00
end)
Util.AddClick(this.quickWarbtn,function()
2020-08-22 13:49:47 +08:00
if GuildTranscriptManager.GetCanBattleCount() <=0 then --今日已无剩余次数!
if GuildTranscriptManager.GetCanBuyBattleCount() <= 0 then
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(Language[11067])
2020-08-22 13:49:47 +08:00
else--是否花费XX妖晶购买1次挑战次数并发起挑战
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP, GuildTranscriptManager.shopGoodId, 1)
2021-01-26 17:08:39 +08:00
local itemName = GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name)
2020-08-22 13:49:47 +08:00
if finalNum > BagManager.GetItemCountById(costId) then
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(string.format(Language[11068],itemName) )
2020-08-22 13:49:47 +08:00
return
end
2020-08-24 18:41:14 +08:00
--是否花费XX妖晶购买1次扫荡次数本次扫荡伤害为XXXXXX
2021-03-02 16:53:12 +08:00
MsgPanel.ShowTwo(string.format( Language[11070],finalNum,itemName,GuildTranscriptManager.damage), nil, function()
2020-08-22 13:49:47 +08:00
--买东西
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,GuildTranscriptManager.shopGoodId,1,function()
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(Language[11071])
2020-08-22 13:49:47 +08:00
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.GUILDTRANSCRIPT_BUY_BATTLENUM, 1)--更新特权
this.QuickWar()
this.ShowEndNumInfo()
end)
end)
end
else
2021-03-02 16:53:12 +08:00
MsgPanel.ShowTwo(string.format( Language[11072],GuildTranscriptManager.damage), nil, function()
2020-08-20 20:05:38 +08:00
this.QuickWar()
2020-08-22 13:49:47 +08:00
end)
end
2020-08-20 20:05:38 +08:00
end)
Util.AddClick(this.endNumBtn,function()
2020-08-21 18:22:53 +08:00
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP, GuildTranscriptManager.shopGoodId, 1)
2021-01-26 17:08:39 +08:00
local itemName =GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name)
2020-08-21 18:22:53 +08:00
if finalNum > BagManager.GetItemCountById(costId) then
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(string.format(Language[11068],itemName) )
2020-08-21 18:22:53 +08:00
return
end
2020-08-24 18:41:14 +08:00
if GuildTranscriptManager.GetCanBuyBattleCount() <= 0 then
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(Language[11073])
2020-08-24 18:41:14 +08:00
return
end
2021-03-02 16:53:12 +08:00
MsgPanel.ShowTwo(string.format( Language[10516],finalNum,itemName), nil, function()
2020-08-21 18:22:53 +08:00
--买东西
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,GuildTranscriptManager.shopGoodId,1,function()
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(Language[10517])
2020-08-21 18:22:53 +08:00
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.GUILDTRANSCRIPT_BUY_BATTLENUM, 1)--更新特权
this.ShowEndNumInfo()
2020-08-20 20:05:38 +08:00
end)
2020-08-21 18:22:53 +08:00
end)
2020-08-19 17:28:17 +08:00
end)
-- GuildTranscriptRewardSortPanel
Util.AddClick(this.rankBun,function()
2020-08-21 15:52:49 +08:00
UIManager.OpenPanel(UIName.GuildTranscriptRewardSortPanel,cutOpenIndex)
2020-08-20 20:05:38 +08:00
end)
Util.AddClick(this.sendBtn,function()
local pos = MyGuildManager.GetMyPositionInGuild()
--LogGreen("pos "..pos)
2020-08-21 18:22:53 +08:00
if pos == GUILD_GRANT.MEMBER then
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(Language[11074])
2020-08-20 20:05:38 +08:00
return
end
if cutOpenIndex ~= GuildTranscriptManager.GetCurBoss() then
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(Language[11075])
2020-08-20 20:05:38 +08:00
return
end
2020-08-21 18:22:53 +08:00
NetManager.GuildChallengeMessageResponse(function (msg)
--LogGreen("msg.nextTime "..msg.nextTime.." PlayerManager.serverTime "..PlayerManager.serverTime)
2020-08-21 19:09:33 +08:00
local second = msg.nextTime - PlayerManager.serverTime
if second <= 0 then
2020-08-20 20:05:38 +08:00
ChatManager.RequestSendGuildTranscript(function()
end)
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(Language[11076])
2020-08-20 20:05:38 +08:00
else
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(string.format(Language[11077],TimeToMS(second)))
2020-08-20 20:05:38 +08:00
end
end)
2020-08-19 17:28:17 +08:00
end)
2020-08-21 15:52:49 +08:00
Util.AddClick(this.attackInfoBtn,function()
local curguildCheckpointConfig = guildCheckpointConfig[GuildTranscriptManager.GetCurBoss()]
local nextBuyIndex = curBuyIndex + 1
2020-08-22 13:49:47 +08:00
local itemId = curguildCheckpointConfig.AttributePromotePrice[1][1]
local buyNum = curguildCheckpointConfig.AttributePromotePrice[2][nextBuyIndex]
2021-01-26 17:08:39 +08:00
local itemName = GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.ItemConfig,itemId).Name)
2020-08-24 18:41:14 +08:00
if not buyNum then
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(Language[11078])
2020-08-24 18:41:14 +08:00
return
end
2020-08-22 13:49:47 +08:00
if buyNum > BagManager.GetItemCountById(itemId) then
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(string.format(Language[11068],itemName) )
2020-08-22 13:49:47 +08:00
return
end
2020-08-21 15:52:49 +08:00
if curguildCheckpointConfig.AttributePromotePrice[2][nextBuyIndex] then
local addNum = ConfigManager.GetConfigData(ConfigName.FoodsConfig,curguildCheckpointConfig.AttributePromote[nextBuyIndex]).EffectPara
2021-03-02 16:53:12 +08:00
MsgPanel.ShowTwo(string.format(Language[11079],buyNum,itemName,math.floor(addNum[1][2]/100) ).."%", nil, function()
2020-08-21 15:52:49 +08:00
--买东西
NetManager.GuildChallengeBuyBuffRequest()
end)
else
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(Language[11080])
2020-08-21 15:52:49 +08:00
end
end)
2020-08-18 19:33:31 +08:00
end
function GuildTranscriptMainPopup:AddListener()
2020-08-19 17:28:17 +08:00
Game.GlobalEvent:AddEvent(GameEvent.Guild.RefreshGuildTranscript, this.ShowPanelData)
2020-08-21 15:52:49 +08:00
Game.GlobalEvent:AddEvent(GameEvent.Guild.RefreshGuildTranscriptBuff, this.ShowBuffData)
Game.GlobalEvent:AddEvent(GameEvent.Guild.RefreshGuildTranscripQuickBtn, this.ShowQuickBtnData)
2020-08-18 19:33:31 +08:00
end
--移除事件监听(用于子类重写)
function GuildTranscriptMainPopup:RemoveListener()
2020-08-19 17:28:17 +08:00
Game.GlobalEvent:RemoveEvent(GameEvent.Guild.RefreshGuildTranscript, this.ShowPanelData)
2020-08-21 15:52:49 +08:00
Game.GlobalEvent:RemoveEvent(GameEvent.Guild.RefreshGuildTranscriptBuff, this.ShowBuffData)
Game.GlobalEvent:RemoveEvent(GameEvent.Guild.RefreshGuildTranscripQuickBtn, this.ShowQuickBtnData)
2020-08-18 19:33:31 +08:00
end
--界面打开时调用(用于子类重写)
function GuildTranscriptMainPopup:OnOpen(_curIndex)
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function GuildTranscriptMainPopup:OnShow()
2021-01-26 17:08:39 +08:00
isplayAnim = true
if isplayAnim then
this.rankScrollView:ForeachItemGO(function (index, go)
go.gameObject:SetActive(false)
end)
end
2020-08-20 20:05:38 +08:00
this.ShowBossInfo()
this.ShowEndNumInfo()
GuildTranscriptManager.GetGuildChallengeInfoRequest()
2020-08-19 17:28:17 +08:00
end
function this.ShowPanelData()
cutOpenIndex = GuildTranscriptManager.GetCurBoss()
this.ShowTitleChapterInfo()
this.ShowPanelInfo(cutOpenIndex)
end
function GuildTranscriptMainPopup:OnSortingOrderChange()
for i, v in pairs(itemList) do
for j = 1, #v do
v[j]:SetEffectLayer(self.sortingOrder)
end
end
sorting = self.sortingOrder
end
function this.ShowTitleChapterInfo()
local allConFigData = GuildTranscriptManager.GetAllConFigData()
this.SelectImage:SetActive(false)
2020-08-19 17:28:17 +08:00
this.titleScrollView:SetData(allConFigData, function (index, go)
this.SingleChapterDataShow(go, allConFigData[index])
2021-02-26 14:52:59 +08:00
end,true,true)
2020-08-19 17:28:17 +08:00
this.titleScrollView:SetIndex(cutOpenIndex)
end
2020-08-22 15:34:02 +08:00
local rankingInfo,myRankingInfo
local firstDamage = 0
function this.ShowRankingListInfo()
rankingInfo,myRankingInfo = RankingManager.GetRankingInfo()
--LogGreen("#rankingInfo "..#rankingInfo)
2020-08-22 15:34:02 +08:00
this.Empty:SetActive(#rankingInfo == 0)
Util.GetGameObject(this.gameObject, "endGo/rankList"):SetActive(#rankingInfo ~= 0)
if #rankingInfo > 0 then
firstDamage = rankingInfo[1].rankInfo.param1
end
this.rankScrollView :SetData(rankingInfo, function (index, go)
this.SingleRankingInfoShow(go, rankingInfo[index])
2021-02-26 14:52:59 +08:00
end,false,true)
-- this.rankScrollView:SetIndex(1)
2020-08-22 15:34:02 +08:00
end
2020-08-19 17:28:17 +08:00
function this.SingleChapterDataShow(go,data)
2021-01-26 17:08:39 +08:00
Util.GetGameObject(go,"title/Text"):GetComponent("Text").text = GetLanguageStrById(data.Remarks)
2020-08-19 17:28:17 +08:00
local lock = Util.GetGameObject(go,"lock")
local mask = Util.GetGameObject(go,"mask")
local monsterData = this.GetMonsterConfigDataById(data.MonsterId)
if not monsterData then return end
2021-04-21 13:12:04 +08:00
Util.GetGameObject(go,"icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetResourcePath(heroConfig[monsterData.MonsterId].Icon))
2020-08-25 18:24:17 +08:00
if GuildTranscriptManager.GetCurBoss() > data.Id then--已打过
2020-08-19 17:28:17 +08:00
Util.SetGray(go, true)
lock:SetActive(false)
mask:SetActive(false)
2020-08-25 18:24:17 +08:00
elseif GuildTranscriptManager.GetCurBoss() == data.Id then--已开启
2020-08-19 17:28:17 +08:00
Util.SetGray(go, false)
lock:SetActive(false)
mask:SetActive(false)
else--未开启
Util.SetGray(go, false)
lock:SetActive(true)
mask:SetActive(true)
end
2020-08-25 18:24:17 +08:00
if cutOpenIndex == data.Id then
2020-08-22 18:03:43 +08:00
this.SetSelectImagePos(go)
2020-08-25 18:24:17 +08:00
elseif oldSelceParent == go then
this.SelectImage:SetActive(false)
2020-08-22 18:03:43 +08:00
end
2020-08-19 17:28:17 +08:00
Util.AddOnceClick(Util.GetGameObject(go,"click"),function()
if data.Id > GuildTranscriptManager.GetCurBoss() then
2021-03-02 16:53:12 +08:00
return PopupTipPanel.ShowTip(Language[11081])
2020-08-19 17:28:17 +08:00
end
this.ShowPanelInfo(data.Id)
2020-08-22 18:03:43 +08:00
this.SetSelectImagePos(go)
2020-08-22 15:34:02 +08:00
end)
end
function this.SingleRankingInfoShow(root,rankData)
2021-03-01 15:09:10 +08:00
-- if isplayAnim then
-- root.gameObject:SetActive(false)
-- else
2021-01-26 17:08:39 +08:00
root.gameObject:SetActive(true)
2021-03-01 15:09:10 +08:00
-- end
2020-08-22 15:34:02 +08:00
--排名
local rank = rankData.rankInfo.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)
if rank > 100 then
rank="100+"
end
Util.GetGameObject(sortNumTabs[4], "TitleText"):GetComponent("Text").text = rank
end
--头像
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(rankData.head)
this.playerScrollHead[root]:SetFrame(rankData.headFrame)
this.playerScrollHead[root]:SetLevel(rankData.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.75)
2020-08-22 15:34:02 +08:00
--
Util.GetGameObject(root, "name"):GetComponent("Text").text = rankData.userName
Util.GetGameObject(root, "progressbar/progress1"):GetComponent("Image").fillAmount = math.floor((rankData.rankInfo.param1/firstDamage)*100)/100
Util.GetGameObject(root, "progressbar/num"):GetComponent("Text").text = rankData.rankInfo.param1--.."/"..firstDamage
2020-08-22 18:03:43 +08:00
Util.GetGameObject(root, "SelfBG"):SetActive(PlayerManager.uid == rankData.uid)
2020-08-22 15:34:02 +08:00
local clickBtn=Util.GetGameObject(root,"ClickBtn")
Util.AddOnceClick(clickBtn,function()
UIManager.OpenPanel(UIName.PlayerInfoPopup, rankData.uid)
2020-08-19 17:28:17 +08:00
end)
2021-01-26 17:08:39 +08:00
2020-08-19 17:28:17 +08:00
end
function this.ShowPanelInfo(chapterId)
2020-08-22 15:34:02 +08:00
cutOpenIndex = chapterId
2020-08-21 15:52:49 +08:00
this.ShowQuickBtnData()
2020-08-20 20:05:38 +08:00
this.ShowEndNumInfo()
2020-08-19 17:28:17 +08:00
cutOpenIndexConFig = guildCheckpointConfig[cutOpenIndex]
cutOpenIndexMonsterConFig =this.GetMonsterConfigDataById(guildCheckpointConfig[cutOpenIndex].MonsterId)
this.ShowBossInfo()
this.ShowRewardInfo()
2020-08-18 19:33:31 +08:00
end
2020-08-21 15:52:49 +08:00
function this.ShowQuickBtnData()
local canSweep = GuildTranscriptManager.GetCanSweep() == 1 and true or false
local isEqualityChapter = cutOpenIndex == GuildTranscriptManager.GetCurBoss() and true or false
--LogGreen("canSweep "..tostring(canSweep).." isEqualityChapter "..tostring(isEqualityChapter))
2020-08-21 15:52:49 +08:00
this.quickWarbtn:GetComponent("Button").enabled = canSweep and isEqualityChapter
this.warbtn:GetComponent("Button").enabled = isEqualityChapter
Util.SetGray(this.quickWarbtn,not (canSweep and isEqualityChapter))
Util.SetGray(this.warbtn,not isEqualityChapter)
2020-08-22 18:03:43 +08:00
RankingManager.InitData(RANK_TYPE.GUILDTRANSCRIPT,function()
this.ShowRankingListInfo()
end,cutOpenIndex)
2020-08-21 15:52:49 +08:00
end
2020-08-18 19:33:31 +08:00
--显示boss立绘信息
function this.ShowBossInfo()
2020-08-19 17:28:17 +08:00
if not cutOpenIndexMonsterConFig then return end
local curheroConfig = heroConfig[cutOpenIndexMonsterConFig.MonsterId]
2021-04-21 13:12:04 +08:00
this.bossHerobg.sprite = this.spLoader:LoadSprite(GetHeroCardStarBg[curheroConfig.Star])
2020-08-19 17:28:17 +08:00
this.bossHerohpPass.fillAmount = GuildTranscriptManager.GetBlood()/10000
this.bossHerohpPassText.text = GuildTranscriptManager.GetBlood()/100 .."%"
2020-08-24 18:41:14 +08:00
if cutOpenIndex < GuildTranscriptManager.GetCurBoss() then
2021-03-02 16:53:12 +08:00
this.bossHerohpPassText.text = Language[11082]
2020-08-25 18:24:17 +08:00
this.bossHerohpPass.fillAmount = 0
2020-08-24 18:41:14 +08:00
end
2020-08-19 17:28:17 +08:00
local liveName = GetResourcePath(curheroConfig.Live)
local roleConfig = ConfigManager.GetConfigData(ConfigName.RoleConfig, curheroConfig.Id)
2020-08-18 19:33:31 +08:00
local scale = roleConfig.play_liveScale
local livePos = Vector3.New(roleConfig.offset[1], roleConfig.offset[2], 0)
2020-08-19 17:28:17 +08:00
this.bossHerolive.texture = CardRendererManager.GetSpineTexture(1, liveName, Vector3.one * scale, livePos, true)
this.bossHerolive.transform.localScale = Vector3.one
this.bossHerolive.transform.localPosition = Vector3.zero * 0.6
end
2020-08-18 19:33:31 +08:00
2020-08-19 17:28:17 +08:00
function this.ShowRewardInfo()
-- guildCheckpointConfig[cutOpenIndex]
if not itemList[this.reward1.name] then
itemList[this.reward1.name] = {}
end
if not itemList[this.reward2.name] then
itemList[this.reward2.name] = {}
end
for i = 1, #itemList[this.reward1.name] do
itemList[this.reward1.name][i].gameObject:SetActive(false)
end
for i = 1, #itemList[this.reward1.name] do
itemList[this.reward1.name][i].gameObject:SetActive(false)
end
local reward1Data = ConfigManager.GetConfigData(ConfigName.RewardGroup,cutOpenIndexConFig.Reward).ShowItem
local reward2Data = ConfigManager.GetConfigData(ConfigName.RewardGroup,cutOpenIndexConFig.KillReward).ShowItem
2020-08-20 20:05:38 +08:00
--96
reward2Data[2] = {96,cutOpenIndexConFig.LegionExp}
2020-08-19 17:28:17 +08:00
for i = 1, #reward1Data do
if itemList[this.reward1.name][i] then
2020-08-24 18:41:14 +08:00
itemList[this.reward1.name][i]:OnOpen(false, reward1Data[i], 0.7,false,false,false,sorting)
2020-08-19 17:28:17 +08:00
else
itemList[this.reward1.name][i] = SubUIManager.Open(SubUIConfig.ItemView, this.reward1.transform)
2020-08-24 18:41:14 +08:00
itemList[this.reward1.name][i]:OnOpen(false, reward1Data[i], 0.7,false,false,false,sorting)
2020-08-19 17:28:17 +08:00
end
itemList[this.reward1.name][i].gameObject:SetActive(true)
end
for i = 1, #reward2Data do
if itemList[this.reward2.name][i] then
2020-08-24 18:41:14 +08:00
itemList[this.reward2.name][i]:OnOpen(false, reward2Data[i], 0.7,false,false,false,sorting)
2020-08-19 17:28:17 +08:00
else
itemList[this.reward2.name][i] = SubUIManager.Open(SubUIConfig.ItemView, this.reward2.transform)
2020-08-24 18:41:14 +08:00
itemList[this.reward2.name][i]:OnOpen(false, reward2Data[i], 0.7,false,false,false,sorting)
2020-08-19 17:28:17 +08:00
end
itemList[this.reward2.name][i].gameObject:SetActive(true)
end
2020-08-18 19:33:31 +08:00
end
2020-08-19 17:28:17 +08:00
function this.GetMonsterConfigDataById(MonsterId)
local monsterConFig = nil
local monsterGrip = ConfigManager.GetConfigData(ConfigName.MonsterGroup,MonsterId)
if not monsterGrip then return nil end
local monsterId = 0
for i = 1, #monsterGrip.Contents do
if monsterId <= 0 then
for j = 1, #monsterGrip.Contents[i] do
if monsterGrip.Contents[i][j] > 0 then
monsterId = monsterGrip.Contents[i][j]
break
end
end
end
end
if monsterId <= 0 then return nil end
local monsterData = ConfigManager.GetConfigData(ConfigName.MonsterConfig,monsterId)
return monsterData
end
2020-08-20 20:05:38 +08:00
function this.ShowEndNumInfo()
2021-03-02 16:53:12 +08:00
this.endNumText.text = Language[11083] .. GuildTranscriptManager.GetCanBattleCount()
this.endNumBuyText.text = Language[11084] .. GuildTranscriptManager.GetCanBuyBattleCount()
2020-08-20 20:05:38 +08:00
end
function this.QuickWar()
GuildTranscriptManager.GuildChallengeRequest(1,function()
this.ShowPanelData()
2020-08-21 15:52:49 +08:00
this.ShowEndNumInfo()
2020-08-22 18:03:43 +08:00
RankingManager.InitData(RANK_TYPE.GUILDTRANSCRIPT,function()
this.ShowRankingListInfo()
end,GuildTranscriptManager.GetCurBoss())
2020-08-20 20:05:38 +08:00
end)
end
2020-08-21 15:52:49 +08:00
function this.ShowBuffData()
curBuyIndex = GuildTranscriptManager.GetbuffCount()
local curguildCheckpointConfig = guildCheckpointConfig[GuildTranscriptManager.GetCurBoss()]
local attackBuffNum = 0
if curBuyIndex > 0 then
local addNum = ConfigManager.GetConfigData(ConfigName.FoodsConfig,curguildCheckpointConfig.AttributePromote[curBuyIndex]).EffectPara
attackBuffNum = math.floor(addNum[1][2]/100)
end
local GetbuffTime = GuildTranscriptManager.GetbuffTime() > 0 and GuildTranscriptManager.GetbuffTime() - PlayerManager.serverTime or 0
2020-08-24 18:41:14 +08:00
if attackBuffNum == 0 then
--<color=#FCF5D3FF>%s</color>
2021-03-02 16:53:12 +08:00
this.attackInfoText.text = Language[11085]
2020-08-24 18:41:14 +08:00
else
2021-03-02 16:53:12 +08:00
this.attackInfoText.text = string.format(Language[11086],attackBuffNum).."%</color>"
2020-08-24 18:41:14 +08:00
end
2020-08-21 15:52:49 +08:00
this.RemainTimeDown(this.attackInfoTime, GetbuffTime)
end
this.timer = Timer.New()
--刷新倒计时显示
function this.RemainTimeDown(_timeTextExpert,timeDown)
if timeDown > 0 then
2020-08-22 15:34:02 +08:00
-- if this.attackInfoTimeGo then
-- this.attackInfoTimeGo:SetActive(true)
-- end
2020-08-21 15:52:49 +08:00
if _timeTextExpert then
_timeTextExpert.text = this.TimeStampToDateString(timeDown)
end
if this.timer then
this.timer:Stop()
this.timer = nil
end
this.timer = Timer.New(function()
if _timeTextExpert then
_timeTextExpert.text = this.TimeStampToDateString(timeDown)
end
if timeDown < 0 then
2020-08-22 15:34:02 +08:00
_timeTextExpert.text = ""
2021-03-02 16:53:12 +08:00
this.attackInfoText.text = Language[11085]
2020-08-22 15:34:02 +08:00
-- if this.attackInfoTimeGo then
-- this.attackInfoTimeGo:SetActive(false)
-- end
2020-08-21 15:52:49 +08:00
this.timer:Stop()
this.timer = nil
end
timeDown = timeDown - 1
end, 1, -1, true)
this.timer:Start()
else
2020-08-26 09:40:32 +08:00
if this.timer then
this.timer:Stop()
this.timer = nil
end
2020-08-22 15:34:02 +08:00
_timeTextExpert.text = ""
2021-03-02 16:53:12 +08:00
this.attackInfoText.text = Language[11085]
-- --LogGreen("ssssssssss")
2020-08-22 15:34:02 +08:00
-- if this.attackInfoTimeGo then
-- --LogGreen("ssssssssss2")
2020-08-22 15:34:02 +08:00
-- this.attackInfoTimeGo:SetActive(false)
-- end
2020-08-21 15:52:49 +08:00
end
end
function this.TimeStampToDateString(second)
2021-03-02 16:53:12 +08:00
return string.format(Language[11087],TimeToHMS(second))
2020-08-21 15:52:49 +08:00
end
2020-08-22 18:03:43 +08:00
function this.SetSelectImagePos(parent)
2020-08-25 18:24:17 +08:00
oldSelceParent = parent
2020-08-22 19:08:50 +08:00
Util.SetGray(this.SelectImage,false)
2020-08-24 18:41:14 +08:00
this.SelectImage:SetActive(true)
2020-08-22 18:03:43 +08:00
this.SelectImage.transform:SetParent(Util.GetGameObject(parent, "GameObject").transform)
this.SelectImage:GetComponent("RectTransform").localPosition = Vector3.zero
this.SelectImage:GetComponent("RectTransform").localScale = Vector3.New(1,1,1)
end
2020-08-18 19:33:31 +08:00
--界面关闭时调用(用于子类重写)
function GuildTranscriptMainPopup:OnClose()
end
--界面销毁时调用(用于子类重写)
function GuildTranscriptMainPopup:OnDestroy()
2021-04-21 13:12:04 +08:00
this.spLoader:Destroy()
2020-08-19 17:28:17 +08:00
itemList = {}
2020-08-21 15:52:49 +08:00
if this.timer then
this.timer:Stop()
this.timer = nil
end
2020-08-18 19:33:31 +08:00
end
2021-04-21 13:12:04 +08:00
return GuildTranscriptMainPopup