From 81977188a2d2bbba8d78c1bd2ca24641b76623d6 Mon Sep 17 00:00:00 2001 From: yangwen Date: Wed, 4 Jun 2025 10:28:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=A8=A1=E5=BC=8F=E9=9D=9E?= =?UTF-8?q?=E6=9C=AC=E6=9C=8810=E5=8F=B7=E9=80=9A=E5=85=B3=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E5=8D=B3=E5=8F=AF=E8=8E=B7=E5=BE=97=E5=A5=96=E6=9D=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Home.ts | 2 +- src/views/Stage.ts | 22 ++++++++++++++++++++++ src/views/dc/DailyChallenge.ts | 4 ++-- src/views/dc/TrophyUnit.ts | 2 +- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/views/Home.ts b/src/views/Home.ts index 1bab2b3..d5a6c88 100644 --- a/src/views/Home.ts +++ b/src/views/Home.ts @@ -52,7 +52,7 @@ export class Home extends Laya.Script { const find = G_getMonthInfo(nowYear, nowMonth) if (find) { this.icon_dc.skin = find.icon_res - if (user.get_doneCountByDate(nowYear, nowMonth) >= find.dayCount) { + if (user.get_trophyRecord(nowYear, nowMonth)) { this.bg_dc.skin = respath.home_top_dc_bg_finish this.label_dc_title.color = "#ffffff" this.label_dc_date.color = "#ffffff" diff --git a/src/views/Stage.ts b/src/views/Stage.ts index 446c869..65b6b29 100644 --- a/src/views/Stage.ts +++ b/src/views/Stage.ts @@ -488,6 +488,8 @@ export class Stage extends Laya.Script { console.log("dc完成信息>>>>>>>>>>>>>>>", nowYear, nowMonth, doneCount, dayCount) if (doneCount >= dayCount) { // 当月每日挑战全部完成 user.add_trophy_record(nowYear, nowMonth, day) + } else { + this.rewardTrophyInDebug() } } UIManager.getInstance().loadGameDoneUI(false, this.data) @@ -589,4 +591,24 @@ export class Stage extends Laya.Script { } return b } + + rewardTrophyInDebug(): void { + console.log("测试模式非本月10号通关之后即可获得奖杯", config.DEBUG) + if (config.DEBUG) { + const stageID = this.data.get_stageID() + const list = stageID.split("-") + const year = Number(list[0]) + const month = Number(list[1]) + const day = Number(list[2]) + if (day === 10) { + const now = new Date() + const nowYear = now.getFullYear() + const nowMonth = now.getMonth() + 1 + if (year !== nowYear || month !== nowMonth) { + const user = StorageManager.getInstance().getUser() + user.add_trophy_record(year, month, day) + } + } + } + } } diff --git a/src/views/dc/DailyChallenge.ts b/src/views/dc/DailyChallenge.ts index a47bc15..2cd57bd 100644 --- a/src/views/dc/DailyChallenge.ts +++ b/src/views/dc/DailyChallenge.ts @@ -191,8 +191,7 @@ export class DailyChallenge extends Laya.Script { this.trophy_icon.skin = info.icon_res // 设置背景 - const starCount = user.get_doneCountByDate(info.year, info.month) - if (starCount >= info.dayCount) { + if (user.get_trophyRecord(info.year, info.month)) { this.bg_dc.skin = respath.dc_top_bg_month_finish this.trophy_light.visible = true this.trophy_icon.gray = false @@ -201,6 +200,7 @@ export class DailyChallenge extends Laya.Script { this.trophy_light.visible = false this.trophy_icon.gray = true } + const starCount = user.get_doneCountByDate(info.year, info.month) this.label_year.text = info.year.toString() this.label_month.text = config.MONTH_FULLNAMES[info.month - 1] this.label_star.text = `${starCount}/${info.dayCount}` diff --git a/src/views/dc/TrophyUnit.ts b/src/views/dc/TrophyUnit.ts index f38a594..f43a95a 100644 --- a/src/views/dc/TrophyUnit.ts +++ b/src/views/dc/TrophyUnit.ts @@ -27,7 +27,7 @@ export class TrophyUnit extends Laya.Script { this.icon.skin = info.icon_res this.label_count.text = `${starCount}/${info.dayCount}` this.label_month.text = config.MONTH_ABBRS[info.month - 1] - if (starCount >= info.dayCount) { + if (user.get_trophyRecord(info.year, info.month)) { this.bg_light.skin = respath.trophy_bg_light_gold this.icon.gray = false this.label_month.color = "#2d3138"