From 74b2ef62ca62f88010d597defa567bcac9a59683 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Tue, 27 Apr 2021 13:48:17 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=81=AD=E5=96=9C=E8=8E=B7=E5=BE=97?= =?UTF-8?q?=E3=80=91=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefabs/UI/Popup/RewardItemPopup.prefab | 324 +++++++++++++++++- .../Modules/Bag/BagResolveAnCompoundPanel.lua | 2 +- .../~Lua/Modules/Popup/RewardItemPopup.lua | 214 +++--------- 3 files changed, 360 insertions(+), 180 deletions(-) diff --git a/Assets/ManagedResources/Prefabs/UI/Popup/RewardItemPopup.prefab b/Assets/ManagedResources/Prefabs/UI/Popup/RewardItemPopup.prefab index aacf7b3ada..aa82f4a0dd 100644 --- a/Assets/ManagedResources/Prefabs/UI/Popup/RewardItemPopup.prefab +++ b/Assets/ManagedResources/Prefabs/UI/Popup/RewardItemPopup.prefab @@ -477,7 +477,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchoredPosition: {x: -287, y: -871} m_SizeDelta: {x: 154.1, y: 159.8} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &222009837576954050 @@ -752,7 +752,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: 9f6415c5993d0154eba0d2d3bd1ffe93, type: 2} + m_Material: {fileID: 2100000, guid: 42263669b8cc5c04a96720be44775913, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -898,7 +898,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0.000061035156} m_SizeDelta: {x: 856.10004, y: 0} m_Pivot: {x: 0, y: 1} --- !u!114 &8389692685733247491 @@ -1729,7 +1729,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 50, y: -75} + m_AnchoredPosition: {x: 540, y: -75} m_SizeDelta: {x: 154.1, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1095481750047364519 @@ -3383,6 +3383,41 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 +--- !u!1 &1604633332735490176 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7843604255110776492} + m_Layer: 5 + m_Name: empty + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7843604255110776492 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1604633332735490176} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 6521713604475601393} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 540, y: -497.5} + m_SizeDelta: {x: 1080, y: 935} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1686586358350173549 GameObject: m_ObjectHideFlags: 0 @@ -5062,7 +5097,7 @@ RectTransform: - {fileID: 4914884123863773537} - {fileID: 5413706603785559337} m_Father: {fileID: 5744485977255746616} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -5151,6 +5186,7 @@ RectTransform: - {fileID: 5494418678873477441} - {fileID: 2019008144071928809} - {fileID: 4508881064897349635} + - {fileID: 6521713604475601393} - {fileID: 6182422547957876774} m_Father: {fileID: 224436599584278754} m_RootOrder: 1 @@ -5227,7 +5263,7 @@ MonoBehaviour: m_Left: 0 m_Right: 0 m_Top: 0 - m_Bottom: 0 + m_Bottom: 20 m_ChildAlignment: 1 m_Spacing: 0 m_ChildForceExpandWidth: 0 @@ -5563,6 +5599,81 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 +--- !u!1 &3370768863445929023 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 729992674260468650} + - component: {fileID: 2359606360096466151} + - component: {fileID: 4098279233995338792} + m_Layer: 5 + m_Name: grid + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &729992674260468650 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3370768863445929023} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 196785919107575387} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: -989} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2359606360096466151 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3370768863445929023} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -2095666955, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 30 + m_Bottom: 100 + m_ChildAlignment: 1 + m_StartCorner: 0 + m_StartAxis: 0 + m_CellSize: {x: 160, y: 160} + m_Spacing: {x: 20, y: 55} + m_Constraint: 1 + m_ConstraintCount: 5 +--- !u!114 &4098279233995338792 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3370768863445929023} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 0 + m_VerticalFit: 2 --- !u!1 &3463983068545149321 GameObject: m_ObjectHideFlags: 0 @@ -5929,7 +6040,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 1080.2, y: 1121.31} + m_SizeDelta: {x: 1080.2, y: 1000} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1764712078286467104 MonoBehaviour: @@ -6000,7 +6111,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &4508881064897349635 RectTransform: m_ObjectHideFlags: 0 @@ -6015,10 +6126,10 @@ RectTransform: m_Father: {fileID: 5744485977255746616} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 540, y: 0} - m_SizeDelta: {x: 1080, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 540, y: -87.5} + m_SizeDelta: {x: 1080, y: 75} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &5301713959679804370 MonoBehaviour: @@ -7193,6 +7304,96 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5628036115581829540} m_CullTransparentMesh: 0 +--- !u!1 &5651600672426435518 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6521713604475601393} + - component: {fileID: 8893471718189658728} + - component: {fileID: 2470159810803146418} + - component: {fileID: 1915842917415792817} + m_Layer: 5 + m_Name: grid2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &6521713604475601393 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5651600672426435518} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 196785919107575387} + - {fileID: 7843604255110776492} + m_Father: {fileID: 5744485977255746616} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 540, y: -582.5} + m_SizeDelta: {x: 1080, y: 1065} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &8893471718189658728 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5651600672426435518} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -2095666955, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 30 + m_Bottom: 100 + m_ChildAlignment: 1 + m_StartCorner: 0 + m_StartAxis: 0 + m_CellSize: {x: 1080, y: 935} + m_Spacing: {x: 20, y: 55} + m_Constraint: 1 + m_ConstraintCount: 5 +--- !u!114 &2470159810803146418 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5651600672426435518} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 0 + m_VerticalFit: 2 +--- !u!114 &1915842917415792817 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5651600672426435518} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -146154839, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &5693619736286800907 GameObject: m_ObjectHideFlags: 0 @@ -8214,6 +8415,105 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 +--- !u!1 &6757859283605255380 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 196785919107575387} + - component: {fileID: 3282425693574545143} + - component: {fileID: 8403851824746664966} + - component: {fileID: 5346122402485712555} + m_Layer: 5 + m_Name: scorll + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &196785919107575387 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6757859283605255380} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 729992674260468650} + m_Father: {fileID: 6521713604475601393} + m_RootOrder: 0 + 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: 0} + m_SizeDelta: {x: 1080, y: 1064} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &3282425693574545143 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6757859283605255380} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 1 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!222 &8403851824746664966 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6757859283605255380} + m_CullTransparentMesh: 0 +--- !u!114 &5346122402485712555 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6757859283605255380} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1367256648, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 729992674260468650} + m_Horizontal: 0 + m_Vertical: 1 + m_MovementType: 1 + m_Elasticity: 0.1 + m_Inertia: 1 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 0} + m_HorizontalScrollbar: {fileID: 0} + m_VerticalScrollbar: {fileID: 0} + m_HorizontalScrollbarVisibility: 0 + m_VerticalScrollbarVisibility: 0 + m_HorizontalScrollbarSpacing: 0 + m_VerticalScrollbarSpacing: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null --- !u!1 &6793220918854341703 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/ManagedResources/~Lua/Modules/Bag/BagResolveAnCompoundPanel.lua b/Assets/ManagedResources/~Lua/Modules/Bag/BagResolveAnCompoundPanel.lua index 3d8edd947b..ab10a21674 100644 --- a/Assets/ManagedResources/~Lua/Modules/Bag/BagResolveAnCompoundPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Bag/BagResolveAnCompoundPanel.lua @@ -299,7 +299,7 @@ function this.OnShowLayout3Data() local maxCompoundValue = math.floor(itemData.num/itemData.itemConfig.UsePerCount) compoundMaxNum=maxCompoundValue > gameSetting.HeroCompoundLimit and gameSetting.HeroCompoundLimit or maxCompoundValue endHeroNum=gameSetting.HeroNumlimit-LengthOfTable(HeroManager.GetAllHeroDatas()) - compoundMaxNum=compoundMaxNum >endHeroNum and endHeroNum or compoundMaxNum + compoundMaxNum= 50 > endHeroNum and endHeroNum or 50 elseif itemData.itemConfig.ItemType==ItemType.Box then--宝箱 this.nameText.text=Language[10194] this.btnCompoundText.text=Language[10195] diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemPopup.lua b/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemPopup.lua index b6221bbf56..e1907e880d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemPopup.lua @@ -29,12 +29,9 @@ function RewardItemPopup:InitComponent() --第一种显示 this.ScrollView = Util.GetGameObject(self.gameObject, "ScrollView") this.dropGrid= Util.GetGameObject(self.gameObject, "ScrollView/Content/grid") - itemListPrefab = {} - for i = 1, 25 do --初始缓存10个 - local view = SubUIManager.Open(SubUIConfig.ItemView, this.dropGrid.transform) - view.gameObject.name = "frame"..i - itemListPrefab[i] = view - end + this.dropGridArena= Util.GetGameObject(self.gameObject, "ScrollView/Content/grid2") + this.dropGrid2= Util.GetGameObject(self.gameObject, "ScrollView/Content/grid2/scorll/grid") + --关卡等级经验 this.lvAndExpGo=Util.GetGameObject(self.gameObject, "ScrollView/Content/bottom/lvAndExpGo") this.lv=Util.GetGameObject(self.gameObject, "ScrollView/Content/bottom/lvAndExpGo/lv"):GetComponent("Text") @@ -50,26 +47,6 @@ function RewardItemPopup:InitComponent() -- 任意位置继续 this.btnGoOn = Util.GetGameObject(self.gameObject, "btnBack/Image") - -- --第二种显示当超过25个元素时 - -- this.ScrollView2 = Util.GetGameObject(self.gameObject, "bg") - -- this.dropGridMax= Util.GetGameObject(self.gameObject, "bg/ScrollView2/ScrollView2/Content") - - -- itemListPrefabMax = {} - -- for i = 1, 25 do --初始缓存10个 - -- local view = SubUIManager.Open(SubUIConfig.ItemView, this.dropGridMax.transform) - -- view.gameObject.name = "frame"..i - -- itemListPrefabMax[i] = view - -- end - -- this.lvAndExpGoMax=Util.GetGameObject(self.gameObject, "bg/lvAndExpGo") - -- this.lvMax=Util.GetGameObject(self.gameObject, "bg/lvAndExpGo/lv"):GetComponent("Text") - -- this.expMax=Util.GetGameObject(self.gameObject, "bg/lvAndExpGo/exp"):GetComponent("Slider") - -- this.expTextMax=Util.GetGameObject(self.gameObject, "bg/lvAndExpGo/exp/Text"):GetComponent("Text") - -- this.lvUpImageMax=Util.GetGameObject(self.gameObject, "bg/lvAndExpGo/lvUpImage") - -- -- 战斗结果按钮 - -- this.btnResultMax = Util.GetGameObject(self.gameObject, "bg/btnResult") - -- this.btnMapBackMax = Util.GetGameObject(self.gameObject, "bg/btnBack") - -- this.btnBattleBackMax = Util.GetGameObject(self.gameObject, "bg/btnBattleBack") - --车迟斗法 显示 this.guildCarDelay = Util.GetGameObject(self.gameObject, "ScrollView/Content/Show/guildCarDelay") this.guildCarDelaysoreNum = Util.GetGameObject(this.guildCarDelay.gameObject, "soreNum"):GetComponent("Text") @@ -108,17 +85,10 @@ function RewardItemPopup:BindEvent() Util.AddClick(this.btnMapBack, function () self:ClosePanel() end) - -- Util.AddClick(this.btnMapBackMax, function () - -- self:ClosePanel() - -- end) Util.AddClick(this.btnResult, function () UIManager.OpenPanel(UIName.DamageResultPanel, 1) end) - -- Util.AddClick(this.btnResultMax, function () - -- UIManager.OpenPanel(UIName.DamageResultPanel, 1) - -- end) Util.AddClick(this.btnBattleBack, function () - --LogGreen("isBackBattle = true") isBackBattle = true BattleManager.BattleBackFun() end) @@ -150,7 +120,6 @@ function RewardItemPopup:OnOpen(...) local haveRecord = BattleRecordManager.isHaveRecord() this.btnResult:SetActive(haveRecord and args[5]) this.btnBattleBack:SetActive(haveRecord and args[5] and BattleManager.GetLastBattleType() ~= BATTLE_TYPE.MAP_FIGHT and not GuideManager.IsInMainGuide() and not MapManager.Mapping and BattleManager.GetLastBattleType() ~= BATTLE_TYPE.TASUILINGXIAO) - -- this.btnResultMax:SetActive(haveRecord and args[5]) this.expeditionGo:SetActive(compShowType == 5) this.guildDeathPos:SetActive(compShowType == 4)--十绝阵 this.guildTranscript:SetActive(compShowType == 6) @@ -160,30 +129,22 @@ function RewardItemPopup:OnOpen(...) local isHideBG = args[6] this.btnBack:GetComponent("Image").color = Color.New(0, 0, 0, isHideBG and 0 or 0.8) this.btnGoOn:SetActive(not isHideBG) - - if compShowType == 3 and not drop then + + if compShowType == 3 then this.GuildCarDelayShow() this.guildCarDelay:SetActive(compShowType == 3) - for i = 1, #itemListPrefab do - itemListPrefab[i].gameObject:SetActive(false) - end + elseif compShowType == 4 then + this.GuildDeathPosShow() + elseif compShowType == 6 then + this.GuildTranscriptShow() + elseif compShowType == 7 then--踏碎凌霄 + this.TaSuiLingXiaoShow() + end + --如果没有掉落就return + if #drop.itemlist < 1 and #drop.equipId < 1 and #drop.Hero < 1 and #drop.soulEquip < 1 and #drop.pokemon < 1 then return end - if compShowType == 4 then - this.GuildDeathPosShow() - end - if compShowType == 6 then - this.GuildTranscriptShow() - end - if compShowType == 7 then--踏碎凌霄 - this.TaSuiLingXiaoShow(#drop.itemlist) - if #drop.itemlist < 1 then - for i = 1, #itemListPrefab do - itemListPrefab[i].gameObject:SetActive(false) - end - return - end - end + local starItemDataList=BagManager.GetItemListFromTempBag(drop) -- LogError("获取宝物的数量:".. LengthOfTable(starItemDataList)) --做装备叠加特殊组拼数据 @@ -208,34 +169,46 @@ function RewardItemPopup:OnOpen(...) table.insert(itemDataList, v) end end - - this.SetComPShowState(compShowType) + LogGreen("Init #itemDataList:"..tostring(#itemDataList)) + this.InitGrid() if #itemDataList < 1 then self:ClosePanel() self:SelectCanPopUpBagMaxMessage() - -- elseif #itemDataList <= 25 then - -- self:SetItemShow(drop) - -- elseif #itemDataList > 25 then - -- self:SetItemShowMax(drop) else self:SetItemShow(drop) end + this.SetComPShowState(compShowType)--一些特殊显隐 SoundManager.PlaySound(SoundConfig.Sound_Reward) this.ShowLvAndExp() self:SelectCanPopUpBagMaxMessage() end + +function this.InitGrid() + this.dropGrid:SetActive(#itemDataList <= 20 ) + this.dropGridArena:SetActive(#itemDataList > 20 ) + itemListPrefab = {} + if #itemDataList <= 20 then + for i = 1, #itemDataList do --初始缓存<= 20 + local view = SubUIManager.Open(SubUIConfig.ItemView, this.dropGrid.transform) + view.gameObject.name = "frame"..i + itemListPrefab[i] = view + end + else + for i = 1, #itemDataList do --初始缓存> 20 + local view = SubUIManager.Open(SubUIConfig.ItemView, this.dropGrid2.transform) + view.gameObject.name = "frame"..i + itemListPrefab[i] = view + end + end +end + --一些元素的显隐 function this.SetComPShowState(type) this.btnBack:GetComponent("Button").enabled = type ~= 2 this.ScrollView:SetActive(#itemDataList >= 1 ) - -- this.ScrollView:SetActive(#itemDataList <= 25 ) - -- this.ScrollView2:SetActive(#itemDataList > 25 ) this.lvAndExpGo:SetActive(type == 1) this.btnMapBack:SetActive(type == 2) - -- this.lvAndExpGoMax:SetActive(type == 1) - -- this.btnMapBackMax:SetActive(type == 2) - -- this.btnMapBackMax:SetActive(type == 2) this.guildCarDelay:SetActive(type == 3) this.guildDeathPos:SetActive(type == 4) this.guildTranscript:SetActive(type == 6) @@ -263,7 +236,7 @@ function this.GuildDeathPosShow() end end --踏碎凌霄 挑战奖励掉落弹窗表现 -function this.TaSuiLingXiaoShow(num) +function this.TaSuiLingXiaoShow() if CommonActPageManager.TaSuiLingXiaoMsg then local curDmg = CommonActPageManager.TaSuiLingXiaoMsg.damageVal local maxDmg = CommonActPageManager.TaSuiLingXiaoHistoryDmg @@ -272,7 +245,6 @@ function this.TaSuiLingXiaoShow(num) local b = curDmg > maxDmg or curDmg < maxDmg this.tasuilingxiao_State.gameObject:SetActive(b) - -- this.tasuilingxiao:GetComponent("RectTransform").localPosition = Vector3.New(0,110*(math.floor(num/5)),0) if curDmg > maxDmg then this.tasuilingxiao_State.sprite=Util.LoadSprite("r_hero_zhanlishangsheng_png") elseif curDmg < maxDmg then @@ -306,11 +278,6 @@ function RewardItemPopup:OnSortingOrderChange() local curItemData=itemDataList[i] view:OnOpen(true,curItemData,1.15,true,true,false,self.sortingOrder) end - -- for i = 1, #itemListPrefabMax do - -- local view = itemListPrefabMax[i] - -- local curItemData=itemDataList[i] - -- view:OnOpen(true,curItemData,1.15,true,true,false,self.sortingOrder) - -- end end -- 根据物品列表数据显示物品 function RewardItemPopup:SetItemShow(drop) @@ -385,88 +352,6 @@ function RewardItemPopup:SetItemShow(drop) end callList:Pop()() end --- 根据物品列表数据显示物品 --- function RewardItemPopup:SetItemShowMax(drop) --- BagManager.OnShowTipDropNumZero(drop) --- if drop==nil then return end --- for i = 1, #itemDataList do --- itemDataList[i].itemConfig = itemConfig[itemDataList[i].sId] --- end --- self:ItemDataListSort(itemDataList) --- for i = 1, math.max(#itemDataList, #itemListPrefabMax) do --- local go = itemListPrefabMax[i] --- if not go then --- go = SubUIManager.Open(SubUIConfig.ItemView, this.dropGridMax.transform) --- go.gameObject.name = "frame"..i --- itemListPrefabMax[i] = go --- end --- go.gameObject:SetActive(false) --- end - --- callList:Clear() --- callList:Push(function () --- if isOpenGeiSSRAvtivityTime then --- isOpenGeiSSRAvtivityTime:Stop() --- isOpenGeiSSRAvtivityTime = nil --- end --- isOpenGeiSSRAvtivityTime = Timer.New(function () --- isPlayerAniEnd = true --- if isOpenGeiSSRAvtivity > 0 then --- HeroManager.DetectionOpenFiveStarActivity(isOpenGeiSSRAvtivity) --- end --- end, 0.5):Start() --- isPlayerAniEnd = true --- if isOpenGeiSSRAvtivity > 0 then --- HeroManager.DetectionOpenFiveStarActivity(isOpenGeiSSRAvtivity) --- end --- --在关卡界面获得装备 刷新下btview成员红点 --- -- Game.GlobalEvent:DispatchEvent(GameEvent.Equip.EquipChange) --- end) --- for i = #itemDataList, 1, -1 do --- isPlayerAniEnd = false --- local view = itemListPrefabMax[i] --- local curItemData=itemDataList[i] --- view:OnOpen(true,curItemData,1.15,true,true,false,self.sortingOrder) --- --view.gameObject:SetActive(false) --- callList:Push(function () --- local func = function() --- view.gameObject:SetActive(true) --- local btn = Util.GetGameObject(view.gameObject, "item/frame"):GetComponent("Button") --- btn.enabled = false --- PlayUIAnim(view.gameObject, function() --- btn.enabled = true --- end) --- --改为后端更新 --- --this.SetItemData2(itemDataList[i]) --- if i <= 25 then --- Timer.New(function () --- isPopGetSSR = false --- callList:Pop()() --- end, 0.05):Start() --- else --- isPopGetSSR = false --- callList:Pop()() --- end --- end --- if curItemData.configData and curItemData.itemType==3 and curItemData.configData.Quality == 5 then --- HeroManager.DetectionOpenFiveStarActivity(curItemData.configData.Star) --- end --- if curItemData.configData and curItemData.itemType==3 and curItemData.configData.Quality == 5 and showHero then--五星英雄 --- isPopGetSSR = true --- isOpenGeiSSRAvtivity = curItemData.configData.Star --- UIManager.OpenPanel(UIName.DropGetSSRHeroShopPanel,curItemData.backData, func) --- elseif curItemData.configData and curItemData.itemType==1 and --- (curItemData.configData.ItemType == ItemType.Title or curItemData.configData.ItemType == ItemType.Ride) then--皮肤 坐骑 --- -- isPopGetSSR = true --- -- UIManager.OpenPanel(UIName.DropGetPlayerDecorateShopPanel,curItemData.backData, func) --- func() --- else --- func() --- end --- end) --- end --- callList:Pop()() --- end --存储本地 function this.SetItemData2(itemdata) if itemdata.itemType==1 then @@ -508,17 +393,10 @@ end function this.ShowLvAndExp() --this.lvAndExpGo:SetActive(compShowType == 1) if compShowType == 1 then - -- if #itemDataList <= 25 then - this.exp.value=PlayerManager.exp/userLevelData[PlayerManager.level].Exp - this.expText.text=PlayerManager.exp.."/"..userLevelData[PlayerManager.level].Exp - this.lv.text= PlayerManager.level - this.lvUpImage:SetActive(FightPointPassManager.oldLevel 25 then - -- this.expMax.value=PlayerManager.exp/userLevelData[PlayerManager.level].Exp - -- this.expTextMax.text=PlayerManager.exp.."/"..userLevelData[PlayerManager.level].Exp - -- this.lvMax.text= PlayerManager.level - -- this.lvUpImageMax:SetActive(FightPointPassManager.oldLevel