diff --git a/Assets/ManagedResources/Atlas/HotRankAtlas/hotRank_bg.png b/Assets/ManagedResources/Atlas/HotRankAtlas/hotRank_bg.png new file mode 100644 index 0000000000..aad9e6359b Binary files /dev/null and b/Assets/ManagedResources/Atlas/HotRankAtlas/hotRank_bg.png differ diff --git a/Assets/ManagedResources/Atlas/HotRankAtlas/hotRank_bg.png.meta b/Assets/ManagedResources/Atlas/HotRankAtlas/hotRank_bg.png.meta new file mode 100644 index 0000000000..24a3924b90 --- /dev/null +++ b/Assets/ManagedResources/Atlas/HotRankAtlas/hotRank_bg.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 83da9ff80ee61124c84b3f8749a830ca +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 65 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 56 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 1cd063b17b87f544a9ab0fb78d6cb5ce + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: HotRankAtlas + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ManagedResources/Atlas/HotRankAtlas/hotRank_zan.png b/Assets/ManagedResources/Atlas/HotRankAtlas/hotRank_zan.png new file mode 100644 index 0000000000..27a8087424 Binary files /dev/null and b/Assets/ManagedResources/Atlas/HotRankAtlas/hotRank_zan.png differ diff --git a/Assets/ManagedResources/Atlas/HotRankAtlas/hotRank_zan.png.meta b/Assets/ManagedResources/Atlas/HotRankAtlas/hotRank_zan.png.meta new file mode 100644 index 0000000000..a9af7a5325 --- /dev/null +++ b/Assets/ManagedResources/Atlas/HotRankAtlas/hotRank_zan.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: fc803b6c0ebc833488ee07ae02f5d369 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 65 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 56 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 4a3954b4c5aa05341b9b37ae5814e436 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: HotRankAtlas + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ManagedResources/Prefabs/UI/GeneralPanel/GeneralBigPopup.prefab b/Assets/ManagedResources/Prefabs/UI/GeneralPanel/GeneralBigPopup.prefab index 3da87fe25a..a9228611c9 100644 --- a/Assets/ManagedResources/Prefabs/UI/GeneralPanel/GeneralBigPopup.prefab +++ b/Assets/ManagedResources/Prefabs/UI/GeneralPanel/GeneralBigPopup.prefab @@ -2350,7 +2350,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &1006421095 RectTransform: m_ObjectHideFlags: 0 @@ -10289,10 +10289,10 @@ RectTransform: m_Father: {fileID: 6669000462376630719} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 720, y: -50} - m_SizeDelta: {x: 60, y: 88} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8682382969320885722 CanvasRenderer: @@ -20931,10 +20931,10 @@ RectTransform: m_Father: {fileID: 6669000462376630719} 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: 580, y: -50} - m_SizeDelta: {x: 60, y: 88} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2548272237263765984 CanvasRenderer: @@ -24124,10 +24124,10 @@ RectTransform: m_Father: {fileID: 6669000462376630719} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 440, y: -50} - m_SizeDelta: {x: 60, y: 88} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &725074640987852237 CanvasRenderer: @@ -28134,7 +28134,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -3.1000977, y: -14.600098} + m_AnchoredPosition: {x: -3.1000977, y: -14.600586} m_SizeDelta: {x: -168.8, y: -584} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &3588302341315408117 @@ -30799,7 +30799,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1823191076860614843 RectTransform: m_ObjectHideFlags: 0 @@ -36848,10 +36848,10 @@ RectTransform: m_Father: {fileID: 6669000462376630719} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 160, y: -50} - m_SizeDelta: {x: 60, y: 88} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1752293183709431928 CanvasRenderer: @@ -37482,6 +37482,7 @@ GameObject: - component: {fileID: 7336085064903931144} - component: {fileID: 8046442266353428765} - component: {fileID: 7092694893323203805} + - component: {fileID: 1560321842092125119} m_Layer: 5 m_Name: hero m_TagString: Untagged @@ -37545,6 +37546,48 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 +--- !u!114 &1560321842092125119 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6744069080421557670} + 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: 7092694893323203805} + 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 &6767514454267608244 GameObject: m_ObjectHideFlags: 0 @@ -40706,6 +40749,7 @@ GameObject: - component: {fileID: 8306107612781045166} - component: {fileID: 1319808899209099893} - component: {fileID: 6492142687987720600} + - component: {fileID: 6886144436042898446} m_Layer: 5 m_Name: icon m_TagString: Untagged @@ -40769,6 +40813,48 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 +--- !u!114 &6886144436042898446 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7442490526007532560} + 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: 6492142687987720600} + 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 &7447930034037549550 GameObject: m_ObjectHideFlags: 0 @@ -43600,8 +43686,8 @@ RectTransform: 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.61627, y: 80.399994} - m_SizeDelta: {x: 1016.6, y: 1188.2} + m_AnchoredPosition: {x: 0.61627, y: 73.5} + m_SizeDelta: {x: 1016.6, y: 1174.4} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1091340552195664627 CanvasRenderer: @@ -45798,7 +45884,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 11.4, y: -0.000022888} - m_SizeDelta: {x: 948.1, y: 0} + m_SizeDelta: {x: 948.1, y: 149} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1478443720213518412 CanvasRenderer: @@ -46390,7 +46476,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -46514,10 +46600,10 @@ RectTransform: m_Father: {fileID: 6669000462376630719} 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: 300, y: -50} - m_SizeDelta: {x: 60, y: 88} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5187175447103501528 CanvasRenderer: diff --git a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/GeneralBigPopup.lua b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/GeneralBigPopup.lua index c3edbaf08c..79a47f0d7f 100644 --- a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/GeneralBigPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/GeneralBigPopup.lua @@ -47,6 +47,8 @@ local contentScripts = { [GENERAL_POPUP_TYPE.GemCompound] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_GemCompound"), panelName = "GeneralBigPopup_GemCompound"}, --神印 [GENERAL_POPUP_TYPE.GodPrintUp ] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_GodPrintUp"), panelName = "GeneralBigPopup_GodPrintUp"}, + --英雄热度排行榜 + [GENERAL_POPUP_TYPE.GiveLikeHotHero ] = {view = require("Modules/Popup/View/GeneralBigPopup_GiveLikeHotHero"), panelName = "GeneralBigPopup_GiveLikeHotHero"}, } --子模块预设 local contentPrefabs={} @@ -58,7 +60,9 @@ function GeneralBigPopup:InitComponent() this.spLoader = SpriteLoader.New() this.contents=Util.GetGameObject(this.gameObject,"Contents") this.backBtn=Util.GetGameObject(this.contents,"BG/BackBtn") + this.backBtn2=Util.GetGameObject(this.contents,"BG2/BackBtn") this.BG=Util.GetGameObject(this.contents,"BG") + this.BG2=Util.GetGameObject(this.contents,"BG2") this.Mask=Util.GetGameObject(this.gameObject,"Mask") this.BG:SetActive(true) this.Mask:SetActive(true) @@ -82,6 +86,10 @@ function GeneralBigPopup:BindEvent() Game.GlobalEvent:DispatchEvent(GameEvent.Bag.OnTempBagChanged) self:ClosePanel() end) + Util.AddClick(this.backBtn2,function() + Game.GlobalEvent:DispatchEvent(GameEvent.Bag.OnTempBagChanged) + self:ClosePanel() + end) Util.AddClick(this.Mask,function() Game.GlobalEvent:DispatchEvent(GameEvent.Bag.OnTempBagChanged) self:ClosePanel() @@ -111,6 +119,7 @@ function GeneralBigPopup:OnOpen(popupKey,...) end this.Mask:SetActive(popupKey ~= GENERAL_POPUP_TYPE.Onhook) this.BG:SetActive(popupKey ~= GENERAL_POPUP_TYPE.Onhook) + this.BG2:SetActive(popupKey == GENERAL_POPUP_TYPE.GiveLikeHotHero) this.popupKey = popupKey contentScripts[this.popupKey].view:OnShow(this,onOpenArgs)--1、传入自己 2、传入不定参 end diff --git a/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua index 7b5d670dd5..a6e31cfcea 100644 --- a/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua @@ -150,7 +150,7 @@ function this:InitComponent() this.gmRedPoint:SetActive(false) this.btnHotRank=Util.GetGameObject(self.gameObject,"RightDown/btnHotRank") this.hrRedPoint = Util.GetGameObject(this.btnHotRank,"redPoint") - this.btnHotRank:SetActive(false) + --this.btnHotRank:SetActive(false) this.hrRedPoint:SetActive(false) --gm礼包 this.btnGMGift=Util.GetGameObject(self.gameObject,"RightDown/btnGMGift") diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index 89adad9a49..fe66532237 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -6798,7 +6798,6 @@ function NetManager.QueryWeekCardInfoRequest(id,func) local msg = data:SerializeToString() Network:SendMessageWithCallBack(MessageTypeProto_pb.QueryWeekCardInfoRequest, MessageTypeProto_pb.QueryWeekCardInfoResponse,msg, function(buffer) -- LogError("buffer=="..buffer) - LogError("11111111111111111") local data = buffer:DataByte() local msg1 = PlayerInfoProto_pb.QueryWeekCardInfoResponse() msg1:ParseFromString(data) @@ -6853,19 +6852,38 @@ function NetManager.CompareNumBonusRequest(levelId,func) end) end +function NetManager.LikeHeroRankRequest(type,id,func) + local data=HeroInfoProto_pb.LikeHeroRankRequest() + data.rankSubId=type + data.heroTid=id + local msg = data:SerializeToString() + Network:SendMessageWithCallBack(MessageTypeProto_pb.LIKE_HERO_RANK_REQUEST,MessageTypeProto_pb.LIKE_HERO_RANK_RESPONSE,msg,function(buffer) + local data = buffer:DataByte() + --local msg = PlayerInfoProto_pb.CompareNumBonusResponse() + --msg:ParseFromString(data) + LogError("点赞成功") + PopupTipPanel.ShowTip("点赞成功") + if func then + func() + end + end) +end + + function NetManager.UserLikeHeroRankRequest(rankId,func) - -- local data = HeroInfoProto_pb.userLikeHeroRankInfoRequest() - -- data.rankSubId=rankId - -- local msg = data:SerializeToString() - -- Network:SendMessageWithCallBack(MessageTypeProto_pb.USER_LIKE_HERO_RANK_INFO_REQUEST,MessageTypeProto_pb.COMPARENUM_BONUS_RESPONSE,msg,function(buffer) - -- local data = buffer:DataByte() - -- local msg = PlayerInfoProto_pb.CompareNumBonusResponse() - -- msg:ParseFromString(data) - -- if func then - -- func(msg) - -- end - -- end) + local data = HeroInfoProto_pb.userLikeHeroRankInfoRequest() + data.rankSubId=rankId + local msg = data:SerializeToString() + Network:SendMessageWithCallBack(MessageTypeProto_pb.USER_LIKE_HERO_RANK_INFO_REQUEST,MessageTypeProto_pb.USER_LIKE_HERO_RANK_INFO_RESPONSE,msg,function(buffer) + local data = buffer:DataByte() + local msg = HeroInfoProto_pb.userLikeHeroRankInfoResponse() + msg:ParseFromString(data) + + if func then + func(msg) + end + end) end function NetManager.TowerCleanfloorRequest(func) diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralBigPopup_GiveLikeHotHero.lua b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralBigPopup_GiveLikeHotHero.lua new file mode 100644 index 0000000000..6ce459ac48 --- /dev/null +++ b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralBigPopup_GiveLikeHotHero.lua @@ -0,0 +1,292 @@ +----- 送神弹窗 ----- +local this = {} +--传入父脚本模块 +local parent +--传入特效层级 +local sortingOrder=0 +local heros=nil +local confirmFunc=nil +local currPro=0 +local curPage = 1 +local type=1 +local curZanId=0 +local fiveHero={} +local newHeroId=0 +local heroConfig=ConfigManager.GetConfig(ConfigName.HeroConfig) +local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig) +local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig) +local hotRankConfig=ConfigManager.GetConfig(ConfigName.HotRanking) +local specialConfig=ConfigManager.GetConfigData(ConfigName.SpecialConfig,152) +local TabBox = require("Modules/Common/TabBox") + local _TabData={ +-- [1] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "人气热榜" }, +-- [2] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "山河社稷图" }, +-- [3] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "心魔试炼" }, +-- [4] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "大闹天宫" }, + } +local _TabFontColor = { default = Color.New(130 / 255, 128 / 255, 120 / 255, 1), + select = Color.New(243 / 255, 235 / 255, 202 / 255, 1)} +function this:InitComponent(gameObject) + this.spLoader = SpriteLoader.New() + this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text") + this.prefab=Util.GetGameObject(gameObject,"ItemPre") + --滚动条根节点 + this.newObj=Util.GetGameObject(gameObject,"new") + this.root = Util.GetGameObject(gameObject, "Root") + this.root2 = Util.GetGameObject(gameObject, "Root2") + this.preList={} + this.tabbox= Util.GetGameObject(gameObject, "TabBox") + local natural=tonumber(specialConfig.Value) + for _, config in ConfigPairs(heroConfig) do + if config.Natural>=natural and config.Id~=21061 and config.Hide==0 and config.Newhero==0 then + table.insert(fiveHero,config.Id) + end + if config.Newhero==1 then + newHeroId=config.Id + end + end + local parObj=nil + if newHeroId==0 then + parObj=this.root2 + this.newObj:SetActive(false) + else + parObj=this.root + this.newObj:SetActive(true) + end + this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, parObj.transform, + this.prefab,nil, Vector2.New(parObj.transform.rect.width,parObj.transform.rect.height), 1, 1,Vector2.New(20,5)) + this.ScrollView.moveTween.MomentumAmount = 1 + this.ScrollView.moveTween.Strength = 2 + this.ScrollView.elastic = false + + + this.selectBar = Util.GetGameObject(gameObject,"pros/Grid") + this.light = Util.GetGameObject(gameObject,"pros/SelectBtn") + this.light:SetActive(true) + this.newIcon=Util.GetGameObject(gameObject,"new/icon"):GetComponent("Image") + this.newPro=Util.GetGameObject(gameObject,"new/pro"):GetComponent("Image") + this.newName=Util.GetGameObject(gameObject,"new/name"):GetComponent("Text") + this.des1=Util.GetGameObject(gameObject,"new/des1"):GetComponent("Text") + this.des2=Util.GetGameObject(gameObject,"new/des2"):GetComponent("Text") + this.hint=Util.GetGameObject(gameObject,"new/hint"):GetComponent("Text") + this.btnList = {} + for i = 1, 5 do + this.btnList[i] = Util.GetGameObject(this.selectBar,"Btn"..i) + end + for index, config in ConfigPairs(hotRankConfig) do + if config.Open==1 then + local rank={} + rank.default="r_hero_xuanze_002" + rank.select="r_hero_xuanze_001" + rank.name=config.HeroID + rank.id=config.Id + table.insert(_TabData,rank) + end + end + + this.TabCtrl = TabBox.New() + this.TabCtrl:SetTabAdapter(this.TabAdapter) + this.TabCtrl:SetChangeTabCallBack(this.SwitchView) + this.TabCtrl:Init(this.tabbox, _TabData) + +end +function this:BindEvent() + -- LogError("1111111111111111") + + for i = 1, 5 do + Util.AddClick(this.btnList[i],function() + if curPage ~= i then + this:Refresh(i) + end + end) + end +end + + +-- tab节点显示自定义 +function this.TabAdapter(tab, index, status) + local tabLab = Util.GetGameObject(tab, "Text") + Util.GetGameObject(tab,"Image"):GetComponent("Image").sprite = this.spLoader:LoadSprite(_TabData[index][status]) + tabLab:GetComponent("Text").text = _TabData[index].name + tabLab:GetComponent("Text").color = _TabFontColor[status] +end +local allHeros={} +--切换视图 +function this.SwitchView(index) + --先执行上一面板关闭逻辑 + --local oldSelect + --oldSelect, curIndex = curIndex, index + -- for i = 1, #this.contents do + -- if oldSelect~=0 then this.contents[oldSelect].view:OnClose() break end + -- end + --切换预设显隐 + -- for i = 1, #this.prefabs do + -- this.prefabs[i].gameObject:SetActive(i == index)--切换子模块预设显隐 + -- end + type=_TabData[index].id + NetManager.UserLikeHeroRankRequest(type,function(msg1) + if msg1.heroTid and #msg1.heroTid>0 then + LogError("msg1.heroTid len=="..#msg1.heroTid) + curZanId=msg1.heroTid[1] + else + curZanId=0 + end + + NetManager.RequestRankInfo(RANK_TYPE.HotHero,function(msg) + LogError("发送请求--------------"..index.." id==".._TabData[index].id) + allHeros={} + local ids={} + for i = 1, #msg.ranks do + local heroId=msg.ranks[i].rankInfo.param1 + --LogError("i=="..i.." heroid=="..heroId) + table.insert(ids,heroId) + table.insert(allHeros,{id=heroId,power=msg.ranks[i].rankInfo.param2,pro=heroConfig[heroId].PropertyName}) + end + for i = 1, #fiveHero do + if not BattleUtil.ChecklistIsContainValue(ids,fiveHero[i]) then + --LogError("fiveHero[i]=="..fiveHero[i]) + table.insert(allHeros,{id=fiveHero[i],power=0,pro=heroConfig[fiveHero[i]].PropertyName}) + end + end + --this:ShowHeroList(0) + this:Refresh(1) + end,_TabData[index].id,1,1) + end) + + --执行子模块初始化 + -- this.contents[index].view:OnShow(this) +end +local list={} +function this:ShowHeroList(_pro) + if not allHeros then + return + end + list={} + if _pro==0 then + list=allHeros + else + for key, value in pairs(allHeros) do + if value.pro==_pro then + table.insert(list,value) + end + end + end + this.ScrollView:SetData(list, function(index, go) + this.SingleHeroDataShow(go,list[index],index) + end) +end + + +function this:AddListener() +end + +function this:RemoveListener() +end + +function this:OnShow(_parent,_args) + + if this.TabCtrl then + this.TabCtrl:ChangeTab(1) + end + this.titleText.text = "神将热榜" + + parent=_parent + sortingOrder =_parent.sortingOrder + if newHeroId~=0 then + this.newObj:SetActive(true) + local newHeroConfig=heroConfig[newHeroId] + this.des1.text=newHeroConfig.HeroLocation + this.des2.text=newHeroConfig.HeroLocationDesc1 + this.newPro.sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(newHeroConfig.PropertyName)) + this.newName.text = newHeroConfig.ReadingName + this.newIcon.sprite = this.spLoader:LoadSprite(artResourcesConfig[newHeroConfig.Icon].Name) + this.hint.text="即将上线,敬请期待" + Util.AddOnceClick(this.newIcon.gameObject,function() + UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, newHeroConfig.Id, newHeroConfig.MaxRank) + end) + end + +end +function this:Refresh(_page) + curPage = _page + LogError("curpage=="..curPage) + currPro=curPage-1 + this.light.transform:SetParent(this.btnList[_page].transform) + this.light.transform.localPosition = Vector3.zero + this.light.transform.localScale = Vector3.one + this:ShowHeroList(currPro) + +end + +--英雄单个数据展示 +function this.SingleHeroDataShow(go,_heroData,_index) + local heroData = _heroData + local config=heroConfig[heroData.id] + --LogError("herodata id=="..heroData.id) + local _go = go + -- _go.gameObject:SetActive(true) + -- local frame = Util.GetGameObject(_go.transform, "frame"):GetComponent("Image") + local name = Util.GetGameObject(_go.transform, "Name"):GetComponent("Text") + local icon = Util.GetGameObject(_go.transform, "hero"):GetComponent("Image") + local rankImg=Util.GetGameObject(_go.transform, "rankImg"):GetComponent("Image") + local rank=Util.GetGameObject(_go.transform, "rank"):GetComponent("Text") + local proIcon = Util.GetGameObject(_go.transform, "pro"):GetComponent("Image") + local desc=Util.GetGameObject(_go.transform, "Desc"):GetComponent("Text") + desc.text=config.HeroLocation + local desc2=Util.GetGameObject(_go.transform, "Desc2"):GetComponent("Text") + local hot=Util.GetGameObject(_go.transform, "hot") + hot:SetActive(false) + local btn_zan=Util.GetGameObject(_go.transform, "btn_zan") + local numTxt=Util.GetGameObject(_go.transform, "numTxt"):GetComponent("Text") + numTxt.text=PrintWanNum(heroData.power) + desc2.text=config.HeroLocationDesc1 + proIcon.sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(config.PropertyName)) + name.text = config.ReadingName + icon.sprite = this.spLoader:LoadSprite(artResourcesConfig[config.Icon].Name) + if _index<4 then + rankImg.sprite=this.spLoader:LoadSprite("r_Dungeon_00".._index) + rank.gameObject:SetActive(false) + else + rankImg.sprite=this.spLoader:LoadSprite("r_hero_zhuangbeidi") + rank.gameObject:SetActive(true) + end + rank.text=_index + + Util.SetGray(btn_zan,curZanId~=0) + Util.AddOnceClick(icon.gameObject, function() + UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, config.Id, config.MaxRank) + --UIManager.OpenPanel(UIName.RoleInfoPopup, false, heroData) + end) + + Util.AddOnceClick(btn_zan, function() + if curZanId~=0 then + return + end + NetManager.LikeHeroRankRequest(type,heroData.id,function() + heroData.power=heroData.power+1 + numTxt.text=PrintWanNum(heroData.power) + curZanId=heroData.id + this.ScrollView:SetData(list, function(index, go) + this.SingleHeroDataShow(go,list[index],index) + end) + this.ScrollView:SetIndex(_index) + end) + end) +end + + +function this:OnClose() + curZanId=0 + heros=nil + +end + +function this:OnDestroy() + this.spLoader:Destroy() + this.choosedList = {} + this.btnList = {} + _TabData={} + fiveHero={} +end + +return this \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralBigPopup_GiveLikeHotHero.lua.meta b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralBigPopup_GiveLikeHotHero.lua.meta new file mode 100644 index 0000000000..47b2f1bb26 --- /dev/null +++ b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralBigPopup_GiveLikeHotHero.lua.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d8c10ef69290be64b9c133b1a63647b7 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: