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"