From 89b70a288cc1020ffcf60ac0abc451ddf50e13dc Mon Sep 17 00:00:00 2001 From: yangwen Date: Wed, 4 Jun 2025 17:36:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E4=B8=AD=E6=9C=80=E5=90=8E=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=9C=AA=E5=AE=8C=E6=88=90=E7=9A=84=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/dc/DailyChallenge.lh | 122 +++++++++++++------------- src/views/dc/DailyChallenge.ts | 16 +++- 2 files changed, 75 insertions(+), 63 deletions(-) diff --git a/assets/resources/dc/DailyChallenge.lh b/assets/resources/dc/DailyChallenge.lh index 9b9d15e..6f2ec00 100644 --- a/assets/resources/dc/DailyChallenge.lh +++ b/assets/resources/dc/DailyChallenge.lh @@ -7129,6 +7129,68 @@ } ] }, + { + "_$id": "ybbojil0", + "_$type": "Box", + "name": "btn_left", + "x": 11, + "y": 492, + "width": 48, + "height": 96, + "_mouseState": 2, + "centerX": -505, + "_$comp": [ + { + "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true + } + ], + "_$child": [ + { + "_$id": "wmm7xhim", + "_$type": "Image", + "name": "Image", + "width": 48, + "height": 97, + "mouseThrough": true, + "skin": "res://535f9c82-7994-4fd9-a6b5-e7d08199cd4f", + "useSourceSize": true, + "color": "#748290" + } + ] + }, + { + "_$id": "rp3gmpnp", + "_$type": "Box", + "name": "btn_right", + "x": 1021, + "y": 492, + "width": 48, + "height": 96, + "_mouseState": 2, + "centerX": 505, + "_$comp": [ + { + "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true + } + ], + "_$child": [ + { + "_$id": "hxt6cgnk", + "_$type": "Image", + "name": "Image", + "width": 48, + "height": 97, + "mouseThrough": true, + "skin": "res://25320e1c-b60c-45af-9122-cdc433872fa7", + "useSourceSize": true, + "color": "#748290" + } + ] + }, { "_$id": "waobo8h4", "_$type": "Box", @@ -7181,66 +7243,6 @@ "valign": "middle", "padding": "0,0,0,0" }, - { - "_$id": "ybbojil0", - "_$type": "Box", - "name": "btn_left", - "x": -61, - "y": -490, - "width": 48, - "height": 96, - "_mouseState": 2, - "_$comp": [ - { - "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts", - "hoverAlpha": true - } - ], - "_$child": [ - { - "_$id": "wmm7xhim", - "_$type": "Image", - "name": "Image", - "width": 48, - "height": 97, - "mouseThrough": true, - "skin": "res://535f9c82-7994-4fd9-a6b5-e7d08199cd4f", - "useSourceSize": true, - "color": "#5b86b1" - } - ] - }, - { - "_$id": "rp3gmpnp", - "_$type": "Box", - "name": "btn_right", - "x": 951, - "y": -490, - "width": 48, - "height": 96, - "_mouseState": 2, - "_$comp": [ - { - "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts", - "hoverAlpha": true - } - ], - "_$child": [ - { - "_$id": "hxt6cgnk", - "_$type": "Image", - "name": "Image", - "width": 48, - "height": 97, - "mouseThrough": true, - "skin": "res://25320e1c-b60c-45af-9122-cdc433872fa7", - "useSourceSize": true, - "color": "#5b86b1" - } - ] - }, { "_$id": "mv2bgo4b", "_$type": "HBox", diff --git a/src/views/dc/DailyChallenge.ts b/src/views/dc/DailyChallenge.ts index 2c515eb..f9a6c2e 100644 --- a/src/views/dc/DailyChallenge.ts +++ b/src/views/dc/DailyChallenge.ts @@ -204,7 +204,8 @@ export class DailyChallenge extends Laya.Script { this.label_month.text = config.MONTH_FULLNAMES[info.month - 1] this.label_star.text = `${starCount}/${info.dayCount}` - this.selectedUnit = null + let todayUnit = null + let lastUnfinishUnit = null let day = 1 for (let i = 0; i < this.units.length; i++) { const unit = this.units[i] @@ -237,7 +238,10 @@ export class DailyChallenge extends Laya.Script { } unit.setCalendarUnit(info.year, info.month, day, open, progress, this, this.onClickUnit) if (info.year === nowYear && info.month === nowMonth && day === nowDay) { - this.selectedUnit = unit + todayUnit = unit + } + if (progress < 1) { + lastUnfinishUnit = unit } day++ } else { @@ -245,8 +249,14 @@ export class DailyChallenge extends Laya.Script { unit.label_show.visible = false } } - if (!this.selectedUnit) + if (todayUnit) { + this.selectedUnit = todayUnit + } else { + this.selectedUnit = lastUnfinishUnit + } + if (!this.selectedUnit) { this.selectedUnit = this.units[info.begin + info.dayCount - 1] + } this.onApplyUnit(this.selectedUnit) }