From 43afe3d6f1cb9b6cb349557bf4ef6a8019377d1b Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 22 Apr 2021 13:40:04 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=86=85=E5=AD=98=E3=80=91btview?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=BC=9A=E5=AF=BC=E8=87=B4=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E5=8D=B8=E8=BD=BD=E8=B5=84=E6=BA=90=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Adventure/AdventureMainPanel.lua | 2 +- .../~Lua/Modules/Bag/BagPanel.lua | 2 +- .../~Lua/Modules/Carbon/CarbonTypePanel.lua | 2 +- .../~Lua/Modules/Carbon/CarbonTypePanelV2.lua | 4 +-- .../Modules/DiffMonster/DemonInfoPanel.lua | 3 +- .../Modules/DiffMonster/DiffMonsterPanel.lua | 3 +- .../DynamicActivity/ActivityMainPanel.lua | 4 +++ .../Modules/Fight/FightPointPassMainPanel.lua | 16 ++++++++-- .../Modules/Fight/View/FightPointMapView.lua | 8 ++--- .../~Lua/Modules/Guild/GuildMainCityPanel.lua | 2 +- .../HandBookHeroAndEquipListPanel.lua | 4 +-- .../Modules/HandBook/HandBookMainPanel.lua | 4 +-- .../~Lua/Modules/Main/MainPanel.lua | 2 +- .../Modules/Recruit/ElementDrawCardPanel.lua | 3 +- .../~Lua/Modules/Resolve/ResolvePanel.lua | 2 +- .../~Lua/Modules/RoleInfo/RoleListPanel.lua | 2 +- .../~Lua/Modules/SecretBox/SecretBoxPanel.lua | 3 +- .../~Lua/Modules/Vip/VipPanelV2.lua | 2 +- Assets/ManagedResources/~Lua/View/BtView.lua | 32 +++---------------- 19 files changed, 42 insertions(+), 58 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Adventure/AdventureMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Adventure/AdventureMainPanel.lua index 3a33dabac3..e8becf20f9 100644 --- a/Assets/ManagedResources/~Lua/Modules/Adventure/AdventureMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Adventure/AdventureMainPanel.lua @@ -479,7 +479,7 @@ end function AdventureMainPanel:OnShow() AdventureManager.isEnterAdventure=true this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.AdventureTimes }) - this.BtView:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView.SecretTerritoryPanel }) + this.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.SecretTerritoryPanel }) this:OnRefreshData() this:RefreshExpeditionsData() this.sayInfoImageBg:SetActive(false) diff --git a/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua b/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua index 988a449e84..655224aa90 100644 --- a/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua @@ -488,7 +488,7 @@ function BagPanel:OnOpen(_sortIndex) end this.UpView:OnOpen({ showType = UpViewOpenType.ShowRight, panelType = PanelType.Main }) - this.BtView:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView.BagPanel }) + this.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.BagPanel }) end --界面打开时调用(用于子类重写) function BagPanel:OnShow() diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanel.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanel.lua index c726e83aff..da84cc1bce 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanel.lua @@ -159,7 +159,7 @@ function CarbonTypePanel:OnOpen() -- 清除一下选得副本类型 CarbonManager.difficulty = 0 CheckRedPointStatus(RedPointType.EpicExplore_GetReward) - this.BtView:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView.Carbon }) + this.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.Carbon }) this.UpView:OnOpen({ showType = UpViewOpenType.ShowRight, panelType = PanelType.Main }) end diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanelV2.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanelV2.lua index 6db577eb8a..4c083eb3a4 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanelV2.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/CarbonTypePanelV2.lua @@ -180,7 +180,7 @@ function CarbonTypePanelV2:OnOpen() -- 清除一下选得副本类型 CarbonManager.difficulty = 0 this.BtView.gameObject:SetActive(true) - this.BtView:OnOpen({sortOrder = self.sortingOrder, panelType = PanelTypeView.Carbon}) + this.BtView:OnOpen(self, {sortOrder = self.sortingOrder, panelType = PanelTypeView.Carbon}) this.UpView:OnOpen({showType = UpViewOpenType.ShowRight, panelType = PanelType.Main}) elseif carbonType == 2 then this.BtView.gameObject:SetActive(false) @@ -189,7 +189,7 @@ function CarbonTypePanelV2:OnOpen() -- 清除一下选得副本类型 CarbonManager.difficulty = 0 this.BtView.gameObject:SetActive(true) - this.BtView:OnOpen({sortOrder = self.sortingOrder, panelType = PanelTypeView.Carbon}) + this.BtView:OnOpen(self, {sortOrder = self.sortingOrder, panelType = PanelTypeView.Carbon}) this.UpView:OnOpen({showType = UpViewOpenType.ShowRight, panelType = PanelType.Main}) end end diff --git a/Assets/ManagedResources/~Lua/Modules/DiffMonster/DemonInfoPanel.lua b/Assets/ManagedResources/~Lua/Modules/DiffMonster/DemonInfoPanel.lua index 1c5d98e9d7..10b20c7cef 100644 --- a/Assets/ManagedResources/~Lua/Modules/DiffMonster/DemonInfoPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/DiffMonster/DemonInfoPanel.lua @@ -50,7 +50,6 @@ function DemonInfoPanel:InitComponent() --可升阶提示 this.upGradFlag = Util.GetGameObject(self.gameObject, "DemonInfoRoot/BtnLevelUp/upGradFlag") - --this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.gameObject.transform) this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform) end @@ -92,7 +91,7 @@ function DemonInfoPanel:OnOpen(context) this.JudgeUpGradCondition(pokeMon) this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.DiffMonster }) - --this.BtView:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView.DiffMonsterPanel }) + --this.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.DiffMonsterPanel }) end diff --git a/Assets/ManagedResources/~Lua/Modules/DiffMonster/DiffMonsterPanel.lua b/Assets/ManagedResources/~Lua/Modules/DiffMonster/DiffMonsterPanel.lua index 526015e84d..b69edec96b 100644 --- a/Assets/ManagedResources/~Lua/Modules/DiffMonster/DiffMonsterPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/DiffMonster/DiffMonsterPanel.lua @@ -85,7 +85,6 @@ function DiffMonsterPanel:InitComponent() this.helpBtn = Util.GetGameObject(self.gameObject, "helpBtn") this.helpPosition = this.helpBtn:GetComponent("RectTransform").localPosition - --this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.gameObject.transform)-- 货币显示 self.bg = Util.GetGameObject(self.gameObject, "effect") this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft }) @@ -156,7 +155,7 @@ function DiffMonsterPanel:OnOpen(...) end this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.DiffMonster }) - --this.BtView:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView.DiffMonsterPanel }) + --this.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.DiffMonsterPanel }) SoundManager.PlayMusic(SoundConfig.BGM_DiffMonster) diff --git a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/ActivityMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/ActivityMainPanel.lua index 97c3a0b2a0..33315508e2 100644 --- a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/ActivityMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/ActivityMainPanel.lua @@ -65,6 +65,9 @@ end -- 打开,重新打开时回调 function ActivityMainPanel:OnShow() orginLayer = self.sortingOrder + if _CurPageIndex == 0 then + _CurPageIndex = 1 + end if _CurPageIndex and _CurPageIndex > #tabs then _CurPageIndex = #tabs end @@ -171,6 +174,7 @@ function this.OnPageTabChange(index) subViewList[index].sub:OnShow(orginLayer) else subViewList[index] = {} + LogError(index) if tabs[index].UIName then subViewList[index].config = SubUIConfig[tabs[index].UIName[1]] subViewList[index].sub = SubUIManager.Open(subViewList[index].config,this.content.transform,tabs[index],index,this) diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua index 35bcd5ea5e..78f990a70f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua @@ -13,6 +13,7 @@ local points = {} local isCounting = false local orginLayer=0 local hasLoad = false +local hasMap = false this.funcBtnList = {} local curMianTaskData = {} local timePressStarted @@ -347,7 +348,7 @@ end --界面打开时调用(用于子类重写) function FightPointPassMainPanel:OnOpen(func) this.UpView:OnOpen({ showType = UpViewOpenType.ShowRight, panelType = PanelType.FightPointPass }) - this.BtView:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView.JieLing }) + this.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.JieLing }) callBack = nil if func then callBack = func @@ -395,7 +396,13 @@ function FightPointPassMainPanel:OnShow() isCounting = false -- 加载地图数据 - fightMap:Init() + coroutine.start(function() + coroutine.wait(0.01) + if UIManager.IsOpen(UIName.FightPointPassMainPanel) then + fightMap:Init() + hasMap = true + end + end) FightPointPassManager.isBattleBack = false hasLoad = true @@ -617,7 +624,10 @@ function FightPointPassMainPanel:OnClose() PlayerManager.StopBattleUpLvTipTime() hasLoad = false invadeMonster:OnClose() - fightMap:Dispose() + if hasMap then + fightMap:Dispose() + hasMap = false + end if this.animTimer then this.animTimer:Stop() diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/View/FightPointMapView.lua b/Assets/ManagedResources/~Lua/Modules/Fight/View/FightPointMapView.lua index 71faa4d4c8..6e7a1f40cd 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/View/FightPointMapView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/View/FightPointMapView.lua @@ -236,10 +236,10 @@ function this:LoadMapData() this.moneyEffect:SetActive(false) - Util.AddParticleSortLayer(this.moneyEffect, m_parent.sortingOrder - m_orginLayer) - Util.AddParticleSortLayer(this.hitEffect, m_parent.sortingOrder - m_orginLayer) - Util.AddParticleSortLayer(this.boxEffect, m_parent.sortingOrder - m_orginLayer) - m_orginLayer = m_parent.sortingOrder + -- Util.AddParticleSortLayer(this.moneyEffect, m_parent.sortingOrder - m_orginLayer) + -- Util.AddParticleSortLayer(this.hitEffect, m_parent.sortingOrder - m_orginLayer) + -- Util.AddParticleSortLayer(this.boxEffect, m_parent.sortingOrder - m_orginLayer) + -- m_orginLayer = m_parent.sortingOrder --this:OnSortingOrderChange(m_parent.sortingOrder) this.boxEffect:SetActive(false) end diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/GuildMainCityPanel.lua b/Assets/ManagedResources/~Lua/Modules/Guild/GuildMainCityPanel.lua index e3164f4494..c3b28a2848 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/GuildMainCityPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/GuildMainCityPanel.lua @@ -251,7 +251,7 @@ end --界面打开或者重新打开后,界面刷新时调用(用于子类重写) function GuildMainCityPanel:OnShow() this.UpView:OnOpen({ showType = UpViewOpenType.ShowRight, panelType = PanelType.Guild }) - this.BtView:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView.GongHui }) + this.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.GongHui }) CheckRedPointStatus(RedPointType.Guild_RedPacket) CheckRedPointStatus(RedPointType.Guild_Fete) CheckRedPointStatus(RedPointType.Guild_AidBox) diff --git a/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookHeroAndEquipListPanel.lua b/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookHeroAndEquipListPanel.lua index cd10295cfa..ef0e970bd5 100644 --- a/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookHeroAndEquipListPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookHeroAndEquipListPanel.lua @@ -99,8 +99,6 @@ function HandBookHeroAndEquipListPanel:InitComponent() violetGridList[i]=Util.GetGameObject(self.violetGrid.transform,"equip ("..i..")") blueGridList[i]=Util.GetGameObject(self.blueGrid.transform,"equip ("..i..")") end - --self.BtView = SubUIManager.Open(SubUIConfig.BtView, self.gameObject.transform) - --self.BtView2 = SubUIManager.Open(SubUIConfig.BtView2, self.gameObject.transform) self.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform) self.selectBtn = Util.GetGameObject(self.gameObject, "Tabs/selectBtn") @@ -139,7 +137,7 @@ function HandBookHeroAndEquipListPanel:OnOpen(_type) -- proId=ProIdConst.All OpenType = _type - --self.BtView:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView.RolePanel }) + --self.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.RolePanel }) --self.BtView2:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView2.HandBookPanel }) self.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main }) end diff --git a/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookMainPanel.lua index 9d38439f51..0319d9be9a 100644 --- a/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookMainPanel.lua @@ -8,8 +8,6 @@ function HandBookMainPanel:InitComponent() self.btnBack = Util.GetGameObject(self.transform, "btnBack/Image") self.HeroBtn = Util.GetGameObject(self.transform, "heroGo/heroBtn") self.equipBtn = Util.GetGameObject(self.transform, "equipGo/equipBtn") - --self.BtView = SubUIManager.Open(SubUIConfig.BtView, self.gameObject.transform) - --self.BtView2 = SubUIManager.Open(SubUIConfig.BtView2, self.gameObject.transform) self.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform) end @@ -41,7 +39,7 @@ end --界面打开时调用(用于子类重写) function HandBookMainPanel:OnOpen(...) - --self.BtView:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView.RolePanel }) + --self.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.RolePanel }) --self.BtView2:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView2.HandBookPanel }) self.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main }) end diff --git a/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua index df4ef20d4c..521c85b4eb 100644 --- a/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua @@ -771,7 +771,7 @@ function this:OnShow() Log(string.format("---------------------%s", BagManager.GetItemCountById(14))) this.UpView:OnOpen({ showType = UpViewOpenType.ShowRight, panelType = PanelType.Main }) - this.BtView:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView.MainCity }) + this.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.MainCity }) -- 刷新功能显示 this.InitFuncShow() diff --git a/Assets/ManagedResources/~Lua/Modules/Recruit/ElementDrawCardPanel.lua b/Assets/ManagedResources/~Lua/Modules/Recruit/ElementDrawCardPanel.lua index f863d4642b..18976a4595 100644 --- a/Assets/ManagedResources/~Lua/Modules/Recruit/ElementDrawCardPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Recruit/ElementDrawCardPanel.lua @@ -15,7 +15,6 @@ function ElementDrawCardPanel:InitComponent() orginLayer = 0 this.btnBack=Util.GetGameObject(self.gameObject, "enterCardPanel/btnBack") this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft, panelType = PanelType.ElementDrawCard }) - --this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.gameObject.transform) this.item1BuyOneBtn=Util.GetGameObject(self.transform, "getCardPanel1/content2/btn1") -- this.item1BuyTenBtn=Util.GetGameObject(self.transform, "getCardPanel1/content2/btn10") this.item2BuyOneBtn=Util.GetGameObject(self.transform, "getCardPanel2/content2/btn1") @@ -271,7 +270,7 @@ end --界面打开或者重新打开后,界面刷新时调用(用于子类重写) function ElementDrawCardPanel:OnShow() this.effect:SetActive(false) - --this.BtView:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView.ElementDrawCardPanel }) + --this.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.ElementDrawCardPanel }) --this.BtView.transform:SetSiblingIndex(2) this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.ElementDrawCard }) Util.GetGameObject(this.getCardPanel1, "content2/btn1/Text"):GetComponent("Text").fontSize = GetCurLanguage() ~= 2 and 38 or 30 diff --git a/Assets/ManagedResources/~Lua/Modules/Resolve/ResolvePanel.lua b/Assets/ManagedResources/~Lua/Modules/Resolve/ResolvePanel.lua index 777d0a9326..63c0a5653a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Resolve/ResolvePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Resolve/ResolvePanel.lua @@ -38,6 +38,7 @@ local heroEndBtns = {} local tabSortType function ResolvePanel:InitComponent() + this.spLoader = SpriteLoader.New() this.panel = Util.GetGameObject(self.gameObject, "Panel") this.bgIma=Util.GetGameObject(self.gameObject,"Bg"):GetComponent("Image") this.title=Util.GetGameObject(self.gameObject,"Title"):GetComponent("Image") @@ -62,7 +63,6 @@ function ResolvePanel:InitComponent() end for i = 1, #this.contents do this.contents[i].view:InitComponent(this.panel) - this.spLoader = SpriteLoader.New() end end diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleListPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleListPanel.lua index 2d4edf800f..e67a512579 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleListPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleListPanel.lua @@ -138,7 +138,7 @@ function RoleListPanel:OnShow() this.maxk:SetActive(true) this.heroNumText:GetComponent("Text").text=string.format(Language[11821],#tarHero) this.UpView:OnOpen({ showType = UpViewOpenType.ShowRight, panelType = PanelType.RoleInfo }) - this.BtView:OnOpen({sortOrder = self.sortingOrder,panelType = PanelTypeView.MemberPanel}) + this.BtView:OnOpen(self, {sortOrder = self.sortingOrder,panelType = PanelTypeView.MemberPanel}) SoundManager.PlayMusic(SoundConfig.BGM_Main) sortType = HeroManager.heroListPanelSortID proId = HeroManager.heroListPanelProID diff --git a/Assets/ManagedResources/~Lua/Modules/SecretBox/SecretBoxPanel.lua b/Assets/ManagedResources/~Lua/Modules/SecretBox/SecretBoxPanel.lua index b4ab1f5419..6687c1329f 100644 --- a/Assets/ManagedResources/~Lua/Modules/SecretBox/SecretBoxPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/SecretBox/SecretBoxPanel.lua @@ -62,7 +62,6 @@ function SecretBoxPanel:InitComponent() this.content2=Util.GetGameObject(this.detailPanel, "bottom/openOneButton/content2") this.costImage1=Util.GetGameObject(this.detailPanel, "bottom/openOneButton/content1/Image") this.costImage2=Util.GetGameObject(this.detailPanel, "bottom/openOneButton (1)/Image") - --this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.gameObject.transform) self.imageList = { "y_yuansu_yuansu", "y_yuansu_qunying", "y_yuansu_mihe","y_yuansu_yuansu", "y_yuansu_qunying", "y_yuansu_mihe" } this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft }) local itemdata={} @@ -294,7 +293,7 @@ function SecretBoxPanel:OnOpen(...) end function SecretBoxPanel:OnShow() - --this.BtView:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView.RecruitPanel }) + --this.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.RecruitPanel }) this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.SecretBox }) -- 打开详情界面 --if this.TabCtrl then diff --git a/Assets/ManagedResources/~Lua/Modules/Vip/VipPanelV2.lua b/Assets/ManagedResources/~Lua/Modules/Vip/VipPanelV2.lua index 468824c35b..a9939cd391 100644 --- a/Assets/ManagedResources/~Lua/Modules/Vip/VipPanelV2.lua +++ b/Assets/ManagedResources/~Lua/Modules/Vip/VipPanelV2.lua @@ -135,7 +135,7 @@ end --待功能扩展(试图打开某个状态) function VipPanelV2:OnOpen() this.UpView:OnOpen({ showType = UpViewOpenType.ShowRight, panelType = PanelType.Main }) - this.BtView:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView.TeQuan }) + this.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.TeQuan }) end function VipPanelV2:OnSortingOrderChange() diff --git a/Assets/ManagedResources/~Lua/View/BtView.lua b/Assets/ManagedResources/~Lua/View/BtView.lua index 90a19e05ff..527c27f728 100644 --- a/Assets/ManagedResources/~Lua/View/BtView.lua +++ b/Assets/ManagedResources/~Lua/View/BtView.lua @@ -4,7 +4,6 @@ local bagPanelUI local RoleListPanelUI --- 静态数据 local static_openId = 0 -local _CurPanel = nil function BtView:New(gameObject) @@ -17,7 +16,7 @@ end --初始化组件(用于子类重写) function this:InitComponent() - this.spLoader = SpriteLoader.New() + self.spLoader = SpriteLoader.New() --basicPart self.BtnMainCity = Util.GetGameObject(self.gameObject, "Down/btnMainCity") self.BtnChengYuan = Util.GetGameObject(self.gameObject, "Down/btnChengYuan") @@ -51,23 +50,10 @@ function this:InitComponent() end -function this:CloseCurPanel() - if not _CurPanel then - return - end - if _CurPanel == UIName.FightPointPassMainPanel then - return - end - if UIManager.IsOpen(_CurPanel) then - UIManager.ClosePanel(_CurPanel, true) - end -end - -- 主城 function this:OPenMainCity() if not UIManager.IsOpen(UIName.MainPanel) then UIManager.OpenPanel(UIName.MainPanel) - _CurPanel = UIName.MainPanel end end --打开英雄列表界面 @@ -76,37 +62,28 @@ function this:OpenChengYuan() HeroManager.heroListPanelSortID = 1 HeroManager.heroListPanelProID = 0 RoleListPanelUI = UIManager.OpenPanel(UIName.RoleListPanel) - _CurPanel = UIName.RoleListPanel end end --打开仓库界面 function this:OpenCangKu() if not UIManager.IsOpen(UIName.BagPanel) or (bagPanelUI and bagPanelUI.isFristOpen == false) then bagPanelUI = UIManager.OpenPanel(UIName.BagPanel) - _CurPanel = UIName.BagPanel end end -- 挂机界面 function this:OpenJieling() UIManager.OpenPanel(UIName.FightPointPassMainPanel) - _CurPanel = UIName.FightPointPassMainPanel end -- 打开副本选择界面 function this:OpenCarbon() PlayerManager.carbonType = 1 UIManager.OpenPanel(UIName.CarbonTypePanelV2) - _CurPanel = UIName.CarbonTypePanelV2 end function this:OpenGuild() JumpManager.GoJump(4001) - -- 如果有公会才修改 - if PlayerManager.familyId ~= 0 then - _CurPanel = UIName.GuildMainCityPanel - end end function this:OpenVIP() UIManager.OpenPanel(UIName.VipPanelV2) - _CurPanel = UIName.VipPanelV2 end --绑定事件(用于子类重写) @@ -150,7 +127,8 @@ end -- panelType = int, -- } --界面打开时调用(用于子类重写) -function this:OnOpen(context) +function this:OnOpen(rootPanel, context) + self.rootPanel = rootPanel -- if not _CurPanel and UIManager.IsOpen(UIName.FightPointPassMainPanel) then -- _CurPanel = UIName.FightPointPassMainPanel -- end @@ -217,8 +195,8 @@ function this:OnBtnClick(pt) local isOpen = self:CheckIsOpen(pt) if isOpen then -- 关闭当前界面 - if pt ~= PanelTypeView.GongHui or PlayerManager.familyId ~= 0 then - this:CloseCurPanel() + if self.rootPanel.uiConfig.id ~= UIName.FightPointPassMainPanel and (pt ~= PanelTypeView.GongHui or PlayerManager.familyId ~= 0) then + self.rootPanel:ClosePanel() end -- 打开新界面 local btnFunc = self._BtnConfig[pt].clickFunc