diff --git a/Assets/ManagedResources/Prefabs/UI/Popup/PlayerInfoPopup.prefab b/Assets/ManagedResources/Prefabs/UI/Popup/PlayerInfoPopup.prefab index 39ec2c9c99..28537ccd3d 100644 --- a/Assets/ManagedResources/Prefabs/UI/Popup/PlayerInfoPopup.prefab +++ b/Assets/ManagedResources/Prefabs/UI/Popup/PlayerInfoPopup.prefab @@ -222535,6 +222535,7 @@ GameObject: - component: {fileID: 9064202090855767920} - component: {fileID: 3198312662970712570} - component: {fileID: 4971326542659485910} + - component: {fileID: 4581237460797020108} m_Layer: 5 m_Name: BgMask m_TagString: Untagged @@ -222598,6 +222599,48 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 +--- !u!114 &4581237460797020108 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7644969809898739546} + 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: 0 + 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: 4971326542659485910} + 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 &7655430334192374917 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/ManagedResources/~Lua/Message/ArenaInfoProto_pb.lua b/Assets/ManagedResources/~Lua/Message/ArenaInfoProto_pb.lua index ad2754e9a1..b6d06e98e0 100644 --- a/Assets/ManagedResources/~Lua/Message/ArenaInfoProto_pb.lua +++ b/Assets/ManagedResources/~Lua/Message/ArenaInfoProto_pb.lua @@ -149,7 +149,7 @@ CROSSLINGMAISECRETAREAINFORESPONSE_STATE_FIELD = protobuf.FieldDescriptor(); CROSSLINGMAISECRETAREAINFORESPONSE_MYOCCUPYID_FIELD = protobuf.FieldDescriptor(); CROSSLINGMAISECRETAREAINFORESPONSE_MYOCCUPYTIME_FIELD = protobuf.FieldDescriptor(); CROSSLINGMAISECRETAREAINFORESPONSE_REMAINCHANGETIMES_FIELD = protobuf.FieldDescriptor(); -CROSSLINGMAISECRETAREAINFORESPONSE_RECORDDATA_FIELD = protobuf.FieldDescriptor(); +CROSSLINGMAISECRETAREAINFORESPONSE_LINGMAIDATA_FIELD = protobuf.FieldDescriptor(); CROSSLINGMAISECRETAREAREQUEST = protobuf.Descriptor(); CROSSLINGMAISECRETAREAREQUEST_ID_FIELD = protobuf.FieldDescriptor(); CROSSLINGMAISECRETAREARESPONSE = protobuf.Descriptor(); @@ -1511,22 +1511,22 @@ CROSSLINGMAISECRETAREAINFORESPONSE_REMAINCHANGETIMES_FIELD.default_value = 0 CROSSLINGMAISECRETAREAINFORESPONSE_REMAINCHANGETIMES_FIELD.type = 5 CROSSLINGMAISECRETAREAINFORESPONSE_REMAINCHANGETIMES_FIELD.cpp_type = 1 -CROSSLINGMAISECRETAREAINFORESPONSE_RECORDDATA_FIELD.name = "recordData" -CROSSLINGMAISECRETAREAINFORESPONSE_RECORDDATA_FIELD.full_name = ".rpc.protocols.CrossLingmaiSecretAreaInfoResponse.recordData" -CROSSLINGMAISECRETAREAINFORESPONSE_RECORDDATA_FIELD.number = 5 -CROSSLINGMAISECRETAREAINFORESPONSE_RECORDDATA_FIELD.index = 4 -CROSSLINGMAISECRETAREAINFORESPONSE_RECORDDATA_FIELD.label = 3 -CROSSLINGMAISECRETAREAINFORESPONSE_RECORDDATA_FIELD.has_default_value = false -CROSSLINGMAISECRETAREAINFORESPONSE_RECORDDATA_FIELD.default_value = {} -CROSSLINGMAISECRETAREAINFORESPONSE_RECORDDATA_FIELD.message_type = CommonProto_pb.LINGMAISECRET -CROSSLINGMAISECRETAREAINFORESPONSE_RECORDDATA_FIELD.type = 11 -CROSSLINGMAISECRETAREAINFORESPONSE_RECORDDATA_FIELD.cpp_type = 10 +CROSSLINGMAISECRETAREAINFORESPONSE_LINGMAIDATA_FIELD.name = "lingmaiData" +CROSSLINGMAISECRETAREAINFORESPONSE_LINGMAIDATA_FIELD.full_name = ".rpc.protocols.CrossLingmaiSecretAreaInfoResponse.lingmaiData" +CROSSLINGMAISECRETAREAINFORESPONSE_LINGMAIDATA_FIELD.number = 5 +CROSSLINGMAISECRETAREAINFORESPONSE_LINGMAIDATA_FIELD.index = 4 +CROSSLINGMAISECRETAREAINFORESPONSE_LINGMAIDATA_FIELD.label = 3 +CROSSLINGMAISECRETAREAINFORESPONSE_LINGMAIDATA_FIELD.has_default_value = false +CROSSLINGMAISECRETAREAINFORESPONSE_LINGMAIDATA_FIELD.default_value = {} +CROSSLINGMAISECRETAREAINFORESPONSE_LINGMAIDATA_FIELD.message_type = CommonProto_pb.ARENAPERSONINFO +CROSSLINGMAISECRETAREAINFORESPONSE_LINGMAIDATA_FIELD.type = 11 +CROSSLINGMAISECRETAREAINFORESPONSE_LINGMAIDATA_FIELD.cpp_type = 10 CROSSLINGMAISECRETAREAINFORESPONSE.name = "CrossLingmaiSecretAreaInfoResponse" CROSSLINGMAISECRETAREAINFORESPONSE.full_name = ".rpc.protocols.CrossLingmaiSecretAreaInfoResponse" CROSSLINGMAISECRETAREAINFORESPONSE.nested_types = {} CROSSLINGMAISECRETAREAINFORESPONSE.enum_types = {} -CROSSLINGMAISECRETAREAINFORESPONSE.fields = {CROSSLINGMAISECRETAREAINFORESPONSE_STATE_FIELD, CROSSLINGMAISECRETAREAINFORESPONSE_MYOCCUPYID_FIELD, CROSSLINGMAISECRETAREAINFORESPONSE_MYOCCUPYTIME_FIELD, CROSSLINGMAISECRETAREAINFORESPONSE_REMAINCHANGETIMES_FIELD, CROSSLINGMAISECRETAREAINFORESPONSE_RECORDDATA_FIELD} +CROSSLINGMAISECRETAREAINFORESPONSE.fields = {CROSSLINGMAISECRETAREAINFORESPONSE_STATE_FIELD, CROSSLINGMAISECRETAREAINFORESPONSE_MYOCCUPYID_FIELD, CROSSLINGMAISECRETAREAINFORESPONSE_MYOCCUPYTIME_FIELD, CROSSLINGMAISECRETAREAINFORESPONSE_REMAINCHANGETIMES_FIELD, CROSSLINGMAISECRETAREAINFORESPONSE_LINGMAIDATA_FIELD} CROSSLINGMAISECRETAREAINFORESPONSE.is_extendable = false CROSSLINGMAISECRETAREAINFORESPONSE.extensions = {} CROSSLINGMAISECRETAREAREQUEST_ID_FIELD.name = "id" diff --git a/Assets/ManagedResources/~Lua/Message/CommonProto_pb.lua b/Assets/ManagedResources/~Lua/Message/CommonProto_pb.lua index e821c2bdcf..9e21c675b3 100644 --- a/Assets/ManagedResources/~Lua/Message/CommonProto_pb.lua +++ b/Assets/ManagedResources/~Lua/Message/CommonProto_pb.lua @@ -228,6 +228,8 @@ ARENAPERSONINFO_USERSKIN_FIELD = protobuf.FieldDescriptor(); ARENAPERSONINFO_USERTITLE_FIELD = protobuf.FieldDescriptor(); ARENAPERSONINFO_USERMOUNT_FIELD = protobuf.FieldDescriptor(); ARENAPERSONINFO_PRACTICELEVEL_FIELD = protobuf.FieldDescriptor(); +ARENAPERSONINFO_LINGMAIID_FIELD = protobuf.FieldDescriptor(); +ARENAPERSONINFO_GETAWARDTIMEOROCCUPYTIME_FIELD = protobuf.FieldDescriptor(); TEAM = protobuf.Descriptor(); TEAM_HEROTID_FIELD = protobuf.FieldDescriptor(); ARENAENEMY = protobuf.Descriptor(); @@ -2971,11 +2973,31 @@ ARENAPERSONINFO_PRACTICELEVEL_FIELD.default_value = 0 ARENAPERSONINFO_PRACTICELEVEL_FIELD.type = 5 ARENAPERSONINFO_PRACTICELEVEL_FIELD.cpp_type = 1 +ARENAPERSONINFO_LINGMAIID_FIELD.name = "lingmaiId" +ARENAPERSONINFO_LINGMAIID_FIELD.full_name = ".rpc.protocols.ArenaPersonInfo.lingmaiId" +ARENAPERSONINFO_LINGMAIID_FIELD.number = 15 +ARENAPERSONINFO_LINGMAIID_FIELD.index = 14 +ARENAPERSONINFO_LINGMAIID_FIELD.label = 1 +ARENAPERSONINFO_LINGMAIID_FIELD.has_default_value = false +ARENAPERSONINFO_LINGMAIID_FIELD.default_value = 0 +ARENAPERSONINFO_LINGMAIID_FIELD.type = 5 +ARENAPERSONINFO_LINGMAIID_FIELD.cpp_type = 1 + +ARENAPERSONINFO_GETAWARDTIMEOROCCUPYTIME_FIELD.name = "getAwardTimeOrOccupyTime" +ARENAPERSONINFO_GETAWARDTIMEOROCCUPYTIME_FIELD.full_name = ".rpc.protocols.ArenaPersonInfo.getAwardTimeOrOccupyTime" +ARENAPERSONINFO_GETAWARDTIMEOROCCUPYTIME_FIELD.number = 16 +ARENAPERSONINFO_GETAWARDTIMEOROCCUPYTIME_FIELD.index = 15 +ARENAPERSONINFO_GETAWARDTIMEOROCCUPYTIME_FIELD.label = 1 +ARENAPERSONINFO_GETAWARDTIMEOROCCUPYTIME_FIELD.has_default_value = false +ARENAPERSONINFO_GETAWARDTIMEOROCCUPYTIME_FIELD.default_value = 0 +ARENAPERSONINFO_GETAWARDTIMEOROCCUPYTIME_FIELD.type = 5 +ARENAPERSONINFO_GETAWARDTIMEOROCCUPYTIME_FIELD.cpp_type = 1 + ARENAPERSONINFO.name = "ArenaPersonInfo" ARENAPERSONINFO.full_name = ".rpc.protocols.ArenaPersonInfo" ARENAPERSONINFO.nested_types = {} ARENAPERSONINFO.enum_types = {} -ARENAPERSONINFO.fields = {ARENAPERSONINFO_UID_FIELD, ARENAPERSONINFO_LEVEL_FIELD, ARENAPERSONINFO_NAME_FIELD, ARENAPERSONINFO_SCORE_FIELD, ARENAPERSONINFO_HEAD_FIELD, ARENAPERSONINFO_RANK_FIELD, ARENAPERSONINFO_TOTALFORCE_FIELD, ARENAPERSONINFO_HEADFRAME_FIELD, ARENAPERSONINFO_SERVERNAME_FIELD, ARENAPERSONINFO_GENDER_FIELD, ARENAPERSONINFO_USERSKIN_FIELD, ARENAPERSONINFO_USERTITLE_FIELD, ARENAPERSONINFO_USERMOUNT_FIELD, ARENAPERSONINFO_PRACTICELEVEL_FIELD} +ARENAPERSONINFO.fields = {ARENAPERSONINFO_UID_FIELD, ARENAPERSONINFO_LEVEL_FIELD, ARENAPERSONINFO_NAME_FIELD, ARENAPERSONINFO_SCORE_FIELD, ARENAPERSONINFO_HEAD_FIELD, ARENAPERSONINFO_RANK_FIELD, ARENAPERSONINFO_TOTALFORCE_FIELD, ARENAPERSONINFO_HEADFRAME_FIELD, ARENAPERSONINFO_SERVERNAME_FIELD, ARENAPERSONINFO_GENDER_FIELD, ARENAPERSONINFO_USERSKIN_FIELD, ARENAPERSONINFO_USERTITLE_FIELD, ARENAPERSONINFO_USERMOUNT_FIELD, ARENAPERSONINFO_PRACTICELEVEL_FIELD, ARENAPERSONINFO_LINGMAIID_FIELD, ARENAPERSONINFO_GETAWARDTIMEOROCCUPYTIME_FIELD} ARENAPERSONINFO.is_extendable = false ARENAPERSONINFO.extensions = {} TEAM_HEROTID_FIELD.name = "heroTid" diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/View/LingMaiFormation.lua b/Assets/ManagedResources/~Lua/Modules/Formation/View/LingMaiFormation.lua index fc7badc73c..5ffe4cb76e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/View/LingMaiFormation.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/View/LingMaiFormation.lua @@ -85,8 +85,8 @@ function this.StartFight() arg.red= {} arg.red.uid = this.nodeData.uid arg.red.name = this.nodeData.name - -- arg.red.head = this.pData.head - -- arg.red.frame = this.pData.headFrame + arg.red.head = this.nodeData.head + arg.red.frame = this.nodeData.headFrame -- 不用回放直接显示结果 UIManager.OpenPanel(UIName.ArenaResultPopup, arg) diff --git a/Assets/ManagedResources/~Lua/Modules/LingMaiMiJing/LingMaiMiJingManager.lua b/Assets/ManagedResources/~Lua/Modules/LingMaiMiJing/LingMaiMiJingManager.lua index 592b6d7d80..aa74f5c17f 100644 --- a/Assets/ManagedResources/~Lua/Modules/LingMaiMiJing/LingMaiMiJingManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/LingMaiMiJing/LingMaiMiJingManager.lua @@ -1,6 +1,8 @@ LingMaiMiJingManager = {} local this = LingMaiMiJingManager local lodeConfig = ConfigManager.GetConfig(ConfigName.LodeConfig) +local monsterGroup = ConfigManager.GetConfig(ConfigName.MonsterGroup) +local monsterConfig = ConfigManager.GetConfig(ConfigName.MonsterConfig) function this.Initialize() this.state = 1--当前状态 @@ -8,7 +10,8 @@ function this.Initialize() this.endTime = 1638460800--结束时间 this.myPlaceId = 1--当前我占领的矿脉的id this.fightTime = 0--我的剩余挑战次数 - this.recordData = {} + this.curPage = 0 + this.lingmaiData = {} this.battleResult = {} end @@ -19,24 +22,52 @@ function this.GetData() data.startTime = this.startTime data.endTime = this.endTime data.myPlaceId = this.myPlaceId - data.recordData = {} + data.lingmaiData = {} for i = 1, 5 do - data.recordData[i] = {} - -- LogGreen("placeId:"..tostring(this.recordData[i].id).." playerId:"..tostring(this.recordData[i].uid).." Name:"..tostring(this.recordData[i].userName)) - data.recordData[i].Id = this.recordData[i].id - if this.recordData[i].uid ~= 0 then - data.recordData[i].uid = this.recordData[i].uid - data.recordData[i].userName = this.recordData[i].userName + data.lingmaiData[i] = {} + -- LogGreen("placeId:"..tostring(this.lingmaiData[i].id).." playerId:"..tostring(this.lingmaiData[i].uid).." Name:"..tostring(this.lingmaiData[i].name)) + data.lingmaiData[i].Id = this.lingmaiData[i].lingmaiId + local curId = data.lingmaiData[i].Id + data.lingmaiData[i].No = lodeConfig[curId].No + data.lingmaiData[i].PageNo = lodeConfig[curId].PageNo + data.lingmaiData[i].Group = lodeConfig[curId].Group + data.lingmaiData[i].Quality = lodeConfig[curId].Quality + data.lingmaiData[i].RewardList = lodeConfig[curId].RewardList + data.lingmaiData[i].Guard = lodeConfig[curId].Guard + data.lingmaiData[i].veinName = lodeConfig[curId].Name + local monsterGroupData = monsterGroup[data.lingmaiData[i].Guard].Contents + + --拼接玩家数据 + if this.lingmaiData[i].uid ~= 0 then + data.lingmaiData[i].uid = this.lingmaiData[i].uid + data.lingmaiData[i].name = this.lingmaiData[i].name + data.lingmaiData[i].servername = this.lingmaiData[i].servername + data.lingmaiData[i].head = this.lingmaiData[i].head + data.lingmaiData[i].headFrame = this.lingmaiData[i].headFrame else - data.recordData[i].uid = 0 - data.recordData[i].userName = "灵脉守护者" + data.lingmaiData[i].uid = 0 + data.lingmaiData[i].name = "灵脉守护者" + data.lingmaiData[i].servername = "" + data.lingmaiData[i].head = 0 + data.lingmaiData[i].headFrame = 0 + data.lingmaiData[i].level = 100 + data.lingmaiData[i].teamInfo = {} + data.lingmaiData[i].teamInfo.totalForce = lodeConfig[curId].GuardCombatNum + data.lingmaiData[i].teamInfo.team = {} + for j = 1, 6 do + if monsterGroupData[1] then + local monsterData = monsterConfig[monsterGroupData[1][j]] + local herodata = {} + herodata.heroTid = monsterData.MonsterId + herodata.star = 5 + herodata.level = monsterData.Level + herodata.position = j + herodata.skinId = 0 + herodata.godSoulLv = 0 + table.insert(data.lingmaiData[i].teamInfo.team,herodata) + end + end end - data.recordData[i].No = lodeConfig[data.recordData[i].Id].No - data.recordData[i].PageNo = lodeConfig[data.recordData[i].Id].PageNo - data.recordData[i].Group = lodeConfig[data.recordData[i].Id].Group - data.recordData[i].Quality = lodeConfig[data.recordData[i].Id].Quality - data.recordData[i].RewardList = lodeConfig[data.recordData[i].Id].RewardList - data.recordData[i].Guard = lodeConfig[data.recordData[i].Id].Guard end return data end @@ -48,13 +79,14 @@ function this.GetLingMaiServerData(msg,func) this.startTime = msg.myOccupyTime this.fightTime = msg.remainChangeTimes -- this.endTime = msg.state.endTime - this.recordData = msg.recordData - LogGreen("state:"..tostring(msg.state).." myPlaceId:"..tostring(msg.myOccupyId).." startTime:"..tostring(msg.myOccupyTime).." fightTime:"..tostring(msg.remainChangeTimes).." recordData:"..tostring(#msg.recordData).." curPage:"..tostring(this.curPage)) - for i = 1, #msg.recordData do - this.curPage = lodeConfig[msg.recordData[i].id].PageNo - LogYellow("id:"..tostring(msg.recordData[i].id).." uid:"..tostring(msg.recordData[i].uid).." userName:"..tostring(msg.recordData[i].userName).." practiceLevel:"..tostring(msg.recordData[i].practiceLevel)) - -- msg.recordData[i].userName = PracticeManager.SetNameColor(msg.recordData[i].userName,msg.recordData[i].practiceLevel) + this.lingmaiData = msg.lingmaiData + for i = 1, #msg.lingmaiData do + this.curPage = lodeConfig[msg.lingmaiData[i].lingmaiId].PageNo + LogYellow("id:"..tostring(msg.lingmaiData[i].lingmaiId).." uid:"..tostring(msg.lingmaiData[i].uid).." name:"..tostring(msg.lingmaiData[i].name) + .." practiceLevel:"..tostring(msg.lingmaiData[i].practiceLevel).." servername:"..tostring(msg.lingmaiData[i].servername)) + msg.lingmaiData[i].name = PracticeManager.SetNameColor(msg.lingmaiData[i].name,msg.lingmaiData[i].practiceLevel) end + LogGreen("state:"..tostring(msg.state).." myPlaceId:"..tostring(msg.myOccupyId).." startTime:"..tostring(msg.myOccupyTime).." fightTime:"..tostring(msg.remainChangeTimes).." lingmaiData:"..tostring(#msg.lingmaiData).." curPage:"..tostring(this.curPage)) -- Game.GlobalEvent:DispatchEvent(GameEvent.LingMaiMiJing.RefreshPanel) if func then func() diff --git a/Assets/ManagedResources/~Lua/Modules/LingMaiMiJing/LingMaiMiJingPanel.lua b/Assets/ManagedResources/~Lua/Modules/LingMaiMiJing/LingMaiMiJingPanel.lua index cb01ed490c..e9011c3c49 100644 --- a/Assets/ManagedResources/~Lua/Modules/LingMaiMiJing/LingMaiMiJingPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/LingMaiMiJing/LingMaiMiJingPanel.lua @@ -39,11 +39,15 @@ function LingMaiMiJingPanel:InitComponent() for i = 1, 5 do self.veinList[i] = Util.GetGameObject(self.contentGrid,"VeinPre ("..i..")") end + --左右切换按钮 + self.lastBtn = Util.GetGameObject(self.gameObject,"lastBtn") + self.nextBtn = Util.GetGameObject(self.gameObject,"nextBtn") end --绑定事件(用于子类重写) function LingMaiMiJingPanel:BindEvent() Util.AddClick(self.backBtn,function() + LingMaiMiJingManager.curPage = 0 self:ClosePanel() end) Util.AddOnceClick(self.helpBtn, function() @@ -58,6 +62,15 @@ function LingMaiMiJingPanel:BindEvent() Util.AddOnceClick(self.sortBtn, function() UIManager.OpenPanel(UIName.RankingSingleListPanel,rankKingList[32]) end) + + Util.AddClick(self.lastBtn,function() + LingMaiMiJingManager.curPage = LingMaiMiJingManager.curPage - 1 + self:OnShow() + end) + Util.AddClick(self.nextBtn,function() + LingMaiMiJingManager.curPage = LingMaiMiJingManager.curPage + 1 + self:OnShow() + end) end --添加事件监听(用于子类重写) @@ -77,11 +90,13 @@ end --界面打开时调用(用于子类重写) function LingMaiMiJingPanel:OnShow() - NetManager.GetLingMaiInfoRequest(0,function () + NetManager.GetLingMaiInfoRequest(LingMaiMiJingManager.curPage,function () self.data = LingMaiMiJingManager.GetData() self:SetTime() self:SetMydata() self:SetVeins() + self.lastBtn:SetActive(LingMaiMiJingManager.curPage - 1 > 0) + self.nextBtn:SetActive(LingMaiMiJingManager.curPage + 1 <= 50) end) end @@ -115,7 +130,7 @@ end function LingMaiMiJingPanel:SetVeins() for i = 1, 5 do local go = self.veinList[i] - local data = self.data.recordData[i] + local data = self.data.lingmaiData[i] local title = Util.GetGameObject(go,"title/Name"):GetComponent("Text") local num = Util.GetGameObject(go,"title/Num"):GetComponent("Text") local name = Util.GetGameObject(go,"obtain/name"):GetComponent("Text") @@ -123,9 +138,9 @@ function LingMaiMiJingPanel:SetVeins() local rewardPre = Util.GetGameObject(grid,"rewardPre") rewardPre:SetActive(false) - title.text = data.userName + title.text = data.veinName num.text = data.No - name.text = data.userName + name.text = string.format( "%s %s",data.servername,data.name) if not self.itemList[i] then self.itemList[i] = {} end @@ -144,11 +159,11 @@ function LingMaiMiJingPanel:SetVeins() end Util.AddOnceClick(go,function () -- UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.LINGMAIMIJING,data) - if data.uid == 0 then - UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.LINGMAIMIJING,data) - else + -- if data.uid == 0 then + -- UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.LINGMAIMIJING,data) + -- else UIManager.OpenPanel(UIName.PlayerInfoPopup, data.uid,PLAYER_INFO_VIEW_TYPE.LINGMAIMIJING,data.serverName and data.serverName or nil,data) - end + -- end end) end end diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua b/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua index 0f4071d2a2..46937ed17f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua @@ -1,5 +1,4 @@ require("Base/BasePanel") -local extraInfo = require("Modules/Popup/PlayerInfoPopup_extra") local PlayerInfoPopup = Inherit(BasePanel) local this = PlayerInfoPopup local netserverName = nil @@ -96,7 +95,9 @@ local _PlayerHead = nil --初始化组件(用于子类重写) function PlayerInfoPopup:InitComponent() this.spLoader = SpriteLoader.New() + this.extraInfo = require("Modules/Popup/PlayerInfoPopup_extra") this.btnBack = Util.GetGameObject(self.transform, "btnClose") + this.BgMask = Util.GetGameObject(self.transform, "BgMask") this.memHead = Util.GetGameObject(self.transform, "tipImage/panel/info/head") this.memName = Util.GetGameObject(self.transform, "tipImage/panel/info/name"):GetComponent("Text") @@ -144,6 +145,7 @@ function PlayerInfoPopup:InitComponent() this.imprintGrid = Util.GetGameObject(this.imprintObj, "Imprints") this.imprintPre = Util.GetGameObject(self.transform, "imprintPre") this.imprintItemList = {} + end --绑定事件(用于子类重写) @@ -152,6 +154,10 @@ function PlayerInfoPopup:BindEvent() PlaySoundWithoutClick(SoundConfig.Sound_UICancel) this:ClosePanel() end) + Util.AddClick(this.BgMask, function() + PlaySoundWithoutClick(SoundConfig.Sound_UICancel) + this:ClosePanel() + end) Util.AddClick(this.addFriendBtn, function() if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.GOODFRIEND) then PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.GOODFRIEND)) @@ -244,7 +250,8 @@ function PlayerInfoPopup:OnShow() this.RefreshBtnShow() end) else - extraInfo.Init(this, ...) + --目前只给灵脉,如果还有其他请写明备注 + this.extraInfo.Init(this,this.data,_ViewConfig[this._ViewType]) end end @@ -565,6 +572,9 @@ function PlayerInfoPopup:OnDestroy() titleLiveStr = nil this.imprintItemList = {} this.Demons = {} + if this.extraInfo then + this.extraInfo.OnDestroy() + end end return PlayerInfoPopup diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup_extra.lua b/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup_extra.lua index e69de29bb2..68477f2dc4 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup_extra.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup_extra.lua @@ -0,0 +1,109 @@ +local PlayerInfoPopup_extra = {} +local this = PlayerInfoPopup_extra +local _PlayerHead = nil +local titleLiveStr = nil +local titleLive = nil + +function this.Init( _parent,_data,_ViewConfig) + this.infoPopup = _parent + this.data = _data + this.viewConfig = _ViewConfig + + this.RefreshPlayerInfo(this.data) + this.FormationAdapter(this.data.teamInfo) + this.RefreshBtnShow() +end + +function this.RefreshPlayerInfo(data) + this.infoPopup.memName.text = data.name + this.infoPopup.memProfess.text = "" + -- 头像 + if not _PlayerHead then + _PlayerHead = SubUIManager.Open(SubUIConfig.PlayerHeadView, this.infoPopup.memHead.transform) + end + _PlayerHead:Reset() + _PlayerHead:SetScale(Vector3.one * 0.85) + _PlayerHead:SetHead(data.head) + _PlayerHead:SetFrame(data.headFrame) + _PlayerHead:SetLevel(data.level) + _PlayerHead:SetLayer(this.infoPopup.sortingOrder) + _PlayerHead:SetEffectScale(0.9) + this.infoPopup.titlePar:SetActive(false) +end + +-- 编队数据匹配 +function this.FormationAdapter(teamInfo) + this.infoPopup.formationTip.text = this.viewConfig.tip + -- 战斗力 + this.infoPopup.memPower.text = teamInfo.totalForce + for i, demon in ipairs(this.infoPopup.Demons) do + demon.frame.sprite = this.infoPopup.spLoader:LoadSprite(GetQuantityImageByquality(1)) + demon.hero:SetActive(false) + end + --队伍阵容 + for i, hero in ipairs(teamInfo.team) do + local demonId = teamInfo.team[i].heroTid + if demonId then + this.infoPopup.Demons[hero.position].hero:SetActive(true) + local star,starType = GetStarOrGodSoulLv(1,hero) + local starSize = Vector2.New(35,35) + local starScale = -8 + if starType == 3 then + starSize = Vector2.New(1,-15.65) + starScale = -13 + elseif starType == 2 then + starSize = Vector2.New(60,57) + end + SetHeroStars(this.infoPopup.spLoader, this.infoPopup.Demons[hero.position].starGrid, star,starType,starSize,starScale) + Util.SetParticleSortLayer(this.infoPopup.Demons[hero.position].starGrid,this.infoPopup.sortingOrder + 1) + local heroConfig = ConfigManager.GetConfigData(ConfigName.HeroConfig, demonId) + this.infoPopup.Demons[hero.position].proIcon.sprite = this.infoPopup.spLoader:LoadSprite(GetProStrImageByProNum(heroConfig.PropertyName)) + this.infoPopup.Demons[hero.position].levelText.text = hero.level + this.infoPopup.Demons[hero.position].frame.sprite = this.infoPopup.spLoader:LoadSprite(GetQuantityImageByquality(heroConfig.Quality, hero.star)) + SetHeroIcon(this.infoPopup.spLoader, hero,this.infoPopup.Demons[hero.position].icon,heroConfig) + end + end +end + +-- 刷新按钮显示 +function this.RefreshBtnShow() + this.infoPopup.btnBox:SetActive(true) + this.infoPopup.addFriendBtn:SetActive(false) + this.infoPopup.starBox:SetActive(false) + + -- 按钮功能 + local btnType = this.infoPopup._Config.btnType + for index, btn in ipairs(this.infoPopup.btnList) do + btn:SetActive(btnType[index] ~= nil) + if btnType[index] then + Util.GetGameObject(btn, "Text"):GetComponent("Text").text = btnType[index].name + Util.AddOnceClick(btn, function() + local funcType = btnType[index].func + if not this.infoPopup.btnFunc[funcType] then + Log("方法不存在") + return + end + this.infoPopup.btnFunc[funcType](btnType[index].param) + end) + end + end + + if this.infoPopup._ViewType == PLAYER_INFO_VIEW_TYPE.LINGMAIMIJING then + this.infoPopup.btnBox:SetActive(true) + this.infoPopup.btnList[1]:SetActive(false) + this.infoPopup.btnList[2]:SetActive(true) + this.infoPopup.btnList[3]:SetActive(false) + end +end + +function this.OnDestroy() + -- 头像 + if _PlayerHead then + _PlayerHead:Recycle() + _PlayerHead = nil + end + titleLive = nil + titleLiveStr = nil +end + +return this \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup_extra.lua.meta b/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup_extra.lua.meta new file mode 100644 index 0000000000..047374bb73 --- /dev/null +++ b/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup_extra.lua.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c472013dee9f73348be9add9813b96f3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: