diff --git a/assets/Scene.ls b/assets/Scene.ls index 498c366..d34b22d 100644 --- a/assets/Scene.ls +++ b/assets/Scene.ls @@ -7,8 +7,8 @@ "top": 0, "bottom": 0, "name": "Scene2D", - "width": 1080, - "height": 1920, + "width": 1920, + "height": 1080, "_$comp": [ { "_$type": "7bad1742-6eed-4d8d-81c0-501dc5bf03d6", @@ -17,7 +17,10 @@ }, { "_$type": "cd70cd5e-b4cd-4277-ac0a-2224cfbe89ac", - "scriptPath": "../src/models/UIManager.ts" + "scriptPath": "../src/models/UIManager.ts", + "mask": { + "_$ref": "2668mvhf" + } } ], "_$child": [ @@ -25,12 +28,25 @@ "_$id": "4rxcl2w3", "_$type": "Panel", "name": "UIRoot", - "x": -420, - "y": 420, "width": 1920, "height": 1080, + "_mouseState": 2, "centerX": 0, "centerY": 0 + }, + { + "_$id": "2668mvhf", + "_$type": "Image", + "name": "mask", + "width": 1920, + "height": 1080, + "alpha": 0, + "left": 0, + "right": 0, + "top": 0, + "bottom": 0, + "skin": "res://a98f334e-ce04-4cd0-8fc5-bbdf9b048609", + "color": "#ffffff" } ] } \ No newline at end of file diff --git a/src/models/UIManager.ts b/src/models/UIManager.ts index 1e8edb1..2234089 100644 --- a/src/models/UIManager.ts +++ b/src/models/UIManager.ts @@ -13,7 +13,7 @@ import { Stage } from "../views/Stage" import { TopBar } from "../views/TopBar" import { StorageManager } from "./StorageManager" -const { regClass } = Laya +const { regClass, property } = Laya @regClass() export class UIManager extends Laya.Script { @@ -24,8 +24,15 @@ export class UIManager extends Laya.Script { return UIManager._instance } + @property(Laya.Image) + public mask: Laya.Image + onAwake(): void { UIManager._instance = this + this.mask.on(Laya.Event.CLICK, this, ()=>{ + console.log("on click mask >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>") + }) + this.mask.visible = false } private UIRoot: Laya.Panel @@ -77,10 +84,12 @@ export class UIManager extends Laya.Script { } public loadDCUI(): void { + this.mask.visible = true Laya.loader.load(respath.dc_ui_res()).then((go) => { const prefab = go.create() this.dc_ui = this.getUIRoot().addChild(prefab).getComponent(DailyChallenge) this.dc_ui.loadWithMonth() + this.mask.visible = false }) } @@ -100,9 +109,11 @@ export class UIManager extends Laya.Script { } public loadTrophyUI(): void { + this.mask.visible = true Laya.loader.load(respath.trophy_ui_res()).then((go) => { const prefab = go.create() this.trophyRoom = this.getUIRoot().addChild(prefab).getComponent(TrophyRoom) + this.mask.visible = false }) } diff --git a/src/views/dc/DailyChallenge.ts b/src/views/dc/DailyChallenge.ts index 1e18751..5c31c5d 100644 --- a/src/views/dc/DailyChallenge.ts +++ b/src/views/dc/DailyChallenge.ts @@ -254,7 +254,7 @@ export class DailyChallenge extends Laya.Script { this.selectedUnit.setSelected(true) const stageID = `${unit.year}-${unit.month}-${unit.day}` - this.label_date.text = `${config.MONTH_ABBRS[unit.month - 1]} ${unit.day},${unit.year}` + this.label_date.text = `${config.MONTH_ABBRS[unit.month - 1]} ${unit.day}, ${unit.year}` const user = StorageManager.getInstance().getUser() const progress = user.get_done(stageID) // console.log("onApplyUnit >>>>>", stageID, progress)