From bb135f863052ff3ae74802da326907ab1c8f8651 Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Mon, 18 Aug 2025 11:48:38 +0800 Subject: [PATCH] fix bug --- lua/app/config/monster_daily_challenge.lua | 2 +- lua/app/ui/hero/cell/hero_list_cell.lua | 4 ++-- lua/app/ui/idle/idle_drop_ui.lua | 24 +++++++++++++++++++- lua/app/ui/main_city/component/main_comp.lua | 2 ++ lua/app/ui/main_city/main_city_ui.lua | 8 +++++++ lua/app/userdata/idle/idle_data.lua | 4 ++-- 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/lua/app/config/monster_daily_challenge.lua b/lua/app/config/monster_daily_challenge.lua index 08e1c445..c8134306 100644 --- a/lua/app/config/monster_daily_challenge.lua +++ b/lua/app/config/monster_daily_challenge.lua @@ -1160,7 +1160,7 @@ local monster_daily_challenge = { ["monster_exp"]=22000 }, [61502]={ - ["monster_base"]=30007, + ["monster_base"]=30003, ["is_boss"]=1, ["hp"]=1800000, ["atk"]=72000000, diff --git a/lua/app/ui/hero/cell/hero_list_cell.lua b/lua/app/ui/hero/cell/hero_list_cell.lua index 005c526f..8d34afc1 100644 --- a/lua/app/ui/hero/cell/hero_list_cell.lua +++ b/lua/app/ui/hero/cell/hero_list_cell.lua @@ -25,12 +25,12 @@ function HeroListCell:refresh(index, heroList, stageFormation, allHeroCount, act end) if activeCount > 0 and index == 1 then self.title:setVisible(true) - self.title:setSprite(GConst.ATLAS_PATH.COMMON, "common_board_105") + self.title:setSprite(GConst.ATLAS_PATH.COMMON, "hero_bg_3") self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_6)) self:getBaseObject():setSizeDeltaY(H.HAS_TITLE) elseif index == math.ceil(activeCount / 4) + 1 then self.title:setVisible(true) - self.title:setSprite(GConst.ATLAS_PATH.COMMON, "common_board_116") + self.title:setSprite(GConst.ATLAS_PATH.COMMON, "hero_bg_3") self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_7)) self:getBaseObject():setSizeDeltaY(H.HAS_TITLE) else diff --git a/lua/app/ui/idle/idle_drop_ui.lua b/lua/app/ui/idle/idle_drop_ui.lua index acf9b40e..7f1af617 100644 --- a/lua/app/ui/idle/idle_drop_ui.lua +++ b/lua/app/ui/idle/idle_drop_ui.lua @@ -59,9 +59,13 @@ function IdleDropUI:onLoadRootComplete() uiMap["idle_drop_ui.bg.desc_tx_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.IDLE_DROP_DESC_1) .. I18N:getGlobalText(I18N.GlobalConst.IDLE_DROP_DESC_2, idleMaxTime // 3600)) self.quickBtn = uiMap["idle_drop_ui.bg.quick_btn"] self.quickBtn:addClickListener(function() - ModuleManager.IdleManager:showIdleQuickDropUI() + ModuleManager.IdleManager:getIdleQuickRewrad(false) end) uiMap["idle_drop_ui.bg.quick_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.IDLE_QUICK)) + local cost = DataManager.IdleData:getQuickIdleCost()[1] + local costNum = GFunc.getRewardNum(cost) + uiMap["idle_drop_ui.bg.quick_btn.bg.text"]:setText(costNum) + self.getBtn = uiMap["idle_drop_ui.bg.get_btn"] self.getBtn:addClickListener(function() self.lastRefreshTime = Time:getServerTime() @@ -72,6 +76,12 @@ function IdleDropUI:onLoadRootComplete() self:closeUI() end) + self.adBtn = uiMap["idle_drop_ui.bg.ad_btn"] + self.adBtnImg = uiMap["idle_drop_ui.bg.ad_btn.img"] + self.adBtn:addClickListener(function() + ModuleManager.IdleManager:getIdleQuickRewrad(true) + end) + uiMap["idle_drop_ui.bg.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.CLICK_CLOSE_DESC)) uiMap["idle_drop_ui.bg.bg1.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.IDLE_DROP_DESC_3)) uiMap["idle_drop_ui.bg.bg1.desc_tx_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.IDLE_DROP_DESC_3)) @@ -255,6 +265,18 @@ function IdleDropUI:refreshBtns() self.quickBtn:setTouchEnable(false) self:removeQuickBtnRedPoint() end + + local adRemainTimes = DataManager.IdleData:getQuickIdleAdRemainTimes() + if adRemainTimes <= 0 then + adRemainTimes = 0 + self.adBtn:setTouchEnable(false) + self.adBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_1") + self.adBtn:removeRedPoint() + else + self.adBtn:setTouchEnable(true) + self.adBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_orange_1") + self.adBtn:addRedPoint(60, 30, 0.5) + end end function IdleDropUI:refreshCD() diff --git a/lua/app/ui/main_city/component/main_comp.lua b/lua/app/ui/main_city/component/main_comp.lua index 8611a211..edee3348 100644 --- a/lua/app/ui/main_city/component/main_comp.lua +++ b/lua/app/ui/main_city/component/main_comp.lua @@ -169,6 +169,8 @@ function MainComp:refreshChapter(force) local chapterId = DataManager.ChapterData:getChapterId() self.chapterList = DataManager.ChapterData:getChapterList(self.chapterPage) if self.currChapterId ~= chapterId or force then + self.chapterPage = DataManager.ChapterData:getChapterPage(chapterId) + self.chapterStage = DataManager.ChapterData:getChapterStage(chapterId) self:refreshChapterBg() self:refreshFightBtn() self:doBossAction() diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index b7c1760e..9b4d87a4 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -262,6 +262,14 @@ function MainCityUI:initBottomUI() if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MALL, false) then return end + elseif i == 4 then -- 商城有开启条件 + if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MALL, false) then + return + end + elseif i == 5 then -- 商城有开启条件 + if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MALL, false) then + return + end end if self.selectedIndex == i then return diff --git a/lua/app/userdata/idle/idle_data.lua b/lua/app/userdata/idle/idle_data.lua index 983dae68..fd4afab2 100644 --- a/lua/app/userdata/idle/idle_data.lua +++ b/lua/app/userdata/idle/idle_data.lua @@ -8,14 +8,14 @@ end function IdleData:init(data) data = data or GConst.EMPTY_TABLE - self.data.dropTime = (data.claim_at or 0) // 1000 + self.data.dropTime = (data.claim_at or 0) self.data.adCount = data.ad_count or 0 self.data.energyCount = data.energy_count or 0 end function IdleData:onGetIdleShowRewrad(data) data = data or GConst.EMPTY_TABLE - self.data.dropTime = (data.claim_at or 0) // 1000 + self.data.dropTime = (data.claim_at or 0) self.data.adCount = data.ad_count or 0 self.data.energyCount = data.energy_count or 0 self:updateIdleRewards(data.items)