From 3e1693d91d9ca8b5fae25b95946853adcbedbb53 Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Tue, 7 Oct 2025 17:18:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/bi_report.lua | 15 + lua/app/common/pay_manager.lua | 6 + lua/app/common/white_res_manager.lua | 2 +- lua/app/global/global_const.lua | 2 +- .../activity/act_sprint/act_sprint_const.lua | 8 +- lua/app/module/shop/shop_const.lua | 6 - lua/app/module/shop/shop_manager.lua | 13 - lua/app/module/sign/sign_const.lua | 19 +- lua/app/module/sign/sign_manager.lua | 41 +- lua/app/proto/proto_msg_type.lua | 36 + .../act_sprint_summon_all/act_main_ui.lua | 6 +- lua/app/ui/activity/common/act_base_ui.lua | 6 +- .../common/cell/act_page_btn_cell.lua | 40 + .../common/cell/act_page_btn_cell.lua.meta | 10 + .../common/comp/act_page_btns_comp.lua | 41 + .../common/comp/act_page_btns_comp.lua.meta | 10 + lua/app/ui/arena/arena_recent_battle_ui.lua | 4 +- lua/app/ui/arena/cell/arena_rank_cell.lua | 8 +- lua/app/ui/common/cell/bounty_reward_cell.lua | 4 +- lua/app/ui/dungeon_rune/cell/rank_cell.lua | 6 +- .../ui/dungeon_rune/dungeon_rune_rank_ui.lua | 2 +- lua/app/ui/fund/cell/fund_chapter_cell.lua | 2 + lua/app/ui/shop/cell/daily_cell.lua | 11 +- lua/app/ui/shop/cell/daily_main_cell.lua | 18 +- lua/app/ui/shop/shop_comp.lua | 92 +- lua/app/ui/sign/sign_main_ui.lua | 18 +- lua/app/ui/summon/summon_main_ui.lua | 4 +- lua/app/userdata/chapter/chapter_data.lua | 2 +- lua/app/userdata/shop/shop_data.lua | 1020 ++++++++--------- lua/app/userdata/sign/sign_week_data.lua | 2 +- 30 files changed, 811 insertions(+), 643 deletions(-) create mode 100755 lua/app/ui/activity/common/cell/act_page_btn_cell.lua create mode 100644 lua/app/ui/activity/common/cell/act_page_btn_cell.lua.meta create mode 100755 lua/app/ui/activity/common/comp/act_page_btns_comp.lua create mode 100644 lua/app/ui/activity/common/comp/act_page_btns_comp.lua.meta diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index 8e51fa5f..270d6685 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -206,6 +206,18 @@ BIReport.ITEM_GET_TYPE = { SHOP_GEM = "shop_gem", SHOP_GOLD = "shop_gold", -- SHOP_EMBLEM = "shop_emblem", + + -- 基金 + FUND_GROW = "fund_grow",-- 基金 + ACT_CHAPTER_FUND_REWARD = "act_chapter_fund_reward", + ACT_LEVEL_FUND_REWARD = "act_level_fund_reward", + + -- 七日签到战令 + SIGN_BOUNTY = "signin_bounty", + SIGN_BOUNTY_REWARD = "sign_bounty_reward", -- 补领上次奖励 + SIGN_BOUNTY_RESIGH = "sign_bounty_resigh", + SIGN_BOUNTY_SIGH = "sign_bounty_sigh", + SIGN_MONTH_ACCUM_CLAIM = "signin_30_accum_claim", } BIReport.ADS_CLICK_TYPE = { @@ -309,6 +321,9 @@ BIReport.GIFT_TYPE = { -- 高级战令 BOUNTY_PRO_REWARD = "bounty_pro_reward", + FUND_GROW = "fund_grow",-- 成长基金 + + SIGN_BOUNTY = "sign_bounty", } BIReport.COIN_TYPE = { diff --git a/lua/app/common/pay_manager.lua b/lua/app/common/pay_manager.lua index d267222e..10179241 100644 --- a/lua/app/common/pay_manager.lua +++ b/lua/app/common/pay_manager.lua @@ -33,6 +33,8 @@ PayManager.PURCHARSE_ACT_TYPE = { -- TOURN_WAVE_GIFT = 23, -- TOURN_ARENA_GIFT = 24, BOUNTY = 3, + FUND = 4, + SIGN_BOUNTY = 5, GIFT_POP_CHAPTER = 10, -- 章节礼包 ACT_COMMON = 11,-- 活动礼包通用11,具体礼包类型使用activity表中的act_type ACT_SEVEN_DAY = 15, -- 七天乐 @@ -57,6 +59,8 @@ PayManager.PURCHARSE_TYPE_CONFIG = { PayManager.BI_ITEM_GET_TYPE = { [PayManager.PURCHARSE_TYPE.ACT_GIFT] = { [PayManager.PURCHARSE_ACT_TYPE.BOUNTY] = BIReport.ITEM_GET_TYPE.BOUNTY, + [PayManager.PURCHARSE_ACT_TYPE.FUND] = BIReport.ITEM_GET_TYPE.FUND_GROW, + [PayManager.PURCHARSE_ACT_TYPE.SIGN_BOUNTY] = BIReport.ITEM_GET_TYPE.SIGN_BOUNTY, [PayManager.PURCHARSE_ACT_TYPE.GIFT_POP_CHAPTER] = BIReport.ITEM_GET_TYPE.GIFT_POP_CHAPTER, [PayManager.PURCHARSE_ACT_TYPE.ACT_COMMON] = {}, -- [PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = BIReport.ITEM_GET_TYPE.FIRST_RECHARGE, @@ -90,6 +94,8 @@ PayManager.BI_ITEM_GET_TYPE = { PayManager.BI_GIFT_TYPE = { [PayManager.PURCHARSE_TYPE.ACT_GIFT] = { [PayManager.PURCHARSE_ACT_TYPE.BOUNTY] = BIReport.GIFT_TYPE.BOUNTY_PRO_REWARD, + [PayManager.PURCHARSE_ACT_TYPE.FUND] = BIReport.GIFT_TYPE.FUND_GROW, + [PayManager.PURCHARSE_ACT_TYPE.SIGN_BOUNTY] = BIReport.GIFT_TYPE.SIGN_BOUNTY, [PayManager.PURCHARSE_ACT_TYPE.GIFT_POP_CHAPTER] = BIReport.GIFT_TYPE.GIFT_POP_CHAPTER, [PayManager.PURCHARSE_ACT_TYPE.ACT_COMMON] = {}, -- [PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = BIReport.GIFT_TYPE.FIRST_RECHARGE, diff --git a/lua/app/common/white_res_manager.lua b/lua/app/common/white_res_manager.lua index c09ca734..53960b45 100644 --- a/lua/app/common/white_res_manager.lua +++ b/lua/app/common/white_res_manager.lua @@ -5,7 +5,7 @@ local WhiteResManager = {} local GAME_RES_WHITE_LIST = { -- ui GConst.ATLAS_PATH.COMMON, - GConst.ATLAS_PATH.ACT_COMMON, + GConst.ATLAS_PATH.UI_ACT_COMMON, -- icon GConst.ATLAS_PATH.ICON_SKILL, GConst.ATLAS_PATH.ICON_SKILL_ROGUE, diff --git a/lua/app/global/global_const.lua b/lua/app/global/global_const.lua index c9d7f796..25f38c80 100644 --- a/lua/app/global/global_const.lua +++ b/lua/app/global/global_const.lua @@ -212,7 +212,7 @@ GConst.TYPEOF_LUA_CLASS = { GConst.ATLAS_PATH = { COMMON = "assets/arts/atlas/ui/common.asset", - ACT_COMMON = "assets/arts/atlas/ui/act_common.asset", + UI_ACT_COMMON = "assets/arts/atlas/ui/act_common.asset", MAIN = "assets/arts/atlas/ui/main.asset", BATTLE = "assets/arts/atlas/ui/battle.asset", DAILY_CHALLENGE = "assets/arts/atlas/ui/daily_challenge.asset", diff --git a/lua/app/module/activity/act_sprint/act_sprint_const.lua b/lua/app/module/activity/act_sprint/act_sprint_const.lua index 3a5b2350..516ca689 100644 --- a/lua/app/module/activity/act_sprint/act_sprint_const.lua +++ b/lua/app/module/activity/act_sprint/act_sprint_const.lua @@ -69,10 +69,10 @@ ActSprintConst.MAIN_PAGE_BTN_DESC = { } ActSprintConst.BOTTOM_PAGE = { - SCORE_TASK = 1, - BOUNTY = 2, - GIFT = 3, - TASK = 4, + SCORE_TASK = 4, + BOUNTY = 3, + GIFT = 2, + TASK = 1, } ActSprintConst.COMP = { diff --git a/lua/app/module/shop/shop_const.lua b/lua/app/module/shop/shop_const.lua index 3cb772d8..131e9ff6 100644 --- a/lua/app/module/shop/shop_const.lua +++ b/lua/app/module/shop/shop_const.lua @@ -28,12 +28,6 @@ ShopConst.FIRST_RECHARGE_ID = { [ShopConst.FIRST_RECHARGE_GEARS.GEAR_3] = {1003000601, 1003000701, 1003000801},-- 第三档首充 } --- 新首充id --- ShopConst.FIRST_RECHARGE_ID_2 = { --- [ShopConst.FIRST_RECHARGE_GEARS.GEAR_1] = {11002, 11102, 11202},-- 第一档首充 --- [ShopConst.FIRST_RECHARGE_GEARS.GEAR_2] = {11302, 11402, 11502},-- 第二档首充 --- [ShopConst.FIRST_RECHARGE_GEARS.GEAR_3] = {11602, 11702, 11802},-- 第三档首充 --- } ShopConst.PRIVILEGE_SHOW_PAGE = { FREE_DAILY_REWARDS = 1, AD_CARD = 2, diff --git a/lua/app/module/shop/shop_manager.lua b/lua/app/module/shop/shop_manager.lua index 2e5a7c3a..a7f19c13 100644 --- a/lua/app/module/shop/shop_manager.lua +++ b/lua/app/module/shop/shop_manager.lua @@ -152,19 +152,6 @@ function ShopManager:rspBuyEmblemGift(result) DataManager.ShopData:onBuyEmblemGiftSuccess(result.reqData.id) end -function ShopManager:reqBuyEmblemGift(id) - self:sendMessage(ProtoMsgType.FromMsgEnum.MallMythicBuyReq, {id = id}, self.rspBuyEmblemGift, BIReport.ITEM_GET_TYPE.SHOP_EMBLEM) -end - -function ShopManager:rspBuyEmblemGift(result) - if result.err_code ~= GConst.ERROR_STR.SUCCESS then - return - end - - GFunc.showRewardBox(result.rewards) - DataManager.ShopData:onBuyEmblemGiftSuccess(result.reqData.id) -end - -- 金币商店 function ShopManager:reqBuyGoldGift(id) self:sendMessage(ProtoMsgType.FromMsgEnum.MallGoldBuyReq, {id = id}, self.rspBuyGoldGift, BIReport.ITEM_GET_TYPE.SHOP_GOLD) diff --git a/lua/app/module/sign/sign_const.lua b/lua/app/module/sign/sign_const.lua index fa8193c3..6cff5c39 100755 --- a/lua/app/module/sign/sign_const.lua +++ b/lua/app/module/sign/sign_const.lua @@ -1,8 +1,9 @@ local SignConst = {} SignConst.GIFT_ID = { - [1] = 1004000001, - [2] = 1004000101, + [1] = 1034000001, + [2] = 1034000001, + -- [2] = 1004000101, } SignConst.REWARD_TYPE = { @@ -15,7 +16,7 @@ SignConst.MONTH_REWARD_TYPE = { } SignConst.SIGN_SHOW_PAGE = { WEEK = 1, - MONTH = 2, + -- MONTH = 2, } SignConst.SIGN_STATE = { CAN_SIGN = 1, -- 可签到 @@ -39,27 +40,27 @@ SignConst.SIGN_MONTH_SLIDER_RANG ={ -- 签到预制体挂载的组件 SignConst.SIGN_COMP = { [SignConst.SIGN_SHOW_PAGE.WEEK] = "app/ui/sign/comp/sign_week_comp", - [SignConst.SIGN_SHOW_PAGE.MONTH] = "app/ui/sign/comp/sign_month_comp", + -- [SignConst.SIGN_SHOW_PAGE.MONTH] = "app/ui/sign/comp/sign_month_comp", } SignConst.SIGN_COMP_NAME = { [SignConst.SIGN_SHOW_PAGE.WEEK] = "sign_main_ui.sign_week_comp", - [SignConst.SIGN_SHOW_PAGE.MONTH] = "sign_main_ui.sign_month_comp", + -- [SignConst.SIGN_SHOW_PAGE.MONTH] = "sign_main_ui.sign_month_comp", } SignConst.SIGN_PAGE_BTN_ICON_ATLAS = { [SignConst.SIGN_SHOW_PAGE.WEEK] = GConst.ATLAS_PATH.UI_ACT_COMMON, - [SignConst.SIGN_SHOW_PAGE.MONTH] = GConst.ATLAS_PATH.UI_ACT_COMMON, + -- [SignConst.SIGN_SHOW_PAGE.MONTH] = GConst.ATLAS_PATH.UI_ACT_COMMON, } SignConst.SIGN_PAGE_BTN_ICON_1 = { [SignConst.SIGN_SHOW_PAGE.WEEK] = "act_common_btn_8_1", - [SignConst.SIGN_SHOW_PAGE.MONTH] = "act_common_btn_9_1", + -- [SignConst.SIGN_SHOW_PAGE.MONTH] = "act_common_btn_9_1", } SignConst.SIGN_PAGE_BTN_ICON_2 = { [SignConst.SIGN_SHOW_PAGE.WEEK] = "act_common_btn_8_2", - [SignConst.SIGN_SHOW_PAGE.MONTH] = "act_common_btn_9_2", + -- [SignConst.SIGN_SHOW_PAGE.MONTH] = "act_common_btn_9_2", } SignConst.SIGN_PAGE_BTN_DESC = { [SignConst.SIGN_SHOW_PAGE.WEEK] = I18N.GlobalConst.ACT_30SIGNIN_2, - [SignConst.SIGN_SHOW_PAGE.MONTH] = I18N.GlobalConst.ACT_30SIGNIN_1, + -- [SignConst.SIGN_SHOW_PAGE.MONTH] = I18N.GlobalConst.ACT_30SIGNIN_1, } return SignConst \ No newline at end of file diff --git a/lua/app/module/sign/sign_manager.lua b/lua/app/module/sign/sign_manager.lua index b12d1fee..c8f503aa 100755 --- a/lua/app/module/sign/sign_manager.lua +++ b/lua/app/module/sign/sign_manager.lua @@ -2,7 +2,7 @@ local SignManager = class("SignManager", BaseModule) -- 领取遗留奖励 function SignManager:reqSignAutoRewardsClaimed() - self:sendMessage(ProtoMsgType.FromMsgEnum.SignAutoRewardsClaimedReq, {}, {}, self.rspSignAutoRewardsClaimed, BIReport.ITEM_GET_TYPE.SIGN_BOUNTY_REWARD) + self:sendMessage(ProtoMsgType.FromMsgEnum.SignAutoRewardsClaimedReq, {}, self.rspSignAutoRewardsClaimed, BIReport.ITEM_GET_TYPE.SIGN_BOUNTY_REWARD) end function SignManager:rspSignAutoRewardsClaimed(result) @@ -10,12 +10,12 @@ function SignManager:rspSignAutoRewardsClaimed(result) return end - GFunc.showRewardBox(result.rewards) - if result.rewards and #result.rewards > 0 then + GFunc.showRewardBox(result.rewards) BIReport:postSignBountyOpt(BIReport.SIGN_WEEK_OPT_TYPE.REWARD) end end + function SignManager:showSignUI(showPage, onlyShowPage, callback) local params = { showPage = showPage, @@ -24,11 +24,13 @@ function SignManager:showSignUI(showPage, onlyShowPage, callback) } UIManager:showUI("app/ui/sign/sign_main_ui", params) end + -- 签到 function SignManager:reqSignClaimed(day, isAll) local isUnlock = DataManager.SignWeekData:isUnlockPro(day) self:sendMessage(ProtoMsgType.FromMsgEnum.SignClaimedReq, {day = day, pay = isUnlock, all = isAll}, self.rspSignClaimed, BIReport.ITEM_GET_TYPE.SIGN_BOUNTY_SIGH) end + function SignManager:rspSignClaimed(result) if result.err_code ~= GConst.ERROR_STR.SUCCESS then return @@ -45,6 +47,7 @@ end function SignManager:reqSignReCheckin(day) self:sendMessage(ProtoMsgType.FromMsgEnum.SignReCheckinReq, {day = day}, self.rspSignReCheckin, BIReport.ITEM_GET_TYPE.SIGN_BOUNTY_RESIGH) end + function SignManager:rspSignReCheckin(result) if result.err_code ~= GConst.ERROR_STR.SUCCESS then return @@ -57,10 +60,10 @@ function SignManager:rspSignReCheckin(result) BIReport:postSignBountyOpt(BIReport.SIGN_WEEK_OPT_TYPE.RESIGN) end - function SignManager:reqMonthSign(day) self:sendMessage(ProtoMsgType.FromMsgEnum.Sign30ClaimReq, {day = day}, self.rspMonthSign, BIReport.ITEM_GET_TYPE.SIGN_MONTH) end + function SignManager:rspMonthSign(result) if result.err_code ~= GConst.ERROR_STR.SUCCESS then return @@ -69,9 +72,11 @@ function SignManager:rspMonthSign(result) GFunc.showRewardBox(result.rewards) DataManager.SignMonthData:setSignSucceed() end + function SignManager:reqMonthSignAgain() self:sendMessage(ProtoMsgType.FromMsgEnum.Sign30ClaimReq, {again = true}, self.rspSignMonthAgain, BIReport.ITEM_GET_TYPE.SIGN_MONTH_AGAIN) end + function SignManager:rspSignMonthAgain(result) if result.err_code ~= GConst.ERROR_STR.SUCCESS then return @@ -80,9 +85,11 @@ function SignManager:rspSignMonthAgain(result) DataManager.SignMonthData:setSignAgainSucceed() BIReport:postSignBountyOpt(BIReport.SIGN_MONTH_OPT_TYPE.SIGN_AGAIN) end + function SignManager:reqMonthAccumClaim(day) self:sendMessage(ProtoMsgType.FromMsgEnum.Sign30AccumClaimReq, {id = day}, self.rspMonthAccumClaim, BIReport.ITEM_GET_TYPE.SIGN_MONTH_ACCUM_CLAIM) end + function SignManager:rspMonthAccumClaim(result) if result.err_code ~= GConst.ERROR_STR.SUCCESS then return @@ -92,4 +99,30 @@ function SignManager:rspMonthAccumClaim(result) BIReport:postSignBountyOpt(BIReport.SIGN_MONTH_OPT_TYPE.ACCUM_CLAIM) end +--region 上报 +local EVENT_SIGN_BOUNTY = "client_sign_bounty"-- 签到战令 + +BIReport.SIGN_WEEK_OPT_TYPE = { + SIGN = "Sign", + RESIGN = "ReSign", + REWARD = "Reward" +} + +BIReport.SIGN_MONTH_OPT_TYPE = { + SIGN = "Sign", + SIGN_AGAIN = "SignAgain", + ACCUM_CLAIM = "AccumClaim" +} + +-- 七日签到战令 +function BIReport:postSignBountyOpt(optType, day, rewards) + local args = { + opt_type = optType, + day = day, + reward_str = GFunc.getRewardsStr(rewards), + } + self:report(EVENT_SIGN_BOUNTY, args) +end +--endregion + return SignManager \ No newline at end of file diff --git a/lua/app/proto/proto_msg_type.lua b/lua/app/proto/proto_msg_type.lua index b5417920..60c27cf7 100644 --- a/lua/app/proto/proto_msg_type.lua +++ b/lua/app/proto/proto_msg_type.lua @@ -104,6 +104,8 @@ local ProtoMsgType = { [2258628591] = "SummonWishClaimRsp", [2285872137] = "ChapterBoxRewardReq", [2285873970] = "ChapterBoxRewardRsp", + [2339018130] = "SevenDaysReq", + [2339019963] = "SevenDaysRsp", [2429586383] = "MailCycleReq", [2429588216] = "MailCycleRsp", [2431353944] = "SignClaimedReq", @@ -122,6 +124,8 @@ local ProtoMsgType = { [2553353804] = "ChapterDailyChallengeStartRsp", [2581180989] = "MailListReq", [2581182822] = "MailListRsp", + [2620369240] = "SevenDayRewardReq", + [2620371073] = "SevenDayRewardRsp", [2660643921] = "SignReCheckinReq", [2660645754] = "SignReCheckinRsp", [2706989220] = "TriggerGrowUpGift2Ntf", @@ -131,6 +135,8 @@ local ProtoMsgType = { [2729914669] = "LevelFundClaimedRsp", [2731281392] = "MailExtractReq", [2731283225] = "MailExtractRsp", + [2740236933] = "SevenDaysTaskReq", + [2740238766] = "SevenDaysTaskRsp", [2772586812] = "DebugPowerReq", [2772588645] = "DebugPowerRsp", [2806041093] = "ChapterDoubleRewardReq", @@ -160,6 +166,8 @@ local ProtoMsgType = { [3137379205] = "ActPayRsp", [3190730044] = "KickOutNtf", [3197501935] = "ArenaBountyBoughtNtf", + [3224230499] = "SevenDayTaskRewardReq", + [3224232332] = "SevenDayTaskRewardRsp", [3309820798] = "HeroPutOnReq", [3309822631] = "HeroPutOnRsp", [3341173994] = "BountyBoughtNtf", @@ -189,6 +197,8 @@ local ProtoMsgType = { [3624439233] = "NewMailNtf", [3629950931] = "PVPStageRewardReq", [3629952764] = "PVPStageRewardRsp", + [3634156164] = "ActivityExchangeReq", + [3634157997] = "ActivityExchangeRsp", [3750411183] = "EquipWearReq", [3750413016] = "EquipWearRsp", [3757169544] = "BountyRewardReq", @@ -219,6 +229,8 @@ local ProtoMsgType = { [4192051877] = "DungeonSweepRsp", [4195650791] = "TriggerWeaponArmorGiftReq", [4195652624] = "TriggerWeaponArmorGiftRsp", + [4234787821] = "SevenDaysScoreRewardReq", + [4234789654] = "SevenDaysScoreRewardRsp", [4250417467] = "PlayerInfoReq", [4250419300] = "PlayerInfoRsp", [4256333947] = "ExistReq", @@ -329,6 +341,8 @@ local ProtoMsgType = { SummonWishClaimRsp = 2258628591, ChapterBoxRewardReq = 2285872137, ChapterBoxRewardRsp = 2285873970, + SevenDaysReq = 2339018130, + SevenDaysRsp = 2339019963, MailCycleReq = 2429586383, MailCycleRsp = 2429588216, SignClaimedReq = 2431353944, @@ -347,6 +361,8 @@ local ProtoMsgType = { ChapterDailyChallengeStartRsp = 2553353804, MailListReq = 2581180989, MailListRsp = 2581182822, + SevenDayRewardReq = 2620369240, + SevenDayRewardRsp = 2620371073, SignReCheckinReq = 2660643921, SignReCheckinRsp = 2660645754, TriggerGrowUpGift2Ntf = 2706989220, @@ -356,6 +372,8 @@ local ProtoMsgType = { LevelFundClaimedRsp = 2729914669, MailExtractReq = 2731281392, MailExtractRsp = 2731283225, + SevenDaysTaskReq = 2740236933, + SevenDaysTaskRsp = 2740238766, DebugPowerReq = 2772586812, DebugPowerRsp = 2772588645, ChapterDoubleRewardReq = 2806041093, @@ -385,6 +403,8 @@ local ProtoMsgType = { ActPayRsp = 3137379205, KickOutNtf = 3190730044, ArenaBountyBoughtNtf = 3197501935, + SevenDayTaskRewardReq = 3224230499, + SevenDayTaskRewardRsp = 3224232332, HeroPutOnReq = 3309820798, HeroPutOnRsp = 3309822631, BountyBoughtNtf = 3341173994, @@ -414,6 +434,8 @@ local ProtoMsgType = { NewMailNtf = 3624439233, PVPStageRewardReq = 3629950931, PVPStageRewardRsp = 3629952764, + ActivityExchangeReq = 3634156164, + ActivityExchangeRsp = 3634157997, EquipWearReq = 3750411183, EquipWearRsp = 3750413016, BountyRewardReq = 3757169544, @@ -444,6 +466,8 @@ local ProtoMsgType = { DungeonSweepRsp = 4192051877, TriggerWeaponArmorGiftReq = 4195650791, TriggerWeaponArmorGiftRsp = 4195652624, + SevenDaysScoreRewardReq = 4234787821, + SevenDaysScoreRewardRsp = 4234789654, PlayerInfoReq = 4250417467, PlayerInfoRsp = 4250419300, ExistReq = 4256333947, @@ -554,6 +578,8 @@ local ProtoMsgType = { SummonWishClaimRsp = "SummonWishClaimRsp", ChapterBoxRewardReq = "ChapterBoxRewardReq", ChapterBoxRewardRsp = "ChapterBoxRewardRsp", + SevenDaysReq = "SevenDaysReq", + SevenDaysRsp = "SevenDaysRsp", MailCycleReq = "MailCycleReq", MailCycleRsp = "MailCycleRsp", SignClaimedReq = "SignClaimedReq", @@ -572,6 +598,8 @@ local ProtoMsgType = { ChapterDailyChallengeStartRsp = "ChapterDailyChallengeStartRsp", MailListReq = "MailListReq", MailListRsp = "MailListRsp", + SevenDayRewardReq = "SevenDayRewardReq", + SevenDayRewardRsp = "SevenDayRewardRsp", SignReCheckinReq = "SignReCheckinReq", SignReCheckinRsp = "SignReCheckinRsp", TriggerGrowUpGift2Ntf = "TriggerGrowUpGift2Ntf", @@ -581,6 +609,8 @@ local ProtoMsgType = { LevelFundClaimedRsp = "LevelFundClaimedRsp", MailExtractReq = "MailExtractReq", MailExtractRsp = "MailExtractRsp", + SevenDaysTaskReq = "SevenDaysTaskReq", + SevenDaysTaskRsp = "SevenDaysTaskRsp", DebugPowerReq = "DebugPowerReq", DebugPowerRsp = "DebugPowerRsp", ChapterDoubleRewardReq = "ChapterDoubleRewardReq", @@ -610,6 +640,8 @@ local ProtoMsgType = { ActPayRsp = "ActPayRsp", KickOutNtf = "KickOutNtf", ArenaBountyBoughtNtf = "ArenaBountyBoughtNtf", + SevenDayTaskRewardReq = "SevenDayTaskRewardReq", + SevenDayTaskRewardRsp = "SevenDayTaskRewardRsp", HeroPutOnReq = "HeroPutOnReq", HeroPutOnRsp = "HeroPutOnRsp", BountyBoughtNtf = "BountyBoughtNtf", @@ -639,6 +671,8 @@ local ProtoMsgType = { NewMailNtf = "NewMailNtf", PVPStageRewardReq = "PVPStageRewardReq", PVPStageRewardRsp = "PVPStageRewardRsp", + ActivityExchangeReq = "ActivityExchangeReq", + ActivityExchangeRsp = "ActivityExchangeRsp", EquipWearReq = "EquipWearReq", EquipWearRsp = "EquipWearRsp", BountyRewardReq = "BountyRewardReq", @@ -669,6 +703,8 @@ local ProtoMsgType = { DungeonSweepRsp = "DungeonSweepRsp", TriggerWeaponArmorGiftReq = "TriggerWeaponArmorGiftReq", TriggerWeaponArmorGiftRsp = "TriggerWeaponArmorGiftRsp", + SevenDaysScoreRewardReq = "SevenDaysScoreRewardReq", + SevenDaysScoreRewardRsp = "SevenDaysScoreRewardRsp", PlayerInfoReq = "PlayerInfoReq", PlayerInfoRsp = "PlayerInfoRsp", ExistReq = "ExistReq", diff --git a/lua/app/ui/activity/act_sprint_summon_all/act_main_ui.lua b/lua/app/ui/activity/act_sprint_summon_all/act_main_ui.lua index f2439b8b..cb275118 100644 --- a/lua/app/ui/activity/act_sprint_summon_all/act_main_ui.lua +++ b/lua/app/ui/activity/act_sprint_summon_all/act_main_ui.lua @@ -14,10 +14,10 @@ local PAGE_BTN_LIGHT = { "act_common_btn_28_1", } local PAGE_BTN_DESC = { - "ACT_GOGOGO_DESC_1", - "ACT_GOGOGO_DESC_10", - "ACT_GOGOGO_DESC_11", "ACT_GOGOGO_DESC_20", + "ACT_GOGOGO_DESC_11", + "ACT_GOGOGO_DESC_10", + "ACT_GOGOGO_DESC_1", } function ActMainUI:showCommonBG() diff --git a/lua/app/ui/activity/common/act_base_ui.lua b/lua/app/ui/activity/common/act_base_ui.lua index b3219693..0326edf3 100755 --- a/lua/app/ui/activity/common/act_base_ui.lua +++ b/lua/app/ui/activity/common/act_base_ui.lua @@ -1,5 +1,7 @@ local ActBaseUI = class("ActBaseUI", BaseUI) +local ACT_PAGE_BTNS_COMP = "app/ui/activity/common/comp/act_page_btns_comp" + function ActBaseUI:ctor(params) self.page = params.page or 1 self.ActConst = self:getActConst() @@ -38,7 +40,7 @@ function ActBaseUI:_display() self.titleTx = uiMap["act_main_ui.top.title_tx"] self.helpBtn = uiMap["act_main_ui.title_bg.help_btn"] self.timeTx = uiMap["act_main_ui.top.time_bg.time_tx"] - self.pageBtnsCompObj = uiMap["act_main_ui.bottom.page_btns_comp"] + self.pageBtnsCompObj = uiMap["act_main_ui.bottom.act_page_btns_comp"] self.disableBg = uiMap["act_main_ui.disable_bg"] self.disableBg:setActive(false) @@ -271,7 +273,7 @@ function ActBaseUI:refreshPageBtns() end if self.pageBtnsCompObj then - self.pageBtnsComp = self.pageBtnsCompObj:addLuaComponent(GConst.TYPEOF_LUA_CLASS.PAGE_BTNS_COMP) + self.pageBtnsComp = self.pageBtnsCompObj:addLuaComponent(ACT_PAGE_BTNS_COMP) self.pageBtnsComp:refresh(self.pageBtnInfos) end diff --git a/lua/app/ui/activity/common/cell/act_page_btn_cell.lua b/lua/app/ui/activity/common/cell/act_page_btn_cell.lua new file mode 100755 index 00000000..28ccf48d --- /dev/null +++ b/lua/app/ui/activity/common/cell/act_page_btn_cell.lua @@ -0,0 +1,40 @@ +local PageBtnCell = class("PageBtnCell", BaseCell) + +function PageBtnCell:init() + local uiMap = self:getUIMap() + self.imgIcon = uiMap["page_btn_cell.img_icon"] + self.txDesc = uiMap["page_btn_cell.tx_desc"] + + self.redPosX = 32 + self.redPosY = 20 + self.redScale = 1 +end + +function PageBtnCell:setRedPointPos(posX, posY, scale) + self.redPosX = posX or self.redPosX + self.redPosY = posY or self.redPosY + self.redScale = scale or self.redScale +end + +function PageBtnCell:refresh(info) + local atlas = info.atlas + local icon = info.icon + local desc = info.desc + local redPoint = info.redPoint + local callback = info.callback + + self:getBaseObject():getGameObject().name = icon + self.imgIcon:setSprite(atlas, icon, function() + self.imgIcon:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):SetNativeSize() + end) + self.txDesc:setText(desc) + self:addClickListener(callback) + + if redPoint then + self:getBaseObject():addRedPoint(self.redPosX, self.redPosY, self.redScale) + else + self:getBaseObject():removeRedPoint() + end +end + +return PageBtnCell \ No newline at end of file diff --git a/lua/app/ui/activity/common/cell/act_page_btn_cell.lua.meta b/lua/app/ui/activity/common/cell/act_page_btn_cell.lua.meta new file mode 100644 index 00000000..5309b06b --- /dev/null +++ b/lua/app/ui/activity/common/cell/act_page_btn_cell.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9605cd038397d4de5b990399ca37e57a +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/activity/common/comp/act_page_btns_comp.lua b/lua/app/ui/activity/common/comp/act_page_btns_comp.lua new file mode 100755 index 00000000..d4d45ecb --- /dev/null +++ b/lua/app/ui/activity/common/comp/act_page_btns_comp.lua @@ -0,0 +1,41 @@ +local PageBtnsComp = class("PageBtnsComp", LuaComponent) + +local PAGE_BTN_CELL = "app/ui/activity/common/cell/act_page_btn_cell" + +function PageBtnsComp:init() + local uiMap = self:getUIMap() + self.scrollrect = uiMap["act_page_btns_comp.scrollrect"] +end + +function PageBtnsComp:setRedPointPos(posX, posY, scale) + self.redPosX = posX + self.redPosY = posY + self.redScale = scale +end + +function PageBtnsComp:refresh(list, index) + self.list = list or {} + if not self.scrollRect then + self.scrollRect = self.scrollrect:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE) + self.scrollRect:addInitCallback(function() + return PAGE_BTN_CELL + end) + self.scrollRect:addRefreshCallback(function(index, cell) + cell:setRedPointPos(self.redPosX, self.redPosY, self.redScale) + cell:refresh(self.list[index]) + end) + end + if self.scrollRect:getTotalCount() == nil or self.scrollRect:getTotalCount() <= 0 then + self.scrollRect:refillCells(#self.list) + elseif self.scrollRect:getTotalCount() ~= #self.list then + self.scrollRect:clearCells() + self.scrollRect:refillCells(#self.list) + else + self.scrollRect:updateAllCell() + end + if index then + self.scrollRect:moveToIndex(index) + end +end + +return PageBtnsComp \ No newline at end of file diff --git a/lua/app/ui/activity/common/comp/act_page_btns_comp.lua.meta b/lua/app/ui/activity/common/comp/act_page_btns_comp.lua.meta new file mode 100644 index 00000000..3a5956e9 --- /dev/null +++ b/lua/app/ui/activity/common/comp/act_page_btns_comp.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f6bb8065a515748e3b3b5f8d3c12ef19 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/arena/arena_recent_battle_ui.lua b/lua/app/ui/arena/arena_recent_battle_ui.lua index ea71ff69..1624fdf7 100644 --- a/lua/app/ui/arena/arena_recent_battle_ui.lua +++ b/lua/app/ui/arena/arena_recent_battle_ui.lua @@ -91,7 +91,7 @@ function ArenaRecentBattleUI:refreshRecord(obj, info) end uiMap["tx_name"]:setText(name) if info.win then - obj:setSprite(GConst.ATLAS_PATH.ACT_COMMON,"act_common_bg_9") + obj:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON,"act_common_bg_9") uiMap["tx_score"]:setText("+"..info.incr_score.."") -- uiMap["img_result"]:setSprite(GConst.ATLAS_PATH.ARENA, "arena_dec_2") if info.attacker then @@ -100,7 +100,7 @@ function ArenaRecentBattleUI:refreshRecord(obj, info) uiMap["tx_result"]:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_17)) end else - obj:setSprite(GConst.ATLAS_PATH.ACT_COMMON,"act_common_bg_8") + obj:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON,"act_common_bg_8") if info.incr_score == 0 then uiMap["tx_score"]:setText("-"..info.incr_score.."") else diff --git a/lua/app/ui/arena/cell/arena_rank_cell.lua b/lua/app/ui/arena/cell/arena_rank_cell.lua index 2fb711ea..ab42c22c 100644 --- a/lua/app/ui/arena/cell/arena_rank_cell.lua +++ b/lua/app/ui/arena/cell/arena_rank_cell.lua @@ -41,22 +41,22 @@ function ArenaRankCell:refresh(rank) self.txRank:setActive(false) self.imgRank:setActive(true) self.imgRank:setSprite(GConst.ATLAS_PATH.ARENA, "arena_ranking_1") - self.baseObject:setSprite(GConst.ATLAS_PATH.ACT_COMMON, "act_common_bg_2") + self.baseObject:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, "act_common_bg_2") elseif rank == 2 then self.txRank:setActive(false) self.imgRank:setActive(true) self.imgRank:setSprite(GConst.ATLAS_PATH.ARENA, "arena_ranking_2") - self.baseObject:setSprite(GConst.ATLAS_PATH.ACT_COMMON, "act_common_bg_3") + self.baseObject:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, "act_common_bg_3") elseif rank == 3 then self.txRank:setActive(false) self.imgRank:setActive(true) self.imgRank:setSprite(GConst.ATLAS_PATH.ARENA, "arena_ranking_3") - self.baseObject:setSprite(GConst.ATLAS_PATH.ACT_COMMON, "act_common_bg_4") + self.baseObject:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, "act_common_bg_4") else self.imgRank:setActive(false) self.txRank:setActive(true) self.txRank:setText(rank) - self.baseObject:setSprite(GConst.ATLAS_PATH.ACT_COMMON, "act_common_bg_8") + self.baseObject:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, "act_common_bg_8") end end diff --git a/lua/app/ui/common/cell/bounty_reward_cell.lua b/lua/app/ui/common/cell/bounty_reward_cell.lua index 92d06255..73368fba 100644 --- a/lua/app/ui/common/cell/bounty_reward_cell.lua +++ b/lua/app/ui/common/cell/bounty_reward_cell.lua @@ -27,9 +27,9 @@ end function BountyRewardCell:refresh(reward, isPro, isLock, showCheck) self:showCheck(showCheck) if isPro then - self.bg:setSprite(GConst.ATLAS_PATH.ACT_COMMON, "act_common_board_2") + self.bg:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, "act_common_board_2") else - self.bg:setSprite(GConst.ATLAS_PATH.ACT_COMMON, "act_common_board_1") + self.bg:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, "act_common_board_1") end if isLock then self.lock:setVisible(true) diff --git a/lua/app/ui/dungeon_rune/cell/rank_cell.lua b/lua/app/ui/dungeon_rune/cell/rank_cell.lua index fb17643f..a5892414 100644 --- a/lua/app/ui/dungeon_rune/cell/rank_cell.lua +++ b/lua/app/ui/dungeon_rune/cell/rank_cell.lua @@ -26,7 +26,7 @@ function RankCell:refresh(index, info) local imgRank = uiMap["act_rank_cell.img_rank"] if RANK_ICON[index] then imgRank:setVisible(true) - imgRank:setSprite(GConst.ATLAS_PATH.ACT_COMMON, RANK_ICON[index]) + imgRank:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, RANK_ICON[index]) uiMap["act_rank_cell.tx_rank"]:setText(GConst.EMPTY_STRING) else imgRank:setVisible(false) @@ -34,9 +34,9 @@ function RankCell:refresh(index, info) local imgBg = uiMap["act_rank_cell.bg"] if RANK_BG[index] then - imgBg:setSprite(GConst.ATLAS_PATH.ACT_COMMON, RANK_BG[index]) + imgBg:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, RANK_BG[index]) else - imgBg:setSprite(GConst.ATLAS_PATH.ACT_COMMON, RANK_BG[4]) + imgBg:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, RANK_BG[4]) end local txName = uiMap["act_rank_cell.tx_name"] diff --git a/lua/app/ui/dungeon_rune/dungeon_rune_rank_ui.lua b/lua/app/ui/dungeon_rune/dungeon_rune_rank_ui.lua index b0e54eb6..829e48ed 100644 --- a/lua/app/ui/dungeon_rune/dungeon_rune_rank_ui.lua +++ b/lua/app/ui/dungeon_rune/dungeon_rune_rank_ui.lua @@ -186,7 +186,7 @@ function DungeonRuneRankUI:refreshMyRankInfo() local imgRank = uiMap["dungeon_rune_rank_ui.bg.my_node.img_rank"] if RANK_ICON[rank] then imgRank:setVisible(true) - imgRank:setSprite(GConst.ATLAS_PATH.ACT_COMMON, RANK_ICON[rank]) + imgRank:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, RANK_ICON[rank]) rankObj:setText(GConst.EMPTY_STRING) else imgRank:setVisible(false) diff --git a/lua/app/ui/fund/cell/fund_chapter_cell.lua b/lua/app/ui/fund/cell/fund_chapter_cell.lua index 5e951ea6..95e6f4c5 100755 --- a/lua/app/ui/fund/cell/fund_chapter_cell.lua +++ b/lua/app/ui/fund/cell/fund_chapter_cell.lua @@ -64,6 +64,7 @@ function FundChapterCell:refresh(id, isLast) cell:showFrameAnimation() else cell:hideFrameAnimation() + cell:clearClickListener() end else cell:setActive(false) @@ -86,6 +87,7 @@ function FundChapterCell:refresh(id, isLast) cell:showFrameAnimation() else cell:hideFrameAnimation() + cell:clearClickListener() end else cell:setActive(false) diff --git a/lua/app/ui/shop/cell/daily_cell.lua b/lua/app/ui/shop/cell/daily_cell.lua index bbc89795..50250784 100755 --- a/lua/app/ui/shop/cell/daily_cell.lua +++ b/lua/app/ui/shop/cell/daily_cell.lua @@ -29,11 +29,12 @@ function DailyCell:refresh(id) end local cfg = DataManager.ShopData:getDailyConfig(self.id) + local maxCount = DataManager.ShopData:getDailyCount(self.id) local remainCount = math.max(0, DataManager.ShopData:getDailyRemainCount(self.id)) local adCount = cfg.limit_ad or 0 local cost = DataManager.ShopData:getDailyCost(self.id) - self.txLimit:setText(I18N:getGlobalText(I18N.GlobalConst.MALL_DESC_15) .. remainCount) + self.txLimit:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_GOGOGO_DESC_5, remainCount, maxCount)) if remainCount <= 0 then -- 告罄 @@ -41,7 +42,7 @@ function DailyCell:refresh(id) self.baseObject:setTouchEnable(false) self.baseObject:removeRedPoint() self.imgCost:setActive(false) - self.txCost:setText("" .. I18N:getGlobalText(I18N.GlobalConst.MALL_DESC_14) .. "") + self.txCost:setText("" .. I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_20) .. "") self.txCost:setAnchoredPositionX(0) self.txCost:setSizeDeltaX(150) elseif not cost or cost.num <= 0 then @@ -51,7 +52,7 @@ function DailyCell:refresh(id) self.baseObject:addRedPoint(84, 118, 1.2) -- 纯免费 self.imgCost:setActive(false) - self.txCost:setText(I18N:getGlobalText(I18N.GlobalConst.MALL_DESC_12)) + self.txCost:setText(I18N:getGlobalText(I18N.GlobalConst.FREE_DESC)) self.txCost:setAnchoredPositionX(0) else if SDKManager:isAdLoaded() then @@ -98,12 +99,12 @@ function DailyCell:refresh(id) if remainCount == 0 then return end - if not GFunc.checkCost(GFunc.getRewardId(cost), GFunc.getRewardNum(cost), true, BIReport.ITEM_GET_TYPE.SHOP_DAILY) then + if not GFunc.checkCost(GFunc.getRewardId(cost), GFunc.getRewardNum(cost), true) then return end if GFunc.getRewardId(cost) == GConst.ItemConst.ITEM_ID_GEM then local params = {} - params.content = I18N:getGlobalText(I18N.GlobalConst.MALL_DESC_13) + params.content = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_33) params.boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL params.showToday = GConst.MESSAGE_BOX_SHOW_TODAY.SHOP_DAILY params.okFunc = function() diff --git a/lua/app/ui/shop/cell/daily_main_cell.lua b/lua/app/ui/shop/cell/daily_main_cell.lua index 0a1edd14..2f348d0b 100755 --- a/lua/app/ui/shop/cell/daily_main_cell.lua +++ b/lua/app/ui/shop/cell/daily_main_cell.lua @@ -36,17 +36,9 @@ function DailyMainCell:init() return end self:onRefreshDaily(false) - - -- local params = {} - -- params.content = I18N:getGlobalText(I18N.GlobalConst.MALL_DESC_13) - -- params.boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL - -- params.showToday = GConst.MESSAGE_BOX_SHOW_TODAY.SHOP_DAILY - -- params.okFunc = function() - -- self:onRefreshDaily(false) - -- end - -- GFunc.showMessageBox(params) end end) + self.btnRefreshAd:addClickListener(function() if DataManager.ShopData:getDailyAdRefreshRemainCount() <= 0 then return @@ -59,7 +51,7 @@ end function DailyMainCell:updateTime() local remainTime = DataManager.ShopData:getDailyRefreshAutoTime() - self.txTime:setText(I18N:getGlobalText(I18N.GlobalConst.MALL_DESC_5, remainTime)) + self.txTime:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_22, remainTime)) if DataManager.ShopData:getDailyAdRefreshRemainCount() <= 0 then self.txTimeAd:setText(remainTime) end @@ -83,7 +75,7 @@ function DailyMainCell:refresh() GFunc.setAdsSprite(self.imgAd, true) self.btnRefreshAd:removeRedPoint() end - self.txAd:setText(I18N:getGlobalText(I18N.GlobalConst.REFRESH_DESC_1)) + self.txAd:setText(I18N:getGlobalText(I18N.GlobalConst.STR_REFRESH)) GFunc.centerImgAndTx(self.imgAd, self.txAd, 3) -- 免费/钻石 @@ -92,7 +84,7 @@ function DailyMainCell:refresh() self.btnRefresh:setTouchEnable(true) GFunc.setGrey(self.btnRefresh:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE), false) self.imgCost:setActive(false) - self.txCost:setText(I18N:getGlobalText(I18N.GlobalConst.REFRESH_DESC_2)) + self.txCost:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_10)) self.txCost:setAnchoredPositionX(0) self.txTimeCost:setText("(" .. DataManager.ShopData:getDailyFreeRefreshRemainCount() .. "/" .. DataManager.ShopData:getDailyRefreshFreeCount() .. ")") self.txFree:setText("") @@ -116,7 +108,7 @@ function DailyMainCell:refresh() self.imgCost:setActive(false) self.txCost:setText("") self.txTimeCost:setText("") - self.txFree:setText(I18N:getGlobalText(I18N.GlobalConst.REFRESH_DESC_2)) + self.txFree:setText(I18N:getGlobalText(I18N.GlobalConst.STR_REFRESH)) self.btnRefresh:removeRedPoint() end end diff --git a/lua/app/ui/shop/shop_comp.lua b/lua/app/ui/shop/shop_comp.lua index 119026ec..c461fdb8 100644 --- a/lua/app/ui/shop/shop_comp.lua +++ b/lua/app/ui/shop/shop_comp.lua @@ -124,22 +124,23 @@ function ShopComp:init() end function ShopComp:refresh(showIdx, noShowIdx) - if showIdx ~= nil then - if showIdx == ModuleManager.ShopManager.COMMERCE_TYPE.FORCE_SKIN then - self.curPage = PAGE_TYPE.SKIN - else - self.curPage = PAGE_TYPE.SHOP - end - end + -- if showIdx ~= nil then + -- if showIdx == ModuleManager.ShopManager.COMMERCE_TYPE.FORCE_SKIN then + -- self.curPage = PAGE_TYPE.SKIN + -- else + -- self.curPage = PAGE_TYPE.SHOP + -- end + -- end - if self.curPage == PAGE_TYPE.SHOP then - self:refreshShop(showIdx, noShowIdx) - elseif self.curPage == PAGE_TYPE.SKIN then - self:refreshSkin() - end + -- if self.curPage == PAGE_TYPE.SHOP then + -- self:refreshShop(showIdx, noShowIdx) + -- elseif self.curPage == PAGE_TYPE.SKIN then + -- self:refreshSkin() + -- end - self.btnShop:setSprite(GConst.ATLAS_PATH.COMMON, self.curPage == PAGE_TYPE.SHOP and "common_menu_6" or "common_menu_5") - self.btnSkin:setSprite(GConst.ATLAS_PATH.COMMON, self.curPage == PAGE_TYPE.SKIN and "common_menu_6" or "common_menu_5") + -- self.btnShop:setSprite(GConst.ATLAS_PATH.COMMON, self.curPage == PAGE_TYPE.SHOP and "common_menu_6" or "common_menu_5") + -- self.btnSkin:setSprite(GConst.ATLAS_PATH.COMMON, self.curPage == PAGE_TYPE.SKIN and "common_menu_6" or "common_menu_5") + self:refreshShop(showIdx, noShowIdx) -- if DataManager.ShopData:showRedPoint() then -- self.btnShop:addRedPoint(75, 23, 0.9) @@ -155,7 +156,7 @@ function ShopComp:refreshShop(showIdx, noShowIdx) self.scrollrectNode:setActive(true) self.scrollrectSkinNode:setActive(false) - self.showIdx = showIdx + self.showIdx = showIdx or self.showIdx self:updateList(noShowIdx) -- if self.showIdx then -- 指定跳转 @@ -224,7 +225,6 @@ function ShopComp:updateList(noShowIdx) self.rpPosY = nil end - function ShopComp:updateChapterList(offsetY) -- 没有新手礼包 if CS.BF.BFMain.IsShenhe then @@ -263,41 +263,41 @@ function ShopComp:updateChapterList(offsetY) return offsetY end -function ShopComp:updateCoreSoulCell(offsetY) - -- self.imgShopIcon:setSprite(GConst.ATLAS_PATH.ICON_ITEM, ModuleManager.ItemManager:getItemIcon(GConst.ItemConst.SOUL_SHOP_GOLD)) - -- self.txShopNum:setText(DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.SOUL_SHOP_GOLD)) - self.txShopNum:setText(I18N:getGlobalText(I18N.GlobalConst.CORE_SUMMON_DESC_21)) - self.coreSoulTitleBg:setActive(false) - self.coreSoulMainCell:setActive(false) +-- function ShopComp:updateCoreSoulCell(offsetY) +-- -- self.imgShopIcon:setSprite(GConst.ATLAS_PATH.ICON_ITEM, ModuleManager.ItemManager:getItemIcon(GConst.ItemConst.SOUL_SHOP_GOLD)) +-- -- self.txShopNum:setText(DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.SOUL_SHOP_GOLD)) +-- self.txShopNum:setText(I18N:getGlobalText(I18N.GlobalConst.CORE_SUMMON_DESC_21)) +-- self.coreSoulTitleBg:setActive(false) +-- self.coreSoulMainCell:setActive(false) - if DataManager.SummonData:getSummonShopSoulUnlock(3) then - self.soulSpine:setActive(true) - else - self.soulSpine:setActive(false) - end +-- if DataManager.SummonData:getSummonShopSoulUnlock(3) then +-- self.soulSpine:setActive(true) +-- else +-- self.soulSpine:setActive(false) +-- end - if not DataManager.ShopData:isCoreSoulOpen() then - return offsetY - end - self.coreSoulTitleBg:setActive(true) - self.coreSoulMainCell:setActive(true) - if self.showIdx == ModuleManager.ShopManager.COMMERCE_TYPE.CORE_SOUL_STORE then - self.beginPosY = math.abs(offsetY) - end - if self.rpPosY == nil then - self.rpPosY = DataManager.ShopData:hasCoreSoulRedPoint() and math.abs(offsetY) or nil - end +-- if not DataManager.ShopData:isCoreSoulOpen() then +-- return offsetY +-- end +-- self.coreSoulTitleBg:setActive(true) +-- self.coreSoulMainCell:setActive(true) +-- if self.showIdx == ModuleManager.ShopManager.COMMERCE_TYPE.CORE_SOUL_STORE then +-- self.beginPosY = math.abs(offsetY) +-- end +-- if self.rpPosY == nil then +-- self.rpPosY = DataManager.ShopData:hasCoreSoulRedPoint() and math.abs(offsetY) or nil +-- end - self.coreSoulTitleBg:setAnchoredPositionY(offsetY) - offsetY = offsetY - 75 - self.coreSoulMainCell:setAnchoredPositionY(offsetY) - offsetY = offsetY - 450 +-- self.coreSoulTitleBg:setAnchoredPositionY(offsetY) +-- offsetY = offsetY - 75 +-- self.coreSoulMainCell:setAnchoredPositionY(offsetY) +-- offsetY = offsetY - 450 - local cell = self.coreSoulMainCell:addLuaComponent(CORE_SOUL_MAIN_CELL) - cell:refresh() +-- local cell = self.coreSoulMainCell:addLuaComponent(CORE_SOUL_MAIN_CELL) +-- cell:refresh() - return offsetY -end +-- return offsetY +-- end function ShopComp:updateDailyCell(offsetY) self.dailyCell:setActive(false) diff --git a/lua/app/ui/sign/sign_main_ui.lua b/lua/app/ui/sign/sign_main_ui.lua index 1724f878..58562786 100755 --- a/lua/app/ui/sign/sign_main_ui.lua +++ b/lua/app/ui/sign/sign_main_ui.lua @@ -50,7 +50,7 @@ function SignMainUI:onLoadRootComplete() self.btnContent = uiMap["sign_main_ui.bottom.btns.viewport.content"] self.btns = {} self.txBtns = {} - for i = 1, table.nums(GConst.SignConst.SIGN_SHOW_PAGE) do + for i = 1, 6 do table.insert(self.btns, uiMap["sign_main_ui.bottom.btns.viewport.content.btn_" .. i]) table.insert(self.txBtns, uiMap["sign_main_ui.bottom.btns.viewport.content.btn_" .. i .. ".tx_desc"]) end @@ -76,7 +76,7 @@ function SignMainUI:onLoadRootComplete() end) self:bind(DataManager.SignMonthData, "isDirty", function() self:refreshRedPoint() - end) + end) end function SignMainUI:initComps() @@ -137,8 +137,8 @@ end function SignMainUI:switchOtherPage() if DataManager.SignWeekData:showRedPoint() then self.curPage = GConst.SignConst.SIGN_SHOW_PAGE.WEEK - elseif DataManager.SignMonthData:showRedPoint() then - self.curPage = GConst.SignConst.SIGN_SHOW_PAGE.MONTH + -- elseif DataManager.SignMonthData:showRedPoint() then + -- self.curPage = GConst.SignConst.SIGN_SHOW_PAGE.MONTH end if self.curPage ~= nil then @@ -200,17 +200,19 @@ end function SignMainUI:isOpen(type) if type == GConst.SignConst.SIGN_SHOW_PAGE.WEEK then return DataManager.SignWeekData:isOpen() - elseif type == GConst.SignConst.SIGN_SHOW_PAGE.MONTH then - return DataManager.SignMonthData:isOpen() + -- elseif type == GConst.SignConst.SIGN_SHOW_PAGE.MONTH then + -- return DataManager.SignMonthData:isOpen() end + return false end function SignMainUI:hasRedPoint(type) if type == GConst.SignConst.SIGN_SHOW_PAGE.WEEK then return DataManager.SignWeekData:showRedPoint() - elseif type == GConst.SignConst.SIGN_SHOW_PAGE.MONTH then - return DataManager.SignMonthData:showRedPoint() + -- elseif type == GConst.SignConst.SIGN_SHOW_PAGE.MONTH then + -- return DataManager.SignMonthData:showRedPoint() end + return false end return SignMainUI \ No newline at end of file diff --git a/lua/app/ui/summon/summon_main_ui.lua b/lua/app/ui/summon/summon_main_ui.lua index 77fa8c37..3dd5854e 100755 --- a/lua/app/ui/summon/summon_main_ui.lua +++ b/lua/app/ui/summon/summon_main_ui.lua @@ -214,9 +214,9 @@ end function SummonMainUI:refreshPageBtn() for i = 1, 2 do if self.page == i then - self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.ACT_COMMON, "act_common_btn_" .. i .."_1") + self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, "act_common_btn_" .. i .."_1") else - self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.ACT_COMMON, "act_common_btn_" .. i .."_2") + self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, "act_common_btn_" .. i .."_2") end end end diff --git a/lua/app/userdata/chapter/chapter_data.lua b/lua/app/userdata/chapter/chapter_data.lua index 87d93fd4..753cf03e 100644 --- a/lua/app/userdata/chapter/chapter_data.lua +++ b/lua/app/userdata/chapter/chapter_data.lua @@ -566,7 +566,7 @@ end function ChapterData:getChapterNameXYMode(chapterId) local chapterCfg = self:getChapterCfg()[chapterId] if chapterCfg then - return string.format("%s-%s",chapterCfg.chapter_id, chapterCfg.stage_num) + return string.format("%s-%s", chapterCfg.chapter, chapterCfg.stage) end return chapterId end diff --git a/lua/app/userdata/shop/shop_data.lua b/lua/app/userdata/shop/shop_data.lua index 1ad2e0df..6894f342 100644 --- a/lua/app/userdata/shop/shop_data.lua +++ b/lua/app/userdata/shop/shop_data.lua @@ -1,49 +1,49 @@ local ShopData = class("ShopData", BaseData) function ShopData:ctor() - self.data.isDirty = true + self.data.isDirty = true self.data.isThirdPayGiftDirty = false end function ShopData:clear() - self.firstRechargePoped = nil - DataManager:unregisterCrossDayFunc("ShopData") + self.firstRechargePoped = nil + DataManager:unregisterCrossDayFunc("ShopData") end function ShopData:setDirty() - self.data.isDirty = not self.data.isDirty + self.data.isDirty = not self.data.isDirty end function ShopData:init() - -- 章节礼包 - self.chapterInfo = {} - -- 魂芯商店 - self.coreSoulAdTimes = 0 - self.coreSoulNormalRewardTimes = 0 - self.coreSoulEliteRewardTimes = 0 - -- 每日商店 - self.dailyInfo = {} - -- 金币商店 - self.goldInfo = {} + -- 章节礼包 + self.chapterInfo = {} + -- 魂芯商店 + self.coreSoulAdTimes = 0 + self.coreSoulNormalRewardTimes = 0 + self.coreSoulEliteRewardTimes = 0 + -- 每日商店 + self.dailyInfo = {} + -- 金币商店 + self.goldInfo = {} - --@TODO 2025-09-24 15:12:35 - self.goldInfo.count = 0 + --@TODO 2025-09-24 15:12:35 + self.goldInfo.count = 0 - DataManager:registerCrossDayFunc("ShopData", function() - self.coreSoulAdTimes = 0 - if self.dailyInfo then - self.dailyInfo.refresh_count = 0 - self.dailyInfo.ad_refresh_count = 0 - end - if self.goldInfo then - self.goldInfo.count = 0 - end - if self.emblemInfo then - self.emblemInfo.today_count = {} - end - self.vitAdCount = 0 - self.vitGemCount = 0 - self:setDirty() - end) + DataManager:registerCrossDayFunc("ShopData", function() + self.coreSoulAdTimes = 0 + if self.dailyInfo then + self.dailyInfo.refresh_count = 0 + self.dailyInfo.ad_refresh_count = 0 + end + if self.goldInfo then + self.goldInfo.count = 0 + end + if self.emblemInfo then + self.emblemInfo.today_count = {} + end + self.vitAdCount = 0 + self.vitGemCount = 0 + self:setDirty() + end) end function ShopData:isOpen(showToast) @@ -55,9 +55,9 @@ function ShopData:isOpen(showToast) end function ShopData:isCoreSoulOpen(showToast) - if not self:isOpen(showToast) then - return false - end + if not self:isOpen(showToast) then + return false + end if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.CORE_BOX, not showToast) then return false end @@ -66,33 +66,33 @@ function ShopData:isCoreSoulOpen(showToast) end function ShopData:hasCoreSoulRedPoint() - if not self:isCoreSoulOpen() then - return false - end + if not self:isCoreSoulOpen() then + return false + end - -- 广告次数 - local adCount = self:getCoreSoulAdRemainTimes() - if adCount > 0 then - return true - end - -- 普通道具次数 - local normalItemId = self:getCoreSoulCostItemId( GConst.ShopConst.CORE_SOUL_TYPE.NORMAL) - if GFunc.checkCost(normalItemId, 1, false) then - return true - end - -- 史诗道具次数 - local eliteItemId = self:getCoreSoulCostItemId( GConst.ShopConst.CORE_SOUL_TYPE.ELITE) - if GFunc.checkCost(eliteItemId, 1, false) then - return true - end + -- 广告次数 + local adCount = self:getCoreSoulAdRemainTimes() + if adCount > 0 then + return true + end + -- 普通道具次数 + local normalItemId = self:getCoreSoulCostItemId( GConst.ShopConst.CORE_SOUL_TYPE.NORMAL) + if GFunc.checkCost(normalItemId, 1, false) then + return true + end + -- 史诗道具次数 + local eliteItemId = self:getCoreSoulCostItemId( GConst.ShopConst.CORE_SOUL_TYPE.ELITE) + if GFunc.checkCost(eliteItemId, 1, false) then + return true + end - return false + return false end function ShopData:isDailyOpen(showToast) - if not self:isOpen(showToast) then - return false - end + if not self:isOpen(showToast) then + return false + end if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MALL_DAILY, not showToast) then return false end @@ -101,350 +101,360 @@ function ShopData:isDailyOpen(showToast) end function ShopData:showRedPoint() - if not self:isOpen() then - return false - end - -- return self:hasCoreSoulRedPoint() or self:hasDailyRedPoint() or self:hasGoldRedPoint(true) or DataManager.CollectionData:hasSummonRedPoint() - return self:hasDailyRedPoint() or self:hasGoldRedPoint(true) + if not self:isOpen() then + return false + end + -- return self:hasCoreSoulRedPoint() or self:hasDailyRedPoint() or self:hasGoldRedPoint(true) or DataManager.CollectionData:hasSummonRedPoint() + return self:hasDailyRedPoint() or self:hasGoldRedPoint(true) end function ShopData:hasDailyRedPoint() - if not self:isDailyOpen() then - return false - end + if not self:isDailyOpen() then + return false + end - if not self:getLoginDailyRp() then - return false - end + if not self:getLoginDailyRp() then + return false + end - for id, cfg in ipairs(self:getDailyConfig()) do - if not cfg.cost then - local remainCount = self:getDailyRemainFreeCount(id) - if remainCount > 0 then - return true - end - end - end - return false + for id, cfg in ipairs(self:getDailyConfig()) do + if not cfg.cost then + local remainCount = self:getDailyRemainFreeCount(id) + if remainCount > 0 then + return true + end + end + end + return false end --是否只包含免费,不包含广告 function ShopData:hasGoldRedPoint(isOnlyFree) - if not SDKManager:isAdLoaded() then - return false - end + if not SDKManager:isAdLoaded() then + return false + end - if not self:getLoginGoldRp() then - return false - end + if not self:getLoginGoldRp() then + return false + end - for id, info in ipairs(self:getGoldConfig()) do - if self:getGoldBuyRemainCountByFree(id) > 0 then - return true - end - if not isOnlyFree then - if self:getGoldBuyRemainCountByAd(id) > 0 then - return true - end - end - end - return false + for id, info in ipairs(self:getGoldConfig()) do + if self:getGoldBuyRemainCountByFree(id) > 0 then + return true + end + if not isOnlyFree then + if self:getGoldBuyRemainCountByAd(id) > 0 then + return true + end + end + end + return false end function ShopData:getActGiftConfig(id) - if id then - return ConfigManager:getConfig("act_gift")[id] - else - return ConfigManager:getConfig("act_gift") - end + if id then + return ConfigManager:getConfig("act_gift")[id] + else + return ConfigManager:getConfig("act_gift") + end end function ShopData:getActGiftIdsByType(giftType) - local ids = {} - for id, info in pairs(self:getActGiftConfig()) do - if info.type == giftType then - table.insert(ids, id) - end - end - table.sort(ids, function(a, b) return a < b end) - return ids + local ids = {} + for id, info in pairs(self:getActGiftConfig()) do + if info.type == giftType then + table.insert(ids, id) + end + end + table.sort(ids, function(a, b) return a < b end) + return ids end -- 章节礼包 ---------------------------------------------------------------------------------------------------------------------------------------- function ShopData:refreshChapterShop(data) - if not data then - return - end - if EDITOR_MODE then - Logger.logHighlight("ShopData 章节礼包") - Logger.printTable(data) - end + if not data then + return + end + if EDITOR_MODE then + Logger.logHighlight("ShopData 章节礼包") + Logger.printTable(data) + end - self.chapterInfo = data.bought - self:setDirty() + self.chapterInfo = data.bought + self:setDirty() end function ShopData:getChapterGiftConfig(id) - if id then - return ConfigManager:getConfig("mall_chapter")[id] - else - return ConfigManager:getConfig("mall_chapter") - end + if id then + return ConfigManager:getConfig("mall_chapter")[id] + else + return ConfigManager:getConfig("mall_chapter") + end end -- 获取要展示的章节礼包id function ShopData:getShowChapterGiftIds() - local ids = {} + local ids = {} - for id, info in ipairs(self:getChapterGiftConfig()) do - if DataManager.ChapterData:getChapterPassed(info.chapter_id) and not self:isBoughtChapterGift(id) then - table.insert(ids, id) - end - end - table.sort(ids, function(a, b) return a < b end) + for id, info in ipairs(self:getChapterGiftConfig()) do + if DataManager.ChapterData:getChapterPassed(info.chapter_id) and not self:isBoughtChapterGift(id) then + table.insert(ids, id) + end + end + table.sort(ids, function(a, b) return a < b end) - return ids + return ids end -- 是否购买了章节礼包 function ShopData:isBoughtChapterGift(id) - return self.chapterInfo[id] and self.chapterInfo[id] > 0 + return self.chapterInfo[id] and self.chapterInfo[id] > 0 end -- 购买章节礼包成功 function ShopData:onBuyChapterGiftSuccess(id) - self.chapterInfo[id] = (self.chapterInfo[id] or 0) + 1 - self:setDirty() + self.chapterInfo[id] = (self.chapterInfo[id] or 0) + 1 + self:setDirty() end -- 魂芯商店 ---------------------------------------------------------------------------------------------------------------------------------------- function ShopData:refreshCoreSoulShop(data) - if not data then - return - end - if not data.summons then - return - end - if EDITOR_MODE then - Logger.logHighlight("ShopData 魂芯商店") - Logger.printTable(data.summons) - end + if not data then + return + end + if not data.summons then + return + end + if EDITOR_MODE then + Logger.logHighlight("ShopData 魂芯商店") + Logger.printTable(data.summons) + end - local coreSoulInfo = data.summons or {} - local normalInfo = coreSoulInfo[GConst.ShopConst.CORE_SOUL_TYPE.NORMAL] or {} - local eliteInfo = coreSoulInfo[GConst.ShopConst.CORE_SOUL_TYPE.ELITE] or {} + local coreSoulInfo = data.summons or {} + local normalInfo = coreSoulInfo[GConst.ShopConst.CORE_SOUL_TYPE.NORMAL] or {} + local eliteInfo = coreSoulInfo[GConst.ShopConst.CORE_SOUL_TYPE.ELITE] or {} - self.coreSoulAdTimes = normalInfo.ad_count or 0 - self.coreSoulNormalRewardTimes = normalInfo.trigger_count or 0 -- 普通宝箱大奖累计次数 - self.coreSoulEliteRewardTimes = eliteInfo.trigger_count or 0 -- 史诗宝箱大奖累计次数 + self.coreSoulAdTimes = normalInfo.ad_count or 0 + self.coreSoulNormalRewardTimes = normalInfo.trigger_count or 0 -- 普通宝箱大奖累计次数 + self.coreSoulEliteRewardTimes = eliteInfo.trigger_count or 0 -- 史诗宝箱大奖累计次数 - self:setDirty() + self:setDirty() end -- 魂芯广告使用次数 function ShopData:getCoreSoulAdTimes() - return self.coreSoulAdTimes or 0 + return self.coreSoulAdTimes or 0 end -- 魂芯广告剩余次数 function ShopData:getCoreSoulAdRemainTimes() - local remainTimes = self:getCoreSoulAdMaxTimes() - self:getCoreSoulAdTimes() - if remainTimes < 0 then - remainTimes = 0 - end - return remainTimes + local remainTimes = self:getCoreSoulAdMaxTimes() - self:getCoreSoulAdTimes() + if remainTimes < 0 then + remainTimes = 0 + end + return remainTimes end -- 魂芯广告上限次数 function ShopData:getCoreSoulAdMaxTimes() - return GFunc.getConstIntValue("summon_core_adtimes_1") + return GFunc.getConstIntValue("summon_core_adtimes_1") end -- 魂芯大奖配置需要次数 function ShopData:getCoreSoulBigRewardConstTimes(idx) - local cfg = ConfigManager:getConfig("summon_core") - return cfg[idx].guarantee_times or 0 + local cfg = ConfigManager:getConfig("summon_core") + return cfg[idx].guarantee_times or 0 end -- 魂芯大奖需要次数 function ShopData:getCoreSoulBigRewardTimes(idx) - local limit = self:getCoreSoulBigRewardConstTimes(idx) - if limit == nil then - limit = 66 - end - if idx == GConst.ShopConst.CORE_SOUL_TYPE.NORMAL then - return limit - (self.coreSoulNormalRewardTimes or 0) - else - return limit - (self.coreSoulEliteRewardTimes or 0) - end + local limit = self:getCoreSoulBigRewardConstTimes(idx) + if limit == nil then + limit = 66 + end + if idx == GConst.ShopConst.CORE_SOUL_TYPE.NORMAL then + return limit - (self.coreSoulNormalRewardTimes or 0) + else + return limit - (self.coreSoulEliteRewardTimes or 0) + end end --- 魂芯抽奖消耗道具id function ShopData:getCoreSoulCostItemId(idx) - local cfgInfo = ConfigManager:getConfig("summon_core")[idx] - local cost = cfgInfo.item_cost - return cost and cost.id + local cfgInfo = ConfigManager:getConfig("summon_core")[idx] + local cost = cfgInfo.item_cost + return cost and cost.id end --- 魂芯抽奖单抽消耗钻石数量 function ShopData:getCoreSoulSingleCostGemNum(idx) - local cfgInfo = ConfigManager:getConfig("summon_core")[idx] - local cost = cfgInfo.cost - return cost and cost.num + local cfgInfo = ConfigManager:getConfig("summon_core")[idx] + local cost = cfgInfo.cost + return cost and cost.num end --- 魂芯抽奖10连抽消耗钻石数量 function ShopData:getCoreSoulMultiCostGemNum(idx) - local cfgInfo = ConfigManager:getConfig("summon_core")[idx] - local cost = cfgInfo.cost_ten - return cost and cost.num + local cfgInfo = ConfigManager:getConfig("summon_core")[idx] + local cost = cfgInfo.cost_ten + return cost and cost.num end function ShopData:onBuyCoreSoulBoxSuccess(idx, free, times, triggerCount) - if idx == GConst.ShopConst.CORE_SOUL_TYPE.NORMAL then - if free then - self.coreSoulAdTimes = self.coreSoulAdTimes + times - end - self.coreSoulNormalRewardTimes = triggerCount - else - self.coreSoulEliteRewardTimes = triggerCount - end - self:setDirty() + if idx == GConst.ShopConst.CORE_SOUL_TYPE.NORMAL then + if free then + self.coreSoulAdTimes = self.coreSoulAdTimes + times + end + self.coreSoulNormalRewardTimes = triggerCount + else + self.coreSoulEliteRewardTimes = triggerCount + end + self:setDirty() end -- 每日商店 ---------------------------------------------------------------------------------------------------------------------------------------- function ShopData:refreshDailyShop(data) - if not data then - return - end - if EDITOR_MODE then - Logger.logHighlight("ShopData 每日商店") - Logger.printTable(data) - end + if not data then + return + end + if EDITOR_MODE then + Logger.logHighlight("ShopData 每日商店") + Logger.printTable(data) + end - self.dailyInfo = data - self:setDirty() + self.dailyInfo = data + self:setDirty() end function ShopData:getDailyConfig(id) - if id then - return ConfigManager:getConfig("mall_daily_store")[id] - else - return ConfigManager:getConfig("mall_daily_store") - end + if id then + return ConfigManager:getConfig("mall_daily_store")[id] + else + return ConfigManager:getConfig("mall_daily_store") + end end -- 获取每日免费刷新次数 function ShopData:getDailyRefreshFreeCount() - return GFunc.getConstIntValue("mall_daily_free_refresh") or 0 + return GFunc.getConstIntValue("mall_daily_free_refresh") or 0 end -- 获取每日广告刷新次数 function ShopData:getDailyRefreshAdCount() - return GFunc.getConstIntValue("mall_daily_ad_refresh") or 0 + return GFunc.getConstIntValue("mall_daily_ad_refresh") or 0 end -- 获取每日道具刷新次数 function ShopData:getDailyRefreshCostCount() - return GFunc.getConstIntValue("mall_daily_refresh") or 0 + return GFunc.getConstIntValue("mall_daily_refresh") or 0 end -- 获取刷新道具 function ShopData:getDailyRefreshCost() - return GFunc.getConstCost("mall_daily_refresh_cost") + return GFunc.getConstCost("mall_daily_refresh_cost") end -- 获取每日商店今日免费+钻石刷新次数 function ShopData:getDailyRefreshCount() - return self.dailyInfo.refresh_count or 0 + return self.dailyInfo.refresh_count or 0 end -- 获取每日商店今日广告刷新次数 function ShopData:getDailyAdRefreshCount() - return self.dailyInfo.ad_refresh_count or 0 + return self.dailyInfo.ad_refresh_count or 0 end function ShopData:getDailyFreeRefreshRemainCount() - return math.max(self:getDailyRefreshFreeCount() - self:getDailyRefreshCount(), 0) + return math.max(self:getDailyRefreshFreeCount() - self:getDailyRefreshCount(), 0) end function ShopData:getDailyAdRefreshRemainCount() - return math.max(self:getDailyRefreshAdCount() - self:getDailyAdRefreshCount(), 0) + return math.max(self:getDailyRefreshAdCount() - self:getDailyAdRefreshCount(), 0) end function ShopData:getDailyCostRefreshRemainCount() - if self:getDailyFreeRefreshRemainCount() <= 0 then - return math.max(self:getDailyRefreshCostCount() - (self:getDailyRefreshCount() - self:getDailyRefreshFreeCount()), 0) - else - return self:getDailyRefreshCostCount() - end + if self:getDailyFreeRefreshRemainCount() <= 0 then + return math.max(self:getDailyRefreshCostCount() - (self:getDailyRefreshCount() - self:getDailyRefreshFreeCount()), 0) + else + return self:getDailyRefreshCostCount() + end end -- 获取自动刷新倒计时 function ShopData:getDailyRefreshAutoTime() - return Time:formatNumTimeStr(Time:getTodaySurplusTime()) + return Time:formatNumTimeStr(Time:getTodaySurplusTime()) end function ShopData:getDailyReward(id) - if self.dailyInfo.grids then - return self.dailyInfo.grids[id] - end + if self.dailyInfo.grids then + return self.dailyInfo.grids[id] + end end function ShopData:getDailyCost(id) - if self.dailyInfo.grids_cost then - return self.dailyInfo.grids_cost[id] - end + if self.dailyInfo.grids_cost then + return self.dailyInfo.grids_cost[id] + end end function ShopData:getDailyIdx(id) - if self.dailyInfo.grids_index then - return self.dailyInfo.grids_index[id] - end + if self.dailyInfo.grids_index then + return self.dailyInfo.grids_index[id] + end end -- 剩余次数,包括免费与广告免费 function ShopData:getDailyRemainCount(id) - local cfg = self:getDailyConfig(id) - if not cfg then - return 0 - end + local cfg = self:getDailyConfig(id) + if not cfg then + return 0 + end - local count = 0 - if self.dailyInfo.daily_count then - count = self.dailyInfo.daily_count[id] or 0 - end + local count = 0 + if self.dailyInfo.daily_count then + count = self.dailyInfo.daily_count[id] or 0 + end - return (cfg.limit or 0) + (cfg.limit_ad or 0) - count + return (cfg.limit or 0) + (cfg.limit_ad or 0) - count end + +function ShopData:getDailyCount(id) + local cfg = self:getDailyConfig(id) + if not cfg then + return 0 + end + + return (cfg.limit or 0) + (cfg.limit_ad or 0) +end + -- 剩余次数,只包括免费,不包括广告 function ShopData:getDailyRemainFreeCount(id) - local cfg = self:getDailyConfig(id) - if not cfg then - return 0 - end + local cfg = self:getDailyConfig(id) + if not cfg then + return 0 + end - local count = 0 - if self.dailyInfo.daily_count then - count = self.dailyInfo.daily_count[id] or 0 - end + local count = 0 + if self.dailyInfo.daily_count then + count = self.dailyInfo.daily_count[id] or 0 + end - return (cfg.limit or 0) - count + return (cfg.limit or 0) - count end function ShopData:getDailyLocked(id) - local cfg = self:getDailyConfig(id) - if not cfg or not cfg.unlock then - return - end + local cfg = self:getDailyConfig(id) + if not cfg or not cfg.unlock then + return + end - if DataManager.ChapterData:getChapterPassed(cfg.unlock) then - return - end + if DataManager.ChapterData:getChapterPassed(cfg.unlock) then + return + end - local str = DataManager.ChapterData:getChapterNameXYMode(cfg.unlock) - return I18N:getGlobalText(I18N.GlobalConst.FUNC_OPEN_STAGE, str) + local str = DataManager.ChapterData:getChapterNameXYMode(cfg.unlock) + return I18N:getGlobalText(I18N.GlobalConst.FUNC_OPEN_STAGE, str) end function ShopData:setLoginDailyRp() @@ -452,8 +462,8 @@ function ShopData:setLoginDailyRp() end function ShopData:getLoginDailyRp() - --@TODO 2025-09-24 15:10:19 - -- if DataManager.PaymentData:getIsSkipAd() then + --@TODO 2025-09-24 15:10:19 + -- if DataManager.PaymentData:getIsSkipAd() then -- return true -- end return not self.loginRpDaily @@ -462,67 +472,67 @@ end -- 钻石商店 ---------------------------------------------------------------------------------------------------------------------------------------- function ShopData:getGemConfig(id) - if id then - return ConfigManager:getConfig("mall_treasure")[id] - else - return ConfigManager:getConfig("mall_treasure") - end + if id then + return ConfigManager:getConfig("mall_treasure")[id] + else + return ConfigManager:getConfig("mall_treasure") + end end -- 金币商店 ---------------------------------------------------------------------------------------------------------------------------------------- function ShopData:refreshGoldShop(data) - if not data then - return - end - if EDITOR_MODE then - Logger.logHighlight("ShopData 金币商店") - Logger.printTable(data) - end + if not data then + return + end + if EDITOR_MODE then + Logger.logHighlight("ShopData 金币商店") + Logger.printTable(data) + end - self.goldInfo = data - self:setDirty() + self.goldInfo = data + self:setDirty() end function ShopData:getGoldConfig(id) - if id then - return ConfigManager:getConfig("mall_gold")[id] - else - return ConfigManager:getConfig("mall_gold") - end + if id then + return ConfigManager:getConfig("mall_gold")[id] + else + return ConfigManager:getConfig("mall_gold") + end end -- 广告次数 function ShopData:getBuyGoldAdCount(id) - local cfg = self:getGoldConfig(id) - return cfg and cfg.daily_ad or 0 + local cfg = self:getGoldConfig(id) + return cfg and cfg.daily_ad or 0 end -- 获取剩余免费广告领取次数 function ShopData:getGoldBuyRemainCountByAd(id) - local freeCount = self:getBuyGoldFreeCount(id) - local adCount = self:getBuyGoldAdCount(id) - return math.max(adCount + freeCount - self.goldInfo.count, 0) + local freeCount = self:getBuyGoldFreeCount(id) + local adCount = self:getBuyGoldAdCount(id) + return math.max(adCount + freeCount - self.goldInfo.count, 0) end -- 免费次数 function ShopData:getBuyGoldFreeCount(id) - local cfg = self:getGoldConfig(id) - return cfg and cfg.daily_free or 0 + local cfg = self:getGoldConfig(id) + return cfg and cfg.daily_free or 0 end -- 获取剩余免费领取次数 function ShopData:getGoldBuyRemainCountByFree(id) - local freeCount = self:getBuyGoldFreeCount(id) - return math.max(freeCount - self.goldInfo.count, 0) + local freeCount = self:getBuyGoldFreeCount(id) + return math.max(freeCount - self.goldInfo.count, 0) end function ShopData:onBuyGoldGiftSuccess(id) - if id == 1 then - -- 今日免费广告次数+1 - self.goldInfo.count = self.goldInfo.count + 1 - end - self:setDirty() + if id == 1 then + -- 今日免费广告次数+1 + self.goldInfo.count = self.goldInfo.count + 1 + end + self:setDirty() end function ShopData:setLoginGoldRp() @@ -530,8 +540,8 @@ function ShopData:setLoginGoldRp() end function ShopData:getLoginGoldRp() - --@TODO 2025-09-24 15:10:19 - -- if DataManager.PaymentData:getIsSkipAd() then + --@TODO 2025-09-24 15:10:19 + -- if DataManager.PaymentData:getIsSkipAd() then -- return true -- end return not self.loginRpGold @@ -540,30 +550,30 @@ end -- 神话星辉 ---------------------------------------------------------------------------------------------------------------------------------------- function ShopData:refreshEmblemShop(data) - if not data then - return - end - if EDITOR_MODE then - Logger.logHighlight("ShopData 星辉商店") - Logger.printTable(data) - end + if not data then + return + end + if EDITOR_MODE then + Logger.logHighlight("ShopData 星辉商店") + Logger.printTable(data) + end - self.emblemInfo = data or {} - self:setDirty() + self.emblemInfo = data or {} + self:setDirty() end function ShopData:getEmblemConfig(id) - if id then - return ConfigManager:getConfig("mall_mythic_emblem")[id] - else - return ConfigManager:getConfig("mall_mythic_emblem") - end + if id then + return ConfigManager:getConfig("mall_mythic_emblem")[id] + else + return ConfigManager:getConfig("mall_mythic_emblem") + end end function ShopData:isEmblemOpen(showToast) - if not self:isOpen(showToast) then - return false - end + if not self:isOpen(showToast) then + return false + end if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MALL_EMBLEM, not showToast) then return false end @@ -572,282 +582,268 @@ function ShopData:isEmblemOpen(showToast) end function ShopData:getEmblemLimitCount(id) - local cfg = self:getEmblemConfig(id) - if not cfg or not cfg.daily_limit then - return 0 - end - return cfg.daily_limit + local cfg = self:getEmblemConfig(id) + if not cfg or not cfg.daily_limit then + return 0 + end + return cfg.daily_limit end function ShopData:getEmblemBoughtCount(id) - return self.emblemInfo.today_count[id] or 0 + return self.emblemInfo.today_count[id] or 0 end function ShopData:getEmblemRemainCount(id) - return self:getEmblemLimitCount(id) - self:getEmblemBoughtCount(id) + return self:getEmblemLimitCount(id) - self:getEmblemBoughtCount(id) end function ShopData:onBuyEmblemGiftSuccess(id) - self.emblemInfo.total_count[id] = (self.emblemInfo.total_count[id] or 0) + 1 - self.emblemInfo.today_count[id] = (self.emblemInfo.today_count[id] or 0) + 1 - self:setDirty() + self.emblemInfo.total_count[id] = (self.emblemInfo.total_count[id] or 0) + 1 + self.emblemInfo.today_count[id] = (self.emblemInfo.today_count[id] or 0) + 1 + self:setDirty() end -- 首充礼包 ---------------------------------------------------------------------------------------------------------------------------------------- function ShopData:isFirstRechargeOpen(gear) - if GFunc.isShenhe() then - return false - end - if gear then - local boughtLast = gear > 1 and self:getFirstRechargeRewardDays(gear - 1) > 0 - -- 时间到了 & 没购买上一档 - if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY["FIRST_CHARGE_" .. gear], true) and not boughtLast then - return false - end - for day = 1, 3 do - if not self:isBoughtFirstRecharge(gear, day) or self:getFirstRechargeRewardDays(gear) < 3 then - -- 特殊处理一下首充3,正常逻辑如果购买了首充1,那么就开首充2,但是如果购买了首充2,首充3还要额外判断一下配置的等级条件是否达到了 - if gear == 3 and not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.FIRST_CHARGE_3, true) and boughtLast then - local cfg = ConfigManager:getConfig("func_open")[ModuleManager.MODULE_KEY.FIRST_CHARGE_3] - if cfg.level then - local isOpen = DataManager.PlayerData:getLv() >= cfg.level - if not isOpen then - return false - end - elseif cfg.stage then - local isOpen = DataManager.ChapterData:getChapterPassed(cfg.stage) - if not isOpen then - return false - end - end - end - return true - end - end - else - for k, gear in pairs(GConst.ShopConst.FIRST_RECHARGE_GEARS) do - if self:isFirstRechargeOpen(gear) then - return true - end - end - end + if GFunc.isShenhe() then + return false + end + if gear then + local boughtLast = gear > 1 and self:getFirstRechargeRewardDays(gear - 1) > 0 + -- 时间到了 & 没购买上一档 + if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY["FIRST_CHARGE_" .. gear], true) and not boughtLast then + return false + end + for day = 1, 3 do + if not self:isBoughtFirstRecharge(gear, day) or self:getFirstRechargeRewardDays(gear) < 3 then + -- 特殊处理一下首充3,正常逻辑如果购买了首充1,那么就开首充2,但是如果购买了首充2,首充3还要额外判断一下配置的等级条件是否达到了 + if gear == 3 and not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.FIRST_CHARGE_3, true) and boughtLast then + local cfg = ConfigManager:getConfig("func_open")[ModuleManager.MODULE_KEY.FIRST_CHARGE_3] + if cfg.level then + local isOpen = DataManager.PlayerData:getLv() >= cfg.level + if not isOpen then + return false + end + elseif cfg.stage then + local isOpen = DataManager.ChapterData:getChapterPassed(cfg.stage) + if not isOpen then + return false + end + end + end + return true + end + end + else + for k, gear in pairs(GConst.ShopConst.FIRST_RECHARGE_GEARS) do + if self:isFirstRechargeOpen(gear) then + return true + end + end + end - return false + return false end -- 开启了几个首冲档位 function ShopData:getFirstRechargeOpenCount() - local count = 0 - for k, gear in pairs(GConst.ShopConst.FIRST_RECHARGE_GEARS) do - if self:isFirstRechargeOpen(gear) then - count = count + 1 - end - end - return count + local count = 0 + for k, gear in pairs(GConst.ShopConst.FIRST_RECHARGE_GEARS) do + if self:isFirstRechargeOpen(gear) then + count = count + 1 + end + end + return count end -- 红点 function ShopData:hasFirstRechargeRedPoint() - for k, gear in pairs(GConst.ShopConst.FIRST_RECHARGE_GEARS) do - local boughtDay = self:getFirstRechargeBoughtDays(gear) - local rewardDay = self:getFirstRechargeRewardDays(gear) - if boughtDay > 0 and rewardDay < 3 and boughtDay > rewardDay then - return true - end - end + for k, gear in pairs(GConst.ShopConst.FIRST_RECHARGE_GEARS) do + local boughtDay = self:getFirstRechargeBoughtDays(gear) + local rewardDay = self:getFirstRechargeRewardDays(gear) + if boughtDay > 0 and rewardDay < 3 and boughtDay > rewardDay then + return true + end + end - return false + return false end function ShopData:getNeedShowFirstRechargePop() - -- if not self:isFirstRechargeOpen() then - -- return false - -- end + -- if not self:isFirstRechargeOpen() then + -- return false + -- end - -- 如果可以领的奖励都领完了也不弹了 - local openCount = 0 - local canGetCount = 0 - for k, gear in pairs(GConst.ShopConst.FIRST_RECHARGE_GEARS) do - if self:isFirstRechargeOpen(gear) then - openCount = openCount + 1 - local boughtDay = self:getFirstRechargeBoughtDays(gear) - local rewardDay = self:getFirstRechargeRewardDays(gear) - if boughtDay > 0 and boughtDay <= rewardDay then -- 已经领取过了不用弹了 - canGetCount = canGetCount + 1 - end - end - end - if openCount == canGetCount then -- 功能没开,或者开启了的首充都已经领取完了 - return false - end - return not self.firstRechargePoped + -- 如果可以领的奖励都领完了也不弹了 + local openCount = 0 + local canGetCount = 0 + for k, gear in pairs(GConst.ShopConst.FIRST_RECHARGE_GEARS) do + if self:isFirstRechargeOpen(gear) then + openCount = openCount + 1 + local boughtDay = self:getFirstRechargeBoughtDays(gear) + local rewardDay = self:getFirstRechargeRewardDays(gear) + if boughtDay > 0 and boughtDay <= rewardDay then -- 已经领取过了不用弹了 + canGetCount = canGetCount + 1 + end + end + end + if openCount == canGetCount then -- 功能没开,或者开启了的首充都已经领取完了 + return false + end + return not self.firstRechargePoped end function ShopData:setFirstrechargePoped() - self.firstRechargePoped = true + self.firstRechargePoped = true end --- 是否使用新的首充礼包 --- function ShopData:isNewFirstRechargeGift(gear) --- if gear == nil then --- return false --- end --- local oldId = GConst.ShopConst.FIRST_RECHARGE_ID[gear][1] --- return DataManager.PaymentData:getGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, oldId) <= 0 --- end - -- 获取档位id function ShopData:getFirstRechargeGiftId(gear, day) - -- if self:isNewFirstRechargeGift(gear) then - -- return GConst.ShopConst.FIRST_RECHARGE_ID_2[gear][day or 1] - -- else - -- return GConst.ShopConst.FIRST_RECHARGE_ID[gear][day or 1] - -- end - return GConst.ShopConst.FIRST_RECHARGE_ID[gear][day or 1] + return GConst.ShopConst.FIRST_RECHARGE_ID[gear][day or 1] end -- 获取档位购买状态 function ShopData:isBoughtFirstRecharge(gear, day) - return DataManager.PaymentData:getGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, self:getFirstRechargeGiftId(gear, day)) > 0 + return DataManager.PaymentData:getGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, self:getFirstRechargeGiftId(gear, day)) > 0 end -- 档位奖励领取天数 function ShopData:getFirstRechargeRewardDays(gear) - if not self:isBoughtFirstRecharge(gear) then - return 0 - end + if not self:isBoughtFirstRecharge(gear) then + return 0 + end - local getDay = 0 - for day = 1, 3 do - if DataManager.PaymentData:getGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, self:getFirstRechargeGiftId(gear, day)) > 0 then - getDay = day - end - end - return getDay + local getDay = 0 + for day = 1, 3 do + if DataManager.PaymentData:getGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, self:getFirstRechargeGiftId(gear, day)) > 0 then + getDay = day + end + end + return getDay end -- 购买天数 function ShopData:getFirstRechargeBoughtDays(gear) - if not self:isBoughtFirstRecharge(gear) then - return 0 - end - local time = DataManager.PaymentData:getGiftBoughtTime(PayManager.PURCHARSE_TYPE.ACT_GIFT, self:getFirstRechargeGiftId(gear)) - if time == nil or time <= 0 then - return 0 - end - local day = Time:getDayBeginTimeStamp(time) - day = (Time:getBeginningOfServerToday() - day) // 86400 - return day + 1 + if not self:isBoughtFirstRecharge(gear) then + return 0 + end + local time = DataManager.PaymentData:getGiftBoughtTime(PayManager.PURCHARSE_TYPE.ACT_GIFT, self:getFirstRechargeGiftId(gear)) + if time == nil or time <= 0 then + return 0 + end + local day = Time:getDayBeginTimeStamp(time) + day = (Time:getBeginningOfServerToday() - day) // 86400 + return day + 1 end -- 是否可领取 function ShopData:canGetFirstRechargeReward(gear, day) - if not self:isBoughtFirstRecharge(gear) then - return false - end - if self:isBoughtFirstRecharge(gear, day) then - return false - end + if not self:isBoughtFirstRecharge(gear) then + return false + end + if self:isBoughtFirstRecharge(gear, day) then + return false + end - local boughtDay = self:getFirstRechargeBoughtDays(gear) - local rewardDay = self:getFirstRechargeRewardDays(gear) - return boughtDay > rewardDay and rewardDay + 1 == day + local boughtDay = self:getFirstRechargeBoughtDays(gear) + local rewardDay = self:getFirstRechargeRewardDays(gear) + return boughtDay > rewardDay and rewardDay + 1 == day end -- 体力 ---------------------------------------------------------------------------------------------------------------------------------------- function ShopData:initVit(data) - data = data or {} - if EDITOR_MODE then - Logger.logHighlight("体力数据") - Logger.printTable(data) - end + data = data or {} + if EDITOR_MODE then + Logger.logHighlight("体力数据") + Logger.printTable(data) + end - self.vitAdCount = data.ad_count or 0 - self.vitGemCount = data.diamond_count or 0 + self.vitAdCount = data.ad_count or 0 + self.vitGemCount = data.diamond_count or 0 end -- 获取体力购买奖励 function ShopData:getVitBuyReward(buyType) - if buyType == GConst.VIT_BUY_TYPE.AD then - return GFunc.getConstCost("stamina_ad_buy") - elseif buyType == GConst.VIT_BUY_TYPE.GEM then - return GFunc.getConstCost("stamina_diamond_buy") - end - return nil + if buyType == GConst.VIT_BUY_TYPE.AD then + return GFunc.getConstCost("stamina_ad_buy") + elseif buyType == GConst.VIT_BUY_TYPE.GEM then + return GFunc.getConstCost("stamina_diamond_buy") + end + return nil end -- 获取体力购买消耗 function ShopData:getVitBuyCost(buyType) - if buyType == GConst.VIT_BUY_TYPE.GEM then - local cost = GFunc.getConstCost("stamina_diamond_cost") - local costAdd = GFunc.getConstCost("stamina_diamond_costadd") - if self._shopVitCost == nil then - self._shopVitCost = { - id = cost.id, - type = cost.type, - } - end - self._shopVitCost.num = cost.num + self.vitGemCount * costAdd.num - return self._shopVitCost - end - return nil + if buyType == GConst.VIT_BUY_TYPE.GEM then + local cost = GFunc.getConstCost("stamina_diamond_cost") + local costAdd = GFunc.getConstCost("stamina_diamond_costadd") + if self._shopVitCost == nil then + self._shopVitCost = { + id = cost.id, + type = cost.type, + } + end + self._shopVitCost.num = cost.num + self.vitGemCount * costAdd.num + return self._shopVitCost + end + return nil end -- 获取体力每日购买次数 function ShopData:getVitBuyLimit(buyType) - if buyType == GConst.VIT_BUY_TYPE.AD then - return GFunc.getConstIntValue("stamina_ad_times") - elseif buyType == GConst.VIT_BUY_TYPE.GEM then - return GFunc.getConstIntValue("stamina_diamond_times") - end - return 0 + if buyType == GConst.VIT_BUY_TYPE.AD then + return GFunc.getConstIntValue("stamina_ad_times") + elseif buyType == GConst.VIT_BUY_TYPE.GEM then + return GFunc.getConstIntValue("stamina_diamond_times") + end + return 0 end -- 获取体力每日购买次数(月卡加成) function ShopData:getVitBuyPrivateLimit(buyType) - if buyType == GConst.VIT_BUY_TYPE.GEM then - return GFunc.getConstIntValue("stamina_dia_privilege") - end - return 0 + if buyType == GConst.VIT_BUY_TYPE.GEM then + return GFunc.getConstIntValue("stamina_dia_privilege") + end + return 0 end -- 获取体力今日已购买次数 function ShopData:getVitBoughtCount(buyType) - if buyType == GConst.VIT_BUY_TYPE.AD then - return self.vitAdCount or 0 - elseif buyType == GConst.VIT_BUY_TYPE.GEM then - return self.vitGemCount or 0 - end - return 0 + if buyType == GConst.VIT_BUY_TYPE.AD then + return self.vitAdCount or 0 + elseif buyType == GConst.VIT_BUY_TYPE.GEM then + return self.vitGemCount or 0 + end + return 0 end -- 获取剩余购买次数 function ShopData:getVitBuyRemainCount(buyType) - if buyType == GConst.VIT_BUY_TYPE.AD then - local total = self:getVitBuyLimit(buyType) - -- if DataManager.MonthlyCardData:getIsCardActive(GConst.MonthlyCardConst.CARD_TYPE.CARD_2) then - -- total = total + self:getVitBuyPrivateLimit(buyType) - -- end - return total - self:getVitBoughtCount(buyType) - elseif buyType == GConst.VIT_BUY_TYPE.GEM then - return 99999 - end - return 0 + if buyType == GConst.VIT_BUY_TYPE.AD then + local total = self:getVitBuyLimit(buyType) + -- if DataManager.MonthlyCardData:getIsCardActive(GConst.MonthlyCardConst.CARD_TYPE.CARD_2) then + -- total = total + self:getVitBuyPrivateLimit(buyType) + -- end + return total - self:getVitBoughtCount(buyType) + elseif buyType == GConst.VIT_BUY_TYPE.GEM then + return 99999 + end + return 0 end function ShopData:onVitBuySuccess(data) - self:initVit(data) - self:setDirty() + self:initVit(data) + self:setDirty() end -- region 三方直接购买礼包 function ShopData:onServerPushThirdPay(data) if data then self:initThirdPayOrder(data) - self:initThirdPayGiftOrder(data) + self:initThirdPayGiftOrder(data) if data.third_pay_total then DataManager.PaymentData:setThirdPayTotal(data.third_pay_total) end @@ -898,44 +894,44 @@ end -- 代金券 ---------------------------------------------------------------------------------------------------------------------------------------- function ShopData:initThirdPayOrder(data) - if EDITOR_MODE then - Logger.logHighlight("ShopData 代金券") - Logger.printTable(data) - end - self.thirdPayOrder = data and data.orders + if EDITOR_MODE then + Logger.logHighlight("ShopData 代金券") + Logger.printTable(data) + end + self.thirdPayOrder = data and data.orders end function ShopData:getNeedShowVoucherReceiveUI() - if self.thirdPayOrder == nil then - return false - end - return #self.thirdPayOrder > 0 + if self.thirdPayOrder == nil then + return false + end + return #self.thirdPayOrder > 0 end function ShopData:getThirdPayOrders() - return self.thirdPayOrder or GConst.EMPTY_TABLE + return self.thirdPayOrder or GConst.EMPTY_TABLE end function ShopData:getThirdPayOrderInfo(order) - if self.thirdPayOrder == nil then - return - end - for k, v in ipairs(self.thirdPayOrder) do - if v.order_id == order then - return v - end - end + if self.thirdPayOrder == nil then + return + end + for k, v in ipairs(self.thirdPayOrder) do + if v.order_id == order then + return v + end + end end function ShopData:deleteThirdPayOrders(orders) - for i = #orders, 1, -1 do - for j = #self.thirdPayOrder, 1, -1 do - if orders[i] == self.thirdPayOrder[j].order_id then - table.remove(self.thirdPayOrder, j) - break - end - end - end + for i = #orders, 1, -1 do + for j = #self.thirdPayOrder, 1, -1 do + if orders[i] == self.thirdPayOrder[j].order_id then + table.remove(self.thirdPayOrder, j) + break + end + end + end end return ShopData \ No newline at end of file diff --git a/lua/app/userdata/sign/sign_week_data.lua b/lua/app/userdata/sign/sign_week_data.lua index 41d62805..4ea04ad1 100755 --- a/lua/app/userdata/sign/sign_week_data.lua +++ b/lua/app/userdata/sign/sign_week_data.lua @@ -263,7 +263,7 @@ function SignWeekData:getSeason() end function SignWeekData:getReSignCost() - return GFunc.getConstCost("act_bounty_buy_cost") + return GFunc.getConstReward2("act_bounty_buy_cost") end -- 解锁高级奖励