优化和容错

This commit is contained in:
xiekaidong 2023-09-18 20:04:21 +08:00
parent f27bdc4cd2
commit eb95400b81
3 changed files with 14 additions and 4 deletions

View File

@ -87,11 +87,13 @@ function ActPvpMainUI:_display()
uiMap["act_pvp_main_ui.bg.ui_spine_obj"]:playAnim("idle", true, false, false)
uiMap["act_pvp_main_ui.down.btn_rank.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_10))
uiMap["act_pvp_main_ui.down.btn_bounty.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_4))
uiMap["act_pvp_main_ui.bg.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_5))
if DataManager.ActPvpData:isFinalDay() then
uiMap["act_pvp_main_ui.bg.desc"]:setText(GConst.EMPTY_STRING)
uiMap["act_pvp_main_ui.down.enter_node.enter_btn"]:setSprite(GConst.ATLAS_PATH.COMMON, ENTER_BTN_BG[2])
uiMap["act_pvp_main_ui.down.enter_node.enter_btn.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_24))
else
uiMap["act_pvp_main_ui.bg.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_5))
uiMap["act_pvp_main_ui.down.enter_node.enter_btn"]:setSprite(GConst.ATLAS_PATH.COMMON, ENTER_BTN_BG[1])
uiMap["act_pvp_main_ui.down.enter_node.enter_btn.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_2))
end
@ -178,6 +180,9 @@ function ActPvpMainUI:refreshEnterNode()
local costIcon = uiMap["act_pvp_main_ui.down.enter_node.cost.icon"]
local btnHelp = uiMap["act_pvp_main_ui.bg.time_bg.btn_help"]
if freeCount > 0 then
if DataManager.ActPvpData:isFinalDay() then
freeCount = 0
end
txFree:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_6, freeCount))
costNode:setVisible(false)
btnHelp:setAnchoredPositionX(txFree:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth / 2 + 30)
@ -255,6 +260,7 @@ function ActPvpMainUI:refreshDialyRewardNode()
obj:setSprite(GConst.ATLAS_PATH.UI_ACT_PVP, icon)
end
end
uiMap["act_pvp_main_ui.bg.mask_img"]:setVisible(DataManager.ActPvpData:isFinalDay())
end
function ActPvpMainUI:showTalk()

View File

@ -16,6 +16,8 @@ ActPvpData.BOUNTY_TYPE_TO_NUM = {
}
function ActPvpData:ctor()
self.endTime = 0
self.startTime = 0
self.data.isDirty = false
self.playing = false
@ -108,7 +110,7 @@ function ActPvpData:getConditionDay()
end
function ActPvpData:getIsOpen()
if GFunc.isShenhe() then
if GFunc.isShenhe() or not self.endTime then
return false
end

View File

@ -450,7 +450,10 @@ end
-- 当前自选英雄的下标
function FullMoonData:getChooseHeroIndex()
return self.curHeroGiftChoose > 0 and self.curHeroGiftChoose or nil
if not self.curHeroGiftChoose or self.curHeroGiftChoose <= 0 then
return nil
end
return self.curHeroGiftChoose
end
-- 获取固定奖励
@ -460,7 +463,6 @@ end
-- 获取自选奖励
function FullMoonData:getChooseRewards(id, isAll)
local rewards = {}
if not isAll then