UIRoot
This commit is contained in:
@@ -187,6 +187,7 @@ export class Stage extends Laya.Script {
|
||||
block.setBlockColor(config.BLOCK_COLOR.WHITE)
|
||||
block.setBlock(doBlock)
|
||||
block.setTipsBgColor(false)
|
||||
block.setSelected(false)
|
||||
}
|
||||
this.onUpdateCandys()
|
||||
this.onClickNote(null)
|
||||
|
||||
@@ -84,7 +84,7 @@ export class DailyChallenge extends Laya.Script {
|
||||
var stageID = `${year}-${month}-${dayNow}`
|
||||
var doStage = StorageManager.getInstance().getStage(stageID)
|
||||
console.log("play >>>>>>>>>>>>>>>>>>>>>>>", stageID, doStage)
|
||||
if (!doStage) {
|
||||
if (!doStage || doStage.get_mistake() >= config.MISTAKE_MAX) {
|
||||
var stageName = `${config.MONTH_ABBRS[month-1]} ${dayNow}`
|
||||
StorageManager.getInstance().newStage(stageID, config.STAGE_TYPE.DC, stageName)
|
||||
}
|
||||
@@ -190,6 +190,16 @@ export class DailyChallenge extends Laya.Script {
|
||||
}
|
||||
var stageID = `${info.year}-${info.month}-${day}`
|
||||
var progress = user.get_done(stageID)
|
||||
if (open && progress < 1) {//检查失败的关卡,如果失败了就重置
|
||||
var doStage = StorageManager.getInstance().getStage(stageID)
|
||||
if (doStage) {//有关卡数据
|
||||
if (doStage.get_mistake() >= config.MISTAKE_MAX) {
|
||||
progress = 0
|
||||
user.update_stage_done(stageID, 0)
|
||||
StorageManager.getInstance().cleanStage(stageID)
|
||||
}
|
||||
}
|
||||
}
|
||||
unit.setCalendarUnit(info.year, info.month, day, open, progress, this, this.onClickUnit)
|
||||
if (info.year == nowYear && info.month == nowMonth && day == nowDay) {
|
||||
this.selectedUnit = unit
|
||||
|
||||
Reference in New Issue
Block a user