From 0c3b0e6326ac702ceceead254cd6d0fa8dceb603 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Fri, 28 Aug 2020 16:35:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E8=BF=9F=E6=96=97=E6=B3=95=E5=89=AF?= =?UTF-8?q?=E6=9C=AC=E7=95=8C=E9=9D=A2=E7=BA=A2=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Carbon/CarbonManager.lua | 16 +++--- .../~Lua/Modules/Carbon/CarbonTypePanelV2.lua | 54 ++++++++++--------- .../Modules/Formation/FormationEditPopup.lua | 1 + .../Guild/CarDelay/GuildCarDelayMainPanel.lua | 12 +++-- .../~Lua/Modules/Map/EndLessMapManager.lua | 2 +- .../~Lua/Modules/Map/TrialMapPanel.lua | 2 +- .../~Lua/Modules/Net/IndicationManager.lua | 2 +- .../~Lua/Modules/Net/NetManager.lua | 1 + .../~Lua/Modules/Player/PlayerManager.lua | 23 ++++++++ 9 files changed, 74 insertions(+), 39 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonManager.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonManager.lua index a460272f62..74f4dd3829 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonManager.lua @@ -833,14 +833,14 @@ function this.CarbonRedCheck(redType) -- return false -- end --车迟斗法 - -- elseif redType == RedPointType.LegendExplore then - -- if ActTimeCtrlManager.IsQualifiled(FUNCTION_OPEN_TYPE.CARDELAY) and PlayerManager.familyId ~= 0 - -- and (GuildCarDelayManager.RefreshRedPoint(GuildCarDelayProType.Challenge) - -- or GuildCarDelayManager.RefreshRedPoint(GuildCarDelayProType.Loot)) then - -- return true - -- else - -- return false - -- end + elseif redType == RedPointType.LegendExplore then + if ActTimeCtrlManager.IsQualifiled(FUNCTION_OPEN_TYPE.CARDELAY) and PlayerManager.familyId ~= 0 + and (GuildCarDelayManager.RefreshRedPoint(GuildCarDelayProType.Challenge) + or GuildCarDelayManager.RefreshRedPoint(GuildCarDelayProType.Loot)) then + return true + else + return false + end end end diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanelV2.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanelV2.lua index f09eda4eac..52c6372dfb 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanelV2.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanelV2.lua @@ -178,6 +178,21 @@ function CarbonTypePanelV2:BindEvent() UIManager.OpenPanel(UIName.VipPanelV2) end ) + + for k,v in ipairs(carbons) do + local data + if not type[PlayerManager.carbonType][k] then + data = type[PlayerManager.carbonType].default + else + data = type[PlayerManager.carbonType][k] + end + if data.redPointType == -1 or not data.redPointType then + Util.GetGameObject(v, "redPoint"):SetActive(false) + else + BindRedPointObject(data.redPointType,Util.GetGameObject(v, "redPoint")) + end + end + end --添加事件监听(用于子类重写) @@ -192,19 +207,7 @@ end --副本类型 1 综合 2 万象 function CarbonTypePanelV2:OnOpen() carbonType = PlayerManager.carbonType - for k,v in ipairs(carbons) do - local data - if not type[PlayerManager.carbonType][k] then - data = type[PlayerManager.carbonType].default - else - data = type[PlayerManager.carbonType][k] - end - if data.redPointType == -1 or not data.redPointType then - Util.GetGameObject(v, "redPoint"):SetActive(false) - else - BindRedPointObject(data.redPointType,Util.GetGameObject(v, "redPoint")) - end - end + if carbonType == 1 then -- 清除一下选得副本类型 CarbonManager.difficulty = 0 @@ -226,8 +229,7 @@ end --界面打开时调用(用于子类重写) function CarbonTypePanelV2:OnShow(...) carbonType = PlayerManager.carbonType - - LogBlue("carbonType2:"..carbonType) + this.title:GetComponent("Image").sprite = Util.LoadSprite(type[carbonType].title) this.title:GetComponent("RectTransform").localPosition = type[carbonType].titlePos this.title:GetComponent("RectTransform").sizeDelta = type[carbonType].titleSize @@ -475,6 +477,18 @@ function CarbonTypePanelV2:OnClose() end this.isPlayDoorAudio = false carbonType = 0 + +end + +--界面销毁时调用(用于子类重写) +function CarbonTypePanelV2:OnDestroy() + hasFresh = false + if this.BtView then + SubUIManager.Close(this.BtView) + end + carbons = {} + this.playerHead=nil + for k,v in ipairs(carbons) do local data if not type[PlayerManager.carbonType][k] then @@ -489,14 +503,4 @@ function CarbonTypePanelV2:OnClose() end end ---界面销毁时调用(用于子类重写) -function CarbonTypePanelV2:OnDestroy() - hasFresh = false - if this.BtView then - SubUIManager.Close(this.BtView) - end - carbons = {} - this.playerHead=nil -end - return CarbonTypePanelV2 \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationEditPopup.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationEditPopup.lua index 4216a6e0e9..8f9e7701f1 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationEditPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationEditPopup.lua @@ -85,6 +85,7 @@ function FormationEditPopup:BindEvent() if func~=nil then --保存完毕后 将英雄did合集传递过去 此时我拥有这些英雄 不用担心英雄已被删除 func(dids) end + PlayerPrefs.SetInt(PlayerManager.uid.."TrialIsOpen",1)--设置森罗红点关 self:ClosePanel() end) else diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/CarDelay/GuildCarDelayMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Guild/CarDelay/GuildCarDelayMainPanel.lua index c5197e47c8..a8c8ad81ee 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/CarDelay/GuildCarDelayMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/CarDelay/GuildCarDelayMainPanel.lua @@ -88,7 +88,9 @@ function GuildCarDelayMainPanel:BindEvent() return end if curProgress == 1 then - UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.GUILD_CAR_DELEAY) + UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.GUILD_CAR_DELEAY,function () + CheckRedPointStatus(RedPointType.LegendExplore) + end) end end) --抢夺 @@ -107,7 +109,9 @@ function GuildCarDelayMainPanel:BindEvent() return end if curProgress == 3 then - UIManager.OpenPanel(UIName.GuildCarDelayLootPopup) + UIManager.OpenPanel(UIName.GuildCarDelayLootPopup,function() + CheckRedPointStatus(RedPointType.LegendExplore) + end) end end) --帮助按钮 @@ -322,6 +326,7 @@ function this.RemainTimeDown(_timeTextExpertgo,_timeTextExpert,timeNumText,timeD if _timeTextExpertgo then _timeTextExpertgo:SetActive(false) end + this.RefrePanelRedPoint() end end function this.TimeStampToDateString(second) @@ -389,6 +394,7 @@ function this.RemainTimeDown2(_timeTextExpertgo,timeNumText) if _timeTextExpertgo then _timeTextExpertgo:SetActive(false) end + this.RefrePanelRedPoint() end end function this.TimeStampToDateString2(second) @@ -412,7 +418,7 @@ end function this.RefrePanelRedPoint() Util.GetGameObject(this.challengeBtn,"redPoint"):SetActive(GuildCarDelayManager.RefreshRedPoint(GuildCarDelayProType.Challenge)) Util.GetGameObject(this.lootBtn,"redPoint"):SetActive(GuildCarDelayManager.RefreshRedPoint(GuildCarDelayProType.Loot)) - --CheckRedPointStatus(RedPointType.LegendExplore) + CheckRedPointStatus(RedPointType.LegendExplore) Util.SetGray(Util.GetGameObject(this.challengeBtn,"redPoint"),false) Util.SetGray(Util.GetGameObject(this.lootBtn,"redPoint"),false) end diff --git a/Assets/ManagedResources/~Lua/Modules/Map/EndLessMapManager.lua b/Assets/ManagedResources/~Lua/Modules/Map/EndLessMapManager.lua index f80855ec47..b8333db26b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Map/EndLessMapManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Map/EndLessMapManager.lua @@ -447,7 +447,7 @@ end --红点检测 function this.EndlessRedCheck() - if this.GetLeftMapEnergy() == 100 and ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ENDLESS)then + if this.GetLeftMapEnergy() >= 100 and ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ENDLESS)then return true else return false diff --git a/Assets/ManagedResources/~Lua/Modules/Map/TrialMapPanel.lua b/Assets/ManagedResources/~Lua/Modules/Map/TrialMapPanel.lua index b87494f6fc..cf258141af 100644 --- a/Assets/ManagedResources/~Lua/Modules/Map/TrialMapPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Map/TrialMapPanel.lua @@ -154,7 +154,7 @@ function TrialMapPanel:OnOpen() -- 检测引导 GuideManager.CheckCarbonGuild(CARBON_TYPE.TRIAL) - PlayerPrefs.SetInt(PlayerManager.uid.."TrialIsOpen",1) + -- PlayerPrefs.SetInt(PlayerManager.uid.."TrialIsOpen",1) end function TrialMapPanel:OnShow() diff --git a/Assets/ManagedResources/~Lua/Modules/Net/IndicationManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/IndicationManager.lua index 1b266d9821..b42a22a586 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/IndicationManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/IndicationManager.lua @@ -180,7 +180,7 @@ function this.RefreshUpdateIndication(buffer) PlayerPrefs.SetInt(PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.Ten,0) PlayerPrefs.SetInt(PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.TimeLimitTen,0) PlayerPrefs.SetInt(PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.QianKunBoxTen,0) - + PlayerPrefs.SetInt(PlayerManager.uid.."Trial",0)--森罗五点刷新重置红点 end diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index 8aff68d615..c1013aeb31 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -159,6 +159,7 @@ function this.PlayerInfoRequest(func) QuestionnaireManager.SetQuestionState(msg.QuestionState) PlayerManager.SetMaxEnergy() + PlayerManager.ResetLocalData()--初始化所有本地的每日一刷 PlayerManager.InitServerTime() GuideManager.InitData(msg.newPlayerGuidePoint) --临时初始化地图探索的静态数据 diff --git a/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua index e6cdc87a4a..2864ab2fed 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua @@ -44,6 +44,29 @@ function this.InitServerTime() UpdateBeat:Add(update, this) end +function this.ResetLocalData() + local func = function () + --三个抽奖勾选重置 + PlayerPrefs.SetInt(PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.Ten,0) + PlayerPrefs.SetInt(PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.TimeLimitTen,0) + PlayerPrefs.SetInt(PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.QianKunBoxTen,0) + PlayerPrefs.SetInt(PlayerManager.uid.."Trial",0)--森罗五点刷新重置红点 + end + + local text =PlayerManager.uid.."fiveTime" + local curTime = GetTimeStamp() + + if PlayerPrefs.HasKey(text) then + if PlayerPrefs.GetInt(text) > curTime then + func() + PlayerPrefs.SetInt(text,Today_N_OClockTimeStamp(5)+86400) + end + else + func() + PlayerPrefs.SetInt(text,Today_N_OClockTimeStamp(5)+86400) + end +end + function this.OnGoldChange() end