diff --git a/lua/app/common/local_data.lua b/lua/app/common/local_data.lua index 616238b6..e64880d5 100644 --- a/lua/app/common/local_data.lua +++ b/lua/app/common/local_data.lua @@ -27,6 +27,7 @@ local LOCAL_DATA_KEY = { LAST_LOGIN_TIME = "LAST_LOGIN_TIME", GATE = "GATE", BOUNTY_POP_TIME = "BOUNTY_POP_TIME", + CHALLENGE_TASK_POP_TIME = "CHALLENGE_TASK_POP_TIME", } LocalData.KEYS = LOCAL_DATA_KEY @@ -345,4 +346,12 @@ function LocalData:getBountyPopTime() return self:getInt(LOCAL_DATA_KEY.BOUNTY_POP_TIME, 0) 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 \ No newline at end of file diff --git a/lua/app/global/global_const.lua b/lua/app/global/global_const.lua index 5093232a..2dd53259 100644 --- a/lua/app/global/global_const.lua +++ b/lua/app/global/global_const.lua @@ -183,6 +183,7 @@ GConst.ATLAS_PATH = { ICON_ITEM = "assets/arts/atlas/icon/item.asset", UI_LOGIN = "assets/arts/atlas/ui/login.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_2 = "assets/arts/atlas/icon/hero_2.asset", ICON_SKILL_ROGUE = "assets/arts/atlas/icon/skill_rogue.asset", diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 1a00b015..e5017cd8 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -1339,18 +1339,24 @@ end function BattleController:generateBoard(isFirst) local boardList, _, mysteryBoxIndexMap = self:getInitBoard() if self.curBoardIndex and self.curBoardIndex >= #boardList then - self.needWaitingBoardOver = false + if isFirst then + self.needWaitingBoardOver = false + end return end if not self.battleUI then - self.needWaitingBoardOver = false + if isFirst then + self.needWaitingBoardOver = false + end return end self.curBoardIndex = (self.curBoardIndex or 0) + 1 if not boardList[self.curBoardIndex] then -- 容错 - self.needWaitingBoardOver = false + if isFirst then + self.needWaitingBoardOver = false + end return end local board = boardList[self.curBoardIndex].board @@ -1361,10 +1367,11 @@ function BattleController:generateBoard(isFirst) self.battleUI:switchBoard(function() self.battleData:refreshBoard(board, self:getBlockIcon()) self.battleUI:initGridCell(function() - self.needWaitingBoardOver = false + if isFirst then + self.needWaitingBoardOver = false + end end) end, function() - -- self:enterRoundBegin() end, isFirst) end diff --git a/lua/app/module/battle/controller/battle_controller_stage.lua b/lua/app/module/battle/controller/battle_controller_stage.lua index e353fc7c..d661eb72 100644 --- a/lua/app/module/battle/controller/battle_controller_stage.lua +++ b/lua/app/module/battle/controller/battle_controller_stage.lua @@ -166,7 +166,7 @@ end function BattleControllerStage:getFixedRogueSkill() if not self.fixedRogueSkill then 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) else self.fixedRogueSkill = {} diff --git a/lua/app/module/chapter/chapter_manager.lua b/lua/app/module/chapter/chapter_manager.lua index b17813c5..88399cc2 100644 --- a/lua/app/module/chapter/chapter_manager.lua +++ b/lua/app/module/chapter/chapter_manager.lua @@ -105,11 +105,6 @@ function ChapterManager:endFightFinish(result) -- 处理金猪,要在章节更新之后 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() if maxChapter ~= newMaxChapter then local data = {} @@ -121,6 +116,8 @@ function ChapterManager:endFightFinish(result) end -- 新章节通关,尝试解锁新功能 DataManager:tryOpenModules() + -- 更新每日挑战数据 + ModuleManager.DailyChallengeManager:onResetState() -- 章节通关 标记可弹出章节礼包 DataManager.ShopData:markPopUpGiftForActChapterStore(maxChapter) ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_PASS_CHAPTER) diff --git a/lua/app/ui/daily_challenge/daily_challenge_task_ui.lua b/lua/app/ui/daily_challenge/daily_challenge_task_ui.lua index 2f6755d5..85adb485 100644 --- a/lua/app/ui/daily_challenge/daily_challenge_task_ui.lua +++ b/lua/app/ui/daily_challenge/daily_challenge_task_ui.lua @@ -34,6 +34,7 @@ function DailyChallengeTaskUI:ctor() end function DailyChallengeTaskUI:onLoadRootComplete() + DataManager.DailyChallengeData:markPopTask() self:_display() self:_addListeners() end diff --git a/lua/app/ui/hero/hero_detail_ui.lua b/lua/app/ui/hero/hero_detail_ui.lua index 5cbd7d9f..3ca83c33 100644 --- a/lua/app/ui/hero/hero_detail_ui.lua +++ b/lua/app/ui/hero/hero_detail_ui.lua @@ -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.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.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())) + uiMap["hero_detail_ui.bg.skill_node.skill_icon"]:setSprite(GConst.ATLAS_PATH.ICON_SKILL_BIG, ModuleManager.HeroManager:getSkillIcon(self.heroEntity:getBaseSkill())) local materials = self.heroEntity:getLvUpMaterials() or {} local fragmentCount = DataManager.BagData.ItemData:getItemNumById(self.heroEntity:getFragmentId()) 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 slider:setSprite(GConst.ATLAS_PATH.COMMON, "common_progress_1", nil, slider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)) else @@ -82,7 +80,7 @@ function HeroDetailUI:_display(lvChange) uiMap["hero_detail_ui.bg.fragment_bg"]:setVisible(not self.heroEntity:isMaxLv()) 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 str diff --git a/lua/app/ui/main_city/component/main_comp.lua b/lua/app/ui/main_city/component/main_comp.lua index 0da3cb6a..c0d561d8 100644 --- a/lua/app/ui/main_city/component/main_comp.lua +++ b/lua/app/ui/main_city/component/main_comp.lua @@ -35,6 +35,9 @@ function MainComp:refreshModule(selectModule) elseif self.curModuleType == GConst.MainCityConst.MAIN_MODULE.DAILY_CHALLENGE then -- 切换到每日挑战 EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.GO_DAILY_CHALLENGE) + if DataManager.DailyChallengeData:getIsPopTask() then + ModuleManager.DailyChallengeManager:showBattleTaskUI() + end end end @@ -167,6 +170,7 @@ end function MainComp:refresh() self:refreshStageFormaion() + self:refreshChallenge() end function MainComp:getCurModuleType() diff --git a/lua/app/userdata/daily_challenge/daily_challenge_data.lua b/lua/app/userdata/daily_challenge/daily_challenge_data.lua index 2a9702df..f64038be 100644 --- a/lua/app/userdata/daily_challenge/daily_challenge_data.lua +++ b/lua/app/userdata/daily_challenge/daily_challenge_data.lua @@ -23,6 +23,7 @@ function DailyChallengeData:init(data) self.totalFightCount = data.total_challenge_count or 0 self.todayFightCount = data.today_challenge_count or 0 self.initDay = Time:getBeginningOfServerToday() + self.popTaskTime = LocalData:getChallengeTaskPopTime() self:setDirty() end @@ -40,12 +41,6 @@ function DailyChallengeData:isOpen() if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.DAILY_CHALLENGE, true) then return false end - if self.tasks == nil then - return false - end - if self.buffIds == nil then - return false - end return true end @@ -295,4 +290,19 @@ function DailyChallengeData:getIsInReset() return self.isInReset 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 \ No newline at end of file