From 80deb6428fa3842fd1e205546d85168fa430226b Mon Sep 17 00:00:00 2001
From: jiaoyangna <3046463818@qq.com>
Date: Sun, 7 Feb 2021 17:54:48 +0800
Subject: [PATCH] =?UTF-8?q?=E5=9B=9B=E7=81=B5=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../FourElementMonsterCampPanel.prefab | 182 +++++++++++++-----
.../Expedition/View/MonsterFormationInfo.lua | 2 +-
.../Modules/Formation/FormationPanelV2.lua | 2 +-
.../Formation/View/FourElementFormation.lua | 6 +-
.../MonsterCamp/MonsterCampManager.lua | 23 +++
.../~Lua/View/FourElementSingleWave.lua | 12 +-
6 files changed, 169 insertions(+), 58 deletions(-)
diff --git a/Assets/ManagedResources/Prefabs/UI/MonsterCamp/FourElementMonsterCampPanel.prefab b/Assets/ManagedResources/Prefabs/UI/MonsterCamp/FourElementMonsterCampPanel.prefab
index 30691cb725..695ac1ab6b 100644
--- a/Assets/ManagedResources/Prefabs/UI/MonsterCamp/FourElementMonsterCampPanel.prefab
+++ b/Assets/ManagedResources/Prefabs/UI/MonsterCamp/FourElementMonsterCampPanel.prefab
@@ -34,6 +34,7 @@ RectTransform:
- {fileID: 4824884566415319091}
- {fileID: 4338331143962917799}
- {fileID: 402076064177301732}
+ - {fileID: 4711150923135007967}
- {fileID: 7806638948486298782}
m_Father: {fileID: 7806638948721940619}
m_RootOrder: 2
@@ -5984,8 +5985,8 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 9034419301867267253}
- - {fileID: 7927477734348558836}
- {fileID: 7465417769745387018}
+ - {fileID: 7927477734348558836}
m_Father: {fileID: 402076064177301732}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -6105,6 +6106,134 @@ MonoBehaviour:
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
+--- !u!1 &2162413284982528109
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 4711150923135007967}
+ - component: {fileID: 5026953602875523087}
+ - component: {fileID: 3609844887995301268}
+ - component: {fileID: 2069817835011753914}
+ - component: {fileID: 8329350526091259844}
+ m_Layer: 5
+ m_Name: btn
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!224 &4711150923135007967
+RectTransform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2162413284982528109}
+ m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 0.9997899, y: 0.9997899, z: 0.9997899}
+ m_Children: []
+ m_Father: {fileID: 5915792893035856279}
+ m_RootOrder: 5
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+ m_AnchorMin: {x: 0.5, y: 0.5}
+ m_AnchorMax: {x: 0.5, y: 0.5}
+ m_AnchoredPosition: {x: 0, y: 35.014}
+ m_SizeDelta: {x: 246, y: 299.83}
+ m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &5026953602875523087
+CanvasRenderer:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2162413284982528109}
+ m_CullTransparentMesh: 0
+--- !u!114 &3609844887995301268
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2162413284982528109}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Navigation:
+ m_Mode: 3
+ m_SelectOnUp: {fileID: 0}
+ m_SelectOnDown: {fileID: 0}
+ m_SelectOnLeft: {fileID: 0}
+ m_SelectOnRight: {fileID: 0}
+ m_Transition: 3
+ m_Colors:
+ m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
+ m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
+ m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
+ m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
+ m_ColorMultiplier: 1
+ m_FadeDuration: 0.1
+ m_SpriteState:
+ m_HighlightedSprite: {fileID: 0}
+ m_PressedSprite: {fileID: 0}
+ m_DisabledSprite: {fileID: 0}
+ m_AnimationTriggers:
+ m_NormalTrigger: Normal
+ m_HighlightedTrigger: Highlighted
+ m_PressedTrigger: Pressed
+ m_DisabledTrigger: Disabled
+ m_Interactable: 1
+ m_TargetGraphic: {fileID: 8329350526091259844}
+ m_OnClick:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
+ Culture=neutral, PublicKeyToken=null
+--- !u!95 &2069817835011753914
+Animator:
+ serializedVersion: 3
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2162413284982528109}
+ m_Enabled: 1
+ m_Avatar: {fileID: 0}
+ m_Controller: {fileID: 9100000, guid: 6ffe000b5a58aac48a9d130543849d76, type: 2}
+ m_CullingMode: 0
+ m_UpdateMode: 0
+ m_ApplyRootMotion: 0
+ m_LinearVelocityBlending: 0
+ m_WarningMessage:
+ m_HasTransformHierarchy: 1
+ m_AllowConstantClipSamplingOptimization: 1
+ m_KeepAnimatorControllerStateOnDisable: 0
+--- !u!114 &8329350526091259844
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2162413284982528109}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: e459a084d8e15a240b58db751097122b, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: 1, g: 1, b: 1, a: 1}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
--- !u!1 &2401087977383135857
GameObject:
m_ObjectHideFlags: 0
@@ -10806,7 +10935,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 6141158140942588348}
- m_RootOrder: 2
+ m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@@ -11691,7 +11820,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 6141158140942588348}
- m_RootOrder: 1
+ m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@@ -12320,7 +12449,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
- m_AnchoredPosition: {x: -0.000019452498, y: 38.649918}
+ m_AnchoredPosition: {x: -0.00003363206, y: 38.649918}
m_SizeDelta: {x: 0, y: 118.97}
m_Pivot: {x: 1, y: 1}
--- !u!114 &7806638948134227578
@@ -12558,7 +12687,7 @@ RectTransform:
- {fileID: 6761671893680758465}
- {fileID: 7806638948134227524}
m_Father: {fileID: 5915792893035856279}
- m_RootOrder: 5
+ m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@@ -13029,7 +13158,6 @@ GameObject:
- component: {fileID: 6739939458115900380}
- component: {fileID: 2518969159541871627}
- component: {fileID: 7477869831985158126}
- - component: {fileID: 1864055160740398556}
m_Layer: 5
m_Name: Bg1
m_TagString: Untagged
@@ -13093,48 +13221,6 @@ MonoBehaviour:
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
---- !u!114 &1864055160740398556
-MonoBehaviour:
- m_ObjectHideFlags: 0
- m_CorrespondingSourceObject: {fileID: 0}
- m_PrefabInstance: {fileID: 0}
- m_PrefabAsset: {fileID: 0}
- m_GameObject: {fileID: 8235688988892365530}
- m_Enabled: 1
- m_EditorHideFlags: 0
- m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
- m_Name:
- m_EditorClassIdentifier:
- m_Navigation:
- m_Mode: 3
- m_SelectOnUp: {fileID: 0}
- m_SelectOnDown: {fileID: 0}
- m_SelectOnLeft: {fileID: 0}
- m_SelectOnRight: {fileID: 0}
- m_Transition: 1
- m_Colors:
- m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
- m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
- m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
- m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
- m_ColorMultiplier: 1
- m_FadeDuration: 0.1
- m_SpriteState:
- m_HighlightedSprite: {fileID: 0}
- m_PressedSprite: {fileID: 0}
- m_DisabledSprite: {fileID: 0}
- m_AnimationTriggers:
- m_NormalTrigger: Normal
- m_HighlightedTrigger: Highlighted
- m_PressedTrigger: Pressed
- m_DisabledTrigger: Disabled
- m_Interactable: 1
- m_TargetGraphic: {fileID: 7477869831985158126}
- m_OnClick:
- m_PersistentCalls:
- m_Calls: []
- m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
- Culture=neutral, PublicKeyToken=null
--- !u!1 &8651721783200003394
GameObject:
m_ObjectHideFlags: 0
diff --git a/Assets/ManagedResources/~Lua/Modules/Expedition/View/MonsterFormationInfo.lua b/Assets/ManagedResources/~Lua/Modules/Expedition/View/MonsterFormationInfo.lua
index 99e7996118..7a0499fa7b 100644
--- a/Assets/ManagedResources/~Lua/Modules/Expedition/View/MonsterFormationInfo.lua
+++ b/Assets/ManagedResources/~Lua/Modules/Expedition/View/MonsterFormationInfo.lua
@@ -139,7 +139,7 @@ function this:OnShow(_parent,...)
color = "17232A"
end
this.fightBtnNum.text =string.format("%s",color,costNum)
- this.fightBtnText.text = "扫荡"
+ this.fightBtnText.text = string.format("%s",color,"扫荡")
if buyTime < 1 then
Util.SetGray(this.fightBtn,true)
end
diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua
index b564091436..b78b2d4e97 100644
--- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua
+++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua
@@ -906,7 +906,7 @@ function this.SetOneKeyGo(rules1,rules2)
if panelType == FORMATION_TYPE.EXPEDITION then
heros = ExpeditionManager.GetAllHeroDatas(heros,limitLevel)
elseif panelType == FORMATION_TYPE.FOUR_ELEMENT then
- heros = MonsterCampManager.GetFriendHelpHero(limitLevel,heros)
+ heros = this.opView.GetHeros(limitLevel)
end
--按战力从大到小排序
table.sort(heros,function(a,b)
diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/View/FourElementFormation.lua b/Assets/ManagedResources/~Lua/Modules/Formation/View/FourElementFormation.lua
index abacbda7b4..b79a0d202e 100644
--- a/Assets/ManagedResources/~Lua/Modules/Formation/View/FourElementFormation.lua
+++ b/Assets/ManagedResources/~Lua/Modules/Formation/View/FourElementFormation.lua
@@ -53,8 +53,10 @@ end
function this.GetHeros(limitLevel)
local heros = HeroManager.GetHeroDataByProperty(curType, limitLevel)
if MonsterCampManager.GetFriendHelpHero(curType) then
- local hero = MonsterCampManager.GetFriendHelpHero(curType).hero
- table.insert(heros,1,hero)
+ if MonsterCampManager.GetFriendHelpHero(curType).player.state ~= 1 then
+ local hero = MonsterCampManager.GetFriendHelpHero(curType).hero
+ table.insert(heros,1,hero)
+ end
end
return heros
end
diff --git a/Assets/ManagedResources/~Lua/Modules/MonsterCamp/MonsterCampManager.lua b/Assets/ManagedResources/~Lua/Modules/MonsterCamp/MonsterCampManager.lua
index a1a7c62efd..7ac0e8a033 100644
--- a/Assets/ManagedResources/~Lua/Modules/MonsterCamp/MonsterCampManager.lua
+++ b/Assets/ManagedResources/~Lua/Modules/MonsterCamp/MonsterCampManager.lua
@@ -177,6 +177,7 @@ function this.ExecuteFightBattle(id,type,func,curType)
LogGreen(tostring(this.fourMonsterData[curType].monsterWave))
this.fourMonsterData[curType].monsterWave = id
this.fourMonsterData[curType].canFightTime = this.fourMonsterData[curType].canFightTime - 1
+ this.SaveFormation(curType)
if this.fourMonsterData[curType].openState ~= 0 then
UIManager.OpenPanel(UIName.FourElementMonsterCampPanel,curType)
else
@@ -196,6 +197,28 @@ function this.ExecuteFightBattle(id,type,func,curType)
end)
end
+function this.SaveFormation(curType)
+ local curFormation = FormationManager.GetFormationByID(1700 + curType)
+ local data = this.GetFriendHelpHero(curType)
+ --上阵列表赋值
+ local choosedList ={}
+ if data then
+ for j = 1, #curFormation.teamHeroInfos do
+ local teamInfo = curFormation.teamHeroInfos[j]
+ -- 加空判断避免不知名错误
+ if teamInfo and teamInfo.heroId == data.hero.dynamicId then
+ data.player.state = 1
+ else
+ table.insert(choosedList, {heroId = teamInfo.heroId,position=teamInfo.position})
+ end
+ end
+ FormationManager.RefreshFormation(
+ (1700 + curType),
+ choosedList,
+ FormationManager.formationList[(1700 + curType)].teamPokemonInfos
+ )
+ end
+end
------------------------------四灵试炼 助战---------------------------------------
diff --git a/Assets/ManagedResources/~Lua/View/FourElementSingleWave.lua b/Assets/ManagedResources/~Lua/View/FourElementSingleWave.lua
index e73e90b1e7..9ec4a8570d 100644
--- a/Assets/ManagedResources/~Lua/View/FourElementSingleWave.lua
+++ b/Assets/ManagedResources/~Lua/View/FourElementSingleWave.lua
@@ -34,11 +34,10 @@ function FourElementSingleWave:InitComponent(go,_data,_curType)
--self.starGrid = Util.GetGameObject(self.hero,"starGrid")
self.starGrid = Util.GetGameObject(self.hero,"StarGrid")
self.name=Util.GetGameObject(self.hero,"Name/Text"):GetComponent("Text")
-
+ self.btn=Util.GetGameObject(go,"bg/btn")
self.data = _data
self.trailData = MonsterCampManager.GetCurFourElementMonsterInfo(_curType)
- self.storeDataId,self.itemId,self.costNum = MonsterCampManager.GetCost(self.trailData.fourElementType)
- self.freeTimes,self.buyTimes = MonsterCampManager.GetTimeTip(self.trailData.fourElementType)
+
self.rewardList = {}
for i = 1, self.rewardGrid.transform.childCount do
local temp = self:NewItemView(SubUIConfig.ItemView, self.rewardGrid.transform:GetChild(i-1).gameObject)
@@ -47,6 +46,7 @@ function FourElementSingleWave:InitComponent(go,_data,_curType)
end
function FourElementSingleWave:OnOpen()
+ self:UpdatePrivilage()
self.fightBtnIcon.gameObject:SetActive(false)
self.fightBtnNum.gameObject:SetActive(false)
self.wave.text = "第"..self.data.wave.."层"
@@ -82,7 +82,7 @@ function FourElementSingleWave:OnOpen()
-- Util.AddOnceClick(self.hero, function()
-- UIManager.OpenPanel(UIName.ExpeditionMonsterInfoPopup,EXPEDITON_POPUP_TYPE.FourElementMonster,self.trailData.fourElementType,self.data.wave)
-- end)
- Util.AddOnceClick(self.frame.gameObject, function()
+ Util.AddOnceClick(self.btn, function()
UIManager.OpenPanel(UIName.ExpeditionMonsterInfoPopup,EXPEDITON_POPUP_TYPE.FourElementMonster,self.trailData.fourElementType,self.data.wave)
end)
Util.AddOnceClick(self.fight, function()
@@ -159,7 +159,7 @@ function FourElementSingleWave:SingleHeroDataShow(monConfig,heroData)
self.name.text = heroData.name
end
-function FourElementSingleWave:UpdatePrivilage(rewardShow)
+function FourElementSingleWave:UpdatePrivilage()
self.storeDataId,self.itemId,self.costNum = MonsterCampManager.GetCost(self.trailData.fourElementType)
self.freeTimes,self.buyTimes = MonsterCampManager.GetTimeTip(self.trailData.fourElementType)
self:SetIcon()
@@ -184,7 +184,7 @@ function FourElementSingleWave:SetIcon()
color = "17232A"
end
self.fightBtnNum.text =string.format("%s",color,self.costNum)
- self.fightBtnText.text = "扫荡"
+ self.fightBtnText.text = string.format("%s",color,"扫荡")
if self.buyTimes < 1 then
Util.SetGray(self.fight,true)
end