From 2e384f43e412af24056774ec438ff2639636dd65 Mon Sep 17 00:00:00 2001 From: yangwen Date: Wed, 21 May 2025 10:15:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=AF=8F=E6=97=A5=E6=8C=91?= =?UTF-8?q?=E6=88=98=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/atlas/comp/left.png | Bin 0 -> 502 bytes assets/atlas/comp/left.png.meta | 6 + assets/atlas/comp/right.png | Bin 0 -> 573 bytes assets/atlas/comp/right.png.meta | 6 + assets/resources/DailyChallenge.lh | 126 +++++++++++++++++- assets/resources/Home.lh | 6 +- assets/resources/TrophyRoom.lh | 122 +++++++++-------- src/constants/config.ts | 16 +++ src/constants/dc-config.ts.meta | 3 + src/constants/respath.ts | 9 ++ src/models/UIManager.ts | 4 +- src/types/global.ts | 2 +- src/views/CalendarUnit.ts | 16 ++- src/views/DailyChallenge.ts | 206 +++++++++++++++++++---------- src/views/Home.ts | 39 ++++-- src/views/TrophyRoom.ts | 29 +++- src/views/TrophyUnit.ts | 18 ++- 17 files changed, 450 insertions(+), 158 deletions(-) create mode 100644 assets/atlas/comp/left.png create mode 100644 assets/atlas/comp/left.png.meta create mode 100644 assets/atlas/comp/right.png create mode 100644 assets/atlas/comp/right.png.meta create mode 100644 src/constants/dc-config.ts.meta diff --git a/assets/atlas/comp/left.png b/assets/atlas/comp/left.png new file mode 100644 index 0000000000000000000000000000000000000000..0423cf07ff73922cae59d9cd87cd470e9f702560 GIT binary patch literal 502 zcmV+* zz_n;VppM7m$Z36pAQ8CCK#pY?^aRX5LZEcH;xwMFqntiXFWgYNJU?~_RKj_@yzh0o zF5T>gN==SoPy!d2aoG)}9&izk3py8$3ran=7MP$C&RuJr8ainhOAjRKmH3LnWu#<{2S_{ljX*k1IdV_@a3r7HIXLZ=P6#xJL07*qoM6N<$g2o!tL;wH) literal 0 HcmV?d00001 diff --git a/assets/atlas/comp/left.png.meta b/assets/atlas/comp/left.png.meta new file mode 100644 index 0000000..a13c8cf --- /dev/null +++ b/assets/atlas/comp/left.png.meta @@ -0,0 +1,6 @@ +{ + "uuid": "01e2c8ef-cb3b-4633-acf1-85ae9e5e0062", + "importer": { + "textureType": 2 + } +} \ No newline at end of file diff --git a/assets/atlas/comp/right.png b/assets/atlas/comp/right.png new file mode 100644 index 0000000000000000000000000000000000000000..5c901971bc15916642b99cc0ce141eb824cbadb1 GIT binary patch literal 573 zcmV-D0>b@?P)^T>k>m&!%E6zM-F4Z{xIg@#qAH*`9{tUOzd@4P zfbZtzRhS`xRRHx!U>R^)UWH2pvkahRi8w_d>i`aPk3iM|G>aT)j{xeU?hRf6oP!Gl z@Cu++#6WunP!DI`0UYRaIPwl4*AIIU0X%rOJ9I<Mb*Xnpbbx0o1g5n?gX->TL=E zG)JYW1iYcr6au#8@%$qyO(9^72H63d)-Ojg19oMrzH|ne0ng>^Z_y|#plNW&vI6d4 zBqM->`vD`-0lel-E}cPiz}jMP$07r^9$$z@2He6yRKUji(iubqm=Eq)M8MkX?2~uE zyZ0|yyaVpx%rn6C(iwOK@W5XXz$<`fe}@1b0h=!HCukl4ZtwX&u?`3s+%d}lvsKn# zSOz>GfmHwpxBBT?3yT2P4{N`v3OEcZpQwH9qX$<+L_|bHM5f>q9B^@n#l|$e00000 LNkvXXu0mjf`#kEA literal 0 HcmV?d00001 diff --git a/assets/atlas/comp/right.png.meta b/assets/atlas/comp/right.png.meta new file mode 100644 index 0000000..e59f9a8 --- /dev/null +++ b/assets/atlas/comp/right.png.meta @@ -0,0 +1,6 @@ +{ + "uuid": "a40c7d39-0906-4227-8784-e7f3eebba541", + "importer": { + "textureType": 2 + } +} \ No newline at end of file diff --git a/assets/resources/DailyChallenge.lh b/assets/resources/DailyChallenge.lh index 014c11c..ee35128 100644 --- a/assets/resources/DailyChallenge.lh +++ b/assets/resources/DailyChallenge.lh @@ -20,6 +20,15 @@ "btn_trophy": { "_$ref": "ft6m7zwa" }, + "icon_trophy": { + "_$ref": "e7a1ntdg" + }, + "btn_left": { + "_$ref": "vy67efg7" + }, + "btn_right": { + "_$ref": "55ije39v" + }, "bg_dc": { "_$ref": "hdia0flx" }, @@ -147,15 +156,14 @@ "y": 108, "width": 468, "height": 468, - "skin": "res://0a33c495-5713-4f5d-bb30-d0021966cf7e", - "useSourceSize": true, + "skin": "res://fb9b2754-ab4b-4558-8db0-f325afc06764", "color": "#ffffff" }, { "_$id": "pohsc0lz", "_$type": "Label", "name": "label_year", - "x": 100, + "x": 133, "y": 224, "width": 200, "height": 72, @@ -170,7 +178,7 @@ "_$id": "syblrak9", "_$type": "Label", "name": "label_month", - "x": 100, + "x": 133, "y": 300, "width": 200, "height": 72, @@ -185,7 +193,7 @@ "_$id": "w9sm094p", "_$type": "Box", "name": "Box", - "x": 100, + "x": 133, "y": 400, "width": 213, "height": 72, @@ -240,6 +248,30 @@ "padding": "0,0,0,0" } ] + }, + { + "_$id": "vy67efg7", + "_$type": "Image", + "name": "btn_left", + "x": 50, + "y": 343, + "width": 21, + "height": 60, + "skin": "res://01e2c8ef-cb3b-4633-acf1-85ae9e5e0062", + "useSourceSize": true, + "color": "#ffffff" + }, + { + "_$id": "55ije39v", + "_$type": "Image", + "name": "btn_right", + "x": 996, + "y": 337, + "width": 48, + "height": 97, + "skin": "res://a40c7d39-0906-4227-8784-e7f3eebba541", + "useSourceSize": true, + "color": "#ffffff" } ] }, @@ -307,6 +339,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -452,6 +486,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -595,6 +631,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -738,6 +776,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -881,6 +921,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -1024,6 +1066,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -1167,6 +1211,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -1321,6 +1367,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -1464,6 +1512,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -1607,6 +1657,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -1750,6 +1802,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -1893,6 +1947,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -2036,6 +2092,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -2179,6 +2237,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -2333,6 +2393,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -2476,6 +2538,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -2619,6 +2683,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -2762,6 +2828,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -2905,6 +2973,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -3048,6 +3118,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -3191,6 +3263,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -3345,6 +3419,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -3488,6 +3564,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -3631,6 +3709,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -3774,6 +3854,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -3917,6 +3999,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -4060,6 +4144,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -4203,6 +4289,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -4357,6 +4445,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -4500,6 +4590,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -4643,6 +4735,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -4786,6 +4880,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -4929,6 +5025,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -5072,6 +5170,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -5215,6 +5315,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -5369,6 +5471,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -5512,6 +5616,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -5655,6 +5761,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -5798,6 +5906,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -5941,6 +6051,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -6084,6 +6196,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, @@ -6227,6 +6341,8 @@ { "_$type": "04c54914-715e-4e07-8a45-770f2a2c05a6", "scriptPath": "../src/views/CalendarUnit.ts", + "year": 0, + "month": 0, "day": 0, "open": false, "progress": 0, diff --git a/assets/resources/Home.lh b/assets/resources/Home.lh index 18dc16d..d2e1e61 100644 --- a/assets/resources/Home.lh +++ b/assets/resources/Home.lh @@ -17,6 +17,9 @@ "bg_dc": { "_$ref": "7270vjom" }, + "icon_dc": { + "_$ref": "h6dakob0" + }, "label_dc_title": { "_$ref": "5ubzcrtp" }, @@ -255,8 +258,7 @@ "width": 468, "height": 468, "right": 0, - "skin": "res://0a33c495-5713-4f5d-bb30-d0021966cf7e", - "useSourceSize": true, + "skin": "res://bb1fa7d6-3640-46a5-aad3-b8aa0dacdd0e", "color": "#ffffff" } ] diff --git a/assets/resources/TrophyRoom.lh b/assets/resources/TrophyRoom.lh index d92a146..8dffaf9 100644 --- a/assets/resources/TrophyRoom.lh +++ b/assets/resources/TrophyRoom.lh @@ -195,15 +195,16 @@ "_$id": "8f3q88gt", "_$type": "Label", "name": "label_count", - "x": 110, + "x": 108, "y": 233, "width": 72, "height": 20, - "centerX": 2, + "centerX": 0, "text": "03/20", "fontSize": 24, "color": "rgba(0, 0, 0, 1)", "bold": true, + "align": "center", "valign": "middle", "padding": "0,0,0,0" }, @@ -227,7 +228,7 @@ ] }, { - "_$id": "12v1zrhf", + "_$id": "5a72w6r6", "_$type": "Box", "name": "Box(2)", "x": 336, @@ -238,45 +239,46 @@ "_$type": "79064920-30a6-4b11-a82e-bbdd4112c4e1", "scriptPath": "../src/views/TrophyUnit.ts", "icon": { - "_$ref": "vqqolq5s" + "_$ref": "qtzrgk8b" }, "label_count": { - "_$ref": "piu2wjzk" + "_$ref": "nejjxzap" }, "label_month": { - "_$ref": "jvyb2bl8" + "_$ref": "kyfur82i" } } ], "_$child": [ { - "_$id": "vqqolq5s", + "_$id": "qtzrgk8b", "_$type": "Image", "name": "icon", - "width": 289, + "width": 288, "height": 288, - "skin": "res://bb1fa7d6-3640-46a5-aad3-b8aa0dacdd0e", + "skin": "res://7d235ac1-6755-4409-ab86-23aaf41e1537", "useSourceSize": true, "color": "#ffffff" }, { - "_$id": "piu2wjzk", + "_$id": "nejjxzap", "_$type": "Label", "name": "label_count", - "x": 110, + "x": 108, "y": 233, "width": 72, "height": 20, - "centerX": 2, + "centerX": 0, "text": "03/20", "fontSize": 24, "color": "rgba(0, 0, 0, 1)", "bold": true, + "align": "center", "valign": "middle", "padding": "0,0,0,0" }, { - "_$id": "jvyb2bl8", + "_$id": "kyfur82i", "_$type": "Label", "name": "month", "x": 94, @@ -295,7 +297,7 @@ ] }, { - "_$id": "wn080pr7", + "_$id": "ou2bc7ya", "_$type": "Box", "name": "Box(3)", "x": 672, @@ -306,45 +308,46 @@ "_$type": "79064920-30a6-4b11-a82e-bbdd4112c4e1", "scriptPath": "../src/views/TrophyUnit.ts", "icon": { - "_$ref": "5ijlv0u5" + "_$ref": "60czvplu" }, "label_count": { - "_$ref": "wp3kmm2v" + "_$ref": "z9p6fvm8" }, "label_month": { - "_$ref": "up14gqcb" + "_$ref": "qt83mjyk" } } ], "_$child": [ { - "_$id": "5ijlv0u5", + "_$id": "60czvplu", "_$type": "Image", "name": "icon", - "width": 289, + "width": 288, "height": 288, - "skin": "res://fb9b2754-ab4b-4558-8db0-f325afc06764", + "skin": "res://7d235ac1-6755-4409-ab86-23aaf41e1537", "useSourceSize": true, "color": "#ffffff" }, { - "_$id": "wp3kmm2v", + "_$id": "z9p6fvm8", "_$type": "Label", "name": "label_count", - "x": 110, + "x": 108, "y": 233, "width": 72, "height": 20, - "centerX": 2, + "centerX": 0, "text": "03/20", "fontSize": 24, "color": "rgba(0, 0, 0, 1)", "bold": true, + "align": "center", "valign": "middle", "padding": "0,0,0,0" }, { - "_$id": "up14gqcb", + "_$id": "qt83mjyk", "_$type": "Label", "name": "month", "x": 94, @@ -387,7 +390,7 @@ ] }, { - "_$id": "ovn0ouow", + "_$id": "qafamkwj", "_$type": "Box", "name": "Box(2)", "y": 416, @@ -395,7 +398,7 @@ "height": 288, "_$child": [ { - "_$id": "0lvqvjcc", + "_$id": "pqcum5of", "_$type": "HBox", "name": "HBox", "width": 960, @@ -404,7 +407,7 @@ "align": "middle", "_$child": [ { - "_$id": "bpnvv8bu", + "_$id": "r4wq2wm7", "_$type": "Box", "name": "Box(1)", "width": 288, @@ -414,45 +417,46 @@ "_$type": "79064920-30a6-4b11-a82e-bbdd4112c4e1", "scriptPath": "../src/views/TrophyUnit.ts", "icon": { - "_$ref": "5nc72uhs" + "_$ref": "f8qx50up" }, "label_count": { - "_$ref": "roiu8xgz" + "_$ref": "sx3ojzwo" }, "label_month": { - "_$ref": "k1vy02th" + "_$ref": "49lxnrrm" } } ], "_$child": [ { - "_$id": "5nc72uhs", + "_$id": "f8qx50up", "_$type": "Image", "name": "icon", - "width": 289, + "width": 288, "height": 288, - "skin": "res://3d104a8e-ef79-46c9-90ef-f0db298666b2", + "skin": "res://7d235ac1-6755-4409-ab86-23aaf41e1537", "useSourceSize": true, "color": "#ffffff" }, { - "_$id": "roiu8xgz", + "_$id": "sx3ojzwo", "_$type": "Label", "name": "label_count", - "x": 110, + "x": 108, "y": 233, "width": 72, "height": 20, - "centerX": 2, + "centerX": 0, "text": "03/20", "fontSize": 24, "color": "rgba(0, 0, 0, 1)", "bold": true, + "align": "center", "valign": "middle", "padding": "0,0,0,0" }, { - "_$id": "k1vy02th", + "_$id": "49lxnrrm", "_$type": "Label", "name": "month", "x": 94, @@ -471,7 +475,7 @@ ] }, { - "_$id": "eqqlj32z", + "_$id": "fvekysyv", "_$type": "Box", "name": "Box(2)", "x": 336, @@ -482,45 +486,46 @@ "_$type": "79064920-30a6-4b11-a82e-bbdd4112c4e1", "scriptPath": "../src/views/TrophyUnit.ts", "icon": { - "_$ref": "eonu3pni" + "_$ref": "7er8q2x5" }, "label_count": { - "_$ref": "dyei47qq" + "_$ref": "6vznujfd" }, "label_month": { - "_$ref": "kqiusmti" + "_$ref": "0jjnp6zh" } } ], "_$child": [ { - "_$id": "eonu3pni", + "_$id": "7er8q2x5", "_$type": "Image", "name": "icon", "width": 288, "height": 288, - "skin": "res://f84532c2-1750-4127-999b-9dd613301eb5", + "skin": "res://7d235ac1-6755-4409-ab86-23aaf41e1537", "useSourceSize": true, "color": "#ffffff" }, { - "_$id": "dyei47qq", + "_$id": "6vznujfd", "_$type": "Label", "name": "label_count", - "x": 110, + "x": 108, "y": 233, "width": 72, "height": 20, - "centerX": 2, + "centerX": 0, "text": "03/20", "fontSize": 24, "color": "rgba(0, 0, 0, 1)", "bold": true, + "align": "center", "valign": "middle", "padding": "0,0,0,0" }, { - "_$id": "kqiusmti", + "_$id": "0jjnp6zh", "_$type": "Label", "name": "month", "x": 94, @@ -539,7 +544,7 @@ ] }, { - "_$id": "7v5iov33", + "_$id": "3sbxo969", "_$type": "Box", "name": "Box(3)", "x": 672, @@ -550,45 +555,46 @@ "_$type": "79064920-30a6-4b11-a82e-bbdd4112c4e1", "scriptPath": "../src/views/TrophyUnit.ts", "icon": { - "_$ref": "pbaarf42" + "_$ref": "xk7btt6d" }, "label_count": { - "_$ref": "vysadw66" + "_$ref": "42lm20bs" }, "label_month": { - "_$ref": "w2el6lze" + "_$ref": "ch29xisl" } } ], "_$child": [ { - "_$id": "pbaarf42", + "_$id": "xk7btt6d", "_$type": "Image", "name": "icon", "width": 288, "height": 288, - "skin": "res://39efa94a-7d72-41e0-8970-51e3508f01f8", + "skin": "res://7d235ac1-6755-4409-ab86-23aaf41e1537", "useSourceSize": true, "color": "#ffffff" }, { - "_$id": "vysadw66", + "_$id": "42lm20bs", "_$type": "Label", "name": "label_count", - "x": 110, + "x": 108, "y": 233, "width": 72, "height": 20, - "centerX": 2, + "centerX": 0, "text": "03/20", "fontSize": 24, "color": "rgba(0, 0, 0, 1)", "bold": true, + "align": "center", "valign": "middle", "padding": "0,0,0,0" }, { - "_$id": "w2el6lze", + "_$id": "ch29xisl", "_$type": "Label", "name": "month", "x": 94, @@ -609,7 +615,7 @@ ] }, { - "_$id": "3hdbfl3a", + "_$id": "fmb77cdv", "_$type": "Sprite", "name": "Sprite", "y": 288, diff --git a/src/constants/config.ts b/src/constants/config.ts index 4ece6e7..e7a70f5 100644 --- a/src/constants/config.ts +++ b/src/constants/config.ts @@ -1,3 +1,4 @@ +import { respath } from "./respath"; @@ -37,5 +38,20 @@ export const config = { MONTH_ABBRS: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], MONTH_FULLNAMES: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + MONTH_LIST: [ + {year: 2025, month: 1, begin: 3, dayCount: 31, icon_res: respath.trophy_01}, + {year: 2025, month: 2, begin: 6, dayCount: 30, icon_res: respath.trophy_02}, + {year: 2025, month: 3, begin: 6, dayCount: 31, icon_res: respath.trophy_03}, + {year: 2025, month: 4, begin: 2, dayCount: 30, icon_res: respath.trophy_04}, + {year: 2025, month: 5, begin: 4, dayCount: 31, icon_res: respath.trophy_05}, + {year: 2025, month: 6, begin: 0, dayCount: 30, icon_res: respath.trophy_06}, + {year: 2025, month: 7, begin: 2, dayCount: 31, icon_res: respath.trophy_07}, + {year: 2025, month: 8, begin: 5, dayCount: 31, icon_res: respath.trophy_08}, + {year: 2025, month: 9, begin: 1, dayCount: 30, icon_res: respath.trophy_01}, + {year: 2025, month: 10, begin: 3, dayCount: 31, icon_res: respath.trophy_02}, + {year: 2025, month: 11, begin: 6, dayCount: 30, icon_res: respath.trophy_03}, + {year: 2025, month: 12, begin: 1, dayCount: 31, icon_res: respath.trophy_04}, + ] + } diff --git a/src/constants/dc-config.ts.meta b/src/constants/dc-config.ts.meta new file mode 100644 index 0000000..9121f66 --- /dev/null +++ b/src/constants/dc-config.ts.meta @@ -0,0 +1,3 @@ +{ + "uuid": "fb5508ba-9b4a-43b3-903e-1063df3deeb8" +} \ No newline at end of file diff --git a/src/constants/respath.ts b/src/constants/respath.ts index 290f5e1..b5dcdd4 100644 --- a/src/constants/respath.ts +++ b/src/constants/respath.ts @@ -17,5 +17,14 @@ export const respath = { dc_top_bg_normal: "atlas/images/img_dc_bg1.png", dc_top_bg_day_finish: "atlas/images/img_dc_bg2.png", dc_top_bg_month_finish: "atlas/images/img_dc_finished.png", + + trophy_01: "atlas/trophys/trophy_01.png", + trophy_02: "atlas/trophys/trophy_02.png", + trophy_03: "atlas/trophys/trophy_03.png", + trophy_04: "atlas/trophys/trophy_04.png", + trophy_05: "atlas/trophys/trophy_05.png", + trophy_06: "atlas/trophys/trophy_06.png", + trophy_07: "atlas/trophys/trophy_07.png", + trophy_08: "atlas/trophys/trophy_08.png", } diff --git a/src/models/UIManager.ts b/src/models/UIManager.ts index 7a84557..9d12b9f 100644 --- a/src/models/UIManager.ts +++ b/src/models/UIManager.ts @@ -1,6 +1,7 @@ import { respath } from "../constants/respath" import { StorageManager } from "./StorageManager" import { Stage } from "../views/Stage" +import { DailyChallenge } from "../views/DailyChallenge" const { regClass, property } = Laya @@ -39,7 +40,8 @@ export class UIManager extends Laya.Script { public loadDCUI(): void { Laya.loader.load(respath.dc_ui_res).then((go)=>{ var prefab = go.create() - this.getUIRoot().addChild(prefab) + var dc = this.getUIRoot().addChild(prefab).getComponent(DailyChallenge) + dc.loadWithMonth() }) } diff --git a/src/types/global.ts b/src/types/global.ts index c9d30f4..37084d2 100644 --- a/src/types/global.ts +++ b/src/types/global.ts @@ -56,4 +56,4 @@ export interface DataProgress { export interface DataUser { dones: Array,//关卡完成进度 progresses: Array,//主线各个难度进度 -} \ No newline at end of file +} diff --git a/src/views/CalendarUnit.ts b/src/views/CalendarUnit.ts index 543c622..7d1d1e8 100644 --- a/src/views/CalendarUnit.ts +++ b/src/views/CalendarUnit.ts @@ -4,6 +4,10 @@ const { regClass, property } = Laya; export class CalendarUnit extends Laya.Script { declare owner : Laya.Box; + @property(Number) + public year: number = 0; + @property(Number) + public month: number = 0; @property(Number) public day: number = 0; @property(Boolean) @@ -38,11 +42,17 @@ export class CalendarUnit extends Laya.Script { } - public onInit(day: number, open: boolean, progress: number, label_obj: Laya.Label, handler: any, func: any): void { - this.day = day; + public onInit(label_obj: Laya.Label): void { + this.label_show = label_obj + } + + public setCalendarUnit(year: number, month: number, day: number, open: boolean, progress: number, handler: any, func: any): void { + this.selected = false + this.year = year + this.month = month + this.day = day this.open = open this.progress = progress - this.label_show = label_obj if (open) { if (progress >= 1) { this.label_show.text = "" diff --git a/src/views/DailyChallenge.ts b/src/views/DailyChallenge.ts index a366184..59bc708 100644 --- a/src/views/DailyChallenge.ts +++ b/src/views/DailyChallenge.ts @@ -6,8 +6,8 @@ import { LevelManager } from "../models/LevelManager"; import { UIManager } from "../models/UIManager"; import { respath } from "../constants/respath"; -const { regClass, property } = Laya; +const { regClass, property } = Laya; @regClass() export class DailyChallenge extends Laya.Script { declare owner : Laya.Box; @@ -16,6 +16,12 @@ export class DailyChallenge extends Laya.Script { public btn_back: Laya.Button @property(Laya.Image) public btn_trophy: Laya.Image + @property(Laya.Image) + public icon_trophy: Laya.Image + @property(Laya.Image) + public btn_left: Laya.Image + @property(Laya.Image) + public btn_right: Laya.Image @property(Laya.Image) public bg_dc: Laya.Image; @@ -46,9 +52,11 @@ export class DailyChallenge extends Laya.Script { @property(Laya.Box) public obj_labels: Laya.Box; private units: Array = new Array(); - private selectedUnit: CalendarUnit; - //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 + private selectedUnit: CalendarUnit; + private currentIndex: number + private indexMax: number + onAwake(): void { this.btn_back.on(Laya.Event.CLICK, this, ()=>{ UIManager.getInstance().loadHomeUI() @@ -57,64 +65,6 @@ export class DailyChallenge extends Laya.Script { this.btn_trophy.on(Laya.Event.CLICK, this, ()=>{ UIManager.getInstance().loadTrophyUI() }) - var dayBegin = 4 - var dayCount = 31 - var user = StorageManager.getInstance().getUser() - var now = new Date() - var year = now.getFullYear() - var month = now.getMonth() + 1 - var dayNow = new Date().getDate() - var stageID = `${year}-${month}-${dayNow}` - var starCount = user.get_doneCountBydate(year, month) - if (starCount >= dayCount) { - this.bg_dc.skin = respath.dc_top_bg_month_finish - } - else { - var progress = user.get_done(stageID) - console.log("progress >>>>>>>>>>>>>", stageID, progress) - if (progress >= 1) { - this.bg_dc.skin = respath.dc_top_bg_day_finish - } - else { - this.bg_dc.skin = respath.dc_top_bg_normal - } - } - this.label_year.text = year.toString() - this.label_month.text = config.MONTH_FULLNAMES[month-1] - this.label_star.text = `${starCount}/${dayCount}` - - var day = 1 - var index = -1 - for (var i=0; i= dayBegin && index < dayBegin+dayCount) { - obj.visible = true - l_obj.visible = true - var unit = obj.getComponent(CalendarUnit) - this.units.push(unit) - var stageID = `${year}-${month}-${day}` - var progress = user.get_done(stageID) - unit.onInit(day, day<=dayNow, progress, l_obj, this, this.onClickUnit) - if (day == dayNow) { - this.selectedUnit = unit - } - day ++ - } - else { - obj.visible = false - l_obj.visible = false - } - } - } - - - this.onApplyUnit(this.selectedUnit) - this.btn_play.on(Laya.Event.CLICK, this, (evt: Laya.Event)=>{ // console.log(">>>>>>>>>>>>>>>>>>>>>>>", this.selectedUnit.day) var now = new Date() @@ -137,6 +87,132 @@ export class DailyChallenge extends Laya.Script { UIManager.getInstance().loadStageUI(stageID); this.owner.destroy() }) + + for (var i=0; i{ + if (this.currentIndex > 0) { + this.currentIndex -- + this.loadWithIndex(this.currentIndex) + } + }) + this.btn_right.on(Laya.Event.CLICK, this, ()=>{ + if (this.currentIndex < this.indexMax) { + this.currentIndex ++ + this.loadWithIndex(this.currentIndex) + } + }) + } + + loadWithMonth(): void { + var now = new Date() + var nowYear = now.getFullYear() + var nowMonth = now.getMonth() + 1 + this.currentIndex = 0 + for (var i=0; i>>>>>>>>>>>>>>", nowYear, nowMonth, this.currentIndex) + this.loadWithIndex(this.currentIndex) + } + + public loadWithIndex(index: number): void { + this.btn_left.visible = this.currentIndex > 0 + this.btn_right.visible = this.currentIndex < this.indexMax + var info = config.MONTH_LIST[index] + var user = StorageManager.getInstance().getUser() + var now = new Date() + var nowYear = now.getFullYear() + var nowMonth = now.getMonth() + 1 + var nowDay = new Date().getDate() + + this.icon_trophy.skin = info.icon_res + //设置背景 + var starCount = user.get_doneCountBydate(info.year, info.month) + if (starCount >= info.dayCount) { + this.bg_dc.skin = respath.dc_top_bg_month_finish + } + else { + if (info.year == nowYear && info.month == nowMonth) {//当前月份 + var stageID = `${info.year}-${info.month}-${nowDay}` + var progress = user.get_done(stageID) + console.log("progress >>>>>>>>>>>>>", stageID, progress) + if (progress >= 1) { + this.bg_dc.skin = respath.dc_top_bg_day_finish + } + else { + this.bg_dc.skin = respath.dc_top_bg_normal + } + } + else { + this.bg_dc.skin = respath.dc_top_bg_normal + } + } + this.label_year.text = info.year.toString() + this.label_month.text = config.MONTH_FULLNAMES[info.month-1] + this.label_star.text = `${starCount}/${info.dayCount}` + + this.selectedUnit = null + var day = 1 + for (var i=0; i= info.begin && i < info.begin+info.dayCount) { + unit.owner.visible = true + unit.label_show.visible = true + var open = true + if (info.year > nowYear) { + open = false + } + else if (info.year == nowYear) { + if (info.month > nowMonth) { + open = false + } + else if (info.month == nowMonth) { + if (day > nowDay) { + open = false + } + } + } + var stageID = `${info.year}-${info.month}-${day}` + var progress = user.get_done(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 + } + day ++ + } + else { + unit.owner.visible = false + unit.label_show.visible = false + } + } + if (this.selectedUnit == null) + this.selectedUnit = this.units[info.begin+info.dayCount-1] + this.onApplyUnit(this.selectedUnit) } public onApplyUnit(unit: CalendarUnit): void { @@ -144,12 +220,8 @@ export class DailyChallenge extends Laya.Script { this.selectedUnit = unit this.selectedUnit.setSelected(true) - var now = new Date() - var year = now.getFullYear() - var month = now.getMonth() + 1 - var dayNow = unit.day - var stageID = `${year}-${month}-${dayNow}` - this.label_date.text = `${config.MONTH_ABBRS[month-1]} ${dayNow},${year}` + var stageID = `${unit.year}-${unit.month}-${unit.day}` + this.label_date.text = `${config.MONTH_ABBRS[unit.month-1]} ${unit.day},${unit.year}` var user = StorageManager.getInstance().getUser() var progress = user.get_done(stageID) // console.log("onApplyUnit >>>>>", stageID, progress) diff --git a/src/views/Home.ts b/src/views/Home.ts index b883573..1932692 100644 --- a/src/views/Home.ts +++ b/src/views/Home.ts @@ -15,6 +15,8 @@ export class Home extends Laya.Script { @property(Laya.Image) public bg_dc: Laya.Image; + @property(Laya.Image) + public icon_dc: Laya.Image; @property(Laya.Label) public label_dc_title: Laya.Label; @property(Laya.Label) @@ -40,15 +42,28 @@ export class Home extends Laya.Script { onAwake(): void { var user = StorageManager.getInstance().getUser() var now = new Date() - var year = now.getFullYear() - var month = now.getMonth() + 1 - var dayNow = new Date().getDate() - var stageID = `${year}-${month}-${dayNow}` - - if (user.get_doneCountBydate(year, month) >= 31) { - this.bg_dc.skin = respath.home_top_dc_bg_finish - this.label_dc_title.color = "#ffffff" - this.label_dc_date.color = "#ffffff" + var nowYear = now.getFullYear() + var nowMonth = now.getMonth() + 1 + var find + for (var i=0; i= find.dayCount) { + this.bg_dc.skin = respath.home_top_dc_bg_finish + this.label_dc_title.color = "#ffffff" + this.label_dc_date.color = "#ffffff" + } + else { + this.bg_dc.skin = respath.home_top_dc_bg_normal + this.label_dc_title.color = "#2d3138" + this.label_dc_date.color = "#2d3138" + } } else { this.bg_dc.skin = respath.home_top_dc_bg_normal @@ -56,7 +71,9 @@ export class Home extends Laya.Script { this.label_dc_date.color = "#2d3138" } - this.label_dc_date.text = `${config.MONTH_ABBRS[month-1]} ${dayNow}` + var nowDay = new Date().getDate() + var stageID = `${nowYear}-${nowMonth}-${nowDay}` + this.label_dc_date.text = `${config.MONTH_ABBRS[nowMonth-1]} ${nowDay}` var progress = user.get_done(stageID) if (progress <= 0) { @@ -69,7 +86,7 @@ export class Home extends Laya.Script { var list = LevelManager.getInstance().getLevelList(value) random = Math.random() var index = Math.floor(random*list.length) - var stageName = `${config.MONTH_ABBRS[month-1]} ${dayNow}` + var stageName = `${config.MONTH_ABBRS[nowMonth-1]} ${nowDay}` console.log("随机一个关卡", value, index) StorageManager.getInstance().newStage(stageID, config.STAGE_TYPE.DC, stageName, value, index) UIManager.getInstance().loadStageUI(stageID); diff --git a/src/views/TrophyRoom.ts b/src/views/TrophyRoom.ts index 74c545b..2032f3f 100644 --- a/src/views/TrophyRoom.ts +++ b/src/views/TrophyRoom.ts @@ -1,6 +1,7 @@ +import { config } from "../constants/config"; import { TrophyUnit } from "./TrophyUnit"; const { regClass, property } = Laya; @@ -23,14 +24,32 @@ export class TrophyRoom extends Laya.Script { this.owner.destroy() }) - var month = 5 + var list: Array = new Array() + var now = new Date() + var nowYear = now.getFullYear() + var nowMonth = now.getMonth() + 1 + for (var i=0; i= info.dayCount) { + this.icon.gray = false + this.label_month.color = "#2d3138" + } + else { + this.icon.gray = true + this.label_month.color = "#a7abb3" + } } } \ No newline at end of file