Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev

This commit is contained in:
CloudJ 2023-06-05 10:56:45 +08:00
commit 1cf9b182d0
9 changed files with 50 additions and 23 deletions

View File

@ -27,6 +27,7 @@ local LOCAL_DATA_KEY = {
LAST_LOGIN_TIME = "LAST_LOGIN_TIME", LAST_LOGIN_TIME = "LAST_LOGIN_TIME",
GATE = "GATE", GATE = "GATE",
BOUNTY_POP_TIME = "BOUNTY_POP_TIME", BOUNTY_POP_TIME = "BOUNTY_POP_TIME",
CHALLENGE_TASK_POP_TIME = "CHALLENGE_TASK_POP_TIME",
} }
LocalData.KEYS = LOCAL_DATA_KEY LocalData.KEYS = LOCAL_DATA_KEY
@ -345,4 +346,12 @@ function LocalData:getBountyPopTime()
return self:getInt(LOCAL_DATA_KEY.BOUNTY_POP_TIME, 0) return self:getInt(LOCAL_DATA_KEY.BOUNTY_POP_TIME, 0)
end end
function LocalData:setChallengeTaskPopTime(time)
self:setInt(LOCAL_DATA_KEY.CHALLENGE_TASK_POP_TIME, time)
end
function LocalData:getChallengeTaskPopTime()
return self:getInt(LOCAL_DATA_KEY.CHALLENGE_TASK_POP_TIME, 0)
end
return LocalData return LocalData

View File

@ -183,6 +183,7 @@ GConst.ATLAS_PATH = {
ICON_ITEM = "assets/arts/atlas/icon/item.asset", ICON_ITEM = "assets/arts/atlas/icon/item.asset",
UI_LOGIN = "assets/arts/atlas/ui/login.asset", UI_LOGIN = "assets/arts/atlas/ui/login.asset",
ICON_SKILL = "assets/arts/atlas/icon/skill.asset", ICON_SKILL = "assets/arts/atlas/icon/skill.asset",
ICON_SKILL_BIG = "assets/arts/atlas/icon/skill_big.asset",
ICON_HERO = "assets/arts/atlas/icon/hero.asset", ICON_HERO = "assets/arts/atlas/icon/hero.asset",
ICON_HERO_2 = "assets/arts/atlas/icon/hero_2.asset", ICON_HERO_2 = "assets/arts/atlas/icon/hero_2.asset",
ICON_SKILL_ROGUE = "assets/arts/atlas/icon/skill_rogue.asset", ICON_SKILL_ROGUE = "assets/arts/atlas/icon/skill_rogue.asset",

View File

@ -1339,18 +1339,24 @@ end
function BattleController:generateBoard(isFirst) function BattleController:generateBoard(isFirst)
local boardList, _, mysteryBoxIndexMap = self:getInitBoard() local boardList, _, mysteryBoxIndexMap = self:getInitBoard()
if self.curBoardIndex and self.curBoardIndex >= #boardList then if self.curBoardIndex and self.curBoardIndex >= #boardList then
self.needWaitingBoardOver = false if isFirst then
self.needWaitingBoardOver = false
end
return return
end end
if not self.battleUI then if not self.battleUI then
self.needWaitingBoardOver = false if isFirst then
self.needWaitingBoardOver = false
end
return return
end end
self.curBoardIndex = (self.curBoardIndex or 0) + 1 self.curBoardIndex = (self.curBoardIndex or 0) + 1
if not boardList[self.curBoardIndex] then -- 容错 if not boardList[self.curBoardIndex] then -- 容错
self.needWaitingBoardOver = false if isFirst then
self.needWaitingBoardOver = false
end
return return
end end
local board = boardList[self.curBoardIndex].board local board = boardList[self.curBoardIndex].board
@ -1361,10 +1367,11 @@ function BattleController:generateBoard(isFirst)
self.battleUI:switchBoard(function() self.battleUI:switchBoard(function()
self.battleData:refreshBoard(board, self:getBlockIcon()) self.battleData:refreshBoard(board, self:getBlockIcon())
self.battleUI:initGridCell(function() self.battleUI:initGridCell(function()
self.needWaitingBoardOver = false if isFirst then
self.needWaitingBoardOver = false
end
end) end)
end, function() end, function()
-- self:enterRoundBegin()
end, isFirst) end, isFirst)
end end

View File

@ -166,7 +166,7 @@ end
function BattleControllerStage:getFixedRogueSkill() function BattleControllerStage:getFixedRogueSkill()
if not self.fixedRogueSkill then if not self.fixedRogueSkill then
local config = ConfigManager:getConfig("chapter")[self.chapterId] local config = ConfigManager:getConfig("chapter")[self.chapterId]
if config.involved_skill then if not DataManager.ChapterData:getChapterPassed(self.chapterId) and config.involved_skill then
self.fixedRogueSkill = GFunc.getTable(config.involved_skill) self.fixedRogueSkill = GFunc.getTable(config.involved_skill)
else else
self.fixedRogueSkill = {} self.fixedRogueSkill = {}

View File

@ -105,11 +105,6 @@ function ChapterManager:endFightFinish(result)
-- 处理金猪,要在章节更新之后 -- 处理金猪,要在章节更新之后
DataManager.GoldPigData:addGoldPigCount() DataManager.GoldPigData:addGoldPigCount()
if ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.DAILY_CHALLENGE, true) and not DataManager.DailyChallengeData:isOpen() then
-- 满足配置开启条件,请求挑战数据
ModuleManager.DailyChallengeManager:onResetState()
end
local newMaxChapter = DataManager.ChapterData:getNewChapterId() local newMaxChapter = DataManager.ChapterData:getNewChapterId()
if maxChapter ~= newMaxChapter then if maxChapter ~= newMaxChapter then
local data = {} local data = {}
@ -121,6 +116,8 @@ function ChapterManager:endFightFinish(result)
end end
-- 新章节通关,尝试解锁新功能 -- 新章节通关,尝试解锁新功能
DataManager:tryOpenModules() DataManager:tryOpenModules()
-- 更新每日挑战数据
ModuleManager.DailyChallengeManager:onResetState()
-- 章节通关 标记可弹出章节礼包 -- 章节通关 标记可弹出章节礼包
DataManager.ShopData:markPopUpGiftForActChapterStore(maxChapter) DataManager.ShopData:markPopUpGiftForActChapterStore(maxChapter)
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_PASS_CHAPTER) ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_PASS_CHAPTER)

