From 5f9f7da2647da0ea136ec1ed75110ac1cf9ea9e7 Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Fri, 24 Dec 2021 17:49:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A2=E7=B4=A2=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Explore/ExploreMainPanel.lua | 14 ++++++++------ .../~Lua/Modules/Explore/ExploreManager.lua | 1 + .../~Lua/Modules/Fight/View/ExploreMapView.lua | 14 +++++++------- .../Modules/Formation/View/ExploreFormation.lua | 1 - .../GeneralPanel/GeneralSizeFitterPopup.lua | 1 - ...neralSizeFitterPopup_ExploreSelectFormation.lua | 14 ++++++++++++-- .../~Lua/Modules/Net/NetManager.lua | 1 + 7 files changed, 29 insertions(+), 17 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Explore/ExploreMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Explore/ExploreMainPanel.lua index e2ae71b337..9653650c78 100644 --- a/Assets/ManagedResources/~Lua/Modules/Explore/ExploreMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Explore/ExploreMainPanel.lua @@ -40,12 +40,11 @@ function ExploreMainPanel:BindEvent() UIManager.OpenPanel(UIName.GeneralInfoPopup,GENERALINFO_TYPE.ExploreMapTip,ExploreManager.GetExploreMapTipData(self.mapId)) end) Util.AddClick(self.jinruBtn,function() - -- if LengthOfTable(self.data[self.mapId].formations) > 0 then - -- UIManager.OpenPanel(UIName.ExplorePanel,ExploreManager.ExploreMapData[self.mapId]) - -- else - -- PopupTipPanel.ShowTip("目标区域无探索队伍,无法进入!") - -- end - UIManager.OpenPanel(UIName.ExplorePanel,ExploreManager.ExploreMapData[self.mapId]) + if LengthOfTable(self.data[self.mapId].formations) > 0 then + UIManager.OpenPanel(UIName.ExplorePanel,ExploreManager.ExploreMapData[self.mapId]) + else + PopupTipPanel.ShowTip("目标区域无探索队伍,无法进入!") + end end) Util.AddClick(self.tansuoBtn,function() --选择队伍弹窗 @@ -55,10 +54,12 @@ end --添加事件监听(用于子类重写) function ExploreMainPanel:AddListener() + Game.GlobalEvent:AddEvent(GameEvent.Explore.UpdateFormation,self.OnShow,self) end --移除事件监听(用于子类重写) function ExploreMainPanel:RemoveListener() + Game.GlobalEvent:RemoveEvent(GameEvent.Explore.UpdateFormation,self.OnShow,self) end --界面打开时调用(用于子类重写) @@ -105,6 +106,7 @@ function ExploreMainPanel:SetMapData() self.mapList[k].data = v self.mapList[k].go.gameObject:SetActive(true) self.mapList[k].go.transform.localPosition = v.pos + self.mapList[k].mapBg.gameObject:SetActive(false) self.mapList[k].mapBgIma.sprite = self.spLoader:LoadSprite(v.iconName) self.mapList[k].mapBgIma:SetNativeSize() SetNumShow(self.mapList[k].minForce,self.mapList[k].force.gameObject,v.force) diff --git a/Assets/ManagedResources/~Lua/Modules/Explore/ExploreManager.lua b/Assets/ManagedResources/~Lua/Modules/Explore/ExploreManager.lua index d8c83ac45a..6b83ba72e4 100644 --- a/Assets/ManagedResources/~Lua/Modules/Explore/ExploreManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Explore/ExploreManager.lua @@ -69,6 +69,7 @@ function this.UpdateFormationsData(_data) for i = 1,#_data do this.UpdateFormationData(_data[i]) end + Game.GlobalEvent:DispatchEvent(GameEvent.Explore.UpdateFormation) end --刷新编队 diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/View/ExploreMapView.lua b/Assets/ManagedResources/~Lua/Modules/Fight/View/ExploreMapView.lua index cd6f4d67a6..cbe8c41d78 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/View/ExploreMapView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/View/ExploreMapView.lua @@ -120,14 +120,14 @@ function this:Init() this.playerViews[v.formationId]:SetData((index3 == 1 and index1 or index2),index4,false,v) end end + -- 设置相机初始化位置 + local v4 = this.playerViews[0].transform.localPosition + v4.z = -50 + TileMapView.SetCameraPos(v4) + -- 初始化两个地图标志 + this.LoadMapIcon() + this.SetPlayerViewWalk() end) - -- 设置相机初始化位置 - local v4 = this.playerViews[0].transform.localPosition - v4.z = -50 - TileMapView.SetCameraPos(v4) - -- 初始化两个地图标志 - this.LoadMapIcon() - this.SetPlayerViewWalk() end function this:LoadMapData() diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/View/ExploreFormation.lua b/Assets/ManagedResources/~Lua/Modules/Formation/View/ExploreFormation.lua index d87852f0e1..243725638f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/View/ExploreFormation.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/View/ExploreFormation.lua @@ -60,7 +60,6 @@ function this.On_Btn2_Click() FormationManager.SaveFormation(k, v.formationinfo, FormationManager.formationList[k].teamPokemonInfos) end - Game.GlobalEvent:DispatchEvent(GameEvent.Explore.UpdateFormation) end end diff --git a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/GeneralSizeFitterPopup.lua b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/GeneralSizeFitterPopup.lua index 531d3e886d..ca7222d25e 100644 --- a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/GeneralSizeFitterPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/GeneralSizeFitterPopup.lua @@ -7,7 +7,6 @@ local sorting = 0 local contentScripts = { [GENERALSIZEFITTER_TYPE.ExploreSelectFormation] = {view = require("Modules/GeneralPanel/GeneralSizeFitterPopup_ExploreSelectFormation"), panelName = "GeneralSizeFitterPopup_ExploreSelectFormation"}, [GENERALSIZEFITTER_TYPE.OneKeyExplore] = {view = require("Modules/GeneralPanel/GeneralSizeFitterPopup_OneKeyExplore"), panelName = "GeneralSizeFitterPopup_OneKeyExplore"}, - } --子模块预设 local contentPrefabs={} diff --git a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/GeneralSizeFitterPopup_ExploreSelectFormation.lua b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/GeneralSizeFitterPopup_ExploreSelectFormation.lua index e2a6f26350..74dd6a198f 100644 --- a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/GeneralSizeFitterPopup_ExploreSelectFormation.lua +++ b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/GeneralSizeFitterPopup_ExploreSelectFormation.lua @@ -25,12 +25,12 @@ end --添加事件监听(用于子类重写) function this:AddListener() - + Game.GlobalEvent:AddEvent(GameEvent.Explore.UpdateFormation,this.RefreshData) end --移除事件监听(用于子类重写) function this:RemoveListener() - + Game.GlobalEvent:RemoveEvent(GameEvent.Explore.UpdateFormation,this.RefreshData) end --界面打开时调用(用于子类重写) @@ -44,6 +44,16 @@ function this:OnOpen(_parent,...) this.mapData = args[3] end +function this.RefreshData() + if this.typeIndex == 0 then + this.data = ExploreManager.GetFormationData(1) + else + this.data = ExploreManager.GetFormationData(0) + end + this.mapData = ExploreManager.ExploreMapData[this.mapData.mapId] + this:OnShow() +end + function this:OnShow() for i = 1,math.max(#this.itemList,#this.data) do if not this.data[i] then diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index da9dbf1b7a..cd3593c6dc 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -6302,6 +6302,7 @@ function NetManager.ExplorerMapRewardRequest(typeId,teamId,fun) data.type = typeId data.teamId = teamId local msg = data:SerializeToString() + LogGreen("data.type:"..data.type.." data.teamId:"..data.teamId) Network:SendMessageWithCallBack(MessageTypeProto_pb.ExplorerMapRewardRequest, MessageTypeProto_pb.ExplorerMapRewardResponse, msg, function(buffer) local data = buffer:DataByte() local msg = PlayerInfoProto_pb.ExplorerMapRewardResponse()