From 0b88a77535de982307734f2df51d5621f1946aac Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Mon, 20 Feb 2023 17:38:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E7=9B=B8=E4=BF=AE=E6=94=B9=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/RoleInfo/FaXiangStrongPopup.prefab | 4 +- .../Popup/RewardTalismanSingleShowPopup2.lua | 4 +- .../~Lua/Modules/RoleInfo/FaXiangManager.lua | 39 +++++++++++++--- .../Modules/RoleInfo/FaXiangStrongPopup.lua | 44 +++++++++---------- .../~Lua/Modules/RoleInfo/RoleEquipPanel.lua | 20 +++++++-- 5 files changed, 77 insertions(+), 34 deletions(-) diff --git a/Assets/ManagedResources/Prefabs/UI/RoleInfo/FaXiangStrongPopup.prefab b/Assets/ManagedResources/Prefabs/UI/RoleInfo/FaXiangStrongPopup.prefab index da1e362f8f..0818fbe2c0 100644 --- a/Assets/ManagedResources/Prefabs/UI/RoleInfo/FaXiangStrongPopup.prefab +++ b/Assets/ManagedResources/Prefabs/UI/RoleInfo/FaXiangStrongPopup.prefab @@ -2489,7 +2489,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 1.99, y: -284.14} + m_AnchoredPosition: {x: 1.99, y: -400} m_SizeDelta: {x: 755.3, y: 88.74} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7941771466587653062 @@ -2527,7 +2527,7 @@ MonoBehaviour: m_BestFit: 1 m_MinSize: 3 m_MaxSize: 50 - m_Alignment: 1 + m_Alignment: 4 m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/RewardTalismanSingleShowPopup2.lua b/Assets/ManagedResources/~Lua/Modules/Popup/RewardTalismanSingleShowPopup2.lua index f68fbb4eab..db4fd60a6f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/RewardTalismanSingleShowPopup2.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/RewardTalismanSingleShowPopup2.lua @@ -435,8 +435,8 @@ function RewardTalismanSingleShowPopup2:OnShow() end if self.openType == 2 then if self.position>6 then - self.upgradeRed:SetActive(false) - self.upstarRed:SetActive(false) + self.upgradeRed:SetActive(FaXiangManager.CheckIsShowRed(self.equipData.idDyn,1)) + self.upstarRed:SetActive(FaXiangManager.CheckIsShowRed(self.equipData.idDyn,2)) self.shenyingRed:SetActive(false) else self.upgradeRed:SetActive(HeroManager.CheckIsUpTreasure(self.equipData.idDyn,1)) diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/FaXiangManager.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/FaXiangManager.lua index 21bd2b2233..05a3e1218e 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/FaXiangManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/FaXiangManager.lua @@ -252,10 +252,6 @@ function this.GetCurrStarAndNextStarPropertyValue(_id, _lv,_data) return starList end - - - - --获取法相升级消耗 function this.GetFaXiangLevelCost(_pool,_lv) local levelConfig=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.FaxiangLevelConfig,"PoolId",_pool,"Level",_lv) @@ -485,7 +481,6 @@ end --获取消耗物品数据 function this.GetCostItems(_config) - if _config==nil then return end @@ -515,6 +510,40 @@ function this.GetCostItems(_config) end +--检测是否显示红点 +function this.CheckIsShowRed(_id,_type) + local faxiang=allTreasures[_id] + if not faxiang then + return false + end + local cost1 + local cost2 + local isLv=false + local isStar=false + if _type==1 then + if faxiang.lv~=faxiang.maxLv then + cost1,isLv=this.GetFaXiangLevelCost(faxiang.levelPool,faxiang.lv) + return isLv + end + + elseif _type==2 then + if faxiang.refineLv~=faxiang.maxRefineLv then + cost2,isStar=this.GetFaXiangStarCost(faxiang.refinePool,faxiang.refineLv,faxiang) + return isStar + end + else + if faxiang.lv~=faxiang.maxLv then + cost1,isLv=this.GetFaXiangLevelCost(faxiang.levelPool,faxiang.lv) + return isLv + end + if faxiang.refineLv~=faxiang.maxRefineLv then + cost2,isStar=this.GetFaXiangStarCost(faxiang.refinePool,faxiang.refineLv,faxiang) + return isStar + end + end + return false +end + --根据动态id获取法相 diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/FaXiangStrongPopup.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/FaXiangStrongPopup.lua index c55c0507d6..fc307d34a3 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/FaXiangStrongPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/FaXiangStrongPopup.lua @@ -181,10 +181,10 @@ end function FaXiangStrongPopup:RefreshRedPoint(delta,isRefreshTabRed) Timer.New(function() - -- for k,v in pairs(this.treasureDatas2) do - -- local redShow = HeroManager.CheckIsUpTreasure(v.data.idDyn,type) - -- v.red.gameObject:SetActive(redShow) - -- end + for k,v in pairs(this.treasureDatas2) do + local redShow = FaXiangManager.CheckIsShowRed(v.data.idDyn,type) + v.red.gameObject:SetActive(redShow) + end this.select.transform:SetParent(curIndex.transform) this.select:GetComponent("RectTransform").anchoredPosition3D = Vector3.New(-8.5,5.04,0) if type==1 then @@ -197,23 +197,21 @@ function FaXiangStrongPopup:RefreshRedPoint(delta,isRefreshTabRed) this.select.gameObject:SetActive(true) this.select.transform:SetSiblingIndex(1) end,delta):Start() - -- if isRefreshTabRed then - -- local redDataStrong ,redDataRefine,redDataShenying = false,false,false - -- for k,v in pairs(datas) do - -- if not redDataStrong then - -- redDataStrong = HeroManager.CheckIsUpTreasure(v.idDyn,1) - -- end - -- if not redDataRefine then - -- redDataRefine = HeroManager.CheckIsUpTreasure(v.idDyn,2) - -- end - -- if not redDataShenying then - -- redDataShenying = HeroManager.CheckIsUpTreasure(v.idDyn,3) - -- end - -- end - -- this.btn_strongPageRed.gameObject:SetActive(redDataStrong) - -- this.btn_refinePageRed.gameObject:SetActive(redDataRefine) - -- this.btn_shenyingPageRed.gameObject:SetActive(redDataShenying) - -- end + if isRefreshTabRed then + local redDataStrong ,redDataRefine,redDataShenying = false,false,false + --for k,v in pairs(datas) do + if not redDataStrong then + redDataStrong = FaXiangManager.CheckIsShowRed(curEquipData.idDyn,1) + end + if not redDataRefine then + redDataRefine = FaXiangManager.CheckIsShowRed(curEquipData.idDyn,2) + end + + --end + this.btn_strongPageRed.gameObject:SetActive(redDataStrong) + this.btn_refinePageRed.gameObject:SetActive(redDataRefine) + + end end --界面打开时调用(用于子类重写) @@ -346,6 +344,7 @@ function FaXiangStrongPopup:SetWindShow(_index) for i = 1, #skillId do des= des..ConfigManager.GetConfigData(ConfigName.PassiveSkillConfig,skillId[i]).Desc end + this.hintTxt.text="已提升至最大等级" this.skillInfo.text= "".."法相技能: "..""..des elseif _index == 2 then this.titleTxt.text="法相升星" @@ -378,8 +377,9 @@ function FaXiangStrongPopup:SetWindShow(_index) des= des..ConfigManager.GetConfigData(ConfigName.PassiveSkillConfig,skillId[i]).Desc end this.skillInfo.text= "".."技能预览: "..""..des + this.hintTxt.text="已提升至最大星级" end - + this.hintTxt.gameObject:SetActive(isMax) isGongMing = false --if HarmonyManager.IsInfo(curEquipData.upHeroDid) and HarmonyManager.GetSingleAdditions(index) ~= -1 and _index == 1 then -- if HarmonyManager.IsInfo(curEquipData.upHeroDid) and _index == 1 then diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleEquipPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleEquipPanel.lua index 156d9b064e..790e19a0e3 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleEquipPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleEquipPanel.lua @@ -143,6 +143,8 @@ function RoleEquipPanel:InitComponent() this.equipBtn6 = Util.GetGameObject(self.gameObject,"bg/equipInfo/equip6/Image") this.equipBTn5Add = Util.GetGameObject(self.gameObject,"bg/equipInfo/equip5/red") this.equipBtn6Add = Util.GetGameObject(self.gameObject,"bg/equipInfo/equip6/red") + this.equipBTn7Add = Util.GetGameObject(self.gameObject,"bg/equipInfo/equip7/red") + this.equipBtn8Add = Util.GetGameObject(self.gameObject,"bg/equipInfo/equip8/red") for i = 1, 8 do Util.GetGameObject(self.gameObject,"bg/equipInfo/equip"..i.."/mask"):GetComponent("Image").sprite = this.spLoader:LoadSprite(EquipPositionIcon[i]) end @@ -1123,13 +1125,25 @@ function this.CheckRedTab() showRed = false end redTabs[i].gameObject:SetActive(showRed) - else - local canEquips = HeroManager.GetHeroIsUpTreasure(curHeroData.dynamicId,(i-4)) - redTabs[i].gameObject:SetActive(isCanUpEquipTreasure and isUpZhen and #canEquips > 0) + elseif i==5 then + -- body + local isRed + for j = 1, 2 do + local canEquips = HeroManager.GetHeroIsUpTreasure(curHeroData.dynamicId,(j-4)) + if canEquips and #canEquips>0 then + isRed=true + end + end + + redTabs[i].gameObject:SetActive(isCanUpEquipTreasure and isUpZhen and isRed) + elseif i==6 then + redTabs[i].gameObject:SetActive(false) end end this.equipBTn5Add.gameObject:SetActive(curEquipTreasureDatas[5] and curEquipTreasureDatas[5].idDyn and HeroManager.CheckIsUpTreasure(curEquipTreasureDatas[5].idDyn,0) ) this.equipBtn6Add.gameObject:SetActive(curEquipTreasureDatas[6] and curEquipTreasureDatas[6].idDyn and HeroManager.CheckIsUpTreasure(curEquipTreasureDatas[6].idDyn,0) ) + this.equipBTn7Add.gameObject:SetActive(curFaXiangDatas[7] and curFaXiangDatas[7].idDyn and FaXiangManager.CheckIsShowRed(curFaXiangDatas[7].idDyn,0) ) + this.equipBtn8Add.gameObject:SetActive(curFaXiangDatas[8] and curFaXiangDatas[8].idDyn and FaXiangManager.CheckIsShowRed(curFaXiangDatas[8].idDyn,0) ) end --选择图片设置父级