View File

@ -34,6 +34,7 @@ function DailyChallengeTaskUI:ctor()
end end
function DailyChallengeTaskUI:onLoadRootComplete() function DailyChallengeTaskUI:onLoadRootComplete()
DataManager.DailyChallengeData:markPopTask()
self:_display() self:_display()
self:_addListeners() self:_addListeners()
end end

View File

@ -32,16 +32,14 @@ function HeroDetailUI:_display(lvChange)
uiMap["hero_detail_ui.bg.skill_desc"]:setText(ModuleManager.HeroManager:getSkillDesc(self.heroEntity:getBaseSkill())) uiMap["hero_detail_ui.bg.skill_desc"]:setText(ModuleManager.HeroManager:getSkillDesc(self.heroEntity:getBaseSkill()))
uiMap["hero_detail_ui.bg.hp_name"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_2)) uiMap["hero_detail_ui.bg.hp_name"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_2))
uiMap["hero_detail_ui.bg.atk_name"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_3)) uiMap["hero_detail_ui.bg.atk_name"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_3))
uiMap["hero_detail_ui.bg.skill_node.skill_icon"]:setSprite(GConst.ATLAS_PATH.ICON_SKILL_BIG, ModuleManager.HeroManager:getSkillIcon(self.heroEntity:getBaseSkill()))
uiMap["hero_detail_ui.bg.skill_icon"]:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(self.heroEntity:getUnlockRogueId()))
uiMap["hero_detail_ui.bg.hero_element"]:setSprite(GConst.ATLAS_PATH.HERO, ModuleManager.HeroManager:getMatchTypeIcon(self.heroEntity:getMatchType()))
local materials = self.heroEntity:getLvUpMaterials() or {} local materials = self.heroEntity:getLvUpMaterials() or {}
local fragmentCount = DataManager.BagData.ItemData:getItemNumById(self.heroEntity:getFragmentId()) local fragmentCount = DataManager.BagData.ItemData:getItemNumById(self.heroEntity:getFragmentId())
local needFragmentCount = materials[1] or 1 local needFragmentCount = materials[1] or 1
uiMap["hero_detail_ui.bg.fragment_num"]:setText(fragmentCount .. "/" .. needFragmentCount) uiMap["hero_detail_ui.bg.fragment_bg.fragment_num"]:setText(fragmentCount .. "/" .. needFragmentCount)
local slider = uiMap["hero_detail_ui.bg.slider"] local slider = uiMap["hero_detail_ui.bg.fragment_bg.slider"]
if fragmentCount >= needFragmentCount then if fragmentCount >= needFragmentCount then
slider:setSprite(GConst.ATLAS_PATH.COMMON, "common_progress_1", nil, slider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)) slider:setSprite(GConst.ATLAS_PATH.COMMON, "common_progress_1", nil, slider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER))
else else
@ -82,7 +80,7 @@ function HeroDetailUI:_display(lvChange)
uiMap["hero_detail_ui.bg.fragment_bg"]:setVisible(not self.heroEntity:isMaxLv()) uiMap["hero_detail_ui.bg.fragment_bg"]:setVisible(not self.heroEntity:isMaxLv())
local canLvUp = self.heroEntity:canLvUp() local canLvUp = self.heroEntity:canLvUp()
uiMap["hero_detail_ui.bg.fragment_icon"]:setVisible(not canLvUp) uiMap["hero_detail_ui.bg.fragment_bg.fragment_icon"]:setVisible(not canLvUp)
local lv = self.heroEntity:getLv() local lv = self.heroEntity:getLv()
local str local str

