fix bug
This commit is contained in:
parent
6f227e06e1
commit
de202e83a9
@ -306,11 +306,11 @@ function BattleRuneResultUI:refreshUnitInfo()
|
|||||||
self.unitTxDesc2:setText(self.wave)
|
self.unitTxDesc2:setText(self.wave)
|
||||||
self.unitTxDesc3:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_7, GFunc.num2Str(self.totalDmg)))
|
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
|
local round = self.remainRound or 0
|
||||||
self.unitTxDesc2:setText(round)
|
self.unitTxDesc2:setText(round)
|
||||||
self.unitTxDesc1:setText(I18N:getGlobalText(I18N.GlobalConst.ROUND_LEFT))
|
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)
|
GFunc.centerImgAndTx(self.unitImgBattleIcon, self.unitTxDesc2, 7)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -223,8 +223,8 @@ function BattleUIPVP:refreshWave(wave, iconAtlas, iconName)
|
|||||||
desc:setText(wave .. "/" .. self.battleController:getMaxRoundCount())
|
desc:setText(wave .. "/" .. self.battleController:getMaxRoundCount())
|
||||||
-- GFunc.centerImgAndTx(icon, desc, 10)
|
-- GFunc.centerImgAndTx(icon, desc, 10)
|
||||||
|
|
||||||
iconAtlas = iconAtlas or GConst.ATLAS_PATH.COMMON
|
iconAtlas = iconAtlas or GConst.ATLAS_PATH.BATTLE
|
||||||
iconName = iconName or "common_dec_15"
|
iconName = iconName or "battle_dec_2"
|
||||||
icon:setSprite(iconAtlas, iconName)
|
icon:setSprite(iconAtlas, iconName)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,11 @@ local EquipGrowthUI = class("EquipGrowthUI", BaseUI)
|
|||||||
|
|
||||||
local EQUIP_LIST_CELL = "app/ui/equip/cell/equip_list_cell"
|
local EQUIP_LIST_CELL = "app/ui/equip/cell/equip_list_cell"
|
||||||
|
|
||||||
|
local PAGE = {
|
||||||
|
ENHANCE = 1,
|
||||||
|
REFINE = 2,
|
||||||
|
}
|
||||||
|
|
||||||
function EquipGrowthUI:isFullScreen()
|
function EquipGrowthUI:isFullScreen()
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@ -17,7 +22,17 @@ end
|
|||||||
function EquipGrowthUI:ctor(parmas)
|
function EquipGrowthUI:ctor(parmas)
|
||||||
self.slotId = parmas.slotId
|
self.slotId = parmas.slotId
|
||||||
self.equipPart = parmas.part or 1
|
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
|
end
|
||||||
|
|
||||||
function EquipGrowthUI:onLoadRootComplete()
|
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.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.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.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()
|
self.refineUpBtn:addClickListener(function()
|
||||||
ModuleManager.EquipManager:onEquipRefineReq(self.slotId, self.equipPart)
|
ModuleManager.EquipManager:onEquipRefineReq(self.slotId, self.equipPart)
|
||||||
end)
|
end)
|
||||||
self.refineResolveBtn:addClickListener(function()
|
self.resolveBtn:addClickListener(function()
|
||||||
ModuleManager.EquipManager:showEquipResolveUI()
|
ModuleManager.EquipManager:showEquipResolveUI()
|
||||||
end)
|
end)
|
||||||
uiMap["equip_growth_ui.bg.page_info_2.attr_bg.bg.info_btn"]:addClickListener(function()
|
uiMap["equip_growth_ui.bg.page_info_2.attr_bg.bg.info_btn"]:addClickListener(function()
|
||||||
@ -116,6 +131,7 @@ function EquipGrowthUI:onLoadRootComplete()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
self.equipPart = i
|
self.equipPart = i
|
||||||
|
self:checkRedPage()
|
||||||
self:onRefresh()
|
self:onRefresh()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@ -154,6 +170,7 @@ function EquipGrowthUI:onRefresh()
|
|||||||
self:refreshEquipCell()
|
self:refreshEquipCell()
|
||||||
self:refreshPageBtn()
|
self:refreshPageBtn()
|
||||||
self:refreshPageInfo()
|
self:refreshPageInfo()
|
||||||
|
self:refreshRedPoint()
|
||||||
end
|
end
|
||||||
|
|
||||||
function EquipGrowthUI:refreshEquipCell()
|
function EquipGrowthUI:refreshEquipCell()
|
||||||
@ -303,4 +320,27 @@ function EquipGrowthUI:refreshPageRefine()
|
|||||||
end
|
end
|
||||||
--@endregion
|
--@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
|
return EquipGrowthUI
|
||||||
@ -150,7 +150,7 @@ function EquipInfoComp:refreshRedPoint()
|
|||||||
else
|
else
|
||||||
self.autoWearBtn:removeRedPoint()
|
self.autoWearBtn:removeRedPoint()
|
||||||
end
|
end
|
||||||
if DataManager.EquipData:hasEquipGrowthRedPoint(slotId) then
|
if DataManager.EquipData:hasOneEquipWear(slotId) and DataManager.EquipData:hasEquipGrowthRedPoint(slotId) then
|
||||||
self.upBtn:addRedPoint(70, 30, 1)
|
self.upBtn:addRedPoint(70, 30, 1)
|
||||||
else
|
else
|
||||||
self.upBtn:removeRedPoint()
|
self.upBtn:removeRedPoint()
|
||||||
|
|||||||
@ -386,7 +386,7 @@ function HeroDetailUI:refreshPageBtn()
|
|||||||
else
|
else
|
||||||
self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, BTN_NORMAL[i])
|
self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, BTN_NORMAL[i])
|
||||||
end
|
end
|
||||||
self.pageRedImgs[i]:setActive(self.heroEntity:showRedPoint(i))
|
self.pageRedImgs[i]:setActive(self.heroEntity:showRedPoint(i, self.formationType))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -51,6 +51,7 @@ function FirstRechargeUI:onLoadRootComplete()
|
|||||||
self.txTips = uiMap["first_recharge_ui.tips.tx_tips"]
|
self.txTips = uiMap["first_recharge_ui.tips.tx_tips"]
|
||||||
self.btnGet = uiMap["first_recharge_ui.btn_get"]
|
self.btnGet = uiMap["first_recharge_ui.btn_get"]
|
||||||
self.txGet = uiMap["first_recharge_ui.btn_get.tx_desc"]
|
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.matchImg = uiMap["first_recharge_ui.match_img"]
|
||||||
self.nameTx = uiMap["first_recharge_ui.match_img.name_tx"]
|
self.nameTx = uiMap["first_recharge_ui.match_img.name_tx"]
|
||||||
@ -218,18 +219,24 @@ function FirstRechargeUI:onRefresh()
|
|||||||
if boughtDay > 0 then
|
if boughtDay > 0 then
|
||||||
-- 已购买
|
-- 已购买
|
||||||
if boughtDay > rewardDay 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:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_3")
|
||||||
self.btnGet:setTouchEnable(true)
|
self.btnGet:setTouchEnable(true)
|
||||||
self.btnGet:addRedPoint(114, 38, 1)
|
self.btnGet:addRedPoint(114, 38, 1)
|
||||||
else
|
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:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_3")
|
||||||
self.btnGet:setTouchEnable(false)
|
self.btnGet:setTouchEnable(false)
|
||||||
self.btnGet:removeRedPoint()
|
self.btnGet:removeRedPoint()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- 未购买
|
-- 未购买
|
||||||
|
self.txGet:setActive(true)
|
||||||
|
self.txGet1:setActive(false)
|
||||||
self.txGet:setText(price)
|
self.txGet:setText(price)
|
||||||
self.btnGet:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_3")
|
self.btnGet:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_3")
|
||||||
self.btnGet:setTouchEnable(true)
|
self.btnGet:setTouchEnable(true)
|
||||||
|
|||||||
@ -226,7 +226,7 @@ function ActTaskData:getTaskNumScore(actId, actTaskId)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ActTaskData:getMaxTurnScore(actId)
|
function ActTaskData:getMaxTurnScore(actId)
|
||||||
return #self:getRewardsgetMaxTurnScore(actId)
|
return DataManager.ActivityData:getActRoundLimit(actId)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ActTaskData:getRewardsgetMaxTurnScore(actId)
|
function ActTaskData:getRewardsgetMaxTurnScore(actId)
|
||||||
|
|||||||
@ -256,11 +256,18 @@ end
|
|||||||
|
|
||||||
function ActivityData:getActRoundReward(actId)
|
function ActivityData:getActRoundReward(actId)
|
||||||
if not self:getActExist(actId) then
|
if not self:getActExist(actId) then
|
||||||
return
|
return {}
|
||||||
end
|
end
|
||||||
return self:getActConfig(actId).round_reward
|
return self:getActConfig(actId).round_reward
|
||||||
end
|
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)
|
function ActivityData:canShowActContent(actId)
|
||||||
if actId == nil then
|
if actId == nil then
|
||||||
|
|||||||
@ -674,7 +674,14 @@ end
|
|||||||
|
|
||||||
function EquipData:getAllEquipsSortInverted(part, qlt, star, use)
|
function EquipData:getAllEquipsSortInverted(part, qlt, star, use)
|
||||||
local list = self:getAllEquips(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
|
end
|
||||||
|
|
||||||
function EquipData:reverseTableInPlace(t)
|
function EquipData:reverseTableInPlace(t)
|
||||||
@ -812,7 +819,12 @@ function EquipData:hasEquipWearRedPointByPart(slotId, part)
|
|||||||
end
|
end
|
||||||
if self:getEquipMaxScore(slotId, part) then
|
if self:getEquipMaxScore(slotId, part) then
|
||||||
return true
|
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
|
return true
|
||||||
elseif self:hasEquipRefineRedPoint(slotId, part) then
|
elseif self:hasEquipRefineRedPoint(slotId, part) then
|
||||||
return true
|
return true
|
||||||
@ -820,6 +832,16 @@ function EquipData:hasEquipWearRedPointByPart(slotId, part)
|
|||||||
return false
|
return false
|
||||||
end
|
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)
|
function EquipData:hasEquipWearRedPoint(slotId)
|
||||||
if self.allEquipsCount <= 0 then
|
if self.allEquipsCount <= 0 then
|
||||||
return false
|
return false
|
||||||
@ -935,28 +957,28 @@ function EquipData:hasEquipRefineRedPoint(slotId, part)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- --未穿戴装备有五十件以上的红点
|
--未穿戴装备有五十件以上的红点
|
||||||
-- function EquipData:hasEquipUnWearRedPoint()
|
function EquipData:hasEquipUnWearRedPoint()
|
||||||
-- local wearList = {}
|
local wearList = {}
|
||||||
-- for slotId = 1, 6 do
|
for slotId = 1, 6 do
|
||||||
-- for part = 1, 6 do
|
for part = 1, 6 do
|
||||||
-- local uid = self:getPartEquipUid(slotId, part)
|
local uid = self:getPartEquipUid(slotId, part)
|
||||||
-- if uid ~= 0 then
|
if uid ~= 0 then
|
||||||
-- wearList[uid] = true
|
wearList[uid] = true
|
||||||
-- end
|
end
|
||||||
-- end
|
end
|
||||||
-- end
|
end
|
||||||
-- local count = 0
|
local count = 0
|
||||||
-- for _, equip in pairs(self.allEquips) do
|
for _, equip in pairs(self.allEquips) do
|
||||||
-- if wearList[equip:getUid()] == nil then
|
if wearList[equip:getUid()] == nil then
|
||||||
-- count = count + 1
|
count = count + 1
|
||||||
-- if count >= 50 then
|
if count >= 50 then
|
||||||
-- return true
|
return true
|
||||||
-- end
|
end
|
||||||
-- end
|
end
|
||||||
-- end
|
end
|
||||||
-- return false
|
return false
|
||||||
-- end
|
end
|
||||||
--endregion
|
--endregion
|
||||||
|
|
||||||
--@region 属性
|
--@region 属性
|
||||||
|
|||||||
@ -912,12 +912,16 @@ function HeroEntity:showRedPointEntrance()
|
|||||||
return self:canLvUp() or self:canStarUp()
|
return self:canLvUp() or self:canStarUp()
|
||||||
end
|
end
|
||||||
|
|
||||||
function HeroEntity:showRedPoint(page)
|
function HeroEntity:showRedPoint(page, formationType)
|
||||||
if page == GConst.HeroConst.PANEL_TYPE.HERO then
|
if page == GConst.HeroConst.PANEL_TYPE.HERO then
|
||||||
return self:canLvUp()
|
return self:canLvUp()
|
||||||
elseif page == GConst.HeroConst.PANEL_TYPE.STAR then
|
elseif page == GConst.HeroConst.PANEL_TYPE.STAR then
|
||||||
return self:canStarUp()
|
return self:canStarUp()
|
||||||
elseif page == GConst.HeroConst.PANEL_TYPE.EQUIP then
|
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())
|
return DataManager.EquipData:hasEquipRedPoint(self:getMatchType())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user