完善每日挑战逻辑

This commit is contained in:
2025-05-21 10:15:23 +08:00
parent 061b8bc042
commit 2e384f43e4
17 changed files with 450 additions and 158 deletions

View File

@@ -14,11 +14,19 @@ export class TrophyUnit extends Laya.Script {
@property(Laya.Label)
public label_month: Laya.Label;
public onInit(year: number, month: number): void {
public onInit(info: any): void {
var user = StorageManager.getInstance().getUser()
var starCount = user.get_doneCountBydate(year, month)
this.label_count.text = `${starCount}/31`
this.label_month.text = config.MONTH_ABBRS[month-1]
var starCount = user.get_doneCountBydate(info.year, info.month)
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) {
this.icon.gray = false
this.label_month.color = "#2d3138"
}
else {
this.icon.gray = true
this.label_month.color = "#a7abb3"
}
}
}