From 6345a18ebe96e880f08edeba24c111f2ddaefb48 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Thu, 26 Aug 2021 13:42:17 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=8E=89=E8=99=9A=E8=AE=BA=E9=81=93?= =?UTF-8?q?=E3=80=91=E6=88=91=E7=9A=84=E7=BC=96=E9=98=9F=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Common/GlobalDefine.lua | 3 + .../Modules/Formation/FormationManager.lua | 8 ++- .../WorldArena/WorldArenaMyTeamPanel.lua | 65 +++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) diff --git a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua index 86646ed23e..8d25afcadc 100644 --- a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua +++ b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua @@ -1785,6 +1785,9 @@ FormationTypeDef = { FIGHT_LEVEL = 1701, --山河社稷图主关卡编队 FIGHT_ASSISTANTLEVEL = 1801, --山河社稷图副主关卡编队 FORMATION_TSLX = 1901, --踏碎凌霄编队 没有实际意义后端做特殊操作 其实就是主线编队 + FORMATION_YUXUNLUNDAO1 = 2001, --玉虚论道1队 + FORMATION_YUXUNLUNDAO2 = 2002, --玉虚论道2队 + FORMATION_YUXUNLUNDAO3 = 2003, --玉虚论道3队 } --编队需要拉取主线 diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua index 50510087be..0a7ecc0e92 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua @@ -42,7 +42,13 @@ function this.MakeAEmptyTeam(teamId) elseif teamId == FormationTypeDef.FIGHT_LEVEL then oTeam.teamName = "山河社稷图"-- 1701 elseif teamId == FormationTypeDef.FIGHT_ASSISTANTLEVEL then - oTeam.teamName = "山河社稷图"-- 1701 + oTeam.teamName = "山河社稷图"-- 1801 + -- elseif teamId == FormationTypeDef.FORMATION_YUXUNLUNDAO1 then + -- oTeam.teamName = "玉虚论道1队"-- 2001 + -- elseif teamId == FormationTypeDef.FORMATION_YUXUNLUNDAO2 then + -- oTeam.teamName = "玉虚论道2队"-- 2002 + -- elseif teamId == FormationTypeDef.FORMATION_YUXUNLUNDAO3 then + -- oTeam.teamName = "玉虚论道3队"-- 2003 end oTeam.teamHeroInfos = {} oTeam.teamPokemonInfos = {} diff --git a/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaMyTeamPanel.lua b/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaMyTeamPanel.lua index 2eb1a5ad9f..ddb5c72e0a 100644 --- a/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaMyTeamPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaMyTeamPanel.lua @@ -34,6 +34,11 @@ local function OnEndDrag(self, Pointgo, data) local curInfo = self.tempInfo.transform:GetChild(0) curInfo:SetParent(obj.transform) curInfo.localPosition = Vector3.zero + + for i = 1, 3 do + self.InfoList[i] = Util.GetGameObject(self.Content, "Grid ("..i..")/Info") + WorldArenaMyTeamPanel:Refresh() + end end function WorldArenaMyTeamPanel:InitComponent() @@ -60,6 +65,13 @@ function WorldArenaMyTeamPanel:InitComponent() self.triggerList[i].onDrag = self.triggerList[i].onDrag + self.OnDrag self.triggerList[i].onEndDrag = self.triggerList[i].onEndDrag + self.OnEndDrag end + self.Heros = {} + for i = 1, 3 do + self.Heros[i] = {} + for j = 1, 6 do + self.Heros[i][j] = Util.GetGameObject(self.Content, "Grid ("..i..")/Info/TeamList/heroPro ("..j..")") + end + end end @@ -91,8 +103,56 @@ function WorldArenaMyTeamPanel:OnShow() end function WorldArenaMyTeamPanel:Refresh() + NetManager.RequestPlayerInfo(self.playerId, PLAYER_INFO_VIEW_TYPE.NORMAL,1, function(msg) + for i = 1, 3 do + WorldArenaMyTeamPanel:SetSingleFormation(self.InfoList[i],msg.teamInfo.team,i) + end + end) end +function WorldArenaMyTeamPanel:SetSingleFormation(go,data,index) + local title = Util.GetGameObject(go,"Title"):GetComponent("Text") + local warPower = Util.GetGameObject(go,"WarPower/Text"):GetComponent("Text") + local btnChange = Util.GetGameObject(go,"ChangeTeam") + local teamList = Util.GetGameObject(go,"TeamList") + title.text = string.format( "第%s队",NumToChinese[index]) + warPower.text = data.totalForce + Util.AddOnceClick(btnChange,function () + PopupTipPanel.ShowTip(string.format( "进入第%s个编队",index)) + end) + + for i, demon in ipairs(self.Heros[index]) do + Util.GetGameObject(demon, "frame"):GetComponent("Image").sprite = self.spLoader:LoadSprite(GetQuantityImageByquality(1)) + Util.GetGameObject(demon, "hero"):SetActive(false) + end + --队伍阵容 + for i, hero in ipairs(data.team) do + local heroTid = data.team[i].heroTid + if heroTid then + local heroGo = Util.GetGameObject(self.Heros[index][hero.position], "hero") + heroGo:SetActive(true) + SetHeroStars(self.spLoader, Util.GetGameObject(heroGo, "starGrid"), hero.star) + local heroConfig = ConfigManager.GetConfigData(ConfigName.HeroConfig, heroTid) + Util.GetGameObject(heroGo, "proIcon"):GetComponent("Image").sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(heroConfig.PropertyName)) + Util.GetGameObject(heroGo, "lvbg/levelText"):GetComponent("Text").text = hero.level + Util.GetGameObject(self.Heros[index][hero.position], "frame"):GetComponent("Image").sprite = self.spLoader:LoadSprite(GetQuantityImageByquality(heroConfig.Quality, hero.star)) + SetHeroIcon(self.spLoader, hero,Util.GetGameObject(heroGo, "icon"):GetComponent("Image"),heroConfig) + local frameBtn = Util.GetGameObject(self.Heros[index][hero.position], "frame") + local heroData = {} + Util.AddOnceClick(frameBtn, function() + NetManager.ViewHeroInfoRequest(self.playerId,hero.heroid,1,PLAYER_INFO_VIEW_TYPE.NORMAL,function(msg) + if not hero.heroid then + return + end + heroData= GoodFriendManager.GetHeroDatas(msg.hero,msg.force,msg.SpecialEffects,msg.guildSkill) + GoodFriendManager.InitEquipData(msg.equip,heroData) + UIManager.OpenPanel(UIName.RoleInfoPopup, heroData,true) + end) + end) + end + end + +end function WorldArenaMyTeamPanel:OnClose() end @@ -100,6 +160,11 @@ end --界面销毁时调用(用于子类重写) function WorldArenaMyTeamPanel:OnDestroy() self.spLoader:Destroy() + self.InfoList = {} + self.dragViewList = {} + self.triggerList = {} + self.gridList = {} + self.Heros = {} end return WorldArenaMyTeamPanel \ No newline at end of file