From c531b3776b6c67bdbb5db2305f223fa3302120bf Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Tue, 7 Sep 2021 18:27:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=89=E8=99=9A=E8=AE=BA=E9=81=93=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Formation/FormationPanelV2.prefab | 4 +-- .../Modules/Formation/FormationManager.lua | 1 - .../Modules/Formation/FormationPanelV2.lua | 27 ++++++++++++++----- .../Formation/View/WorldArenaFormation.lua | 23 +++++++++++++++- .../GlobalActTimeCtrl/ActTimeCtrlManager.lua | 8 ++++++ .../WorldArena/WorldArenaMainPanel.lua | 4 +-- .../Modules/WorldArena/WorldArenaManager.lua | 12 +++++++-- 7 files changed, 65 insertions(+), 14 deletions(-) diff --git a/Assets/ManagedResources/Prefabs/UI/Formation/FormationPanelV2.prefab b/Assets/ManagedResources/Prefabs/UI/Formation/FormationPanelV2.prefab index b9adcc53be..68c67e9877 100644 --- a/Assets/ManagedResources/Prefabs/UI/Formation/FormationPanelV2.prefab +++ b/Assets/ManagedResources/Prefabs/UI/Formation/FormationPanelV2.prefab @@ -18162,7 +18162,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: [] @@ -21916,7 +21916,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0.8588236, g: 0.69803923, b: 0.41960788, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua index 9b2c73a5d6..a7ae39710a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua @@ -95,7 +95,6 @@ end function this.RefreshFormation(index, roleList, pokemonList,isDiffmonster) local curFormation = this.formationList[index] if not curFormation or #this.formationList == 0 then - LogError("==============nil") return end local newTeamheroInfos = {} diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua index 59967e4cc8..956e39a9e1 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua @@ -690,6 +690,7 @@ end --设置每条英雄数据 function this.SingleHeroDataShow(_go, _heroData) local go=_go + local yxID=0 local heroData=_heroData local frame=Util.GetGameObject(go,"frame"):GetComponent("Image") local icon=Util.GetGameObject(go, "icon"):GetComponent("Image") @@ -750,16 +751,18 @@ function this.SingleHeroDataShow(_go, _heroData) choosedObj:SetActive(true) end end - if yxAllHeros and yxAllHeros[heroData.dynamicId] and yxAllHeros[heroData.dynamicId].index+2000~=this.curFormationIndex then + local index + if yxAllHeros and yxAllHeros[heroData.dynamicId] and yxAllHeros[heroData.dynamicId].index~=this.curFormationIndex then yxInfo:SetActive(true) - local index=yxAllHeros[heroData.dynamicId].index - if index==1 then + index=yxAllHeros[heroData.dynamicId].index + if index==2001 then yxTeamName.text="第一队" - elseif index==2 then + elseif index==2002 then yxTeamName.text="第二队" - elseif index==3 then + elseif index==2003 then yxTeamName.text="第三队" end + yxID=index else yxInfo:SetActive(false) end @@ -774,6 +777,7 @@ function this.SingleHeroDataShow(_go, _heroData) PopupTipPanel.ShowTip("激活神将图鉴后才可使用!") return end + for k, v in ipairs(this.choosedList) do if v.heroId == heroData.dynamicId then choosedObj:SetActive(false) @@ -785,7 +789,7 @@ function this.SingleHeroDataShow(_go, _heroData) return end end - + -- 当前可选的最大上阵人数 local maxNum = ActTimeCtrlManager.MaxArmyNum() if this.curFormationIndex == FormationTypeDef.FIGHT_ASSISTANTLEVEL then--山河社稷图判断上阵数量 @@ -804,6 +808,8 @@ function this.SingleHeroDataShow(_go, _heroData) return end end + + -- 判断是否有血量 -- if heroHp and heroHp <= 0 then PopupTipPanel.ShowTip("猎妖师重伤,不可上阵!") return end choosedObj:SetActive(true) @@ -813,6 +819,15 @@ function this.SingleHeroDataShow(_go, _heroData) if this.GetPos()==0 then PopupTipPanel.ShowTip(Language[10689]) return + end + --如果在玉虚三个队里面的另外一个队 + if yxID~=0 and yxID~=this.curFormationIndex then + MsgPanel.ShowTwo("该神将正处于其他队伍,是否要编入当前队伍内",nil, function() + --改变英雄队伍id改变 + this.opView.ChangeHeroTeam(heroData.dynamicId,this.curFormationIndex,this.GetPos()) + yxID=this.curFormationIndex + yxInfo:SetActive(false) + end) end table.insert(this.choosedList, {heroId = heroData.dynamicId, position=this.GetPos()}) this.SetCardsData(this.choosedList) diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/View/WorldArenaFormation.lua b/Assets/ManagedResources/~Lua/Modules/Formation/View/WorldArenaFormation.lua index c3bfce7577..409745456b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/View/WorldArenaFormation.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/View/WorldArenaFormation.lua @@ -103,7 +103,7 @@ function this.Init(root,...) for j = 1, #team.teamHeroInfos do local teamInfo = team.teamHeroInfos[j] --table.insert(allHeros,{Id=teamInfo.heroId,pos=teamInfo.position,index=i-2000}) - allHeros[teamInfo.heroId]={Id=teamInfo.heroId,pos=teamInfo.position,index=i-2000} + allHeros[teamInfo.heroId]={Id=teamInfo.heroId,pos=teamInfo.position,index=i} end --缓存本地所有玉虚论道队伍的数据 -- table.insert(currAllTeams,team) @@ -114,6 +114,27 @@ end function this.GetFormationIndex() return 2000 + this.curIndex end + +function this.ChangeHeroTeam(id,_index,_pos) + local hero=nil + --旧队伍里移除 + for key, value in pairs(currAllTeams) do + for i = 1, #value.teamHeroInfos do + if value.teamHeroInfos[i].heroId==id then + hero=value.teamHeroInfos[i] + table.remove(value.teamHeroInfos[i]) + break + end + end + end + hero.position=_pos + table.insert(currAllTeams,hero) + allHeros[id].pos=_pos + allHeros[id].index=_index +end + + + function this.GetTeamInfoByIndex(index) if currAllTeams[index] then return currAllTeams[index] diff --git a/Assets/ManagedResources/~Lua/Modules/GlobalActTimeCtrl/ActTimeCtrlManager.lua b/Assets/ManagedResources/~Lua/Modules/GlobalActTimeCtrl/ActTimeCtrlManager.lua index cba38f0cb2..f88fd8aaa1 100644 --- a/Assets/ManagedResources/~Lua/Modules/GlobalActTimeCtrl/ActTimeCtrlManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/GlobalActTimeCtrl/ActTimeCtrlManager.lua @@ -451,6 +451,14 @@ function this.GetActLeftTime(typeId) return leftTime end +-- 获取某模块剩余开放时间 -1 表示未开放/已关闭 +function this.GetActEndTime(typeId) + -- 检测数据正确性 + local serData = this.GetSerDataByTypeId(typeId) + if not typeId or not serData then return -1 end + return serData.endTime +end + function this.GetActOpenTime(id) local serData = this.GetSerDataByTypeId(id) diff --git a/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaMainPanel.lua index 193b7a2e2b..da0ae03415 100644 --- a/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaMainPanel.lua @@ -315,8 +315,8 @@ function this:RefreshEnemyData(team) local btnItem = Util.GetGameObject(node, "challenge/item"):GetComponent("Image") local btnItemNum = Util.GetGameObject(node, "challenge/item/num"):GetComponent("Text") local rankImg= Util.GetGameObject(node, "rankImg"):GetComponent("Image") - local rankId=1 - rankImg.sprite=this.spLoader:LoadSprite("y_yuxulundao_xiaobiao_0"..MServerRankConfig[rankId].RankGrade+1) + local rankId=WorldArenaManager.GetRankImgByScore(EnemyList[i].score) + rankImg.sprite=this.spLoader:LoadSprite("y_yuxulundao_xiaobiao_0"..rankId) local name=EnemyList[i].servername.." "..EnemyList[i].name lv_name.text = PracticeManager.SetNameColor(JingJiShouWeiToEn(name),EnemyList[i].practiceLevel) integral:GetComponent("Text").text = Language[11693].. EnemyList[i].score diff --git a/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaManager.lua b/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaManager.lua index 4e09579e7d..dcce8a4031 100644 --- a/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaManager.lua @@ -1,7 +1,7 @@ WorldArenaManager = {}; local this = WorldArenaManager local ArenaSetting = ConfigManager.GetConfig(ConfigName.MServerArenaSetting) - +local rankConfig = ConfigManager.GetConfig(ConfigName.MServerRankConfig) function this.Initialize() this.rank=0 @@ -25,6 +25,14 @@ function this.GetArenaChallengeCost() return itemId, itemNum end - +--根据积分获取段位图标id +function this.GetRankImgByScore(num) + for k, v in ConfigPairs(rankConfig) do + if v.ScoreLow=num then + return v.RankGrade+1 + end + end + return 1 +end return this \ No newline at end of file