From 956826c46a1a6bb89887765b238bda59ae8b4cbe Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Thu, 6 Jan 2022 17:53:53 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=AE=B6=E5=9B=AD=E3=80=91=E6=91=98?= =?UTF-8?q?=E6=98=9F=E9=98=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DynamicActivityManager.lua | 8 +- .../View/GeneralBigPopup_YiJingBaoKu.lua | 27 ++-- .../Popup/View/GeneralPopup_HomeLandEquip.lua | 115 ++++++++++-------- 3 files changed, 85 insertions(+), 65 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/DynamicActivityManager.lua b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/DynamicActivityManager.lua index d071e1995c..853f1ce223 100644 --- a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/DynamicActivityManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/DynamicActivityManager.lua @@ -211,7 +211,7 @@ function this.GetBaoKuData() data.reward = RewardAllConfig[v.progress].Reward data.configId = RewardAllConfig[v.progress].Id end - -- --LogGreen("Id:"..v.missionId.." rewardId:"..v.progress.." ") + LogGreen("Id:"..v.missionId.." rewardId:"..v.progress.." ") table.insert(finalCardDatas,data) end end @@ -230,7 +230,7 @@ function this.GetBaoKuData() local data = {} data.rewardId = v.missionId-1000 data.progress = v.progress - -- LogYellow("rewardId:"..data.rewardId.." data.progress:"..data.progress) + LogYellow("rewardId:"..data.rewardId.." data.progress:"..data.progress) data.configId = RewardAllConfig[data.rewardId].Id table.insert(allData,data) end @@ -285,10 +285,10 @@ function this.GetLeftRewardData() data[RewardConfig[i].Id].limit = RewardConfig[i].InitializeNum end - -- LogYellow("#finalCardDatas:"..#finalCardDatas.." actData.selectId:"..actData.selectId) + LogYellow("#finalCardDatas:"..#finalCardDatas.." actData.selectId:"..actData.selectId) for i = 1, #finalCardDatas do if finalCardDatas[i].rewardId and finalCardDatas[i].rewardId ~= 0 and finalCardDatas[i].rewardId ~= actData.selectId then - -- LogYellow("i:"..i.." rewardId:"..tostring(finalCardDatas[i].rewardId) .." progress"..tonumber(data[finalCardDatas[i].rewardId].progress)) + LogYellow("i:"..i.." rewardId:"..tostring(finalCardDatas[i].rewardId) .." progress"..tonumber(data[finalCardDatas[i].rewardId].progress)) data[finalCardDatas[i].rewardId].progress = data[finalCardDatas[i].rewardId].progress - 1 end end diff --git a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_YiJingBaoKu.lua b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_YiJingBaoKu.lua index ddc12c196d..5875d2a2ae 100644 --- a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_YiJingBaoKu.lua +++ b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_YiJingBaoKu.lua @@ -137,29 +137,32 @@ function this:SetSingleData(index,item,data) end local aData = this.GetDataByRewardId(data.Id) -- LogRed(aData.rewardId..":"..tostring(aData.progress)) - if aData.progress >= data.InitializeNum then - t3 = false - -- 如果是当前层选中的特殊奖励 - if aData.progress == data.InitializeNum and ActData.selectId == data.Id then--and ActData.curLevel > data.InitializeNum - t3 = true - end - num.text = ""..(data.InitializeNum-aData.progress).."/"..data.InitializeNum.."" - else - t3 = true - num.text = (data.InitializeNum - aData.progress).."/"..data.InitializeNum - end + -- if aData.progress >= data.InitializeNum then + -- t3 = false + -- -- 如果是当前层选中的特殊奖励 + -- if aData.progress == data.InitializeNum and ActData.selectId == data.Id then--and ActData.curLevel > data.InitializeNum + -- t3 = true + -- end + -- num.text = ""..(data.InitializeNum-aData.progress).."/"..data.InitializeNum.."" + -- else + -- t3 = true + -- num.text = (data.InitializeNum - aData.progress).."/"..data.InitializeNum + -- end - select:SetActive(t1 and t2 and t3) + -- select:SetActive(t1 and t2 and t3) end -- 获取数量 function this.GetDataByRewardId(rId) + LogPink("rId:"..tostring(rId)) for k, v in ipairs(ActData.allData) do + LogGreen("v.rewardId:"..tostring(v.rewardId)) if v.rewardId == rId then return v end end + LogError("rId:"..tostring(rId)) end diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_HomeLandEquip.lua b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_HomeLandEquip.lua index ec3cf710fc..764caaa1ba 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_HomeLandEquip.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_HomeLandEquip.lua @@ -22,6 +22,7 @@ function this:InitComponent(gameObject) this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text") this.titleText.text="摘星阁" this.Btn1 = Util.GetGameObject(gameObject,"Btn1") + this.Btn1Text = Util.GetGameObject(gameObject,"Btn1/Text"):GetComponent("Text") this.Btn2 = Util.GetGameObject(gameObject,"Btn2") this.costCondition = Util.GetGameObject(gameObject,"Cost/Condition"):GetComponent("Text") this.costIcon = Util.GetGameObject(gameObject,"Cost/Icon"):GetComponent("Image") @@ -108,60 +109,76 @@ end function this:SetData() -- LogPink(HomeLandManager.EquipData[HomeLandManager.curEquip].Id) local curIndex = HomeLandManager.curEquip - local data = EquipStrengthen[HomeLandManager.EquipData[curIndex].Id].Rate--当前装备加成 - local proData = EquipRankUp[HomeLandManager.levelProId].Rate--当前装备突破加成 - - local nextData = EquipStrengthen[HomeLandManager.EquipData[curIndex].Id + 1].Rate--下一装备加成 - local nextProData = EquipRankUp[HomeLandManager.levelProId + 1].Rate--下一装备突破加成 - - local num1 = data + proData[curIndex] - -- LogYellow(tostring(data).." @ "..tostring(proData[curIndex])) - local num2 = 0 - if not HomeLandManager.GetCurIndexBtnsShow() then--如果都到达了等级上限 - num2 = data + nextProData[curIndex] - -- LogYellow(tostring(data).." $ "..tostring(nextProData[curIndex])) - else - num2 = nextData + proData[curIndex] - -- LogYellow(tostring(nextData).." # "..tostring(proData[curIndex])) - end - this.Desc.text = string.format("神将佩戴的%s%s属性增加%s",TEXT[curIndex][1],TEXT[curIndex][3],num1).."%"..string.format("(%s",num2).."%)" - --设置消耗 local limit = EquipStrengthen[HomeLandManager.EquipData[curIndex].Id].Limit local cost = EquipStrengthen[HomeLandManager.EquipData[curIndex].Id].Cost - this.costIcon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(cost[1][1])) - if HomeLandManager.BuildData[limit[1]].level >= limit[2] then - this.costCondition.text = "" - this.costIcon.gameObject:SetActive(true) - this.costNum.gameObject:SetActive(true) - local color2 = BagManager.GetTotalItemNum(cost[1][1]) >= cost[1][2] and "#FFEED6" or "red" - this.costNum.text = string.format("%s",color2,cost[1][2]) - else - this.costIcon.gameObject:SetActive(false) - this.costNum.gameObject:SetActive(false) - this.costCondition.text = string.format("%s需要到达%s级",HomeLand[limit[1]].Name,limit[2]) - end + local data = EquipStrengthen[HomeLandManager.EquipData[curIndex].Id].Rate--当前装备加成 + local proData = EquipRankUp[HomeLandManager.levelProId].Rate--当前装备突破加成 - --按钮和tips显示 - local bool = HomeLandManager.GetCurIndexBtnsShow() - -- LogBlue("bool:"..tostring(bool)) - this.Btn1:SetActive(bool) - this.Btn2:SetActive(not bool) - --不同显示 - this.Cost:SetActive(bool) - this.Tips:SetActive(not bool) - this.costCondition.gameObject:SetActive(true) - this.Tips:GetComponent("Text").text = string.format("全部加持到达%s级后方可进行突破",EquipStrengthen[HomeLandManager.EquipData[curIndex].Id].Level) - if not bool and HomeLandManager.GetAllCanUpgrade() then - this.Cost:SetActive(true) + if cost then--如果有下一级 + local nextData = EquipStrengthen[HomeLandManager.EquipData[curIndex].Id + 1].Rate--下一装备加成 + local nextProData = EquipRankUp[HomeLandManager.levelProId + 1].Rate--下一装备突破加成 + + local num1 = data + proData[curIndex] + -- LogYellow(tostring(data).." @ "..tostring(proData[curIndex])) + local num2 = 0 + if not HomeLandManager.GetCurIndexBtnsShow() then--如果都到达了等级上限 + num2 = data + nextProData[curIndex] + -- LogYellow(tostring(data).." $ "..tostring(nextProData[curIndex])) + else + num2 = nextData + proData[curIndex] + -- LogYellow(tostring(nextData).." # "..tostring(proData[curIndex])) + end + this.Desc.text = string.format("神将佩戴的%s%s属性增加%s",TEXT[curIndex][1],TEXT[curIndex][3],num1).."%"..string.format("(%s",num2).."%)" + + this.Btn1Text.text = "强 化" + Util.SetGray(this.Btn1,false) + this.Btn1:GetComponent("Button").enabled = true + this.costIcon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(cost[1][1])) + if HomeLandManager.BuildData[limit[1]].level >= limit[2] then + this.costCondition.text = "" + this.costIcon.gameObject:SetActive(true) + this.costNum.gameObject:SetActive(true) + local color2 = BagManager.GetTotalItemNum(cost[1][1]) >= cost[1][2] and "#FFEED6" or "red" + this.costNum.text = string.format("%s",color2,cost[1][2]) + else + this.costIcon.gameObject:SetActive(false) + this.costNum.gameObject:SetActive(false) + this.costCondition.text = string.format("%s需要到达%s级",HomeLand[limit[1]].Name,limit[2]) + end + + --按钮和tips显示 + local bool = HomeLandManager.GetCurIndexBtnsShow() + local bool2 = + -- LogBlue("bool:"..tostring(bool)) + this.Btn1:SetActive(bool) + this.Btn2:SetActive(not bool) + --不同显示 + this.Cost:SetActive(bool) + this.Tips:SetActive(not bool) + this.costCondition.gameObject:SetActive(true) + this.Tips:GetComponent("Text").text = string.format("全部加持到达%s级后方可进行突破",EquipStrengthen[HomeLandManager.EquipData[curIndex].Id].Level) + if not bool and HomeLandManager.GetAllCanUpgrade() then + this.Cost:SetActive(true) + this.Tips:SetActive(false) + this.costIcon.gameObject:SetActive(true) + this.costNum.gameObject:SetActive(true) + this.costCondition.gameObject:SetActive(false) + --突破的消耗和升级不同 + local cost = EquipRankUp[HomeLandManager.levelProId].Cost + local color2 = BagManager.GetTotalItemNum(cost[1]) >= cost[2] and "#FFEED6" or "red" + this.costNum.text = string.format("%s",color2,cost[2]) + end + else + this.Btn1:SetActive(true) + this.Btn2:SetActive(false) + this.Btn1Text.text = "已达上限" + Util.SetGray(this.Btn1,true) + this.Btn1:GetComponent("Button").enabled = false + local num1 = data + proData[curIndex] + this.Desc.text = string.format("神将佩戴的%s%s属性增加%s",TEXT[curIndex][1],TEXT[curIndex][3],num1).."%" + this.Cost:SetActive(false) this.Tips:SetActive(false) - this.costIcon.gameObject:SetActive(true) - this.costNum.gameObject:SetActive(true) - this.costCondition.gameObject:SetActive(false) - --突破的消耗和升级不同 - local cost = EquipRankUp[HomeLandManager.levelProId].Cost - local color2 = BagManager.GetTotalItemNum(cost[1]) >= cost[2] and "#FFEED6" or "red" - this.costNum.text = string.format("%s",color2,cost[2]) end end