add trophy logic
This commit is contained in:
@@ -6,6 +6,7 @@ import { Difficulty } from "./Difficulty";
|
||||
import { LevelManager } from "../models/LevelManager";
|
||||
import { config } from "../constants/config";
|
||||
import { Utility_ConvertSecondToString } from "../utils/utility";
|
||||
import { G_getMonthInfo } from "../models/DCManager";
|
||||
|
||||
const { regClass, property } = Laya
|
||||
|
||||
@@ -44,17 +45,11 @@ export class Home extends Laya.Script {
|
||||
var now = new Date()
|
||||
var nowYear = now.getFullYear()
|
||||
var nowMonth = now.getMonth() + 1
|
||||
var find
|
||||
for (var i=0; i<config.MONTH_LIST.length; i++) {
|
||||
var obj = config.MONTH_LIST[i]
|
||||
if (obj.year == nowYear && obj.month == nowMonth) {
|
||||
find = obj
|
||||
break
|
||||
}
|
||||
}
|
||||
var nowDay = now.getDate()
|
||||
var 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_doneCountByDate(nowYear, nowMonth) >= find.dayCount) {
|
||||
this.bg_dc.skin = respath.home_top_dc_bg_finish
|
||||
this.label_dc_title.color = "#ffffff"
|
||||
this.label_dc_date.color = "#ffffff"
|
||||
@@ -70,8 +65,7 @@ export class Home extends Laya.Script {
|
||||
this.label_dc_title.color = "#2d3138"
|
||||
this.label_dc_date.color = "#2d3138"
|
||||
}
|
||||
|
||||
var nowDay = new Date().getDate()
|
||||
|
||||
var stageID = `${nowYear}-${nowMonth}-${nowDay}`
|
||||
this.label_dc_date.text = `${config.MONTH_ABBRS[nowMonth-1]} ${nowDay}`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user