diff --git a/lua/app/global/global_const.lua b/lua/app/global/global_const.lua index edd1a8e1..9789feaf 100644 --- a/lua/app/global/global_const.lua +++ b/lua/app/global/global_const.lua @@ -244,6 +244,7 @@ GConst.ATLAS_PATH = { UI_ACT_PVP = "assets/arts/atlas/ui/act_pvp.asset", UI_TALENT = "assets/arts/atlas/ui/talent.asset", UI_SUMMON = "assets/arts/atlas/ui/summon.asset", + ICON_SUMMON = "assets/arts/atlas/icon/hero_summon.asset", } GConst.TOUCH_EVENT = { diff --git a/lua/app/global/global_func.lua b/lua/app/global/global_func.lua index ec3f43f6..3d57c15f 100644 --- a/lua/app/global/global_func.lua +++ b/lua/app/global/global_func.lua @@ -1988,6 +1988,9 @@ function GFunc.getHeroQltImg(qlt) return GConst.ATLAS_PATH.HERO, "hero_quality_" .. qlt end +function GFunc.getHeroIcon(icon) + return GConst.ATLAS_PATH.ICON_HERO, tostring(icon) +end function GFunc.getHeroQltStr(qlt) return I18N:getGlobalText("QLT_DESC_" .. qlt) diff --git a/lua/app/module/task/task_manager.lua b/lua/app/module/task/task_manager.lua index 01a262b4..284eb754 100644 --- a/lua/app/module/task/task_manager.lua +++ b/lua/app/module/task/task_manager.lua @@ -19,7 +19,7 @@ end function TaskManager:onTaskDailyStageRewardReq(dailyTaskId) local parmas = {} parmas.id = 0 - parmas.type = 1 + -- parmas.type = 1 self:sendMessage(ProtoMsgType.FromMsgEnum.TaskDailyStageRewardReq, parmas, {}, self.onTaskDailyStageRewardRsp, BIReport.ITEM_GET_TYPE.TASK_DAILY_REFRESH) end @@ -27,6 +27,10 @@ function TaskManager:onTaskDailyStageRewardRsp(result) if result.err_code == GConst.ERROR_STR.SUCCESS then if result.task_daily then DataManager.DailyTaskData:initDaily(result.task_daily) + DataManager.DailyTaskData:setDirty() + end + if result.rewards then + GFunc.showRewardBox(result.rewards) end end end diff --git a/lua/app/ui/daily_challenge/daily_challenge_ui.lua b/lua/app/ui/daily_challenge/daily_challenge_ui.lua index 05c24a20..c9c2e2b5 100644 --- a/lua/app/ui/daily_challenge/daily_challenge_ui.lua +++ b/lua/app/ui/daily_challenge/daily_challenge_ui.lua @@ -55,6 +55,10 @@ function DailyChallengeUI:onLoadRootComplete() self.fightBtn:addClickListener(function () ModuleManager.DailyChallengeManager:startChallenge() end) + + self:bind(DataManager.DailyChallengeData, "isDirty", function() + self:onRefresh() + end) end function DailyChallengeUI:updateTime() diff --git a/lua/app/ui/hero/hero_detail_ui.lua b/lua/app/ui/hero/hero_detail_ui.lua index 635bac15..c4bc9076 100644 --- a/lua/app/ui/hero/hero_detail_ui.lua +++ b/lua/app/ui/hero/hero_detail_ui.lua @@ -233,6 +233,7 @@ function HeroDetailUI:refreshPageBtn() self.rightBtn:setActive(false) for i = 1, 2 do self.pageBtns[i]:setActive(false) + self.pageRedImgs[i]:setActive(false) end else self.leftBtn:setActive(self:isShowLeftArrow()) diff --git a/lua/app/ui/main_city/component/main_comp.lua b/lua/app/ui/main_city/component/main_comp.lua index 7f34ca1f..3f00707c 100644 --- a/lua/app/ui/main_city/component/main_comp.lua +++ b/lua/app/ui/main_city/component/main_comp.lua @@ -299,6 +299,12 @@ function MainComp:refreshRedPoint() else self.arenaBtn:removeRedPoint() end + + if DataManager.DailyChallengeData:showRedPoint() then + self.dailyChallengeBtn:addRedPoint(-70, 26, 1) + else + self.dailyChallengeBtn:removeRedPoint() + end end function MainComp:getArenaBtnPosition() diff --git a/lua/app/ui/summon/cell/summon_hero_cell.lua b/lua/app/ui/summon/cell/summon_hero_cell.lua index e4d11ef2..f45eed79 100755 --- a/lua/app/ui/summon/cell/summon_hero_cell.lua +++ b/lua/app/ui/summon/cell/summon_hero_cell.lua @@ -32,10 +32,9 @@ function SummonBallCell:refresh(wishHeroId, heroId, callback, select) end local cfg = DataManager.HeroData:getHeroConfig(heroId) - -- self.icon:setSprite(GConst.ATLAS_PATH.ICON_HERO, cfg.icon) - -- self.heroBg:setSprite(GConst.ATLAS_PATH.HERO, GConst.FRAME_QLT[cfg.qlt]) - self.heroBg:setSprite(GConst.ATLAS_PATH.UI_SUMMON, "summon_card_" .. cfg.qlt) - self.heroDec:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HERO_DEC_QLT[cfg.qlt]) + self.icon:setSprite(GConst.ATLAS_PATH.ICON_SUMMON, tostring(cfg.icon)) + self.heroBg:setSprite(GConst.ATLAS_PATH.ICON_SUMMON, "summon_card_" .. cfg.qlt) + self.heroDec:setSprite(GConst.ATLAS_PATH.ICON_SUMMON, "summon_card_mark_" .. cfg.qlt) self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[cfg.position]) self.nameTx:setText(ModuleManager.HeroManager:getHeroName(heroId)) diff --git a/lua/app/ui/summon/summon_main_ui.lua b/lua/app/ui/summon/summon_main_ui.lua index a514c73b..91ceefda 100755 --- a/lua/app/ui/summon/summon_main_ui.lua +++ b/lua/app/ui/summon/summon_main_ui.lua @@ -72,6 +72,7 @@ function SummonMainUI:onLoadRootComplete() self.btnWish = uiMap["summon_main_ui.node.btn_wish"] --心愿 self.btnWishTx = uiMap["summon_main_ui.node.btn_wish.unlock.tx_guarantee"] --心愿 + self.btnWishIcon = uiMap["summon_main_ui.node.btn_wish.unlock.img_wish_icon"] --心愿 -- self.toggleJump = uiMap["summon_main_ui.jump_tween"]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TOGGLE) -- self.isJumpTween = self.toggleJump.isOn @@ -338,6 +339,16 @@ function SummonMainUI:refreshWishBtn() local wishCount = DataManager.SummonData:getSummonWishCount(self.page) local needCount = DataManager.SummonData:getSummonWishGuarantee2(self.page) self.btnWishTx:setText(wishCount .. "/" .. needCount) + + local wishHeroId = DataManager.SummonData:getSummonWishHeroId(self.page) + local cfg = DataManager.HeroData:getHeroConfig(wishHeroId) + if cfg then + self.btnWishIcon:setSprite(GFunc.getHeroIcon(cfg.icon)) + self.btnWish:setSprite(GConst.ATLAS_PATH.ICON_ITEM, GConst.FRAME_QLT[cfg.qlt]) + else + self.btnWishIcon:setSprite(GConst.ATLAS_PATH.COMMON, "common_alpha") + self.btnWish:setSprite(GConst.ATLAS_PATH.ICON_ITEM, "frame_1") + end end --检查单抽红点 diff --git a/lua/app/userdata/daily_challenge/daily_challenge_data.lua b/lua/app/userdata/daily_challenge/daily_challenge_data.lua index 8b272b77..c9c9fae5 100644 --- a/lua/app/userdata/daily_challenge/daily_challenge_data.lua +++ b/lua/app/userdata/daily_challenge/daily_challenge_data.lua @@ -299,4 +299,14 @@ function DailyChallengeData:markPopTask() LocalData:setChallengeTaskPopTime(self.popTaskTime) end +--@region 红点 +function DailyChallengeData:showRedPoint() + for i = 1, 3 do + if DataManager.DailyChallengeData:canClaimTask(i) then + return true + end + end + return false +end +--@endregion return DailyChallengeData \ No newline at end of file diff --git a/lua/app/userdata/task/daily_task_data.lua b/lua/app/userdata/task/daily_task_data.lua index 47c2efc6..1a994c1e 100644 --- a/lua/app/userdata/task/daily_task_data.lua +++ b/lua/app/userdata/task/daily_task_data.lua @@ -67,7 +67,7 @@ function DailyTaskData:initDaily(daily) -- 活跃度 self.dayPoint = daily.point or 0 -- 活跃度领奖 - self.progRewardData = daily.stage_reward_claimed or {} + self.progRewardData = daily.stage_claimed or {} -- 任务配置 self.dailyTaskIds = {}