This commit is contained in:
puxuan 2025-10-31 20:12:26 +08:00
parent 6f227e06e1
commit de202e83a9
10 changed files with 118 additions and 38 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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 属性

View File

@ -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