View File

@ -35,6 +35,9 @@ function MainComp:refreshModule(selectModule)
elseif self.curModuleType == GConst.MainCityConst.MAIN_MODULE.DAILY_CHALLENGE then elseif self.curModuleType == GConst.MainCityConst.MAIN_MODULE.DAILY_CHALLENGE then
-- 切换到每日挑战 -- 切换到每日挑战
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.GO_DAILY_CHALLENGE) EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.GO_DAILY_CHALLENGE)
if DataManager.DailyChallengeData:getIsPopTask() then
ModuleManager.DailyChallengeManager:showBattleTaskUI()
end
end end
end end
@ -167,6 +170,7 @@ end
function MainComp:refresh() function MainComp:refresh()
self:refreshStageFormaion() self:refreshStageFormaion()
self:refreshChallenge()
end end
function MainComp:getCurModuleType() function MainComp:getCurModuleType()

View File

@ -23,6 +23,7 @@ function DailyChallengeData:init(data)
self.totalFightCount = data.total_challenge_count or 0 self.totalFightCount = data.total_challenge_count or 0
self.todayFightCount = data.today_challenge_count or 0 self.todayFightCount = data.today_challenge_count or 0
self.initDay = Time:getBeginningOfServerToday() self.initDay = Time:getBeginningOfServerToday()
self.popTaskTime = LocalData:getChallengeTaskPopTime()
self:setDirty() self:setDirty()
end end
@ -40,12 +41,6 @@ function DailyChallengeData:isOpen()
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.DAILY_CHALLENGE, true) then if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.DAILY_CHALLENGE, true) then
return false return false
end end
if self.tasks == nil then
return false
end
if self.buffIds == nil then
return false
end
return true return true
end end
@ -295,4 +290,19 @@ function DailyChallengeData:getIsInReset()
return self.isInReset return self.isInReset
end end
function DailyChallengeData:getIsPopTask()
if not self:isOpen() then
return false
end
return self.popTaskTime < Time:getBeginningOfServerToday()
end
function DailyChallengeData:markPopTask()
if self.popTaskTime >= Time:getBeginningOfServerToday() then
return
end
self.popTaskTime = Time:getBeginningOfServerToday()
LocalData:setChallengeTaskPopTime(self.popTaskTime)
end
return DailyChallengeData return DailyChallengeData