探索提交
parent
21e5b0846b
commit
5f9f7da264
|
@ -40,12 +40,11 @@ function ExploreMainPanel:BindEvent()
|
||||||
UIManager.OpenPanel(UIName.GeneralInfoPopup,GENERALINFO_TYPE.ExploreMapTip,ExploreManager.GetExploreMapTipData(self.mapId))
|
UIManager.OpenPanel(UIName.GeneralInfoPopup,GENERALINFO_TYPE.ExploreMapTip,ExploreManager.GetExploreMapTipData(self.mapId))
|
||||||
end)
|
end)
|
||||||
Util.AddClick(self.jinruBtn,function()
|
Util.AddClick(self.jinruBtn,function()
|
||||||
-- if LengthOfTable(self.data[self.mapId].formations) > 0 then
|
if LengthOfTable(self.data[self.mapId].formations) > 0 then
|
||||||
-- UIManager.OpenPanel(UIName.ExplorePanel,ExploreManager.ExploreMapData[self.mapId])
|
UIManager.OpenPanel(UIName.ExplorePanel,ExploreManager.ExploreMapData[self.mapId])
|
||||||
-- else
|
else
|
||||||
-- PopupTipPanel.ShowTip("目标区域无探索队伍,无法进入!")
|
PopupTipPanel.ShowTip("目标区域无探索队伍,无法进入!")
|
||||||
-- end
|
end
|
||||||
UIManager.OpenPanel(UIName.ExplorePanel,ExploreManager.ExploreMapData[self.mapId])
|
|
||||||
end)
|
end)
|
||||||
Util.AddClick(self.tansuoBtn,function()
|
Util.AddClick(self.tansuoBtn,function()
|
||||||
--选择队伍弹窗
|
--选择队伍弹窗
|
||||||
|
@ -55,10 +54,12 @@ end
|
||||||
|
|
||||||
--添加事件监听(用于子类重写)
|
--添加事件监听(用于子类重写)
|
||||||
function ExploreMainPanel:AddListener()
|
function ExploreMainPanel:AddListener()
|
||||||
|
Game.GlobalEvent:AddEvent(GameEvent.Explore.UpdateFormation,self.OnShow,self)
|
||||||
end
|
end
|
||||||
|
|
||||||
--移除事件监听(用于子类重写)
|
--移除事件监听(用于子类重写)
|
||||||
function ExploreMainPanel:RemoveListener()
|
function ExploreMainPanel:RemoveListener()
|
||||||
|
Game.GlobalEvent:RemoveEvent(GameEvent.Explore.UpdateFormation,self.OnShow,self)
|
||||||
end
|
end
|
||||||
|
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
|
@ -105,6 +106,7 @@ function ExploreMainPanel:SetMapData()
|
||||||
self.mapList[k].data = v
|
self.mapList[k].data = v
|
||||||
self.mapList[k].go.gameObject:SetActive(true)
|
self.mapList[k].go.gameObject:SetActive(true)
|
||||||
self.mapList[k].go.transform.localPosition = v.pos
|
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.sprite = self.spLoader:LoadSprite(v.iconName)
|
||||||
self.mapList[k].mapBgIma:SetNativeSize()
|
self.mapList[k].mapBgIma:SetNativeSize()
|
||||||
SetNumShow(self.mapList[k].minForce,self.mapList[k].force.gameObject,v.force)
|
SetNumShow(self.mapList[k].minForce,self.mapList[k].force.gameObject,v.force)
|
||||||
|
|
|
@ -69,6 +69,7 @@ function this.UpdateFormationsData(_data)
|
||||||
for i = 1,#_data do
|
for i = 1,#_data do
|
||||||
this.UpdateFormationData(_data[i])
|
this.UpdateFormationData(_data[i])
|
||||||
end
|
end
|
||||||
|
Game.GlobalEvent:DispatchEvent(GameEvent.Explore.UpdateFormation)
|
||||||
end
|
end
|
||||||
|
|
||||||
--刷新编队
|
--刷新编队
|
||||||
|
|
|
@ -120,14 +120,14 @@ function this:Init()
|
||||||
this.playerViews[v.formationId]:SetData((index3 == 1 and index1 or index2),index4,false,v)
|
this.playerViews[v.formationId]:SetData((index3 == 1 and index1 or index2),index4,false,v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- 设置相机初始化位置
|
||||||
|
local v4 = this.playerViews[0].transform.localPosition
|
||||||
|
v4.z = -50
|
||||||
|
TileMapView.SetCameraPos(v4)
|
||||||
|
-- 初始化两个地图标志
|
||||||
|
this.LoadMapIcon()
|
||||||
|
this.SetPlayerViewWalk()
|
||||||
end)
|
end)
|
||||||
-- 设置相机初始化位置
|
|
||||||
local v4 = this.playerViews[0].transform.localPosition
|
|
||||||
v4.z = -50
|
|
||||||
TileMapView.SetCameraPos(v4)
|
|
||||||
-- 初始化两个地图标志
|
|
||||||
this.LoadMapIcon()
|
|
||||||
this.SetPlayerViewWalk()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function this:LoadMapData()
|
function this:LoadMapData()
|
||||||
|
|
|
@ -60,7 +60,6 @@ function this.On_Btn2_Click()
|
||||||
FormationManager.SaveFormation(k, v.formationinfo,
|
FormationManager.SaveFormation(k, v.formationinfo,
|
||||||
FormationManager.formationList[k].teamPokemonInfos)
|
FormationManager.formationList[k].teamPokemonInfos)
|
||||||
end
|
end
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.Explore.UpdateFormation)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ local sorting = 0
|
||||||
local contentScripts = {
|
local contentScripts = {
|
||||||
[GENERALSIZEFITTER_TYPE.ExploreSelectFormation] = {view = require("Modules/GeneralPanel/GeneralSizeFitterPopup_ExploreSelectFormation"), panelName = "GeneralSizeFitterPopup_ExploreSelectFormation"},
|
[GENERALSIZEFITTER_TYPE.ExploreSelectFormation] = {view = require("Modules/GeneralPanel/GeneralSizeFitterPopup_ExploreSelectFormation"), panelName = "GeneralSizeFitterPopup_ExploreSelectFormation"},
|
||||||
[GENERALSIZEFITTER_TYPE.OneKeyExplore] = {view = require("Modules/GeneralPanel/GeneralSizeFitterPopup_OneKeyExplore"), panelName = "GeneralSizeFitterPopup_OneKeyExplore"},
|
[GENERALSIZEFITTER_TYPE.OneKeyExplore] = {view = require("Modules/GeneralPanel/GeneralSizeFitterPopup_OneKeyExplore"), panelName = "GeneralSizeFitterPopup_OneKeyExplore"},
|
||||||
|
|
||||||
}
|
}
|
||||||
--子模块预设
|
--子模块预设
|
||||||
local contentPrefabs={}
|
local contentPrefabs={}
|
||||||
|
|
|
@ -25,12 +25,12 @@ end
|
||||||
|
|
||||||
--添加事件监听(用于子类重写)
|
--添加事件监听(用于子类重写)
|
||||||
function this:AddListener()
|
function this:AddListener()
|
||||||
|
Game.GlobalEvent:AddEvent(GameEvent.Explore.UpdateFormation,this.RefreshData)
|
||||||
end
|
end
|
||||||
|
|
||||||
--移除事件监听(用于子类重写)
|
--移除事件监听(用于子类重写)
|
||||||
function this:RemoveListener()
|
function this:RemoveListener()
|
||||||
|
Game.GlobalEvent:RemoveEvent(GameEvent.Explore.UpdateFormation,this.RefreshData)
|
||||||
end
|
end
|
||||||
|
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
|
@ -44,6 +44,16 @@ function this:OnOpen(_parent,...)
|
||||||
this.mapData = args[3]
|
this.mapData = args[3]
|
||||||
end
|
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()
|
function this:OnShow()
|
||||||
for i = 1,math.max(#this.itemList,#this.data) do
|
for i = 1,math.max(#this.itemList,#this.data) do
|
||||||
if not this.data[i] then
|
if not this.data[i] then
|
||||||
|
|
|
@ -6302,6 +6302,7 @@ function NetManager.ExplorerMapRewardRequest(typeId,teamId,fun)
|
||||||
data.type = typeId
|
data.type = typeId
|
||||||
data.teamId = teamId
|
data.teamId = teamId
|
||||||
local msg = data:SerializeToString()
|
local msg = data:SerializeToString()
|
||||||
|
LogGreen("data.type:"..data.type.." data.teamId:"..data.teamId)
|
||||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.ExplorerMapRewardRequest, MessageTypeProto_pb.ExplorerMapRewardResponse, msg, function(buffer)
|
Network:SendMessageWithCallBack(MessageTypeProto_pb.ExplorerMapRewardRequest, MessageTypeProto_pb.ExplorerMapRewardResponse, msg, function(buffer)
|
||||||
local data = buffer:DataByte()
|
local data = buffer:DataByte()
|
||||||
local msg = PlayerInfoProto_pb.ExplorerMapRewardResponse()
|
local msg = PlayerInfoProto_pb.ExplorerMapRewardResponse()
|
||||||
|
|
Loading…
Reference in New Issue