副本入口

This commit is contained in:
xiekaidong 2023-07-18 21:00:12 +08:00
parent 2610718eb2
commit 27ef576c8f
7 changed files with 56 additions and 5 deletions

View File

@ -350,6 +350,14 @@ local LocalizationGlobalConst =
COLLECTION_DESC_12 = "COLLECTION_DESC_12", COLLECTION_DESC_12 = "COLLECTION_DESC_12",
TIME_BEFORE_STR_H = "TIME_BEFORE_STR_H", TIME_BEFORE_STR_H = "TIME_BEFORE_STR_H",
TIME_BEFORE_STR_M = "TIME_BEFORE_STR_M", TIME_BEFORE_STR_M = "TIME_BEFORE_STR_M",
["DUNGEON_ARMOR_DESC_1"] = "DUNGEON_ARMOR_DESC_1",
["DUNGEON_ARMOR_DESC_2"] = "DUNGEON_ARMOR_DESC_2",
["DUNGEON_ARMOR_DESC_3"] = "DUNGEON_ARMOR_DESC_3",
["DUNGEON_WEAPON_DESC_1"] = "DUNGEON_WEAPON_DESC_1",
["DUNGEON_WEAPON_DESC_2"] = "DUNGEON_WEAPON_DESC_2",
["DUNGEON_WEAPON_DESC_3"] = "DUNGEON_WEAPON_DESC_3",
} }
return LocalizationGlobalConst return LocalizationGlobalConst

View File

