From 111c7255ab0c68f17b2f766ee4ed05a93d2251b5 Mon Sep 17 00:00:00 2001 From: "PC-202302260912\\Administrator" <1545929779@qq.com> Date: Thu, 21 Dec 2023 15:43:57 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=89=B9=E8=AE=AD]=3D=3D=3D=3D=3D=3D=3D=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=89=B9=E8=AE=AD=E4=B8=AD=E7=9A=84=E8=8B=B1=E9=9B=84?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=88=86=E8=A7=A3=20=E5=8D=87=E6=98=9F?= =?UTF-8?q?=E8=A2=AB=E5=90=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Hero/HeroManager.lua | 5 ++ .../Modules/HomeLand/TrainBuildManager.lua | 6 +- .../~Lua/Modules/HomeLand/TrainBuildPanel.lua | 88 ++++++++++--------- .../~Lua/Modules/Login/LoginPanel.lua | 1 + .../Resolve/View/Resolve_Dismantle.lua | 34 ++++--- .../Modules/RoleInfo/RoleUpStarListPanel.lua | 7 +- 6 files changed, 83 insertions(+), 58 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua b/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua index 403f14f66b..74b95441a8 100644 --- a/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua @@ -661,6 +661,10 @@ function this.GetAllHeroDataMsinusUpWar(_sortTypeId,type) --0全部 1-6属性 7 if HarmonyManager:IsEnvoy(v.dynamicId) then heros[i].isHarmonyGongMing = 2 end + heros[i].isTrain=0 + if TrainBuildManager.CheckHeroIsTraining(v.dynamicId) then + heros[i].isTrain=1 + end end end --所有的所在队伍id, @@ -793,6 +797,7 @@ function this.DeleteHeroDatas(heroDIds) --装备的法灵 FaLingManager.SetEquipBelongHero(heroDatas[heroDIds[i]].baublesId,nil) HeroManager.SetHeroBaublesId(heroDIds[i],"") + TrainBuildManager.RemoveTrainHero(heroDIds[i]) --删除英雄 heroDatas[heroDIds[i]] = nil end diff --git a/Assets/ManagedResources/~Lua/Modules/HomeLand/TrainBuildManager.lua b/Assets/ManagedResources/~Lua/Modules/HomeLand/TrainBuildManager.lua index a3fda8ee6d..1ec74a429e 100644 --- a/Assets/ManagedResources/~Lua/Modules/HomeLand/TrainBuildManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/HomeLand/TrainBuildManager.lua @@ -59,8 +59,10 @@ function this.GetAllCanTrainHero() end return heros end - - +--检测英雄是否正在特训 +function this.CheckHeroIsTraining(_did) + return CheckListIsContainValue1(trainHeroId,_did) +end ---检测功能开启方法 function this.CheckBuildIsOpen(str) diff --git a/Assets/ManagedResources/~Lua/Modules/HomeLand/TrainBuildPanel.lua b/Assets/ManagedResources/~Lua/Modules/HomeLand/TrainBuildPanel.lua index c1696812b9..a1d786b6f3 100644 --- a/Assets/ManagedResources/~Lua/Modules/HomeLand/TrainBuildPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/HomeLand/TrainBuildPanel.lua @@ -226,53 +226,57 @@ function TrainBuildPanel:SetBuildsState() end end if data.heroId and data.heroId~="" then - --LogError("data.heroid====================="..data.heroId) local heroData=HeroManager.GetSingleHeroData(data.heroId) - curObj.Icon.sprite = self.spLoader:LoadSprite(GetResourcePath(heroData.heroConfig.Icon)) - local pos=data.dataSingle.Position - local max=0 - local curValue=0 - local train=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.Train,"HeroID",heroData.heroConfig.Id,"Level",heroData.HeroTraining.trainingLv) - if train then - local aaa=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.TrainSetting,"PoolID",train.TrainSettingID,"Level",heroData.HeroTraining.trainingLv) - if pos==1 then - max=aaa.TrainExp1 - curValue=heroData.HeroTraining.attackExp - elseif pos==2 then - max=aaa.TrainExp2 - curValue=heroData.HeroTraining.defenseExp - elseif pos==3 then - max=aaa.TrainExp3 - curValue=heroData.HeroTraining.hpExp - end - end - --LogError("curvalue==========================="..curValue) - local endTime=data.heroStarTime+math.ceil((max-curValue)/data.dataSingle.Gain)*60 - curObj.trainLeftTime=endTime-GetTimeStamp() - --LogError("endtime=================================="..endTime.." trainLeftTime=="..curObj.trainLeftTime) - curObj.CanGet:SetActive(true) - PlayUIAnim(curObj.CanGet) - Util.AddOnceClick(curObj.CanGet,function () - if curObj.trainLeftTime>0 then - local sureFunc=function() + if heroData then + curObj.Icon.sprite = self.spLoader:LoadSprite(GetResourcePath(heroData.heroConfig.Icon)) + local pos=data.dataSingle.Position + local max=0 + local curValue=0 + local train=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.Train,"HeroID",heroData.heroConfig.Id,"Level",heroData.HeroTraining.trainingLv) + if train then + local aaa=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.TrainSetting,"PoolID",train.TrainSettingID,"Level",heroData.HeroTraining.trainingLv) + if pos==1 then + max=aaa.TrainExp1 + curValue=heroData.HeroTraining.attackExp + elseif pos==2 then + max=aaa.TrainExp2 + curValue=heroData.HeroTraining.defenseExp + elseif pos==3 then + max=aaa.TrainExp3 + curValue=heroData.HeroTraining.hpExp + end + end + --LogError("curvalue==========================="..curValue) + local endTime=data.heroStarTime+math.ceil((max-curValue)/data.dataSingle.Gain)*60 + curObj.trainLeftTime=endTime-GetTimeStamp() + --LogError("endtime=================================="..endTime.." trainLeftTime=="..curObj.trainLeftTime) + curObj.CanGet:SetActive(true) + PlayUIAnim(curObj.CanGet) + Util.AddOnceClick(curObj.CanGet,function () + if curObj.trainLeftTime>0 then + local sureFunc=function() + NetManager.TrainingRequest(data.dataMain.Id,data.heroId,2,function () + self:OnShow() + end) + end + local args={} + args[1]="特训未完成是否提前结束?" + args[2]="结束" + args[3]="取消" + args[4]=sureFunc + UIManager.OpenPanel(UIName.GMCommonConfirmPanel,args) + else + LogError("data.heroid==============================="..data.heroId) NetManager.TrainingRequest(data.dataMain.Id,data.heroId,2,function () self:OnShow() end) end - local args={} - args[1]="特训未完成是否提前结束?" - args[2]="结束" - args[3]="取消" - args[4]=sureFunc - UIManager.OpenPanel(UIName.GMCommonConfirmPanel,args) - else - LogError("data.heroid==============================="..data.heroId) - NetManager.TrainingRequest(data.dataMain.Id,data.heroId,2,function () - self:OnShow() - end) - end - - end) + + end) + else + LogError("herodata========================================="..nil) + end + else curObj.trainLeftTime=-1 end diff --git a/Assets/ManagedResources/~Lua/Modules/Login/LoginPanel.lua b/Assets/ManagedResources/~Lua/Modules/Login/LoginPanel.lua index 56fe67ae3a..8e1448d37a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Login/LoginPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Login/LoginPanel.lua @@ -731,6 +731,7 @@ function this.ExecuteLoading() --[[[58] =]]function() NetManager.RequestMagicSoldierInfo(LoadingPanel.OnStep) end, --神兵 --[[[59] =]]function() NetManager.GemNewInfoRequest(LoadingPanel.OnStep) end, --新命石 function() NetManager.BaublesAllInfoRequest(LoadingPanel.OnStep) end, --新法宝 + function() NetManager.TrainingArchitectureInfoRequest(LoadingPanel.OnStep) end, function() -- 登录请求最终接口,所有请求放在此接口之前 -- 登录成功确认 NetManager.LoginConfimRequest() diff --git a/Assets/ManagedResources/~Lua/Modules/Resolve/View/Resolve_Dismantle.lua b/Assets/ManagedResources/~Lua/Modules/Resolve/View/Resolve_Dismantle.lua index 6084cb468b..ac673ad080 100644 --- a/Assets/ManagedResources/~Lua/Modules/Resolve/View/Resolve_Dismantle.lua +++ b/Assets/ManagedResources/~Lua/Modules/Resolve/View/Resolve_Dismantle.lua @@ -155,6 +155,10 @@ function this.SingleHeroDataShow(go,_heroData) PopupTipPanel.ShowTip(Language[12184]) end) Util.AddOnceClick(cardclickBtn, function() + if heroData.isTrain==1 then + PopupTipPanel.ShowTip("神将正在特训中") + return + end if selectHeroData[heroData.dynamicId] then choosed:SetActive(false) selectHeroData[heroData.dynamicId] = nil @@ -218,24 +222,28 @@ function this.SortHeroDatas(_heroDatas) if (a.isFormation == "" or (a.isFormation ~= "" and a.isFormations[1] == FormationTypeDef.EXPEDITION)) and (b.isFormation == "" or (b.isFormation ~= "" and b.isFormations[1] == FormationTypeDef.EXPEDITION)) then if a.lockState == b.lockState then if a.isHarmonyGongMing == b.isHarmonyGongMing then - if a.heroConfig.Natural ==b.heroConfig.Natural then - if a.star == b.star then - local aGodLv = GodSoulManager.GetGodSoulLv(a.dynamicId) - local bGodLv = GodSoulManager.GetGodSoulLv(b.dynamicId) - if aGodLv == bGodLv then - if a.lv == b.lv then - return a.heroConfig.Id > b.heroConfig.Id + if a.isTrain ==b.isTrain then + if a.heroConfig.Natural ==b.heroConfig.Natural then + if a.star == b.star then + local aGodLv = GodSoulManager.GetGodSoulLv(a.dynamicId) + local bGodLv = GodSoulManager.GetGodSoulLv(b.dynamicId) + if aGodLv == bGodLv then + if a.lv == b.lv then + return a.heroConfig.Id > b.heroConfig.Id + else + return a.lv < b.lv + end else - return a.lv < b.lv + return aGodLv < bGodLv end else - return aGodLv < bGodLv - end + return a.star < b.star + end else - return a.star < b.star - end + return a.heroConfig.Natural < b.heroConfig.Natural + end else - return a.heroConfig.Natural < b.heroConfig.Natural + return a.isTrain < b.isTrain end else return a.isHarmonyGongMing < b.isHarmonyGongMing diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleUpStarListPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleUpStarListPanel.lua index fec0ea3519..fc23712754 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleUpStarListPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleUpStarListPanel.lua @@ -228,6 +228,10 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择 PopupTipPanel.ShowTip(Language[12184]) end) Util.AddOnceClick(cardBtn, function() + if TrainBuildManager.CheckHeroIsTraining(heroData.dynamicId) then + PopupTipPanel.ShowTip("该神将正在特训") + return + end local isSelect = false local selectIndex = 0 for i = 1, #curSelectHeroList do @@ -377,7 +381,8 @@ function RoleUpStarListPanel:AutoSelectHero() curSelectHeroList = {} for i = 1, #heroDataList do if heroDataList[i].type == RoleUpStarMatType.item and LengthOfTable(curSelectHeroList) < curNeedRoleNum or heroDataList[i].type == RoleUpStarMatType.hero and LengthOfTable(curSelectHeroList) < curNeedRoleNum - and heroDataList[i].isFormation == "" and heroDataList[i].lockState == 0 and (not HarmonyManager.IsChangeColor(heroDataList[i].dynamicId) and(not HarmonyManager:IsEnvoy(heroDataList[i].dynamicId))) then + and heroDataList[i].isFormation == "" and heroDataList[i].lockState == 0 and (not HarmonyManager.IsChangeColor(heroDataList[i].dynamicId) and(not HarmonyManager:IsEnvoy(heroDataList[i].dynamicId))) + and TrainBuildManager.CheckHeroIsTraining(heroDataList[i].dynamicId)==false then -- curSelectHeroList[heroDataList[i].dynamicId]=heroDataList[i] table.insert(curSelectHeroList,heroDataList[i]) end