diff --git a/Assets/ManagedResources/~Lua/Common/functions.lua b/Assets/ManagedResources/~Lua/Common/functions.lua index 3cfd70785c..4ffa4ce1b5 100644 --- a/Assets/ManagedResources/~Lua/Common/functions.lua +++ b/Assets/ManagedResources/~Lua/Common/functions.lua @@ -2038,4 +2038,17 @@ function OpenWeb(url) UnityEngine.Application.OpenURL(url) end end +end + +function GetProfessionNameById(_professionId) + if _professionId==1 then + return "肉盾" + elseif _professionId==2 then + return "输出" + elseif _professionId==3 then + return "控制" + elseif _professionId==4 then + return "辅助" + end + return "" end \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index a1f5822f16..a1631b40cf 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -5606,7 +5606,7 @@ function NetManager.SendSixiangUpStarRequest(_professionId,func) if curGongmingLv>gongmingLv then PopupTipPanel.ShowTip(string.format("进阶成功,并激活了%s级共鸣效果!",curGongmingLv)) else - PopupTipPanel.ShowTip("进阶成功") + PopupTipPanel.ShowTip(string.format("四象心法-%s进阶成功",GetProfessionNameById(_professionId))) end NetManager.RequestUserForceChange(FormationTypeDef.FORMATION_NORMAL) if func then diff --git a/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantGongmingPopup.lua b/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantGongmingPopup.lua index fa0625b381..87f91bc8dd 100644 --- a/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantGongmingPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantGongmingPopup.lua @@ -10,14 +10,6 @@ local ProfessionType = { [4] = 4,--辅助 } ---职业id对应职业名称 -local ProfessionName={ - [1] = "肉盾", - [2] = "输出", - [3] = "控制", - [4] = "辅助", -} - local propertyType = { [1] = 2,--攻击 [2] = 1,--生命 @@ -44,7 +36,7 @@ function this:InitComponent() for i = 1, this.professionGrid.transform.childCount do local obj= this.professionGrid.transform:GetChild(i-1) local professionId=ProfessionType[i] - Util.GetGameObject(obj,"professionName"):GetComponent("Text").text=ProfessionName[professionId] + Util.GetGameObject(obj,"professionName"):GetComponent("Text").text=GetProfessionNameById(professionId) Util.GetGameObject(obj,"professionIcon"):GetComponent("Image").sprite=this.spLoader:LoadSprite(GetHeroProfessionById(professionId)) local btn=Util.GetGameObject(obj,"btn") Util.AddClick(btn, function() @@ -105,8 +97,8 @@ function this:OnOpen(data) end function this.SetPropAdd(_propAddObj,_gongmingLv,isNext) - local curFourQuadConfig = ConfigManager.GetConfigDataByKey(ConfigName.FourQuadrantConfig,"Star",_gongmingLv) - if curFourQuadConfig then + if _gongmingLv<=5 then + local curFourQuadConfig = ConfigManager.GetConfigDataByKey(ConfigName.FourQuadrantConfig,"Star",_gongmingLv) _propAddObj.transform.parent.gameObject:SetActive(true) for i = 1, #propertyType do local propertyObj=_propAddObj.transform:GetChild(i-1) diff --git a/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantPopup.lua b/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantPopup.lua index a9fc34137b..2fefa29686 100644 --- a/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantPopup.lua @@ -15,13 +15,6 @@ local propertyType = { [3] = 3,--护甲 [4] = 4,--魔抗 } ---职业id对应职业名称 -local ProfessionName={ - [1] = "肉盾", - [2] = "输出", - [3] = "控制", - [4] = "辅助", -} --属性id对应属性名称 local PropertyName={ @@ -43,6 +36,8 @@ local _isReqLvUp=false local oldPower = 0 local newPower = 0 this.timePressStarted = 0--监听长按时间 +local oldPropMap={} +local barWidth=700 --初始化组件(用于子类重写)FourQuadrantPopup function this:InitComponent() this.spLoader = SpriteLoader.New() @@ -77,6 +72,18 @@ function this:InitComponent() [2]=this.shuchuBtn, [3]=this.kongzhiBtn, [4]=this.fuzhuBtn,} + this.propPreMap={} + for i = 1, #propertyType do + local obj=this.propertyGrid.transform:GetChild(i-1) + local propObjMap={} + propObjMap.bar=Util.GetGameObject(obj.gameObject,"progressBg/progressBar"):GetComponent("RectTransform") + propObjMap.addValue=Util.GetGameObject(obj.gameObject,"progressBg/addValue"):GetComponent("Text") + propObjMap.propertyValueText=Util.GetGameObject(obj.gameObject,"propertyValue"):GetComponent("Text") + propObjMap.propertyNameText=Util.GetGameObject(obj.gameObject,"propertyName"):GetComponent("Text") + propObjMap.propertyIcon=Util.GetGameObject(obj.gameObject,"propertyIcon"):GetComponent("Image") + propObjMap.fade=nil + this.propPreMap[propertyType[i]]=propObjMap + end this.itemView= SubUIManager.Open(SubUIConfig.ItemView, this.limitCost.transform) end @@ -133,7 +140,7 @@ function this:BindEvent() end) Util.AddClick(this.upStarBtn, function() - if this.CheckXiuxingLv() then + -- if this.CheckXiuxingLv() then local costArr=fourQuadConfig.RankupCost for i = 1, #costArr do if BagManager.GetTotalItemNum(costArr[i][1])进阶后,四种属性全部提升%s%%",10) + if fourQuadConfig.RankupCost then + this.upStarCostitem= ConfigManager.GetConfigData(ConfigName.ItemConfig,fourQuadConfig.RankupCost[1][1]) + this.limitHint.gameObject:SetActive(true) + if this.CheckIsUpStar() then + this.limitCost.gameObject:SetActive(false) + this.limitHint.text=string.format("进阶后,四种属性全部提升%s%%",10) + else + local itemName=this.upStarCostitem.Name + local itemIcon=GetResourcePath(this.upStarCostitem.ResourceID) + this.limitHint.text=string.format("四种属性强化至上限后使用 %s进阶",itemName) + this.limitCost.gameObject:SetActive(true) + this.limitCost.sprite=this.spLoader:LoadSprite(itemIcon) + this.itemView:OnOpen(false, {this.upStarCostitem.Id,1}, 0, false,false,false) + end else - local itemName=this.upStarCostitem.Name - local itemIcon=GetResourcePath(this.upStarCostitem.ResourceID) - this.limitHint.text=string.format("四种属性强化至上限后使用 %s进阶",itemName) - this.limitCost.gameObject:SetActive(true) - this.limitCost.sprite=this.spLoader:LoadSprite(itemIcon) - this.itemView:OnOpen(false, {this.upStarCostitem.Id,1}, 0, false,false,false) + this.limitHint.gameObject:SetActive(false) end - upStarProperty=PracticeManager.fourQuadrantUpStarPropMap[_professionId] + upStarProperty=PracticeManager.fourQuadrantUpStarPropMap[_professionId] + this.SaveOldProp(propertyList) this.UpdateBtnStateAndCostShow() this.UpdateProperty(propertyList) this.UpdateStarLv() this.professionIcon.sprite = this.spLoader:LoadSprite(GetHeroProfessionById(_professionId)) end - +---更新职业等级显示 function this.UpdateStarLv() local lvCount=this.starLv.transform.childCount for i = 0, lvCount-1 do @@ -331,9 +346,9 @@ function this.UpdateBtnStateAndCostShow() local num = costObj:GetComponent("Text") icon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(costStr[1])) local cueHasNum=BagManager.GetTotalItemNum(costArr[i][1]) - num.text = string.format("%s/%s",cueHasNum,costStr[2]) + num.text = string.format("%s/%s",PrintWanNum2(cueHasNum),costStr[2]) if cueHasNum%s/%s",cueHasNum,costStr[2]) + num.text = string.format("%s/%s",PrintWanNum2(cueHasNum),costStr[2]) end else costObj:SetActive(false); @@ -350,28 +365,25 @@ function this.UpdateProperty(_propertyInfoList) end end for i = 1, #propertyType do - local obj=this.propertyGrid.transform:GetChild(i-1) - local bar=Util.GetGameObject(obj.gameObject,"progressBg/progressBar"):GetComponent("Image") - local propertyValueText=Util.GetGameObject(obj.gameObject,"propertyValue"):GetComponent("Text") - local propertyNameText=Util.GetGameObject(obj.gameObject,"propertyName"):GetComponent("Text") - local propertyIcon=Util.GetGameObject(obj.gameObject,"propertyIcon"):GetComponent("Image") local propertyId=propertyType[i] - propertyIcon.sprite=this.spLoader:LoadSprite(PropertyTypeIconDef[propertyId]) - propertyNameText.text=string.format("%s神将%s",this.curProfessionName,PropertyName[propertyId]) + this.propPreMap[propertyId].propertyIcon.sprite=this.spLoader:LoadSprite(PropertyTypeIconDef[propertyId]) + this.propPreMap[propertyId].propertyNameText.text=string.format("%s神将%s",this.curProfessionName,PropertyName[propertyId]) local propertyNum=_propertyInfoMap[propertyId] and _propertyInfoMap[propertyId] or 0; local curPropLimit=propertyLimit[propertyId] + local propBar=this.propPreMap[propertyId].bar if this.professionLv>0 then local progressNum=_propertyInfoMap[propertyId]-lastPropertyLimit[propertyId] local progressLimit=curPropLimit-lastPropertyLimit[propertyId] - bar.fillAmount = progressNum/progressLimit + propBar.sizeDelta= Vector2.New(progressNum/progressLimit*barWidth,propBar.sizeDelta.y) else - bar.fillAmount = propertyNum/curPropLimit + propBar.sizeDelta = Vector2.New(propertyNum/curPropLimit*barWidth.sizeDelta.y) end - propertyValueText.text=string.format("%s/%s",propertyNum,curPropLimit) + this.propPreMap[propertyId].propertyValueText.text=string.format("%s/%s",propertyNum,curPropLimit) end this.UpdateBtnStateAndCostShow() _isReqLvUp = false this.CheckWinRedPoint() + this.ShowAddPropNum(this.professionId) end ---显示战斗力提升 @@ -380,6 +392,36 @@ function this.ShowPower() UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldPower,newValue = newPower}) oldPower = newPower end +--保存打开界面时初始属性 +function this.SaveOldProp(_propertyInfoList) + if _propertyInfoList then + for i = 1, #_propertyInfoList do + oldPropMap[_propertyInfoList[i].propertyId]=_propertyInfoList[i].propertyNum + end + end +end +--显示属性值增加 +function this.ShowAddPropNum(_professionId) + local propertyList=PracticeManager.FourQuadrantData[_professionId].propertyList + if propertyList then + for i = 1, #propertyList do + local propertyInfo=propertyList[i] + local addNum=propertyInfo.propertyNum-oldPropMap[propertyInfo.propertyId] + if addNum>0 then + this.propPreMap[propertyInfo.propertyId].addValue.text=string.format("+%s",addNum); + this.propPreMap[propertyInfo.propertyId].addValue.gameObject:SetActive(true) + if this.propPreMap[propertyInfo.propertyId].fade then + this.propPreMap[propertyInfo.propertyId].fade:Kill() + end + this.propPreMap[propertyInfo.propertyId].addValue:DOFade(1, 0) + this.propPreMap[propertyInfo.propertyId].fade= this.propPreMap[propertyInfo.propertyId].addValue:DOFade(0, 3):OnComplete(function() + this.propPreMap[propertyInfo.propertyId].fade=nil + end) + end + oldPropMap[propertyInfo.propertyId]=propertyInfo.propertyNum + end + end +end --进阶刷新界面 function this.UpStarUpdate() diff --git a/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua b/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua index d3a634a370..96a2eda702 100644 --- a/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua @@ -537,6 +537,9 @@ function this.CheckIsUpStarByProfessionId(_professionId) if not professionInfo then return false end + if professionInfo.level>=5 then + return false + end local fourQuadConfig = ConfigManager.GetConfigDataByKey(ConfigName.FourQuadrantConfig,"Star",professionInfo.level) for i = 1, #fourQuadConfig.PropLimit do local propLimitArr=fourQuadConfig.PropLimit[i] @@ -603,16 +606,4 @@ function this.CheckIsUpStarCondition(_professionId) return true end -function this.GetGongMingPropList() - local propMap={} - propMap[1]=1000 - propMap[2]=1000 - propMap[3]=1000 - propMap[4]=1000 - return propMap -end - - - - return PracticeManager \ No newline at end of file