diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua index dbcba6d603..c2ccedb62a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua @@ -218,14 +218,15 @@ end function this.UserPowerChanged() local maxPower, targetTeamId = 0 - for _, teamInfo in pairs(this.formationList) do - if #teamInfo.teamHeroInfos > 0 then - if this.GetFormationPower(teamInfo.teamId) > maxPower then - maxPower = this.GetFormationPower(teamInfo.teamId) - targetTeamId = teamInfo.teamId + -- for _, teamInfo in pairs(this.formationList) do + -- if #teamInfo.teamHeroInfos > 0 then + local curFormationWarPower = this.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)--teamInfo.teamId + if curFormationWarPower > maxPower then + maxPower = curFormationWarPower + -- targetTeamId = teamInfo.teamId end - end - end + -- end + -- end if maxPower > PlayerManager.maxForce then Log(Language[10684]) NetManager.RequestUserForceChange(FormationTypeDef.FORMATION_NORMAL)--targetTeamId diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua index a97c7c720b..93bbc3049c 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua @@ -239,9 +239,10 @@ function RoleInfoPanel:BindEvent() end) --升级 Util.AddClick(this.upLvBtn, function() - if Time.realtimeSinceStartup - RoleInfoPanel.timePressStarted <= 0.4 then + -- if Time.realtimeSinceStartup - RoleInfoPanel.timePressStarted <= 0.4 then + LogGreen("upLvBtn ") self:LvUpClick(true) - end + -- end end) --长按升级按下状态 this._onPointerDown = function(Pointgo, data) @@ -419,12 +420,12 @@ function this:LoadHerolive(_heroData, _objPoint) return testLive end --更新界面显示 -function this:UpdatePanelData() - this:UpdateHeroInfoData()--详情 +function this:UpdatePanelData(isNeedLoadLive) + this:UpdateHeroInfoData(isNeedLoadLive)--详情 RoleInfoPanel:GetCurHeroUpLvOrUpStarSData()--获取升级 突破 进阶数据 this:UpdateHeroUpLvAndBreakData()--升级 - this:UpdateHeroUpStarData()--进阶 - if curHeroData.heroConfig.GrowthSwitch then + this:UpdateHeroUpStarData(isNeedLoadLive)--进阶 + if curHeroData.heroConfig.GrowthSwitch and not isNeedLoadLive then RoleInfoPanel.HideAllLayout() this.roleInfoLayout:SetActive(true) RoleInfoPanel:SetSelectBtn(self.btnInfo, Language[11836]) @@ -432,42 +433,60 @@ function this:UpdatePanelData() end end --更新英雄情报数据 -function this:UpdateHeroInfoData() - if teamHero[curHeroData.dynamicId] then - isUpZhen = true - this.equipBtnRedPoint:SetActive(#HeroManager.GetHeroIsUpEquip(curHeroData.dynamicId) > 0) - this.talismanBtnRedPoint:SetActive(HeroManager.GetIsShowTalismanRedPoint(curHeroData)) - this.soulPrintBtnRedPoint:SetActive(HeroManager.GetIsShowSoulPrintRedPoint(curHeroData)) - else - isUpZhen = false - this.equipBtnRedPoint:SetActive(false) - this.talismanBtnRedPoint:SetActive(false) - this.soulPrintBtnRedPoint:SetActive(false) - end +function this:UpdateHeroInfoData(isNeedLoadLive) curTuPoRankUpConfig=heroRankupConfig[curHeroData.breakId] curStarRankUpConfig=heroRankupConfig[curHeroData.upStarId] - --角色定位按钮 - this.posBtn.gameObject:SetActive(curHeroData.heroConfig.ShowHeroLocation==1) - - --法宝按钮逻辑 - this.talismanBtn.gameObject:SetActive(TalismanManager.CheckTalismanIsInConfig(curHeroData)) - if TalismanManager.CheckTalismanIsInConfig(curHeroData) then - talismanIsOpen = TalismanManager.GetCurHeroIsOpenTalisman(curHeroData) - this.talismanInfo.gameObject:SetActive(not talismanIsOpen) - Util.SetGray(this.talismanClick, not talismanIsOpen) - Util.GetGameObject(this.talismanClick.transform, "lock"):SetActive(not talismanIsOpen) - if not talismanIsOpen then - Util.GetGameObject(this.talismanClick, "lock/Text"):GetComponent("Text").text = TalismanManager.GetCurHeroIsOpenTalismanStr() - end - end - - --魂印按钮逻辑 local EquipSignUnlock = ConfigManager.GetConfigData(ConfigName.GameSetting,1).EquipSignUnlock - if curHeroData.heroConfig.RankupConsumeMaterial then - this.soulPrintBtn:SetActive(PlayerManager.level>=EquipSignUnlock[1][2] and (#curHeroData.heroConfig.RankupConsumeMaterial + curHeroData.heroConfig.Star) >= EquipSignUnlock[2][2]) - else - this.soulPrintBtn:SetActive(PlayerManager.level>=EquipSignUnlock[1][2] and curHeroData.heroConfig.Star >= EquipSignUnlock[2][2]) + if not isNeedLoadLive then + if teamHero[curHeroData.dynamicId] then + isUpZhen = true + this.equipBtnRedPoint:SetActive(#HeroManager.GetHeroIsUpEquip(curHeroData.dynamicId) > 0) + this.talismanBtnRedPoint:SetActive(HeroManager.GetIsShowTalismanRedPoint(curHeroData)) + this.soulPrintBtnRedPoint:SetActive(HeroManager.GetIsShowSoulPrintRedPoint(curHeroData)) + else + isUpZhen = false + this.equipBtnRedPoint:SetActive(false) + this.talismanBtnRedPoint:SetActive(false) + this.soulPrintBtnRedPoint:SetActive(false) + end + --角色定位按钮 + this.posBtn.gameObject:SetActive(curHeroData.heroConfig.ShowHeroLocation==1) --法宝按钮逻辑 + this.talismanBtn.gameObject:SetActive(TalismanManager.CheckTalismanIsInConfig(curHeroData)) + if TalismanManager.CheckTalismanIsInConfig(curHeroData) then + talismanIsOpen = TalismanManager.GetCurHeroIsOpenTalisman(curHeroData) + this.talismanInfo.gameObject:SetActive(not talismanIsOpen) + Util.SetGray(this.talismanClick, not talismanIsOpen) + Util.GetGameObject(this.talismanClick.transform, "lock"):SetActive(not talismanIsOpen) + if not talismanIsOpen then + Util.GetGameObject(this.talismanClick, "lock/Text"):GetComponent("Text").text = TalismanManager.GetCurHeroIsOpenTalismanStr() + end + end + --魂印按钮逻辑 + if curHeroData.heroConfig.RankupConsumeMaterial then + this.soulPrintBtn:SetActive(PlayerManager.level>=EquipSignUnlock[1][2] and (#curHeroData.heroConfig.RankupConsumeMaterial + curHeroData.heroConfig.Star) >= EquipSignUnlock[2][2]) + else + this.soulPrintBtn:SetActive(PlayerManager.level>=EquipSignUnlock[1][2] and curHeroData.heroConfig.Star >= EquipSignUnlock[2][2]) + end + --情报 + self.dragView:SetDragGO(this.curLiveObj) + local starSize = Vector2.New(60,60) + SetHeroStars(self.starGrid, curHeroData.star,2,starSize,-10,Vector2.New(0.5,0.5)) + --常规属性赋值 + Util.GetGameObject(self.transform,"rolePanel/layout/roleStoryLayout/infoBg/infoRect/infoText"):GetComponent("RectTransform").anchoredPosition = Vector2.New(-2, 0) + local stroyStr = string.gsub(curHeroData.heroConfig.HeroStory,"#","\n") + self.infoTextStory.text = string.gsub(stroyStr,"|","  ")--传记 + self.posImage.sprite =Util.LoadSprite(curHeroData.professionIcon) + self.posText.text = GetJobStrByJobNum(curHeroData.profession) + self.heroName.text = curHeroData.name + self.profession.sprite =Util.LoadSprite(GetProStrImageByProNum(curHeroData.heroConfig.PropertyName)) + --定位描述相关 + this.posBgImage.sprite=Util.LoadSprite(GetHeroPosBgStr(curHeroData.heroConfig.Profession)) + this.posImage.sprite=Util.LoadSprite(GetHeroPosStr(curHeroData.heroConfig.Profession)) + this.posText.text=curHeroData.heroConfig.HeroLocation + this.unlockImage:SetActive(curHeroData.lockState == 0) + this.lockImage:SetActive(curHeroData.lockState == 1) end + --魂印 soulPrintIsOpen=SoulPrintManager.GetSoulPrintIsOpen(curHeroData) Util.GetGameObject(this.soulPrintBtn, "lock"):SetActive(not soulPrintIsOpen) Util.SetGray(this.soulPrintBtn, not soulPrintIsOpen) @@ -485,30 +504,8 @@ function this:UpdateHeroInfoData() this.talentTipStr.text = "" end end - --情报 - self.dragView:SetDragGO(this.curLiveObj) - local starSize = Vector2.New(60,60) - SetHeroStars(self.starGrid, curHeroData.star,2,starSize,-10,Vector2.New(0.5,0.5)) - --常规属性赋值 - Util.GetGameObject(self.transform,"rolePanel/layout/roleStoryLayout/infoBg/infoRect/infoText"):GetComponent("RectTransform").anchoredPosition = Vector2.New(-2, 0) - local stroyStr = string.gsub(curHeroData.heroConfig.HeroStory,"#","\n") - self.infoTextStory.text = string.gsub(stroyStr,"|","  ")--传记 - self.posImage.sprite =Util.LoadSprite(curHeroData.professionIcon) - self.posText.text = GetJobStrByJobNum(curHeroData.profession) + --情报等级 self.level.text = curHeroData.lv.."/"..HeroManager.GetCurHeroStarLvEnd(1,curHeroData) - self.heroName.text = curHeroData.name - self.profession.sprite =Util.LoadSprite(GetProStrImageByProNum(curHeroData.heroConfig.PropertyName)) - - --资质相关 - -- this.qualityImage.sprite=GetQuantityImage(curHeroData.heroConfig.Natural) - -- this.quality:SetActive(curHeroData.heroConfig.Natural < 10) - -- this.doubleQuality:SetActive(curHeroData.heroConfig.Natural >= 10) - -- this.quality:GetComponent("Text").text = curHeroData.heroConfig.Natural - -- this.doubleQuality:GetComponent("Text").text = curHeroData.heroConfig.Natural - --定位描述相关 - this.posBgImage.sprite=Util.LoadSprite(GetHeroPosBgStr(curHeroData.heroConfig.Profession)) - this.posImage.sprite=Util.LoadSprite(GetHeroPosStr(curHeroData.heroConfig.Profession)) - this.posText.text=curHeroData.heroConfig.HeroLocation --动态品阶 local pId=0 --当前突破的阶数 if curHeroData.breakId~=0 then @@ -528,8 +525,6 @@ function this:UpdateHeroInfoData() this.pinjieRoot.transform:GetChild(n).gameObject:SetActive(n+1<=#hruConfig) end - this.unlockImage:SetActive(curHeroData.lockState == 0) - this.lockImage:SetActive(curHeroData.lockState == 1) -- self.infoText.text =curHeroData.heroConfig.HeroLocation --计算面板属性 if isUpZhen then @@ -663,7 +658,8 @@ function this:UpdateHeroUpLvAndBreakMaterialShow() end local upStarPreList = {} --更新英雄进阶数据 -function this:UpdateHeroUpStarData() +function this:UpdateHeroUpStarData(isNeedLoadLive) + if isNeedLoadLive then return end --进阶材料 this:UpdateHeroUpStarMaterialShow() --进阶属性提升 @@ -1174,6 +1170,7 @@ end --升级按钮点击事件处理 function RoleInfoPanel:LvUpClick(isSingleLvUp) --是否为最大等级 + LogGreen("isSingleLvUp "..tostring(isSingleLvUp)) if curHeroData.lv>=HeroManager.heroLvEnd[curHeroData.heroConfig.Id] then PopupTipPanel.ShowTip(Language[11846]) _isClicked = false @@ -1225,6 +1222,7 @@ function RoleInfoPanel:LvUpClick(isSingleLvUp) else curUpLv = curHeroData.lv + 1 end + LogGreen("isSingleLvUp "..tostring(isSingleLvUp)) NetManager.HeroLvUpEvent(curHeroData.dynamicId,curUpLv,curHeroData.lv,function (msg) self:DeleteLvUpMaterials(isSingleLvUp,msg) end) @@ -1332,16 +1330,16 @@ function RoleInfoPanel:DeleteLvUpMaterials(isSingleLvUp,msg) BagManager.HeroLvUpUpdateItemsNum(costItemList[i][1],costItemList[i][2]) end end - for i, v in pairs(heroDatas) do - if curHeroData == v then + -- for i, v in pairs(heroDatas) do + -- if curHeroData == v then if isHeroUpTuPo and upTuPoRankUpConfig and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then UIManager.OpenPanel(UIName.RoleUpLvBreakSuccessPanel,curHeroData,upTuPoRankUpConfig.Id,upTuPoRankUpConfig.OpenLevel) curHeroData.breakId=upTuPoRankUpConfig.Id - v.breakId=curHeroData.breakId + curHeroData.breakId=curHeroData.breakId --突破有可能会升星 if curHeroData.star