miduo_client/Assets/ManagedResources/~Lua/Modules/Guild/GuildMainCityPanel.lua

646 lines
25 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

require("Base/BasePanel")
--屏蔽车迟斗法七天限制
local limitTime=PlayerManager.GetServerOpenTime() -- + 7*24*60*60
local _GuildBuildConfig = {
[GUILD_MAP_BUILD_TYPE.HOUSE] = {
isOpen = true,
rpType = RedPointType.Guild_House,
btnName = "btnHouse",
btnFunc = function()
UIManager.OpenPanel(UIName.GuildInfoPopup)
end,
},
[GUILD_MAP_BUILD_TYPE.STORE] = {
isOpen = true,
rpType = RedPointType.Guild_Shop,
btnName = "btnShop",
btnFunc = function()
local isActive = ShopManager.IsActive(SHOP_TYPE.GUILD_SHOP)
if not isActive then
PopupTipPanel.ShowTip(Language[10908])
return
end
UIManager.OpenPanel(UIName.MainShopPanel, SHOP_TYPE.GUILD_SHOP)
end,
},
[GUILD_MAP_BUILD_TYPE.FETE] = { --祭祀
isOpen = true,
rpType = RedPointType.Guild_Fete,
btnName = "btnFete",
btnFunc = function ()
UIManager.OpenPanel(UIName.GuildFetePopup)
end,
},
[GUILD_MAP_BUILD_TYPE.TENPOS] = { --十绝阵
isOpen = true,
rpType = RedPointType.Guild_DeathPos,
btnName = "btnTenPos",
btnFunc = function()
if DeathPosManager.status==DeathPosStatus.Death then
PopupTipPanel.ShowTip(Language[10909])
return
elseif DeathPosManager.status==DeathPosStatus.Close then
PopupTipPanel.ShowTip(Language[10910])
return
end
UIManager.OpenPanel(UIName.DeathPosPanel)
end,
},
[GUILD_MAP_BUILD_TYPE.SKILL] = { --技能
isOpen = false,
rpType = RedPointType.Guild_Skill,
btnName = "btnSkill",
btnFunc = function()
UIManager.OpenPanel(UIName.GuildSkillUpLvPopup)
end,
},
[GUILD_MAP_BUILD_TYPE.CARDELAY] = { --车迟斗法
isOpen = true,
rpType = RedPointType.LegendExplore,
btnName = "btnCarDelay",
btnFunc = function()
if limitTime>GetTimeStamp() then
return
end
if ActTimeCtrlManager.IsQualifiled(FUNCTION_OPEN_TYPE.CARDELAY) then
if PlayerManager.familyId == 0 then
PopupTipPanel.ShowTip(Language[10278])
return
end
UIManager.OpenPanel(UIName.GuildCarDelayMainPanel)
else
PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.CARDELAY))
end
end,
},
[GUILD_MAP_BUILD_TYPE.AID] = { --援助
isOpen = true,
rpType = RedPointType.Guild_Aid,
btnName = "btnAid",
btnFunc = function()
UIManager.OpenPanel(UIName.GuildAidMainPopup)
end,
},
[GUILD_MAP_BUILD_TYPE.TRANSCRIPT] = { --公会副本
isOpen = true,
rpType = RedPointType.Guild_Transcript,
btnName = "btntranscript",
btnFunc = function()
UIManager.OpenPanel(UIName.GuildTranscriptMainPopup)
end,
}
}
local GuildMainCityPanel = Inherit(BasePanel)
local this = GuildMainCityPanel
local _StageNameIcon = {
[GUILD_FIGHT_STAGE.DEFEND] = {"r_gonghui_bufangjieduan"},
[GUILD_FIGHT_STAGE.MATCHING] = {"r_gonghui_pipeijieduan"},
[GUILD_FIGHT_STAGE.ATTACK] = {"r_gonghui_jingongjieduan"},
[GUILD_FIGHT_STAGE.COUNTING] = {"r_gonghui_jiesuanjieduan", "r_gonghui_jiesuanwancheng"},
[GUILD_FIGHT_STAGE.EMPTEY] = {"r_gonghui_bencilunkong"},
}
--初始化组件(用于子类重写)
function GuildMainCityPanel:InitComponent()
this.spLoader = SpriteLoader.New()
this.btnBack = Util.GetGameObject(self.transform, "btnBack")
this.btnHelp = Util.GetGameObject(self.gameObject, "btnHelp")
this.helpPosition=this.btnHelp:GetComponent("RectTransform").localPosition
this.stageView = Util.GetGameObject(self.transform, "layout/panel1")
this.stageName = Util.GetGameObject(this.stageView, "stage/name"):GetComponent("Image")
this.stageTime = Util.GetGameObject(this.stageView, "stage/time"):GetComponent("Text")
this.myGuild = Util.GetGameObject(this.stageView, "stage/my")
this.enemyGuild = Util.GetGameObject(this.stageView, "stage/enemy")
this.myStar = Util.GetGameObject(this.stageView, "stage/my/starNum"):GetComponent("Text")
this.enemyStar = Util.GetGameObject(this.stageView, "stage/enemy/starNum"):GetComponent("Text")
this.rightBox = Util.GetGameObject(self.transform, "layout/panel2/btnbox")
this.btnOneKeyDefend = Util.GetGameObject(this.rightBox, "oneKeyDefend")
this.btnCheckDefend = Util.GetGameObject(this.rightBox, "checkDefend")
this.btnMatching = Util.GetGameObject(this.rightBox, "matching")
this.btnAttack = Util.GetGameObject(this.rightBox, "attack")
this.btnAttackLog = Util.GetGameObject(this.rightBox, "attackLog")
this.btnResult = Util.GetGameObject(this.rightBox, "result")
this.btnRedPacket=Util.GetGameObject(this.rightBox,"redPacket")
this.btnRedPacketRedPoint=Util.GetGameObject(this.btnRedPacket,"redPoint")
this.btnRedPacket:SetActive(false)
this.timeCount = Util.GetGameObject(self.transform,"Bg/btnCarDelay/Time")
this.timeText = Util.GetGameObject(this.timeCount,"Text"):GetComponent("Text")
if not this.playerInfoView then
this.playerInfoView = SubUIManager.Open(SubUIConfig.PlayerInfoView, this.transform)
end
-- 聊天
this.ChatTipView = SubUIManager.Open(SubUIConfig.ChatTipView, self.transform, 2)
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft })
-- Util.GetGameObject(this.UpView.transform,"upFrame"):SetActive(true)
this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.gameObject.transform)
for type, data in pairs(_GuildBuildConfig) do
if data.btnName then
local btn = Util.GetGameObject(self.gameObject, "Bg/"..data.btnName)
if btn then
btn:SetActive(data.isOpen)
if data.isOpen then
if data.btnFunc then
Util.AddOnceClick(btn, data.btnFunc)
end
if data.rpType then
BindRedPointObject(data.rpType, Util.GetGameObject(btn, "flag/redpot"))
end
end
end
end
end
--副本立绘
this.btntranscriptLive = Util.GetGameObject(self.gameObject, "Bg/btntranscript/live2d")
end
--绑定事件(用于子类重写)
function GuildMainCityPanel:BindEvent()
Util.AddClick(this.btnBack, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
this:ClosePanel()
end)
--帮助按钮
Util.AddClick(this.btnHelp, function()
UIManager.OpenPanel(UIName.HelpPopup, HELP_TYPE.Guilds, this.helpPosition.x, this.helpPosition.y)
end)
-- 一键布防
Util.AddClick(this.btnOneKeyDefend, function()
-- 判断是否已经上阵
local defendData = GuildFightManager.GetDefendStagePlayerBuildType(PlayerManager.uid)
if defendData then
PopupTipPanel.ShowTip(Language[10911])
return
end
-- 判断编队是否符合条件
local curFormationIndex = FormationManager.curFormationIndex
local formationList = FormationManager.GetFormationByID(curFormationIndex)
if #formationList.teamHeroInfos < 5 then
UIManager.OpenPanel(UIName.FormationPanel, FORMATION_TYPE.GUILD_DEFEND, "DEFEND", 0)
PopupTipPanel.ShowTip(Language[10912])
return
end
-- 布防到随机建筑
GuildFightManager.RequestDefend(0, function()
-- 刷新编队信息
FormationManager.RefreshFormationData()
PopupTipPanel.ShowTip(Language[10726])
end)
end)
-- 查看布防
Util.AddClick(this.btnCheckDefend, function()
local curStage = GuildFightManager.GetCurFightStage()
if curStage == GUILD_FIGHT_STAGE.DEFEND then
GuildFightManager.RequestDefendStageData(function()
UIManager.OpenPanel(UIName.GuildFightDefendInfoPopup)
end)
end
end)
-- 去进攻
Util.AddClick(this.btnAttack, function()
local curStage = GuildFightManager.GetCurFightStage()
if curStage == GUILD_FIGHT_STAGE.ATTACK then
GuildFightManager.RequestAttackStageDefendData(function()
UIManager.OpenPanel(UIName.GuildFightAttackInfoPopup, GUILD_FIGHT_GUILD_TYPE.ENEMY)
end)
end
end)
-- 查看进攻日志
Util.AddClick(this.btnAttackLog, function()
-- 请求排名信息,也就是进攻日志
UIManager.OpenPanel(UIName.GuildFightAttackLogPopup)
end)
-- 查看结果
Util.AddClick(this.btnResult, function()
GuildFightManager.RequestGuildFightResultData(function()
UIManager.OpenPanel(UIName.GuildFightResultPopup)
end)
end)
--公会红包
Util.AddClick(this.btnRedPacket,function()
UIManager.OpenPanel(UIName.RedPacketPanel)
end)
-- 绑定红点
BindRedPointObject(RedPointType.Guild_RedPacket, this.btnRedPacketRedPoint)
end
--添加事件监听(用于子类重写)
function GuildMainCityPanel:AddListener()
-- ctrlView.AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Guild.OnQuitGuild, this.OnQuitGuild)
Game.GlobalEvent:AddEvent(GameEvent.Guild.BeKickOut, this.OnQuitGuild)
Game.GlobalEvent:AddEvent(GameEvent.Guild.DismissStatusChanged, this.RefreshStageShow)
Game.GlobalEvent:AddEvent(GameEvent.GuildFight.FightBaseDataUpdate, this.RefreshStageShow)
Game.GlobalEvent:AddEvent(GameEvent.GuildFight.EnemyBaseDataUpdate, this.RefreshGuildInfo)
Game.GlobalEvent:AddEvent(GameEvent.GuildFight.ResultDataUpdate, this.RefreshGuildInfo)
Game.GlobalEvent:AddEvent(GameEvent.GuildFight.AttackStageDefendDataUpdate, this.RefreshGetStar)
Game.GlobalEvent:AddEvent(GameEvent.GuildRedPacket.OnCloseRedPointClick, this.CloseRedPointClick)
Game.GlobalEvent:AddEvent(GameEvent.Guild.RefreshDeathPosStatus, this.RefreshDeathPos)
end
--移除事件监听(用于子类重写)
function GuildMainCityPanel:RemoveListener()
-- ctrlView.RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Guild.OnQuitGuild, this.OnQuitGuild)
Game.GlobalEvent:RemoveEvent(GameEvent.Guild.BeKickOut, this.OnQuitGuild)
Game.GlobalEvent:RemoveEvent(GameEvent.Guild.DismissStatusChanged, this.RefreshStageShow)
Game.GlobalEvent:RemoveEvent(GameEvent.GuildFight.FightBaseDataUpdate, this.RefreshStageShow)
Game.GlobalEvent:RemoveEvent(GameEvent.GuildFight.EnemyBaseDataUpdate, this.RefreshGuildInfo)
Game.GlobalEvent:RemoveEvent(GameEvent.GuildFight.ResultDataUpdate, this.RefreshGuildInfo)
Game.GlobalEvent:RemoveEvent(GameEvent.GuildFight.AttackStageDefendDataUpdate, this.RefreshGetStar)
Game.GlobalEvent:RemoveEvent(GameEvent.GuildRedPacket.OnCloseRedPointClick, this.CloseRedPointClick)
Game.GlobalEvent:RemoveEvent(GameEvent.Guild.RefreshDeathPosStatus, this.RefreshDeathPos)
end
--界面打开时调用(用于子类重写)
function GuildMainCityPanel:OnOpen(...)
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function GuildMainCityPanel:OnShow()
this.UpView:OnOpen({ showType = UpViewOpenType.ShowRight, panelType = PanelType.Guild })
this.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.GongHui })
CheckRedPointStatus(RedPointType.Guild_Fete)
CheckRedPointStatus(RedPointType.Guild_AidBox)
CheckRedPointStatus(RedPointType.Guild_AidGuild)
CheckRedPointStatus(RedPointType.Guild_AidMy)
CheckRedPointStatus(RedPointType.Guild_Transcript)
CheckRedPointStatus(RedPointType.Celebration)
if not PlayerManager.familyId or PlayerManager.familyId == 0 then
this:ClosePanel()
Log("尚未加入公会")
return
end
-- 刷新一遍公会数据,这里主要是为了刷新玩家位置信息,避免返回地图界面出现的问题
NetManager.RequestMyGuildInfo()
-- 刷新公会战阶段信息
this.RefreshStageShow()
-- 开始定时刷新聊天数据
this.ChatTipView:StartCheck()
MyGuildManager.ReuqsetRedPackage()
-- 刷新十绝阵是否开启
this.RefreshDeathPos()
-- 开始吧
this._TimeUpdate()
if not this._TimeCounter then
this._TimeCounter = Timer.New(this._TimeUpdate, 1, -1, true)
this._TimeCounter:Start()
end
if not RECHARGEABLE or SERVER_VERSION == 1 then--(是否开启充值)
this.btnRedPacket:SetActive(false)
end
this.LiveName = "live2d_huyao"
if not this.LiveGO then
this.LiveGO = poolManager:LoadLive(this.LiveName, this.btntranscriptLive.transform,
Vector3.one * 0.15, Vector3.New(0,0,0))
end
-- 刷新一次编队战斗力
FormationManager.RefreshMainFormationPower()
end
function this:OnSortingOrderChange()
if this.playerInfoView then
this.playerInfoView:SetLayer(self.sortingOrder)
end
end
function this.RefreshStageShow()
-- 关闭按钮显示
this.btnOneKeyDefend:SetActive(false)
this.btnCheckDefend:SetActive(false)
this.btnMatching:SetActive(false)
this.btnAttack:SetActive(false)
this.btnAttackLog:SetActive(false)
this.btnResult:SetActive(false)
this.stageView:SetActive(false)--原公会战关闭暂时 可惜了~
local curStage = GuildFightManager.GetCurFightStage()
-- 阶段名称显示
this.stageName.gameObject:SetActive(_StageNameIcon[curStage] ~= nil)
if _StageNameIcon[curStage] then
this.stageName.gameObject:SetActive(true)
this.stageName.sprite = this.spLoader:LoadSprite(_StageNameIcon[curStage][1])
this.stageName:SetNativeSize()
end
-- 按钮显示,及特殊阶段处理
if curStage == GUILD_FIGHT_STAGE.UN_START then
elseif curStage == GUILD_FIGHT_STAGE.DEFEND then
this.btnCheckDefend:SetActive(true)
elseif curStage == GUILD_FIGHT_STAGE.MATCHING then
elseif curStage == GUILD_FIGHT_STAGE.ATTACK then
this.btnAttack:SetActive(true)
this.btnAttackLog:SetActive(true)
elseif curStage == GUILD_FIGHT_STAGE.COUNTING then
this.btnResult:SetActive(true)
local result = GuildFightManager.GetGuildFightResultData()
-- 显示结算完成
if result and _StageNameIcon[curStage] then
this.stageName.sprite = this.spLoader:LoadSprite(_StageNameIcon[curStage][2])
end
elseif curStage == GUILD_FIGHT_STAGE.EMPTEY then
end
-- 刷新展示信息
this.RefreshGuildInfo()
end
-- 刷新公会信息展示
function this.RefreshGuildInfo()
local enemyInfo = GuildFightManager.GetEnemyBaseData()
if not enemyInfo then
this.myGuild:SetActive(false)
this.enemyGuild:SetActive(false)
else
this.myGuild:SetActive(true)
this.enemyGuild:SetActive(true)
-- 敌方数据显示
this.GuildBaseInfoAdapter(this.enemyGuild, enemyInfo)
-- 我方数据显示
local myGuildData = GuildFightManager.GetMyBaseData()
this.GuildBaseInfoAdapter(this.myGuild, myGuildData)
end
-- 刷新获取的星数
this.RefreshGetStar()
-- 检测阶段提示
this.CheckStageTip()
end
-- 公会基础数据匹配
function this.GuildBaseInfoAdapter(node, data)
local nameText = Util.GetGameObject(node, "name"):GetComponent("Text")
local levelText = Util.GetGameObject(node, "level"):GetComponent("Text")
local levelbg = Util.GetGameObject(node, "lvbg")
local logoSpr = Util.GetGameObject(node, "icon"):GetComponent("Image")
levelText.gameObject:SetActive(data ~= nil)
levelbg.gameObject:SetActive(data ~= nil)
if data then
nameText.text = data.name
levelText.text = data.level
local logoName = GuildManager.GetLogoResName(data.pictureId)
logoSpr.sprite = this.spLoader:LoadSprite(logoName)
else
nameText.text = "..."
logoSpr.sprite = this.spLoader:LoadSprite("r_gonghui_pipeiwenhao")
end
end
-- 刷新获取星数的显示
function this.RefreshGetStar()
this.myStar.gameObject:SetActive(false)
this.enemyStar.gameObject:SetActive(false)
local curStage = GuildFightManager.GetCurFightStage()
if curStage == GUILD_FIGHT_STAGE.ATTACK or curStage == GUILD_FIGHT_STAGE.COUNTING then
this.myStar.gameObject:SetActive(true)
this.enemyStar.gameObject:SetActive(true)
local myGetStar, enemyGetStar = GuildFightManager.GetBothGetStarNum()
this.myStar.text = myGetStar
this.enemyStar.text = enemyGetStar
end
end
-- 计时显示
local _BGMFlag = nil
function this._TimeUpdate()
--车迟斗法倒计时显示
local timeDown = -1
if limitTime>GetTimeStamp() then
--LogError("timeStamp=="..limitTime-GetTimeStamp())
local cha =limitTime-GetTimeStamp()
if cha>86400 then
this.timeText.text = string.format("%s天后开启",TimeToD(limitTime-GetTimeStamp()))
elseif cha>3600 then
this.timeText.text = string.format("%s后开启",TimeToH(limitTime-GetTimeStamp()))
else
this.timeText.text = string.format("%s后开启",TimeToMorS(limitTime-GetTimeStamp()))
end
return
end
if not ActTimeCtrlManager.IsQualifiled(FUNCTION_OPEN_TYPE.CARDELAY) then
local config=ConfigManager.GetConfigData(ConfigName.GlobalSystemConfig,FUNCTION_OPEN_TYPE.CARDELAY)
if config then
LogError("config.OpenRules[1][2]=="..config.OpenRules[2])
this.timeText.text = config.OpenRules[2].."级开启"
else
this.timeText.text = "50级开启"
end
return
end
if GuildCarDelayManager.progress == GuildCarDelayProType.Challenge then
if PrivilegeManager.GetPrivilegeRemainValue(PRIVILEGE_TYPE.GUILD_CAR_DELEAY_CHALLENGE) > 0 then
timeDown = GuildCarDelayManager.ChallengeCdTime
if timeDown > 0 then
this.timeText.text = string.format("%s后可挑战",TimeToMorS(timeDown))
else
this.timeText.text = string.format("挑战中")
end
else
--this.timeText.text = string.format("15点开始抢夺")
this.timeText.text = string.format("每日8点开启")
end
-- elseif GuildCarDelayManager.progress == GuildCarDelayProType.Loot then
-- if PrivilegeManager.GetPrivilegeRemainValue(PRIVILEGE_TYPE.GUILD_CAR_DELEAY_LOOT) > 0 then
-- timeDown = GuildCarDelayManager.LootCdTime
-- if timeDown > 0 then
-- this.timeText.text = string.format("%s后可抢夺",TimeToMorS(timeDown))
-- else
-- this.timeText.text = string.format("抢夺中")
-- end
-- else
-- this.timeText.text = string.format("每日8点开启")
-- end
else
this.timeText.text = string.format("每日8点开启")
end
--这个结构不适合做==0的判断无奈写了个Timer
if timeDown == 1 then
Timer.New(function ()
CheckRedPointStatus(RedPointType.LegendExplore)
end,1.5):Start()
end
local curStage = GuildFightManager.GetCurFightStage()
if curStage == GUILD_FIGHT_STAGE.DISSMISS or curStage == GUILD_FIGHT_STAGE.CLOSE then
if not _BGMFlag or _BGMFlag == 1 then
_BGMFlag = 0
SoundManager.PlayMusic(SoundConfig.BGM_Guild)
end
return
end
local guildFightData = GuildFightManager.GetGuildFightData()
local startTime = guildFightData.startTime
local curTime = GetTimeStamp()
if guildFightData.type == GUILD_FIGHT_STAGE.UN_START and curTime < startTime then
local leftTime = startTime - curTime
leftTime = leftTime < 0 and 0 or leftTime
this.stageTime.text = string.format(Language[10913], TimeToHMS(leftTime))
if not _BGMFlag or _BGMFlag == 1 then
_BGMFlag = 0
SoundManager.PlayMusic(SoundConfig.BGM_Guild)
end
else
local roundEndTime = guildFightData.roundEndTime
local leftTime = roundEndTime - curTime
leftTime = leftTime < 0 and 0 or leftTime
this.stageTime.text = string.format(Language[10914], TimeToHMS(leftTime))
if not _BGMFlag or _BGMFlag == 0 then
_BGMFlag = 1
SoundManager.PlayMusic(SoundConfig.BGM_GuildFight)
end
end
end
-- 退出公会回调事件
function this.OnQuitGuild()
this:ClosePanel()
end
--- 检测当前阶段是否需要显示阶段提示界面
function this.CheckStageTip()
-- 获取当前公会战阶段
local isInFight = GuildFightManager.IsInGuildFight()
if not isInFight then return end
local curStage = GuildFightManager.GetCurFightStage()
local curTipStage = GuildFightManager.GetCurTipStage()
-- 轮空状态特殊处理
if curStage == GUILD_FIGHT_STAGE.EMPTEY and curTipStage ~= GUILD_FIGHT_STAGE.EMPTEY then
GuildFightManager.SetCurTipStage(GUILD_FIGHT_STAGE.EMPTEY)
if UIManager.IsOpen(UIName.GuildFightMatchingPopup) then
UIManager.ClosePanel(UIName.GuildFightMatchingPopup)
end
-- 显示轮空提示
UIManager.OpenPanel(UIName.GuildFightMatchSuccessPopup, 2)
return
elseif curStage == GUILD_FIGHT_STAGE.MATCHING then
local enemyInfo = GuildFightManager.GetEnemyBaseData()
if not enemyInfo then
if not curTipStage or curTipStage < curStage - 0.5 then
-- 这里匹配阶段但是未匹配成功的阶段用 匹配阶段减0.5代替 以符合提示显示的规则
-- 阶段设计问题,应该将匹配阶段分开为两个阶段
GuildFightManager.SetCurTipStage(curStage - 0.5)
if UIManager.IsOpen(UIName.GuildFightDefendInfoPopup) then
UIManager.ClosePanel(UIName.GuildFightDefendInfoPopup)
end
UIManager.OpenPanel(UIName.GuildFightMatchingPopup)
end
else
if not curTipStage or curTipStage < curStage then
-- 匹配成功的阶段,显示匹配结果
GuildFightManager.SetCurTipStage(curStage)
if UIManager.IsOpen(UIName.GuildFightMatchingPopup) then
UIManager.ClosePanel(UIName.GuildFightMatchingPopup)
end
UIManager.OpenPanel(UIName.GuildFightMatchSuccessPopup, 1)
end
end
return
end
if not curTipStage or curTipStage < curStage then
GuildFightManager.SetCurTipStage(curStage)
-- 根据不同的阶段显示不同的界面
if curStage == GUILD_FIGHT_STAGE.DEFEND then
if UIManager.IsOpen(UIName.GuildFightResultPopup) then
UIManager.ClosePanel(UIName.GuildFightResultPopup)
end
UIManager.OpenPanel(UIName.GuildFightDefendInfoPopup, true)
elseif curStage == GUILD_FIGHT_STAGE.ATTACK then
if UIManager.IsOpen(UIName.GuildFightMatchSuccessPopup) then
UIManager.ClosePanel(UIName.GuildFightMatchSuccessPopup)
end
UIManager.OpenPanel(UIName.GuildFightAttackTipPopup)
elseif curStage == GUILD_FIGHT_STAGE.COUNTING then
if UIManager.IsOpen(UIName.GuildFightAttackTipPopup) then
UIManager.ClosePanel(UIName.GuildFightAttackTipPopup)
end
UIManager.OpenPanel(UIName.GuildFightResultPopup)
end
end
end
-- 刷新红包红点
function this.CloseRedPointClick()
GuildRedPacketManager.isCheck=false
--CheckRedPointStatus(RedPointType.Guild_RedPacket)
--CheckRedPointStatus(RedPointType.Guid_SendPackage)
--CheckRedPointStatus(RedPointType.Guid_GetPackage)
MyGuildManager.ReuqsetRedPackage()
end
--刷新十绝阵是否开启
function this.RefreshDeathPos()
NetManager.GetDeathPathStatusResponse(function(msg)
LogBlue(tostring("十绝阵开启状态 "..msg.status))
DeathPosManager.status=msg.status
CheckRedPointStatus(RedPointType.Guild_DeathPos)--阶段切换时 检测红点
end)
end
--界面关闭时调用(用于子类重写)
function GuildMainCityPanel:OnClose()
_BGMFlag = nil
-- 计时器关闭
if this._TimeCounter then
this._TimeCounter:Stop()
this._TimeCounter = nil
end
-- 关闭定时刷新数据
this.ChatTipView:StopCheck()
end
--界面销毁时调用(用于子类重写)
function GuildMainCityPanel:OnDestroy()
this.spLoader:Destroy()
SubUIManager.Close(this.ChatTipView)
SubUIManager.Close(this.UpView)
SubUIManager.Close(this.BtView)
-- SubUIManager.Close(this.playerHead)
-- 移除红点
for type, data in pairs(_GuildBuildConfig) do
if data.btnName then
local btn = Util.GetGameObject(self.gameObject, "Bg/"..data.btnName)
if btn and data.isOpen and data.rpType then
ClearRedPointObject(data.rpType, Util.GetGameObject(btn, "flag/redpot"))
end
end
end
-- 清除红点
ClearRedPointObject(RedPointType.Guild_RedPacket, this.btnRedPacketRedPoint)
-- this.playerHead = nil
if this.LiveGO then
poolManager:UnLoadLive(this.LiveName,this.LiveGO)
this.LiveName = nil
this.LiveGO = nil
end
if this.playerInfoView then
SubUIManager.Close(this.playerInfoView)
this.playerInfoView = nil
end
end
return GuildMainCityPanel