diff --git a/assets/atlas/trophys/trophy_01.png b/assets/atlas/trophys/trophy_01.png new file mode 100644 index 0000000..1c1d3d9 Binary files /dev/null and b/assets/atlas/trophys/trophy_01.png differ diff --git a/assets/atlas/trophys/trophy_01.png.meta b/assets/atlas/trophys/trophy_01.png.meta new file mode 100644 index 0000000..d91cf70 --- /dev/null +++ b/assets/atlas/trophys/trophy_01.png.meta @@ -0,0 +1,6 @@ +{ + "uuid": "7d235ac1-6755-4409-ab86-23aaf41e1537", + "importer": { + "textureType": 2 + } +} \ No newline at end of file diff --git a/assets/atlas/trophys/trophy_02.png b/assets/atlas/trophys/trophy_02.png new file mode 100644 index 0000000..a172a1f Binary files /dev/null and b/assets/atlas/trophys/trophy_02.png differ diff --git a/assets/atlas/trophys/trophy_02.png.meta b/assets/atlas/trophys/trophy_02.png.meta new file mode 100644 index 0000000..3e4d84b --- /dev/null +++ b/assets/atlas/trophys/trophy_02.png.meta @@ -0,0 +1,6 @@ +{ + "uuid": "bb1fa7d6-3640-46a5-aad3-b8aa0dacdd0e", + "importer": { + "textureType": 2 + } +} \ No newline at end of file diff --git a/assets/atlas/trophys/trophy_03.png b/assets/atlas/trophys/trophy_03.png new file mode 100644 index 0000000..554650c Binary files /dev/null and b/assets/atlas/trophys/trophy_03.png differ diff --git a/assets/atlas/trophys/trophy_03.png.meta b/assets/atlas/trophys/trophy_03.png.meta new file mode 100644 index 0000000..8dbe41f --- /dev/null +++ b/assets/atlas/trophys/trophy_03.png.meta @@ -0,0 +1,6 @@ +{ + "uuid": "fb9b2754-ab4b-4558-8db0-f325afc06764", + "importer": { + "textureType": 2 + } +} \ No newline at end of file diff --git a/assets/atlas/trophys/trophy_04.png b/assets/atlas/trophys/trophy_04.png new file mode 100644 index 0000000..b72086a Binary files /dev/null and b/assets/atlas/trophys/trophy_04.png differ diff --git a/assets/atlas/trophys/trophy_04.png.meta b/assets/atlas/trophys/trophy_04.png.meta new file mode 100644 index 0000000..c9915c2 --- /dev/null +++ b/assets/atlas/trophys/trophy_04.png.meta @@ -0,0 +1,6 @@ +{ + "uuid": "3d104a8e-ef79-46c9-90ef-f0db298666b2", + "importer": { + "textureType": 2 + } +} \ No newline at end of file diff --git a/assets/atlas/trophys/trophy_05.png b/assets/atlas/trophys/trophy_05.png new file mode 100644 index 0000000..f473ed0 Binary files /dev/null and b/assets/atlas/trophys/trophy_05.png differ diff --git a/assets/atlas/trophys/trophy_05.png.meta b/assets/atlas/trophys/trophy_05.png.meta new file mode 100644 index 0000000..0adb73f --- /dev/null +++ b/assets/atlas/trophys/trophy_05.png.meta @@ -0,0 +1,6 @@ +{ + "uuid": "f84532c2-1750-4127-999b-9dd613301eb5", + "importer": { + "textureType": 2 + } +} \ No newline at end of file diff --git a/assets/atlas/trophys/trophy_06.png b/assets/atlas/trophys/trophy_06.png new file mode 100644 index 0000000..c9ffa70 Binary files /dev/null and b/assets/atlas/trophys/trophy_06.png differ diff --git a/assets/atlas/trophys/trophy_06.png.meta b/assets/atlas/trophys/trophy_06.png.meta new file mode 100644 index 0000000..3434b8a --- /dev/null +++ b/assets/atlas/trophys/trophy_06.png.meta @@ -0,0 +1,6 @@ +{ + "uuid": "39efa94a-7d72-41e0-8970-51e3508f01f8", + "importer": { + "textureType": 2 + } +} \ No newline at end of file diff --git a/assets/atlas/trophys/trophy_07.png b/assets/atlas/trophys/trophy_07.png new file mode 100644 index 0000000..5466fca Binary files /dev/null and b/assets/atlas/trophys/trophy_07.png differ diff --git a/assets/atlas/trophys/trophy_07.png.meta b/assets/atlas/trophys/trophy_07.png.meta new file mode 100644 index 0000000..38ba45c --- /dev/null +++ b/assets/atlas/trophys/trophy_07.png.meta @@ -0,0 +1,6 @@ +{ + "uuid": "06f0e4a0-8056-4632-9f9a-f939013aebd7", + "importer": { + "textureType": 2 + } +} \ No newline at end of file diff --git a/assets/atlas/trophys/trophy_08.png b/assets/atlas/trophys/trophy_08.png new file mode 100644 index 0000000..5dfe3a0 Binary files /dev/null and b/assets/atlas/trophys/trophy_08.png differ diff --git a/assets/atlas/trophys/trophy_08.png.meta b/assets/atlas/trophys/trophy_08.png.meta new file mode 100644 index 0000000..2e04afd --- /dev/null +++ b/assets/atlas/trophys/trophy_08.png.meta @@ -0,0 +1,6 @@ +{ + "uuid": "2e8680d7-0e1f-4165-9354-ee110beb9c47", + "importer": { + "textureType": 2 + } +} \ No newline at end of file diff --git a/assets/resources/DailyChallenge.lh b/assets/resources/DailyChallenge.lh index 3f8beaf..014c11c 100644 --- a/assets/resources/DailyChallenge.lh +++ b/assets/resources/DailyChallenge.lh @@ -17,6 +17,9 @@ "btn_back": { "_$ref": "yvza2lgb" }, + "btn_trophy": { + "_$ref": "ft6m7zwa" + }, "bg_dc": { "_$ref": "hdia0flx" }, diff --git a/assets/resources/TrophyRoom.lh b/assets/resources/TrophyRoom.lh new file mode 100644 index 0000000..d92a146 --- /dev/null +++ b/assets/resources/TrophyRoom.lh @@ -0,0 +1,638 @@ +{ + "_$ver": 1, + "_$id": "1189xhfw", + "_$type": "Box", + "name": "TrophyRoom", + "width": 1080, + "height": 1920, + "_mouseState": 2, + "left": 0, + "right": 0, + "top": 0, + "bottom": 0, + "_$comp": [ + { + "_$type": "554595b0-0dd8-4e4b-8073-8d775219659c", + "scriptPath": "../src/views/TrophyRoom.ts", + "btn_back": { + "_$ref": "frfomxcb" + }, + "obj_items": { + "_$ref": "jt9xxw2i" + } + } + ], + "_$child": [ + { + "_$id": "ei2oglth", + "_$type": "Image", + "name": "bg", + "width": 1080, + "height": 1920, + "left": 0, + "right": 0, + "top": 0, + "bottom": 0, + "skin": "res://a98f334e-ce04-4cd0-8fc5-bbdf9b048609", + "color": "#f5f7fb" + }, + { + "_$id": "jgayyog0", + "_$type": "Box", + "name": "back", + "x": 38, + "y": 78, + "width": 400, + "height": 64, + "_mouseState": 2, + "centerX": -302, + "centerY": -850, + "_$child": [ + { + "_$id": "frfomxcb", + "_$type": "Button", + "name": "btn_back", + "width": 69, + "height": 48, + "_mouseState": 2, + "stateNum": 1, + "skin": "res://06a9c4a8-d664-4f3a-9c35-25b610195ced", + "label": "", + "labelSize": 20, + "labelAlign": "center", + "labelVAlign": "middle" + }, + { + "_$id": "6dm2cil7", + "_$type": "Label", + "name": "title", + "x": 92, + "y": -6, + "width": 500, + "height": 60, + "bottom": 10, + "text": "Trophy Room", + "fontSize": 54, + "color": "rgba(45, 49, 56, 1)", + "bold": true, + "valign": "middle", + "padding": "0,0,0,0" + } + ] + }, + { + "_$id": "457s8lgx", + "_$type": "Box", + "name": "center", + "y": 188, + "width": 1080, + "height": 1632, + "bottom": 100, + "centerX": 0, + "_$child": [ + { + "_$id": "sf0c1is5", + "_$type": "Sprite", + "name": "Sprite", + "x": 48, + "width": 984, + "height": 72, + "_gcmds": [ + { + "_$type": "DrawRoundRectCmd", + "x": 0, + "y": 0, + "width": 1, + "height": 1, + "lt": 0, + "rt": 0, + "lb": 0, + "rb": 0, + "percent": true, + "lineWidth": 1, + "fillColor": "#FFFFFF" + } + ], + "_$child": [ + { + "_$id": "aeojubkf", + "_$type": "Label", + "name": "Label", + "width": 984, + "height": 72, + "centerX": 0, + "centerY": 0, + "text": "2025", + "fontSize": 48, + "color": "rgba(84, 89, 98, 1)", + "align": "center", + "valign": "middle", + "padding": "0,0,0,0" + } + ] + }, + { + "_$id": "jt9xxw2i", + "_$type": "VBox", + "name": "items", + "x": 60, + "y": 88, + "width": 960, + "height": 1500, + "centerX": 0, + "space": 128, + "align": "center", + "_$child": [ + { + "_$id": "rtjlzxrg", + "_$type": "Box", + "name": "Box(1)", + "width": 960, + "height": 288, + "_$child": [ + { + "_$id": "sxhnu7s0", + "_$type": "HBox", + "name": "HBox", + "width": 960, + "height": 288, + "space": 48, + "align": "middle", + "_$child": [ + { + "_$id": "ahv6vinq", + "_$type": "Box", + "name": "Box(1)", + "width": 288, + "height": 288, + "_$comp": [ + { + "_$type": "79064920-30a6-4b11-a82e-bbdd4112c4e1", + "scriptPath": "../src/views/TrophyUnit.ts", + "icon": { + "_$ref": "i99wsuz9" + }, + "label_count": { + "_$ref": "8f3q88gt" + }, + "label_month": { + "_$ref": "rnb9of21" + } + } + ], + "_$child": [ + { + "_$id": "i99wsuz9", + "_$type": "Image", + "name": "icon", + "width": 288, + "height": 288, + "skin": "res://7d235ac1-6755-4409-ab86-23aaf41e1537", + "useSourceSize": true, + "color": "#ffffff" + }, + { + "_$id": "8f3q88gt", + "_$type": "Label", + "name": "label_count", + "x": 110, + "y": 233, + "width": 72, + "height": 20, + "centerX": 2, + "text": "03/20", + "fontSize": 24, + "color": "rgba(0, 0, 0, 1)", + "bold": true, + "valign": "middle", + "padding": "0,0,0,0" + }, + { + "_$id": "rnb9of21", + "_$type": "Label", + "name": "month", + "x": 94, + "y": 334, + "width": 100, + "height": 60, + "bottom": -106, + "centerX": 0, + "text": "Otc", + "fontSize": 42, + "color": "rgba(167, 171, 179, 1)", + "bold": true, + "valign": "middle", + "padding": "0,0,0,0" + } + ] + }, + { + "_$id": "12v1zrhf", + "_$type": "Box", + "name": "Box(2)", + "x": 336, + "width": 288, + "height": 288, + "_$comp": [ + { + "_$type": "79064920-30a6-4b11-a82e-bbdd4112c4e1", + "scriptPath": "../src/views/TrophyUnit.ts", + "icon": { + "_$ref": "vqqolq5s" + }, + "label_count": { + "_$ref": "piu2wjzk" + }, + "label_month": { + "_$ref": "jvyb2bl8" + } + } + ], + "_$child": [ + { + "_$id": "vqqolq5s", + "_$type": "Image", + "name": "icon", + "width": 289, + "height": 288, + "skin": "res://bb1fa7d6-3640-46a5-aad3-b8aa0dacdd0e", + "useSourceSize": true, + "color": "#ffffff" + }, + { + "_$id": "piu2wjzk", + "_$type": "Label", + "name": "label_count", + "x": 110, + "y": 233, + "width": 72, + "height": 20, + "centerX": 2, + "text": "03/20", + "fontSize": 24, + "color": "rgba(0, 0, 0, 1)", + "bold": true, + "valign": "middle", + "padding": "0,0,0,0" + }, + { + "_$id": "jvyb2bl8", + "_$type": "Label", + "name": "month", + "x": 94, + "y": 334, + "width": 100, + "height": 60, + "bottom": -106, + "centerX": 0, + "text": "Otc", + "fontSize": 42, + "color": "rgba(167, 171, 179, 1)", + "bold": true, + "valign": "middle", + "padding": "0,0,0,0" + } + ] + }, + { + "_$id": "wn080pr7", + "_$type": "Box", + "name": "Box(3)", + "x": 672, + "width": 288, + "height": 288, + "_$comp": [ + { + "_$type": "79064920-30a6-4b11-a82e-bbdd4112c4e1", + "scriptPath": "../src/views/TrophyUnit.ts", + "icon": { + "_$ref": "5ijlv0u5" + }, + "label_count": { + "_$ref": "wp3kmm2v" + }, + "label_month": { + "_$ref": "up14gqcb" + } + } + ], + "_$child": [ + { + "_$id": "5ijlv0u5", + "_$type": "Image", + "name": "icon", + "width": 289, + "height": 288, + "skin": "res://fb9b2754-ab4b-4558-8db0-f325afc06764", + "useSourceSize": true, + "color": "#ffffff" + }, + { + "_$id": "wp3kmm2v", + "_$type": "Label", + "name": "label_count", + "x": 110, + "y": 233, + "width": 72, + "height": 20, + "centerX": 2, + "text": "03/20", + "fontSize": 24, + "color": "rgba(0, 0, 0, 1)", + "bold": true, + "valign": "middle", + "padding": "0,0,0,0" + }, + { + "_$id": "up14gqcb", + "_$type": "Label", + "name": "month", + "x": 94, + "y": 334, + "width": 100, + "height": 60, + "bottom": -106, + "centerX": 0, + "text": "Otc", + "fontSize": 42, + "color": "rgba(167, 171, 179, 1)", + "bold": true, + "valign": "middle", + "padding": "0,0,0,0" + } + ] + } + ] + }, + { + "_$id": "908k43gz", + "_$type": "Sprite", + "name": "Sprite", + "y": 288, + "width": 960, + "height": 18, + "_gcmds": [ + { + "_$type": "DrawRectCmd", + "x": 0, + "y": 0, + "width": 1, + "height": 1, + "percent": true, + "lineWidth": 1, + "fillColor": "#ffffff" + } + ] + } + ] + }, + { + "_$id": "ovn0ouow", + "_$type": "Box", + "name": "Box(2)", + "y": 416, + "width": 960, + "height": 288, + "_$child": [ + { + "_$id": "0lvqvjcc", + "_$type": "HBox", + "name": "HBox", + "width": 960, + "height": 288, + "space": 48, + "align": "middle", + "_$child": [ + { + "_$id": "bpnvv8bu", + "_$type": "Box", + "name": "Box(1)", + "width": 288, + "height": 288, + "_$comp": [ + { + "_$type": "79064920-30a6-4b11-a82e-bbdd4112c4e1", + "scriptPath": "../src/views/TrophyUnit.ts", + "icon": { + "_$ref": "5nc72uhs" + }, + "label_count": { + "_$ref": "roiu8xgz" + }, + "label_month": { + "_$ref": "k1vy02th" + } + } + ], + "_$child": [ + { + "_$id": "5nc72uhs", + "_$type": "Image", + "name": "icon", + "width": 289, + "height": 288, + "skin": "res://3d104a8e-ef79-46c9-90ef-f0db298666b2", + "useSourceSize": true, + "color": "#ffffff" + }, + { + "_$id": "roiu8xgz", + "_$type": "Label", + "name": "label_count", + "x": 110, + "y": 233, + "width": 72, + "height": 20, + "centerX": 2, + "text": "03/20", + "fontSize": 24, + "color": "rgba(0, 0, 0, 1)", + "bold": true, + "valign": "middle", + "padding": "0,0,0,0" + }, + { + "_$id": "k1vy02th", + "_$type": "Label", + "name": "month", + "x": 94, + "y": 334, + "width": 100, + "height": 60, + "bottom": -106, + "centerX": 0, + "text": "Otc", + "fontSize": 42, + "color": "rgba(167, 171, 179, 1)", + "bold": true, + "valign": "middle", + "padding": "0,0,0,0" + } + ] + }, + { + "_$id": "eqqlj32z", + "_$type": "Box", + "name": "Box(2)", + "x": 336, + "width": 288, + "height": 288, + "_$comp": [ + { + "_$type": "79064920-30a6-4b11-a82e-bbdd4112c4e1", + "scriptPath": "../src/views/TrophyUnit.ts", + "icon": { + "_$ref": "eonu3pni" + }, + "label_count": { + "_$ref": "dyei47qq" + }, + "label_month": { + "_$ref": "kqiusmti" + } + } + ], + "_$child": [ + { + "_$id": "eonu3pni", + "_$type": "Image", + "name": "icon", + "width": 288, + "height": 288, + "skin": "res://f84532c2-1750-4127-999b-9dd613301eb5", + "useSourceSize": true, + "color": "#ffffff" + }, + { + "_$id": "dyei47qq", + "_$type": "Label", + "name": "label_count", + "x": 110, + "y": 233, + "width": 72, + "height": 20, + "centerX": 2, + "text": "03/20", + "fontSize": 24, + "color": "rgba(0, 0, 0, 1)", + "bold": true, + "valign": "middle", + "padding": "0,0,0,0" + }, + { + "_$id": "kqiusmti", + "_$type": "Label", + "name": "month", + "x": 94, + "y": 334, + "width": 100, + "height": 60, + "bottom": -106, + "centerX": 0, + "text": "Otc", + "fontSize": 42, + "color": "rgba(167, 171, 179, 1)", + "bold": true, + "valign": "middle", + "padding": "0,0,0,0" + } + ] + }, + { + "_$id": "7v5iov33", + "_$type": "Box", + "name": "Box(3)", + "x": 672, + "width": 288, + "height": 288, + "_$comp": [ + { + "_$type": "79064920-30a6-4b11-a82e-bbdd4112c4e1", + "scriptPath": "../src/views/TrophyUnit.ts", + "icon": { + "_$ref": "pbaarf42" + }, + "label_count": { + "_$ref": "vysadw66" + }, + "label_month": { + "_$ref": "w2el6lze" + } + } + ], + "_$child": [ + { + "_$id": "pbaarf42", + "_$type": "Image", + "name": "icon", + "width": 288, + "height": 288, + "skin": "res://39efa94a-7d72-41e0-8970-51e3508f01f8", + "useSourceSize": true, + "color": "#ffffff" + }, + { + "_$id": "vysadw66", + "_$type": "Label", + "name": "label_count", + "x": 110, + "y": 233, + "width": 72, + "height": 20, + "centerX": 2, + "text": "03/20", + "fontSize": 24, + "color": "rgba(0, 0, 0, 1)", + "bold": true, + "valign": "middle", + "padding": "0,0,0,0" + }, + { + "_$id": "w2el6lze", + "_$type": "Label", + "name": "month", + "x": 94, + "y": 334, + "width": 100, + "height": 60, + "bottom": -106, + "centerX": 0, + "text": "Otc", + "fontSize": 42, + "color": "rgba(167, 171, 179, 1)", + "bold": true, + "valign": "middle", + "padding": "0,0,0,0" + } + ] + } + ] + }, + { + "_$id": "3hdbfl3a", + "_$type": "Sprite", + "name": "Sprite", + "y": 288, + "width": 960, + "height": 18, + "_gcmds": [ + { + "_$type": "DrawRectCmd", + "x": 0, + "y": 0, + "width": 1, + "height": 1, + "percent": true, + "lineWidth": 1, + "fillColor": "#ffffff" + } + ] + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/assets/resources/TrophyRoom.lh.meta b/assets/resources/TrophyRoom.lh.meta new file mode 100644 index 0000000..08c2eb1 --- /dev/null +++ b/assets/resources/TrophyRoom.lh.meta @@ -0,0 +1,3 @@ +{ + "uuid": "9bb199ae-4249-42ca-bc7a-49bbd550454b" +} \ No newline at end of file diff --git a/src/constants/respath.ts b/src/constants/respath.ts index 37f62c3..290f5e1 100644 --- a/src/constants/respath.ts +++ b/src/constants/respath.ts @@ -3,6 +3,7 @@ export const respath = { home_ui_res: "resources/Home.lh", dc_ui_res: "resources/DailyChallenge.lh", + trophy_ui_res: "resources/TrophyRoom.lh", stage_ui_res: "resources/Stage.lh", gameover_ui_res: "resources/GameOver.lh", gamedone_ui_res: "resources/GameDone.lh", diff --git a/src/models/UIManager.ts b/src/models/UIManager.ts index 29b1944..7a84557 100644 --- a/src/models/UIManager.ts +++ b/src/models/UIManager.ts @@ -43,6 +43,13 @@ export class UIManager extends Laya.Script { }) } + public loadTrophyUI(): void { + Laya.loader.load(respath.trophy_ui_res).then((go)=>{ + var prefab = go.create() + this.getUIRoot().addChild(prefab) + }) + } + public loadStageUI(stageID: string): void { if (this.stage) { this.stage.onLoadStage(StorageManager.getInstance().loadStage(stageID)) diff --git a/src/views/DailyChallenge.ts b/src/views/DailyChallenge.ts index f0259b4..a366184 100644 --- a/src/views/DailyChallenge.ts +++ b/src/views/DailyChallenge.ts @@ -14,6 +14,8 @@ export class DailyChallenge extends Laya.Script { @property(Laya.Button) public btn_back: Laya.Button + @property(Laya.Image) + public btn_trophy: Laya.Image @property(Laya.Image) public bg_dc: Laya.Image; @@ -52,6 +54,9 @@ export class DailyChallenge extends Laya.Script { UIManager.getInstance().loadHomeUI() this.owner.destroy() }) + this.btn_trophy.on(Laya.Event.CLICK, this, ()=>{ + UIManager.getInstance().loadTrophyUI() + }) var dayBegin = 4 var dayCount = 31 var user = StorageManager.getInstance().getUser() diff --git a/src/views/TrophyRoom.ts b/src/views/TrophyRoom.ts new file mode 100644 index 0000000..74c545b --- /dev/null +++ b/src/views/TrophyRoom.ts @@ -0,0 +1,38 @@ + + + +import { TrophyUnit } from "./TrophyUnit"; + +const { regClass, property } = Laya; + +@regClass() +export class TrophyRoom extends Laya.Script { + declare owner : Laya.Box; + + @property(Laya.Button) + public btn_back: Laya.Button; + + @property(Laya.Box) + public obj_items: Laya.Box; + private items: Array = new Array() + + //第一次执行update之前执行,只会执行一次 + onStart(): void { + + this.btn_back.on(Laya.Event.CLICK, this, ()=>{ + this.owner.destroy() + }) + + var month = 5 + for (var i=0; i