@ -12,6 +12,8 @@ function RewardCell:init()
self.sImg = uiMap["reward_cell.item_bg.s"] self.sImg = uiMap["reward_cell.item_bg.s"]
self.matchImg = uiMap["reward_cell.item_bg.match_img"] self.matchImg = uiMap["reward_cell.item_bg.match_img"]
self.frameAni = uiMap["reward_cell.frame_ani"] self.frameAni = uiMap["reward_cell.frame_ani"]
self.firstPass = uiMap["reward_cell.first"]
self.firstPassTx = uiMap["reward_cell.first.tx_first"]
self:hideFrameAnimation() self:hideFrameAnimation()
self.baseObject:addClickListener(function() self.baseObject:addClickListener(function()
if self.clickCallback then if self.clickCallback then
@ -35,6 +37,7 @@ function RewardCell:refresh(reward)
else else
self.rewardId = nil self.rewardId = nil
end end
self:showFirstPass(false)
end end
function RewardCell:refreshByConfig(reward, mask, check) function RewardCell:refreshByConfig(reward, mask, check)
@ -50,6 +53,7 @@ function RewardCell:refreshByConfig(reward, mask, check)
else else
self.rewardId = nil self.rewardId = nil
end end
self:showFirstPass(false)
end end
function RewardCell:refreshItemById(itemId, count, mask, check) function RewardCell:refreshItemById(itemId, count, mask, check)
@ -61,6 +65,7 @@ function RewardCell:refreshItemById(itemId, count, mask, check)
self.rewardId = itemId self.rewardId = itemId
self.rewardType = GConst.REWARD_TYPE.ITEM self.rewardType = GConst.REWARD_TYPE.ITEM
self:_refreshItem(info, count) self:_refreshItem(info, count)
self:showFirstPass(false)
end end
function RewardCell:_refreshItem(info, count) function RewardCell:_refreshItem(info, count)
@ -155,4 +160,11 @@ function RewardCell:showRightUpIcon(show, atlas, iconName)
self.rightUpIcon:setSprite(atlas, iconName) self.rightUpIcon:setSprite(atlas, iconName)
end end
function RewardCell:showFirstPass(show)
self.firstPass:setVisible(show == true)
if show then
self.firstPassTx:setText(I18N:getGlobalText(I18N.GlobalConst.FIRST_PASS))
end
end
return RewardCell return RewardCell

View File

@ -19,8 +19,7 @@ function DungeonBoardCell:init()
self.itemReward = self.uiMap["dungeon_board_cell.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL) self.itemReward = self.uiMap["dungeon_board_cell.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.btnStart:addClickListener(function() self.btnStart:addClickListener(function()
-- 打开副本关卡选择界面 DataManager.DungeonData:onClickFight(self.moduleKey)
UIManager:showUI("app/ui/dungeon/dungeon_difficulty_ui", {module = self.moduleKey})
end) end)
self.btnHelp:addClickListener(function() self.btnHelp:addClickListener(function()
-- 展示提示 -- 展示提示
@ -72,6 +71,7 @@ function DungeonBoardCell:refreshInfo()
self.lockTxLock:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_OPEN)) self.lockTxLock:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_OPEN))
self:refreshCountdown(self.lockTxCountdown) self:refreshCountdown(self.lockTxCountdown)
end end
self.txTimes:setVisible(not DataManager.DungeonData:isNoTotalLimit(self.moduleKey))
GFunc.centerImgAndTx(self.lockIcon, self.lockTxLock, 10) GFunc.centerImgAndTx(self.lockIcon, self.lockTxLock, 10)
GFunc.centerImgAndTx(self.lockIconCountdown, self.lockTxCountdown, 10) GFunc.centerImgAndTx(self.lockIconCountdown, self.lockTxCountdown, 10)
@ -88,9 +88,8 @@ function DungeonBoardCell:refreshCountdown(txCountdown)
self.countdownSid = nil self.countdownSid = nil
end end
if DataManager.DungeonData:getIsAllTimeOpen(self.moduleKey) then if DataManager.DungeonData:getIsAllTimeOpen(self.moduleKey) then
txCountdown:setVisible(false) self.countdown:setVisible(false)
else else
txCountdown:setVisible(true)
self.countdownSid = self:getBaseObject():scheduleGlobal(function() self.countdownSid = self:getBaseObject():scheduleGlobal(function()
self:updateTime(txCountdown) self:updateTime(txCountdown)
end, 1) end, 1)

View File

@ -54,11 +54,18 @@ function DungeonArmorEntity:getBanner()
end end
function DungeonArmorEntity:getOpenTextColor() function DungeonArmorEntity:getOpenTextColor()
return "#FFEDC5" return "#FFFFFF"
end end
function DungeonArmorEntity:getChallengeHpCost() function DungeonArmorEntity:getChallengeHpCost()
return GFunc.getConstReward("dungeon_armor_limit") return GFunc.getConstReward("dungeon_armor_limit")
end end
function DungeonArmorEntity:isNoTotalLimit()
return true
end
function DungeonArmorEntity:onClickFight()
end
return DungeonArmorEntity return DungeonArmorEntity

View File

@ -100,11 +100,21 @@ function DungeonBaseEntity:getPassRewardNum()
return 0 return 0
end end
function DungeonBaseEntity:isNoTotalLimit()
return false
end
function DungeonBaseEntity:onClickFight()
UIManager:showUI("app/ui/dungeon/dungeon_difficulty_ui", {module = self:getModuleKey()})
end
-- 常规逻辑 ********************************************************************* -- 常规逻辑 *********************************************************************
-- 获取今日剩余挑战次数 -- 获取今日剩余挑战次数
function DungeonBaseEntity:getTodayRemainLimitCount() function DungeonBaseEntity:getTodayRemainLimitCount()
if self:isNoTotalLimit() then
return 1
end
return self:getTodayMaxCount() - self:getTodayChallengeCount() return self:getTodayMaxCount() - self:getTodayChallengeCount()
end end

View File

@ -451,4 +451,12 @@ function DungeonData:getIsAllTimeOpen(moduleKey)
return self.dataDungeons[moduleKey]:getIsAllTimeOpen() return self.dataDungeons[moduleKey]:getIsAllTimeOpen()
end end
function DungeonData:isNoTotalLimit(moduleKey)
return self.dataDungeons[moduleKey]:isNoTotalLimit()
end
function DungeonData:onClickFight(moduleKey)
self.dataDungeons[moduleKey]:onClickFight()
end
return DungeonData return DungeonData

View File

@ -59,4 +59,11 @@ function DungeonWeaponEntity:getChallengeHpCost()
return GFunc.getConstReward("dungeon_armor_limit") return GFunc.getConstReward("dungeon_armor_limit")
end end
function DungeonWeaponEntity:isNoTotalLimit()
return true
end
function DungeonWeaponEntity:onClickFight()
end
return DungeonWeaponEntity return DungeonWeaponEntity