From de202e83a9d2b1768572e528b80f30c4a6c9265a Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Fri, 31 Oct 2025 20:12:26 +0800 Subject: [PATCH] fix bug --- lua/app/ui/battle/battle_rune_result_ui.lua | 4 +- lua/app/ui/battle/battle_ui_pvp.lua | 4 +- lua/app/ui/equip/equip_growth_ui.lua | 46 +++++++++++++- lua/app/ui/hero/equip_info_comp.lua | 2 +- lua/app/ui/hero/hero_detail_ui.lua | 2 +- lua/app/ui/shop/first_recharge_ui.lua | 11 +++- lua/app/userdata/activity/act_task_data.lua | 2 +- lua/app/userdata/activity/activity_data.lua | 9 ++- lua/app/userdata/equip/equip_data.lua | 70 ++++++++++++++------- lua/app/userdata/hero/hero_entity.lua | 6 +- 10 files changed, 118 insertions(+), 38 deletions(-) diff --git a/lua/app/ui/battle/battle_rune_result_ui.lua b/lua/app/ui/battle/battle_rune_result_ui.lua index 1c1bbda3..4f576709 100644 --- a/lua/app/ui/battle/battle_rune_result_ui.lua +++ b/lua/app/ui/battle/battle_rune_result_ui.lua @@ -306,11 +306,11 @@ function BattleRuneResultUI:refreshUnitInfo() self.unitTxDesc2:setText(self.wave) self.unitTxDesc3:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_7, GFunc.num2Str(self.totalDmg))) - local iconName = "common_dec_15" + local iconName = "battle_dec_2" local round = self.remainRound or 0 self.unitTxDesc2:setText(round) self.unitTxDesc1:setText(I18N:getGlobalText(I18N.GlobalConst.ROUND_LEFT)) - self.unitImgBattleIcon:setSprite(GConst.ATLAS_PATH.COMMON, iconName) + self.unitImgBattleIcon:setSprite(GConst.ATLAS_PATH.BATTLE, iconName) GFunc.centerImgAndTx(self.unitImgBattleIcon, self.unitTxDesc2, 7) end diff --git a/lua/app/ui/battle/battle_ui_pvp.lua b/lua/app/ui/battle/battle_ui_pvp.lua index ae51199c..aaf1e59c 100644 --- a/lua/app/ui/battle/battle_ui_pvp.lua +++ b/lua/app/ui/battle/battle_ui_pvp.lua @@ -223,8 +223,8 @@ function BattleUIPVP:refreshWave(wave, iconAtlas, iconName) desc:setText(wave .. "/" .. self.battleController:getMaxRoundCount()) -- GFunc.centerImgAndTx(icon, desc, 10) - iconAtlas = iconAtlas or GConst.ATLAS_PATH.COMMON - iconName = iconName or "common_dec_15" + iconAtlas = iconAtlas or GConst.ATLAS_PATH.BATTLE + iconName = iconName or "battle_dec_2" icon:setSprite(iconAtlas, iconName) end diff --git a/lua/app/ui/equip/equip_growth_ui.lua b/lua/app/ui/equip/equip_growth_ui.lua index c086a3d8..5cddcc95 100644 --- a/lua/app/ui/equip/equip_growth_ui.lua +++ b/lua/app/ui/equip/equip_growth_ui.lua @@ -2,6 +2,11 @@ local EquipGrowthUI = class("EquipGrowthUI", BaseUI) local EQUIP_LIST_CELL = "app/ui/equip/cell/equip_list_cell" +local PAGE = { + ENHANCE = 1, + REFINE = 2, +} + function EquipGrowthUI:isFullScreen() return false end @@ -17,7 +22,17 @@ end function EquipGrowthUI:ctor(parmas) self.slotId = parmas.slotId self.equipPart = parmas.part or 1 - self.page = 1 + self.page = PAGE.ENHANCE + self:checkRedPage() +end + +function EquipGrowthUI:checkRedPage() + if DataManager.EquipData:hasEquipEnhanceRedPoint(self.slotId, self.equipPart) then + self.page = PAGE.ENHANCE + end + if DataManager.EquipData:hasEquipRefineRedPoint(self.slotId, self.equipPart) then + self.page = PAGE.REFINE + end end function EquipGrowthUI:onLoadRootComplete() @@ -82,11 +97,11 @@ function EquipGrowthUI:onLoadRootComplete() self.refineUpBtn = uiMap["equip_growth_ui.bg.page_info_2.attr_bg.up_btn"] self.refineRateTx = uiMap["equip_growth_ui.bg.page_info_2.attr_bg.rate_tx"] self.refineDescTx2 = uiMap["equip_growth_ui.bg.page_info_2.attr_bg.desc_tx_1"] - self.refineResolveBtn = uiMap["equip_growth_ui.bg.resolve_btn"] + self.resolveBtn = uiMap["equip_growth_ui.bg.resolve_btn"] self.refineUpBtn:addClickListener(function() ModuleManager.EquipManager:onEquipRefineReq(self.slotId, self.equipPart) end) - self.refineResolveBtn:addClickListener(function() + self.resolveBtn:addClickListener(function() ModuleManager.EquipManager:showEquipResolveUI() end) uiMap["equip_growth_ui.bg.page_info_2.attr_bg.bg.info_btn"]:addClickListener(function() @@ -116,6 +131,7 @@ function EquipGrowthUI:onLoadRootComplete() return end self.equipPart = i + self:checkRedPage() self:onRefresh() end) end @@ -154,6 +170,7 @@ function EquipGrowthUI:onRefresh() self:refreshEquipCell() self:refreshPageBtn() self:refreshPageInfo() + self:refreshRedPoint() end function EquipGrowthUI:refreshEquipCell() @@ -303,4 +320,27 @@ function EquipGrowthUI:refreshPageRefine() end --@endregion +--@region 红点 +function EquipGrowthUI:refreshRedPoint() + if DataManager.EquipData:hasEquipUnWearRedPoint() then + self.resolveBtn:addRedPoint(85, 37, 1) + else + self.resolveBtn:removeRedPoint() + end + if DataManager.EquipData:hasEquipEnhanceRedPoint(self.slotId, self.equipPart) then + self.upUpBtn:addRedPoint(102, 42, 1) + self.pageBtns[1]:addRedPoint(106, 20, 1) + else + self.upUpBtn:removeRedPoint() + self.pageBtns[1]:removeRedPoint() + end + if DataManager.EquipData:hasEquipRefineRedPoint(self.slotId, self.equipPart) then + self.refineUpBtn:addRedPoint(102, 42, 1) + self.pageBtns[2]:addRedPoint(106, 20, 1) + else + self.refineUpBtn:removeRedPoint() + self.pageBtns[2]:removeRedPoint() + end +end +--@endregion return EquipGrowthUI \ No newline at end of file diff --git a/lua/app/ui/hero/equip_info_comp.lua b/lua/app/ui/hero/equip_info_comp.lua index 11bb491c..4d4c7d99 100644 --- a/lua/app/ui/hero/equip_info_comp.lua +++ b/lua/app/ui/hero/equip_info_comp.lua @@ -150,7 +150,7 @@ function EquipInfoComp:refreshRedPoint() else self.autoWearBtn:removeRedPoint() end - if DataManager.EquipData:hasEquipGrowthRedPoint(slotId) then + if DataManager.EquipData:hasOneEquipWear(slotId) and DataManager.EquipData:hasEquipGrowthRedPoint(slotId) then self.upBtn:addRedPoint(70, 30, 1) else self.upBtn:removeRedPoint() diff --git a/lua/app/ui/hero/hero_detail_ui.lua b/lua/app/ui/hero/hero_detail_ui.lua index 8858c6f8..2673713b 100644 --- a/lua/app/ui/hero/hero_detail_ui.lua +++ b/lua/app/ui/hero/hero_detail_ui.lua @@ -386,7 +386,7 @@ function HeroDetailUI:refreshPageBtn() else self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, BTN_NORMAL[i]) end - self.pageRedImgs[i]:setActive(self.heroEntity:showRedPoint(i)) + self.pageRedImgs[i]:setActive(self.heroEntity:showRedPoint(i, self.formationType)) end end end diff --git a/lua/app/ui/shop/first_recharge_ui.lua b/lua/app/ui/shop/first_recharge_ui.lua index 6db53926..4260972c 100755 --- a/lua/app/ui/shop/first_recharge_ui.lua +++ b/lua/app/ui/shop/first_recharge_ui.lua @@ -51,6 +51,7 @@ function FirstRechargeUI:onLoadRootComplete() self.txTips = uiMap["first_recharge_ui.tips.tx_tips"] self.btnGet = uiMap["first_recharge_ui.btn_get"] self.txGet = uiMap["first_recharge_ui.btn_get.tx_desc"] + self.txGet1 = uiMap["first_recharge_ui.btn_get.tx_desc_1"] self.matchImg = uiMap["first_recharge_ui.match_img"] self.nameTx = uiMap["first_recharge_ui.match_img.name_tx"] @@ -218,18 +219,24 @@ function FirstRechargeUI:onRefresh() if boughtDay > 0 then -- 已购买 if boughtDay > rewardDay then - self.txGet:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM)) + self.txGet:setActive(false) + self.txGet1:setActive(true) + self.txGet1:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM)) self.btnGet:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_3") self.btnGet:setTouchEnable(true) self.btnGet:addRedPoint(114, 38, 1) else - self.txGet:setText(I18N:getGlobalText(I18N.GlobalConst.FIRST_CHARGE_3)) + self.txGet:setActive(false) + self.txGet1:setActive(true) + self.txGet1:setText(I18N:getGlobalText(I18N.GlobalConst.FIRST_CHARGE_3)) self.btnGet:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_3") self.btnGet:setTouchEnable(false) self.btnGet:removeRedPoint() end else -- 未购买 + self.txGet:setActive(true) + self.txGet1:setActive(false) self.txGet:setText(price) self.btnGet:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_3") self.btnGet:setTouchEnable(true) diff --git a/lua/app/userdata/activity/act_task_data.lua b/lua/app/userdata/activity/act_task_data.lua index f8ab44c1..4c4c3c3a 100755 --- a/lua/app/userdata/activity/act_task_data.lua +++ b/lua/app/userdata/activity/act_task_data.lua @@ -226,7 +226,7 @@ function ActTaskData:getTaskNumScore(actId, actTaskId) end function ActTaskData:getMaxTurnScore(actId) - return #self:getRewardsgetMaxTurnScore(actId) + return DataManager.ActivityData:getActRoundLimit(actId) end function ActTaskData:getRewardsgetMaxTurnScore(actId) diff --git a/lua/app/userdata/activity/activity_data.lua b/lua/app/userdata/activity/activity_data.lua index 09092baa..1b9b3924 100644 --- a/lua/app/userdata/activity/activity_data.lua +++ b/lua/app/userdata/activity/activity_data.lua @@ -256,11 +256,18 @@ end function ActivityData:getActRoundReward(actId) if not self:getActExist(actId) then - return + return {} end return self:getActConfig(actId).round_reward end +function ActivityData:getActRoundLimit(actId) + if not self:getActExist(actId) then + return 0 + end + return self:getActConfig(actId).round_limit +end + -- 获取活动相关内容是否可展示 function ActivityData:canShowActContent(actId) if actId == nil then diff --git a/lua/app/userdata/equip/equip_data.lua b/lua/app/userdata/equip/equip_data.lua index 9dd070ee..1f2d0dc9 100644 --- a/lua/app/userdata/equip/equip_data.lua +++ b/lua/app/userdata/equip/equip_data.lua @@ -674,7 +674,14 @@ end function EquipData:getAllEquipsSortInverted(part, qlt, star, use) local list = self:getAllEquips(part, qlt, star, use) - return self:reverseTableInPlace(self:sortEquipsList(list)) + -- 已装备的不显示在分解列表 + local equips = {} + for i,v in ipairs(list) do + if not self:getEquipUseHero(v:getUid()) then + table.insert(equips, v) + end + end + return self:reverseTableInPlace(self:sortEquipsList(equips)) end function EquipData:reverseTableInPlace(t) @@ -812,7 +819,12 @@ function EquipData:hasEquipWearRedPointByPart(slotId, part) end if self:getEquipMaxScore(slotId, part) then return true - elseif self:hasEquipEnhanceRedPoint(slotId, part) then + end + local useUid = self:getPartEquipUid(slotId, part) + if useUid <= 0 then + return false + end + if self:hasEquipEnhanceRedPoint(slotId, part) then return true elseif self:hasEquipRefineRedPoint(slotId, part) then return true @@ -820,6 +832,16 @@ function EquipData:hasEquipWearRedPointByPart(slotId, part) return false end +function EquipData:hasOneEquipWear(slotId) + for part = 1, 6 do + local useUid = self:getPartEquipUid(slotId, part) + if useUid and useUid > 0 then + return true + end + end + return false +end + function EquipData:hasEquipWearRedPoint(slotId) if self.allEquipsCount <= 0 then return false @@ -935,28 +957,28 @@ function EquipData:hasEquipRefineRedPoint(slotId, part) return false end --- --未穿戴装备有五十件以上的红点 --- function EquipData:hasEquipUnWearRedPoint() --- local wearList = {} --- for slotId = 1, 6 do --- for part = 1, 6 do --- local uid = self:getPartEquipUid(slotId, part) --- if uid ~= 0 then --- wearList[uid] = true --- end --- end --- end --- local count = 0 --- for _, equip in pairs(self.allEquips) do --- if wearList[equip:getUid()] == nil then --- count = count + 1 --- if count >= 50 then --- return true --- end --- end --- end --- return false --- end +--未穿戴装备有五十件以上的红点 +function EquipData:hasEquipUnWearRedPoint() + local wearList = {} + for slotId = 1, 6 do + for part = 1, 6 do + local uid = self:getPartEquipUid(slotId, part) + if uid ~= 0 then + wearList[uid] = true + end + end + end + local count = 0 + for _, equip in pairs(self.allEquips) do + if wearList[equip:getUid()] == nil then + count = count + 1 + if count >= 50 then + return true + end + end + end + return false +end --endregion --@region 属性 diff --git a/lua/app/userdata/hero/hero_entity.lua b/lua/app/userdata/hero/hero_entity.lua index 4884c5b8..a7992a86 100644 --- a/lua/app/userdata/hero/hero_entity.lua +++ b/lua/app/userdata/hero/hero_entity.lua @@ -912,12 +912,16 @@ function HeroEntity:showRedPointEntrance() return self:canLvUp() or self:canStarUp() end -function HeroEntity:showRedPoint(page) +function HeroEntity:showRedPoint(page, formationType) if page == GConst.HeroConst.PANEL_TYPE.HERO then return self:canLvUp() elseif page == GConst.HeroConst.PANEL_TYPE.STAR then return self:canStarUp() elseif page == GConst.HeroConst.PANEL_TYPE.EQUIP then + self.curFormation = DataManager.FormationData:getFormation(formationType) + if self.curFormation[self:getMatchType()] ~= self:getCfgId() then + return false + end return DataManager.EquipData:hasEquipRedPoint(self:getMatchType()) end end