diff --git a/assets/atlas/comp/icon_star.png b/assets/atlas/comp/icon_star.png index e40f885..3f551b0 100644 Binary files a/assets/atlas/comp/icon_star.png and b/assets/atlas/comp/icon_star.png differ diff --git a/assets/resources/dc/TrophyRoom_H.lh b/assets/resources/dc/TrophyRoom_H.lh index 0f8c731..e0188b2 100644 --- a/assets/resources/dc/TrophyRoom_H.lh +++ b/assets/resources/dc/TrophyRoom_H.lh @@ -123,6 +123,13 @@ "width": 220, "height": 90, "_mouseState": 2, + "_$comp": [ + { + "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true + } + ], "_$child": [ { "_$id": "3ym1hz0b", diff --git a/src/models/UIManager.ts b/src/models/UIManager.ts index 614cd21..26dfe13 100644 --- a/src/models/UIManager.ts +++ b/src/models/UIManager.ts @@ -66,6 +66,8 @@ export class UIManager extends Laya.Script { private topbar: TopBar private stage: Stage private dc_ui: DailyChallenge + private dc_year: number = -1 + private dc_month: number = -1 private trophyRoom: TrophyRoom onStart(): void { @@ -96,12 +98,23 @@ export class UIManager extends Laya.Script { } } + public setCurrentDCMonth(year: number, month: number): void { + this.dc_year = year + this.dc_month = month + console.log("setCurrentDCMonth >>>>>>>>>>>>>>>>>>>>", year, month) + } + 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() + if (this.dc_year <= 0 || this.dc_month <= 0) { + const now = new Date() + this.dc_year = now.getFullYear() + this.dc_month = now.getMonth() + 1 + } + this.dc_ui.loadWithMonth(this.dc_year, this.dc_month) this.mask.visible = false }) } diff --git a/src/views/dc/DailyChallenge.ts b/src/views/dc/DailyChallenge.ts index b73cbc2..1415e53 100644 --- a/src/views/dc/DailyChallenge.ts +++ b/src/views/dc/DailyChallenge.ts @@ -154,10 +154,7 @@ export class DailyChallenge extends Laya.Script { } } - loadWithMonth(): void { - const now = new Date() - const nowYear = now.getFullYear() - const nowMonth = now.getMonth() + 1 + loadWithMonth(nowYear: number, nowMonth: number): void { this.currentIndex = 0 for (let i = 0; i < MONTH_LIST.length; i++) { const obj = MONTH_LIST[i] @@ -173,6 +170,7 @@ export class DailyChallenge extends Laya.Script { this.btn_left.visible = this.currentIndex > 0 this.btn_right.visible = this.currentIndex < this.indexMax const info = MONTH_LIST[index] + UIManager.getInstance().setCurrentDCMonth(info.year, info.month) console.log("DailyChallenge loadWithIndex >>>>>>>>>>>>>>>", info.year, info.month) const user = StorageManager.getInstance().getUser() const now = new Date()