update daily

This commit is contained in:
Vick Scarlet
2021-11-09 00:08:05 +08:00
parent 2666983f89
commit c06cd9ea62
43 changed files with 4709 additions and 168 deletions

7
.vscode/launch.json vendored
View File

@@ -4,6 +4,13 @@
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome",
"request": "launch",
"type": "pwa-chrome",
"url": "http://172.27.192.1:8000/public/index.html",
"webRoot": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -2,8 +2,8 @@
"x":0,
"type":"View",
"selectedBox":1,
"selecteID":2,
"props":{"width":1125,"sceneColor":"#000000","sceneBg":"laya/views/view/CyberTheme/CyberAchievement.png","height":2436},
"selecteID":1,
"props":{"width":1125,"sceneColor":"#000000","sceneBg":"laya/views/view/CyberTheme/CyberAchievement.png","runtime":"ViewBase","height":2436},
"nodeParent":-1,
"label":"View",
"isOpen":true,

View File

@@ -2,8 +2,8 @@
"x":0,
"type":"View",
"selectedBox":1,
"selecteID":11,
"props":{"width":1125,"sceneColor":"#000000","sceneBg":"laya/views/view/CyberTheme/CyberMain.png","height":2436},
"selecteID":68,
"props":{"width":1125,"sceneColor":"#000000","sceneBg":"laya/views/view/CyberTheme/CyberMain.png","runtime":"ViewBase","height":2436},
"nodeParent":-1,
"label":"View",
"isOpen":true,
@@ -42,9 +42,9 @@
{
"x":15,
"type":"Image",
"props":{"skin":"images/accessories/title@3x.png","centerY":-350,"centerX":0},
"props":{"var":"imgTitle","skin":"images/accessories/title@3x.png","runtime":"ColorFilterItem","name":"imgTitle","centerY":-350,"centerX":0},
"nodeParent":1,
"label":"Image",
"label":"Image(imgTitle)",
"isOpen":false,
"isDirectory":true,
"isAniNode":true,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
"type":"View",
"selectedBox":1,
"selecteID":1,
"props":{"width":1125,"sceneColor":"#000000","sceneBg":"laya/views/view/CyberTheme/CyberTalent.png","height":2436},
"props":{"width":1125,"sceneColor":"#000000","sceneBg":"laya/views/view/CyberTheme/CyberTalent.png","runtime":"ViewBase","height":2436},
"nodeParent":-1,
"label":"View",
"isOpen":true,
@@ -401,13 +401,14 @@
"props":{"y":0,"x":0,"var":"pageResult","top":0,"right":0,"name":"pageResult","left":0,"bottom":0},
"nodeParent":1,
"label":"Box(pageResult)",
"isOpen":false,
"isOpen":true,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
"compId":21,
"child":[
{
"x":30,
"type":"List",
"props":{"var":"listTalents","vScrollBarSkin":" ","top":310,"right":20,"name":"listTalents","left":20,"bottom":370},
"nodeParent":21,
@@ -419,6 +420,7 @@
"compId":22,
"child":[
{
"x":45,
"type":"Box",
"props":{"width":537,"renderType":"render","height":352},
"nodeParent":22,
@@ -430,6 +432,7 @@
"compId":23,
"child":[
{
"x":60,
"type":"Image",
"props":{"top":0,"skin":"images/border/talent_item@3x.png","right":0,"name":"unselected","left":0,"bottom":0},
"nodeParent":23,
@@ -443,6 +446,7 @@
"$HIDDEN":false
},
{
"x":60,
"type":"Image",
"props":{"top":0,"skin":"images/border/talent_item_selected@3x.png","right":0,"name":"selected","left":0,"bottom":3},
"nodeParent":23,
@@ -456,6 +460,7 @@
"$HIDDEN":false
},
{
"x":60,
"type":"HBox",
"props":{"top":104,"space":15,"name":"hboxTitle","left":66,"height":58},
"nodeParent":23,
@@ -467,6 +472,7 @@
"compId":26,
"child":[
{
"x":75,
"type":"Box",
"props":{"y":0,"x":0,"width":15,"name":"grades","height":58},
"nodeParent":26,
@@ -478,6 +484,7 @@
"compId":108,
"child":[
{
"x":90,
"type":"Box",
"props":{"width":15,"name":"grade1","height":58},
"nodeParent":108,
@@ -489,6 +496,7 @@
"compId":27,
"child":[
{
"x":105,
"type":"Sprite",
"props":{},
"nodeParent":27,
@@ -500,6 +508,7 @@
"compId":28,
"child":[
{
"x":120,
"type":"Rect",
"props":{"width":15,"lineWidth":1,"height":58,"fillColor":"#55fffe"},
"nodeParent":28,
@@ -515,6 +524,7 @@
}]
},
{
"x":90,
"type":"Box",
"props":{"width":15,"name":"grade2","height":58},
"nodeParent":108,
@@ -526,6 +536,7 @@
"compId":105,
"child":[
{
"x":105,
"type":"Sprite",
"props":{},
"nodeParent":105,
@@ -537,6 +548,7 @@
"compId":106,
"child":[
{
"x":120,
"type":"Rect",
"props":{"width":15,"lineWidth":1,"height":58,"fillColor":"#b17cff"},
"nodeParent":106,
@@ -552,6 +564,7 @@
}]
},
{
"x":90,
"type":"Box",
"props":{"width":15,"name":"grade3","height":58},
"nodeParent":108,
@@ -563,6 +576,7 @@
"compId":102,
"child":[
{
"x":105,
"type":"Sprite",
"props":{},
"nodeParent":102,
@@ -574,6 +588,7 @@
"compId":103,
"child":[
{
"x":120,
"type":"Rect",
"props":{"width":15,"lineWidth":1,"height":58,"fillColor":"#ffce45"},
"nodeParent":103,
@@ -590,6 +605,7 @@
}]
},
{
"x":75,
"type":"Label",
"props":{"x":1,"text":"Title","name":"labTitle","fontSize":58,"font":"方正像素12","color":"#ffffff"},
"nodeParent":26,
@@ -603,6 +619,7 @@
}]
},
{
"x":60,
"type":"Label",
"props":{"y":205,"wordWrap":true,"text":"description","right":66,"name":"labDescription","left":66,"leading":8,"fontSize":44,"font":"方正像素12","color":"#9dacaf"},
"nodeParent":23,
@@ -619,6 +636,7 @@
"$HIDDEN":false
},
{
"x":30,
"type":"Button",
"props":{"width":1040,"var":"btnNext","skin":"images/button/button_main@3x.png","name":"btnNext","labelSize":60,"label":"UI_Next","height":192,"centerY":1040,"centerX":0},
"nodeParent":21,
@@ -630,6 +648,7 @@
"compId":33,
"child":[
{
"x":45,
"type":"Box",
"props":{},
"nodeParent":33,
@@ -810,11 +829,12 @@
}]
},
{
"x":45,
"type":"Box",
"props":{},
"nodeParent":33,
"label":"Box",
"isOpen":true,
"isOpen":false,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
@@ -918,14 +938,13 @@
"props":{"y":160,"x":563,"space":30,"height":70,"centerX":0,"anchorY":0.5,"anchorX":0.5},
"nodeParent":20,
"label":"HBox",
"isOpen":true,
"isOpen":false,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
"compId":13,
"child":[
{
"x":45,
"type":"Image",
"props":{"y":10,"x":1,"skin":"images/accessories/title_left@3x.png","name":"left"},
"nodeParent":13,
@@ -938,7 +957,6 @@
]
},
{
"x":45,
"type":"Label",
"props":{"y":0,"x":2,"text":"UI_Title_Talent","fontSize":60,"font":"方正像素12","color":"#ffffff"},
"nodeParent":13,
@@ -951,7 +969,6 @@
]
},
{
"x":45,
"type":"Image",
"props":{"y":10,"x":3,"skin":"images/accessories/title_right@3x.png","name":"right"},
"nodeParent":13,

View File

@@ -2,8 +2,8 @@
"x":0,
"type":"View",
"selectedBox":1,
"selecteID":2,
"props":{"width":1125,"sceneColor":"#000000","height":2436},
"selecteID":1,
"props":{"width":1125,"sceneColor":"#000000","runtime":"ViewBase","height":2436},
"nodeParent":-1,
"label":"View",
"isOpen":true,

View File

@@ -1,12 +1,12 @@
{
"x":0,
"type":"View",
"selectedBox":1,
"selecteID":25,
"props":{"width":1125,"sceneColor":"#000000","sceneBg":"laya/views/view/CyberTheme/CyberTrajectory.png","height":2436},
"selectedBox":102,
"selecteID":19,
"props":{"width":1125,"sceneColor":"#000000","sceneBg":"laya/views/view/CyberTheme/CyberTrajectory.png","runtime":"ViewBase","height":2436},
"nodeParent":-1,
"label":"View",
"isOpen":false,
"isOpen":true,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
@@ -100,9 +100,9 @@
"child":[
{
"type":"Box",
"props":{"x":1,"width":260,"height":82},
"props":{"x":1,"width":260,"name":"boxCharm","height":82},
"nodeParent":71,
"label":"Box",
"label":"Box(boxCharm)",
"isOpen":true,
"isDirectory":true,
"isAniNode":true,
@@ -148,7 +148,7 @@
},
{
"type":"Label",
"props":{"text":"颜值","fontSize":40,"font":"方正像素12","color":"#ffffff","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"props":{"text":"UI_Property_Charm","fontSize":40,"font":"方正像素12","color":"#ffffff","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"nodeParent":34,
"label":"Label",
"isDirectory":false,
@@ -171,9 +171,9 @@
"child":[
{
"type":"Label",
"props":{"text":"10","fontSize":55,"font":"方正像素12","color":"#55fffe","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"props":{"var":"labCharm","text":"10","name":"labCharm","fontSize":55,"font":"方正像素12","color":"#55fffe","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"nodeParent":41,
"label":"Label",
"label":"Label(labCharm)",
"isDirectory":false,
"isAniNode":true,
"hasChild":false,
@@ -186,10 +186,10 @@
},
{
"type":"Box",
"props":{"y":0,"x":2,"width":260,"height":82},
"props":{"y":0,"x":2,"width":260,"name":"boxMoney","height":82},
"nodeParent":71,
"label":"Box",
"isOpen":true,
"label":"Box(boxMoney)",
"isOpen":false,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
@@ -234,7 +234,7 @@
},
{
"type":"Label",
"props":{"text":"家境","fontSize":40,"font":"方正像素12","color":"#ffffff","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"props":{"text":"UI_Property_Money","fontSize":40,"font":"方正像素12","color":"#ffffff","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"nodeParent":43,
"label":"Label",
"isDirectory":false,
@@ -257,9 +257,9 @@
"child":[
{
"type":"Label",
"props":{"text":"10","fontSize":55,"font":"方正像素12","color":"#55fffe","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"props":{"var":"labMoney","text":"10","name":"labMoney","fontSize":55,"font":"方正像素12","color":"#55fffe","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"nodeParent":48,
"label":"Label",
"label":"Label(labMoney)",
"isDirectory":false,
"isAniNode":true,
"hasChild":false,
@@ -271,10 +271,10 @@
},
{
"type":"Box",
"props":{"x":3,"width":260,"height":82},
"props":{"x":3,"width":260,"name":"boxIntelligence","height":82},
"nodeParent":71,
"label":"Box",
"isOpen":true,
"label":"Box(boxIntelligence)",
"isOpen":false,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
@@ -319,7 +319,7 @@
},
{
"type":"Label",
"props":{"text":"智力","fontSize":40,"font":"方正像素12","color":"#ffffff","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"props":{"text":"UI_Property_Intelligence","fontSize":40,"font":"方正像素12","color":"#ffffff","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"nodeParent":50,
"label":"Label",
"isDirectory":false,
@@ -342,9 +342,9 @@
"child":[
{
"type":"Label",
"props":{"text":"10","fontSize":55,"font":"方正像素12","color":"#55fffe","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"props":{"var":"labIntelligence","text":"10","name":"labIntelligence","fontSize":55,"font":"方正像素12","color":"#55fffe","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"nodeParent":55,
"label":"Label",
"label":"Label(labIntelligence)",
"isDirectory":false,
"isAniNode":true,
"hasChild":false,
@@ -369,10 +369,10 @@
"child":[
{
"type":"Box",
"props":{"y":0,"x":0,"width":260,"height":82},
"props":{"y":0,"x":0,"width":260,"name":"boxStrength","height":82},
"nodeParent":73,
"label":"Box",
"isOpen":true,
"label":"Box(boxStrength)",
"isOpen":false,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
@@ -417,7 +417,7 @@
},
{
"type":"Label",
"props":{"text":"体质","fontSize":40,"font":"方正像素12","color":"#ffffff","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"props":{"text":"UI_Property_Strength","fontSize":40,"font":"方正像素12","color":"#ffffff","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"nodeParent":74,
"label":"Label",
"isDirectory":false,
@@ -440,9 +440,9 @@
"child":[
{
"type":"Label",
"props":{"text":"10","fontSize":55,"font":"方正像素12","color":"#55fffe","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"props":{"var":"labStrength","text":"10","name":"labStrength","fontSize":55,"font":"方正像素12","color":"#55fffe","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"nodeParent":79,
"label":"Label",
"label":"Label(labStrength)",
"isDirectory":false,
"isAniNode":true,
"hasChild":false,
@@ -454,10 +454,10 @@
},
{
"type":"Box",
"props":{"width":260,"height":82},
"props":{"width":260,"name":"boxSpirit","height":82},
"nodeParent":73,
"label":"Box",
"isOpen":true,
"label":"Box(boxSpirit)",
"isOpen":false,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
@@ -502,7 +502,7 @@
},
{
"type":"Label",
"props":{"text":"快乐","fontSize":40,"font":"方正像素12","color":"#ffffff","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"props":{"text":"UI_Property_Spirit","fontSize":40,"font":"方正像素12","color":"#ffffff","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"nodeParent":81,
"label":"Label",
"isDirectory":false,
@@ -525,9 +525,9 @@
"child":[
{
"type":"Label",
"props":{"text":"10","fontSize":55,"font":"方正像素12","color":"#55fffe","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"props":{"var":"labSpirit","text":"10","name":"labSpirit","fontSize":55,"font":"方正像素12","color":"#55fffe","centerY":0,"centerX":0,"anchorY":5,"anchorX":0.5},
"nodeParent":86,
"label":"Label",
"label":"Label(labSpirit)",
"isDirectory":false,
"isAniNode":true,
"hasChild":false,
@@ -541,6 +541,7 @@
}],
"$HIDDEN":false
}],
"$LOCKED":true,
"$HIDDEN":false
},
{
@@ -549,17 +550,18 @@
"props":{"width":1,"height":1,"centerX":0,"bottom":-1},
"nodeParent":1,
"label":"Box",
"isOpen":false,
"isOpen":true,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
"compId":14,
"child":[
{
"x":30,
"type":"Button",
"props":{"y":-155,"width":500,"skin":"images/button/button_main@3x.png","label":"人生总结","height":180,"centerX":0},
"props":{"y":-155,"width":500,"var":"btnSummary","skin":"images/button/button_main@3x.png","name":"btnSummary","label":"人生总结","height":180,"centerX":0},
"nodeParent":14,
"label":"Button",
"label":"Button(btnSummary)",
"isDirectory":false,
"isAniNode":true,
"hasChild":false,
@@ -568,25 +570,26 @@
],
"$HIDDEN":false
}],
"$LOCKED":true,
"$HIDDEN":false
},
{
"x":15,
"type":"Panel",
"props":{"vScrollBarSkin":"images/slider/vslider_1@3x.png","top":440,"right":20,"left":20,"bottom":250},
"type":"Box",
"props":{"top":440,"right":20,"left":20,"bottom":250},
"nodeParent":1,
"label":"Panel",
"label":"Box",
"isOpen":true,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
"compId":18,
"compId":102,
"child":[
{
"x":30,
"type":"Image",
"props":{"y":0,"x":0,"top":0,"skin":"images/border/border_1@3x.png","right":0,"left":0,"bottom":0},
"nodeParent":18,
"props":{"top":0,"skin":"images/border/border_1@3x.png","right":0,"left":0,"bottom":0},
"nodeParent":102,
"label":"Image",
"isDirectory":false,
"isAniNode":true,
@@ -597,31 +600,116 @@
},
{
"x":30,
"type":"VBox",
"props":{"top":0,"centerX":0},
"nodeParent":18,
"label":"VBox",
"isDirectory":false,
"type":"Panel",
"props":{"var":"panelTrajectory","vScrollBarSkin":"images/slider/vslider_1@3x.png","top":80,"right":20,"name":"panelTrajectory","left":0,"bottom":80},
"nodeParent":102,
"label":"Panel(panelTrajectory)",
"isOpen":true,
"isDirectory":true,
"isAniNode":true,
"hasChild":false,
"compId":17,
"hasChild":true,
"compId":18,
"child":[
]
{
"x":45,
"type":"VBox",
"props":{"var":"vboxTrajectory","top":0,"right":40,"name":"vboxTrajectory","left":20},
"nodeParent":18,
"label":"VBox(vboxTrajectory)",
"isOpen":false,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
"compId":17,
"child":[
{
"type":"Box",
"props":{"right":0,"name":"boxTrajectoryItem","left":0},
"nodeParent":17,
"label":"Box(boxTrajectoryItem)",
"isOpen":true,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
"compId":88,
"child":[
{
"type":"HBox",
"props":{"y":0,"x":200,"name":"hboxAge","anchorX":1,"align":"middle"},
"nodeParent":88,
"label":"HBox(hboxAge)",
"isOpen":true,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
"compId":91,
"child":[
{
"type":"Label",
"props":{"x":0,"text":"3000","name":"labAge","fontSize":50,"font":"方正像素12","color":"#cfea5c","anchorX":0},
"nodeParent":91,
"label":"Label(labAge)",
"isDirectory":false,
"isAniNode":true,
"hasChild":false,
"compId":90,
"child":[
]
},
{
"type":"Label",
"props":{"x":1,"text":"岁","fontSize":50,"font":"方正像素12","color":"#cfea5c","anchorX":0},
"nodeParent":91,
"label":"Label",
"isDirectory":false,
"isAniNode":true,
"hasChild":false,
"compId":94,
"child":[
]
},
{
"type":"Label",
"props":{"x":2,"text":"","fontSize":50,"font":"方正像素12","color":"#cfea5c","anchorX":0},
"nodeParent":91,
"label":"Label",
"isDirectory":false,
"isAniNode":true,
"hasChild":false,
"compId":92,
"child":[
]
}]
},
{
"type":"Label",
"props":{"wordWrap":true,"text":"你的父母开始辅导你数学和英语,智力+1","right":0,"name":"labContent","left":220,"leading":44,"fontSize":50,"font":"方正像素12","color":"#ffffff"},
"nodeParent":88,
"label":"Label(labContent)",
"isDirectory":false,
"isAniNode":true,
"hasChild":false,
"compId":95,
"child":[
]
}]
}]
}],
"$HIDDEN":false
},
{
"x":30,
"type":"Box",
"props":{"top":20,"right":20,"left":20,"height":50},
"nodeParent":18,
"label":"Box",
"isOpen":true,
"props":{"y":20,"x":20,"var":"btnUp","top":20,"right":20,"name":"btnUp","left":20,"height":50},
"nodeParent":102,
"label":"Box(btnUp)",
"isOpen":false,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
"compId":19,
"child":[
{
"x":45,
"type":"Image",
"props":{"top":0,"skin":"images/border/up@3x.png","right":0,"left":0,"bottom":0},
"nodeParent":19,
@@ -634,7 +722,6 @@
]
},
{
"x":45,
"type":"Box",
"props":{"width":60,"height":60,"centerY":0,"centerX":0,"anchorY":0.5,"anchorX":0.5},
"nodeParent":19,
@@ -662,9 +749,9 @@
{
"x":30,
"type":"Box",
"props":{"right":20,"left":20,"height":50,"bottom":20},
"nodeParent":18,
"label":"Box",
"props":{"y":1676,"x":20,"var":"btnDown","right":20,"name":"btnDown","left":20,"height":50,"bottom":20},
"nodeParent":102,
"label":"Box(btnDown)",
"isOpen":false,
"isDirectory":true,
"isAniNode":true,
@@ -707,8 +794,7 @@
]
}]
}]
}],
"$HIDDEN":false
}]
}],
"animations":[
{

View File

@@ -2,8 +2,8 @@
"x":0,
"type":"View",
"selectedBox":1,
"selecteID":10,
"props":{"width":1125,"sceneColor":"#000000","height":2436},
"selecteID":1,
"props":{"width":1125,"sceneColor":"#000000","runtime":"ViewBase","height":2436},
"nodeParent":-1,
"label":"View",
"isOpen":true,
@@ -77,7 +77,7 @@
{
"x":15,
"type":"Label",
"props":{"text":"Now Loading","fontSize":80,"font":"Impact","color":"#ffffff","centerY":400,"centerX":0},
"props":{"text":"UI_Loading","fontSize":80,"font":"Impact","color":"#ffffff","centerY":400,"centerX":0},
"nodeParent":1,
"label":"Label",
"isDirectory":false,

View File

@@ -38,10 +38,14 @@ P 6ECB5FEC icon_up@3x.png
D images/progress
P E2BF0C93 progress_1@3x$bar.png
P B86E1D0F progress_1@3x.png
P E7F15BA7 progress_2$bar.png
P 641A22BF progress_2.png
D images/resource
P F3659301 bottombreath.png
P 496D6FB9 circle.png
P B5087365 circleflash.png
D images/slider
R 8B95E6D3 vslider_1@3x$bar.png
P 6581FBA8 vslider_1@3x$down.png
P 6581FBA8 vslider_1@3x$up.png
R C9587878 vslider_1@3x.png

View File

@@ -1 +1 @@
{"frames":{"progress_1@3x$bar.png":{"frame":{"h":36,"idx":0,"w":203,"x":0,"y":0},"sourceSize":{"h":36,"w":203},"spriteSourceSize":{"x":0,"y":0}},"progress_1@3x.png":{"frame":{"h":36,"idx":0,"w":203,"x":0,"y":37},"sourceSize":{"h":36,"w":203},"spriteSourceSize":{"x":0,"y":0}}},"meta":{"image":"progress.png","prefix":"images/progress/"}}
{"frames":{"progress_1@3x$bar.png":{"frame":{"h":36,"idx":0,"w":203,"x":0,"y":201},"sourceSize":{"h":36,"w":203},"spriteSourceSize":{"x":0,"y":0}},"progress_1@3x.png":{"frame":{"h":36,"idx":0,"w":203,"x":204,"y":201},"sourceSize":{"h":36,"w":203},"spriteSourceSize":{"x":0,"y":0}},"progress_2$bar.png":{"frame":{"h":200,"idx":0,"w":200,"x":0,"y":0},"sourceSize":{"h":200,"w":200},"spriteSourceSize":{"x":0,"y":0}},"progress_2.png":{"frame":{"h":200,"idx":0,"w":200,"x":201,"y":0},"sourceSize":{"h":200,"w":200},"spriteSourceSize":{"x":0,"y":0}}},"meta":{"image":"progress.png","prefix":"images/progress/"}}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 666 B

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1 @@
{"frames":{"vslider_1@3x$down.png":{"frame":{"h":1,"idx":0,"w":1,"x":0,"y":0},"sourceSize":{"h":1,"w":1},"spriteSourceSize":{"x":0,"y":0}},"vslider_1@3x$up.png":{"frame":{"h":1,"idx":0,"w":1,"x":0,"y":2},"sourceSize":{"h":1,"w":1},"spriteSourceSize":{"x":0,"y":0}}},"meta":{"image":"slider.png","prefix":"images/slider/"}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

View File

@@ -70,6 +70,7 @@
<script type="text/javascript" src="../src/ui/layaUI.max.all.js"></script>
<script type="text/javascript" src="../src/ui/promisesLaya.js"></script>
<script type="text/javascript" src="../src/ui/uiManager.js"></script>
<script type="text/javascript" src="../src/ui/pluginFunction.js"></script>
<script type="module" src="../src/index.js"></script>
<!--jsfile--endTag-->
</body>

View File

@@ -1,4 +1,4 @@
import ViewTypes from './view/views.js';
import ViewTypes from './ui/themes/views.js';
class App{
constructor(){
@@ -57,6 +57,7 @@ class App{
"images/atlas/images/button.atlas",
"images/atlas/images/icons.atlas",
"images/atlas/images/progress.atlas",
"images/atlas/images/slider.atlas",
]
});
}

View File

@@ -12,20 +12,39 @@ export default ({
UI_Close: 'Close',
UI_Open: 'Open',
UI_Search: 'Search',
UI_Loading: 'Loading',
UI_Loading: 'Now Loading',
UI_Error: 'Error',
UI_Colon: ':',
UI_Property_Charm: 'CHR',
UI_Property_Intelligence: 'INT',
UI_Property_Strength: 'STR',
UI_Property_Money: 'MNY',
UI_Property_Spirit: 'SPR',
UI_Title_Remake: 'Remake Simulate',
UI_Title_Subsequent: 'The rubbish life doesn\'t want to stay for a second',
UI_Cyber_Theme_Art_Design: 'UI Design by 晰晰',
UI_Remake: 'Remake Now',
UI_Thanks: 'Thx',
UI_Achievement: 'Achv',
UI_Cyber_Theme_Art_Design: 'UI Design by 晰晰',
UI_Title_Talent: 'Talent Draw',
UI_Talent_Draw: '!10 Pulls!',
UI_Talent_Select_Uncomplete: 'Choose 3 Talents, Please.',
UI_Title_Property: 'Property Allocate',
UI_Left_Property_Point: 'Left Property Point',
UI_Selected_Talent: 'Selected Talent',
UI_Random_Allocate: 'Random Allocate',
UI_Make_New_Life: 'Make New Life',
UI_Title_Summary: 'Life Summary',
UI_Talent_Extend: 'Talent, You can choose one to extend',
UI_Remake_Again: 'Remake Again',
UI_Final_Age: 'Age',
UI_Total_Judge: 'Judge',
});

View File

@@ -15,17 +15,35 @@ export default ({
UI_Loading: '加载中...',
UI_Error: '错误',
UI_Colon: '',
UI_Property_Charm: '颜值',
UI_Property_Intelligence: '智力',
UI_Property_Strength: '体质',
UI_Property_Money: '家境',
UI_Property_Spirit: '快乐',
UI_Title_Remake: '人生重开模拟器',
UI_Title_Subsequent: '这垃圾人生一秒也不想待了',
UI_Cyber_Theme_Art_Design: 'UI 设计 by 晰晰',
UI_Remake: '立即重开',
UI_Thanks: '感谢',
UI_Achievement: '成就',
UI_Cyber_Theme_Art_Design: 'UI 设计 by 晰晰',
UI_Title_Talent: '天赋抽卡',
UI_Talent_Draw: '10连抽',
UI_Talent_Select_Uncomplete: '请选取 3 个天赋',
UI_Title_Property: '调整初始属性',
UI_Left_Property_Point: '剩余属性点',
UI_Selected_Talent: '已选天赋',
UI_Random_Allocate: '随机分配',
UI_Make_New_Life: '开始新人生',
UI_Title_Summary: '人生总结',
UI_Talent_Extend: '天赋:你可以选择一个,下辈子还能抽到',
UI_Remake_Again: '再次重开',
UI_Final_Age: '享年',
UI_Total_Judge: '总评',
});

View File

@@ -1,6 +1,24 @@
import App from './app.js';
import Life from './modules/life.js';
globalThis.$$eventMap = new Map();
globalThis.$$event = (tag, data) => {
const listener = $$eventMap.get(tag);
if(listener) listener.forEach(fn=>fn(data));
}
globalThis.$$on = (tag, fn) => {
let listener = $$eventMap.get(tag);
if(!listener) {
listener = new Set();
$$eventMap.set(tag, listener);
}
listener.add(fn);
}
globalThis.$$off = (tag, fn) => {
const listener = $$eventMap.get(tag);
if(listener) listener.delete(fn);
}
const core = new Life();
const game = new App();
globalThis.core = core;
@@ -12,4 +30,16 @@ location.search.substr(1).split('&').forEach(item => {
query[parts[0]] = parts[1];
});
core.config({
defaultPropertyPoints: 20, // default number of points for a property
talentSelectLimit: 3, // max number of talents that can be selected
propertyAllocateLimit: [0, 10], // scoop of properties that can be allocated
talentConfig: { // config for talent
talentPullCount: 10, // number of talents to pull from the talent pool
talentRate: { 1:100, 2:10, 3:1, total: 1000 }, // rate of talent pull
},
defaultPropertys: {
SPR: 5,
}
})
game.start(query);

View File

@@ -1,4 +1,4 @@
import { weightRandom } from '../functions/util.js'
import { clone, weightRandom } from '../functions/util.js'
import Property from './property.js';
import Event from './event.js';
import Talent from './talent.js';
@@ -17,6 +17,10 @@ class Life {
#talent;
#achievement;
#triggerTalents;
#defaultPropertyPoints;
#talentSelectLimit;
#propertyAllocateLimit;
#defaultPropertys;
async initial(loadJSON) {
const [age, talents, events, achievements] = await Promise.all([
@@ -31,10 +35,28 @@ class Life {
this.#achievement.initial({achievements});
}
config({
defaultPropertyPoints = 20, // default number of points for a property
talentSelectLimit = 3, // max number of talents that can be selected
propertyAllocateLimit = [0, 10], // scoop of properties that can be allocated
defaultPropertys = {}, // default propertys
talentConfig, // config for talent
} = {}) {
this.#defaultPropertyPoints = defaultPropertyPoints;
this.#talentSelectLimit = talentSelectLimit;
this.#propertyAllocateLimit = propertyAllocateLimit;
this.#defaultPropertys = defaultPropertys;
this.#talent.config(talentConfig);
}
restart(allocation) {
const propertys = clone(this.#defaultPropertys);
for(const key in allocation) {
propertys[key] = clone(allocation[key]);
}
this.#triggerTalents = {};
const contents = this.talentReplace(allocation.TLT);
this.#property.restart(allocation);
const contents = this.talentReplace(propertys.TLT);
this.#property.restart(propertys);
this.doTalent()
this.#property.restartLastStep();
this.#achievement.achieve(
@@ -44,8 +66,8 @@ class Life {
return contents;
}
getTalentAllocationAddition(talents) {
return this.#talent.allocationAddition(talents);
getPropertyPoints(selectedTalentIds) {
return this.#defaultPropertyPoints + this.#talent.allocationAddition(selectedTalentIds);
}
getTalentCurrentTriggerCount(talentId) {
@@ -208,6 +230,12 @@ class Life {
}
}
get PropertyTypes() { return clone(this.#property.TYPES); }
get talentSelectLimit() { return this.#talentSelectLimit; }
get propertyAllocateLimit() { return clone(this.#propertyAllocateLimit); }
get propertys() { return this.#property.getPropertys(); }
get times() { return this.#property?.get(this.#property.TYPES.TMS) || 0; }
set times(v) {
this.#property?.set(this.#property.TYPES.TMS, v) || 0;

View File

@@ -237,7 +237,7 @@ class Property {
}
}
getLastRecord() {
getPropertys() {
return clone({
[this.TYPES.AGE]: this.get(this.TYPES.AGE),
[this.TYPES.CHR]: this.get(this.TYPES.CHR),

View File

@@ -6,6 +6,9 @@ class Talent {
constructor() {}
#talents;
#talentPullCount;
#talentRate;
#rateAddition;
initial({talents}) {
this.#talents = talents;
@@ -27,6 +30,14 @@ class Talent {
}
}
config({
talentPullCount = 10, // number of talents to pull from the talent pool
talentRate = { 1:100, 2:10, 3:1, total: 1000 }, // rate of talent pull
} = {}) {
this.#talentPullCount = talentPullCount;
this.#talentRate = talentRate;
}
count() {
return Object.keys(this.#talents).length;
}
@@ -59,7 +70,7 @@ class Talent {
}
talentRandom(include, {times = 0, achievement = 0} = {}) {
const rate = { 1:100, 2:10, 3:1, };
const rate = clone(this.#talentRate);
const rateAddition = { 1:1, 2:1, 3:1, };
const timesRate = getRate('times', times);
const achievementRate = getRate('achievement', achievement);
@@ -74,7 +85,7 @@ class Talent {
rate[grade] *= rateAddition[grade];
const randomGrade = () => {
let randomNumber = Math.floor(Math.random() * 1000);
let randomNumber = Math.floor(Math.random() * rate.total);
if((randomNumber -= rate[3]) < 0) return 3;
if((randomNumber -= rate[2]) < 0) return 2;
if((randomNumber -= rate[1]) < 0) return 1;
@@ -93,7 +104,7 @@ class Talent {
else talentList[grade].push({ grade, name, description, id });
}
return new Array(10)
return new Array(this.#talentPullCount)
.fill(1).map((v, i)=>{
if(!i && include) return include;
let grade = randomGrade();

File diff suppressed because one or more lines are too long

24
src/ui/pluginFunction.js Normal file
View File

@@ -0,0 +1,24 @@
var plugin = {};
plugin.extractComponents = function(uiView, componentNames) {
const components = {};
const deepSearch = (uiView, componentNames) => {
if(!uiView.child) return;
for(let i = uiView.child.length - 1; i >= 0; i--) {
const child = uiView.child[i];
if(componentNames.includes(child?.props.name)) {
components[child.props.name] = child;
uiView.child.splice(i, 1);
continue;
}
deepSearch(child, componentNames, components);
}
};
deepSearch(uiView, componentNames);
return componentName => {
if(components[componentName]) {
return Laya.View.createComp(components[componentName]);
}
return null;
}
}

View File

@@ -1,3 +1,68 @@
class ColorFilterItem extends Laya.Image {
constructor() {
super();
}
#hexToRgba = (hex) => {
const rgba = [];
hex = hex.replace('#', '');
hex = hex.match(new RegExp('(.{2})(.{2})(.{2})(.{2})', 'i'));
hex.forEach((item, index) => {
rgba[index] = parseInt(item, 16);
});
rgba.shift();
return rgba;
}
#rgbaToMatrix = (rgba) => {
let matrix = [
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0
];
matrix[0] = rgba[0] / 255;
matrix[6] = rgba[1] / 255;
matrix[12] = rgba[2] / 255;
matrix[18] = rgba[3] / 255;
return matrix;
}
get colorFilter() {
return this._colorFilter;
}
set colorFilter(value) {
this._colorFilter = value;
if(value) {
const rgba = this.#hexToRgba(this.colorFilter);
const matrix = this.#rgbaToMatrix(rgba);
const colorFilter = new Laya.ColorFilter(matrix);
this.filters = [colorFilter];
} else {
this.filters = [];
}
}
}
class UIBase extends Laya.View {
constructor() {
super();
}
}
class ViewBase extends UIBase {
constructor() {
super();
}
}
class dialogBase extends UIBase {
constructor() {
super();
}
}
class ScaleButton extends Laya.Button {
constructor() {
super();
@@ -19,4 +84,5 @@ class ScaleButton extends Laya.Button {
break;
}
}
}
}

View File

@@ -0,0 +1,244 @@
export default class cyberProperty extends CyberPropertyUI {
constructor() {
super();
const types =
this.#types = core.PropertyTypes;
this.btnCharmIncrease.on(Laya.Event.CLICK, this, this.onPropertyAllocate, [types.CHR, 1]);
this.btnCharmReduce.on(Laya.Event.CLICK, this, this.onPropertyAllocate, [types.CHR, -1]);
this.btnIntelligenceIncrease.on(Laya.Event.CLICK, this, this.onPropertyAllocate, [types.INT, 1]);
this.btnIntelligenceReduce.on(Laya.Event.CLICK, this, this.onPropertyAllocate, [types.INT, -1]);
this.btnStrengthIncrease.on(Laya.Event.CLICK, this, this.onPropertyAllocate, [types.STR, 1]);
this.btnStrengthReduce.on(Laya.Event.CLICK, this, this.onPropertyAllocate, [types.STR, -1]);
this.btnMoneyIncrease.on(Laya.Event.CLICK, this, this.onPropertyAllocate, [types.MNY, 1]);
this.btnMoneyReduce.on(Laya.Event.CLICK, this, this.onPropertyAllocate, [types.MNY, -1]);
this.inputCharm.on(Laya.Event.INPUT, this, this.onPropertyAllocateInput, [types.CHR]);
this.inputIntelligence.on(Laya.Event.INPUT, this, this.onPropertyAllocateInput, [types.INT]);
this.inputStrength.on(Laya.Event.INPUT, this, this.onPropertyAllocateInput, [types.STR]);
this.inputMoney.on(Laya.Event.INPUT, this, this.onPropertyAllocateInput, [types.MNY]);
const selectAll = ({currentTarget: item}) => { item.text=''; };
this.inputCharm.on(Laya.Event.MOUSE_DOWN, this, selectAll);
this.inputIntelligence.on(Laya.Event.MOUSE_DOWN, this, selectAll);
this.inputStrength.on(Laya.Event.MOUSE_DOWN, this, selectAll);
this.inputMoney.on(Laya.Event.MOUSE_DOWN, this, selectAll);
this.btnRandomAllocate.on(Laya.Event.CLICK, this, this.random);
this.btnNext.on(Laya.Event.CLICK, this, this.next);
this.listSelectedTalents.renderHandler = Laya.Handler.create(this, this.renderTalent, null, false);
}
#types;
#propertyPoints;
#propertyAllocate;
#propertyAllocateLimit;
init({talents}) {
this.listSelectedTalents.array = talents;
const talentIds = talents.map(talent => talent.id);
// core.talentReplace(talentIds);
this.#propertyPoints = core.getPropertyPoints(talentIds);
this.#propertyAllocateLimit = core.propertyAllocateLimit;
this.labLeftPropertyPoint.text = this.#propertyPoints;
this.#propertyAllocate = {
[this.#types.CHR]: 0,
[this.#types.INT]: 0,
[this.#types.STR]: 0,
[this.#types.MNY]: 0,
[this.#types.TLT]: talentIds,
}
this.updateAllocate();
}
next() {
if (this.total < this.#propertyPoints) {
return;
}
UIManager.getInstance().switchView(
UIManager.getInstance().themes.TRAJECTORY,
{
propertyAllocate: this.#propertyAllocate,
talents: this.listSelectedTalents.array,
}
);
}
get total() {
return this.#propertyAllocate[this.#types.CHR]
+ this.#propertyAllocate[this.#types.INT]
+ this.#propertyAllocate[this.#types.STR]
+ this.#propertyAllocate[this.#types.MNY];
}
updateAllocate() {
const charm = this.#propertyAllocate[this.#types.CHR];
const intelligence = this.#propertyAllocate[this.#types.INT];
const strength = this.#propertyAllocate[this.#types.STR];
const money = this.#propertyAllocate[this.#types.MNY];
this.inputCharm.text = ''+charm;
this.inputIntelligence.text = ''+intelligence;
this.inputStrength.text = ''+strength;
this.inputMoney.text = ''+money;
this.labLeftPropertyPoint.text = this.#propertyPoints - this.total;
this.btnCharmIncrease.disabled = this.btnCharmIncrease.gray = false;
this.btnCharmReduce.disabled = this.btnCharmReduce.gray = false;
this.btnIntelligenceIncrease.disabled = this.btnIntelligenceIncrease.gray = false;
this.btnIntelligenceReduce.disabled = this.btnIntelligenceReduce.gray = false;
this.btnStrengthIncrease.disabled = this.btnStrengthIncrease.gray = false;
this.btnStrengthReduce.disabled = this.btnStrengthReduce.gray = false;
this.btnMoneyIncrease.disabled = this.btnMoneyIncrease.gray = false;
this.btnMoneyReduce.disabled = this.btnMoneyReduce.gray = false;
if (this.total >= this.#propertyPoints) {
this.btnCharmIncrease.disabled = this.btnCharmIncrease.gray = true;
this.btnIntelligenceIncrease.disabled = this.btnIntelligenceIncrease.gray = true;
this.btnStrengthIncrease.disabled = this.btnStrengthIncrease.gray = true;
this.btnMoneyIncrease.disabled = this.btnMoneyIncrease.gray = true;
} else if (this.total <= 0) {
this.btnCharmReduce.disabled = this.btnCharmReduce.gray = true;
this.btnIntelligenceReduce.disabled = this.btnIntelligenceReduce.gray = true;
this.btnStrengthReduce.disabled = this.btnStrengthReduce.gray = true;
this.btnMoneyReduce.disabled = this.btnMoneyReduce.gray = true;
}
if (charm <= this.#propertyAllocateLimit[0]) {
this.btnCharmReduce.disabled = this.btnCharmReduce.gray = true;
} else if (charm >= this.#propertyAllocateLimit[1]) {
this.btnCharmIncrease.disabled = this.btnCharmIncrease.gray = true;
}
if (intelligence <= this.#propertyAllocateLimit[0]) {
this.btnIntelligenceReduce.disabled = this.btnIntelligenceReduce.gray = true;
} else if (intelligence >= this.#propertyAllocateLimit[1]) {
this.btnIntelligenceIncrease.disabled = this.btnIntelligenceIncrease.gray = true;
}
if (strength <= this.#propertyAllocateLimit[0]) {
this.btnStrengthReduce.disabled = this.btnStrengthReduce.gray = true;
} else if (strength >= this.#propertyAllocateLimit[1]) {
this.btnStrengthIncrease.disabled = this.btnStrengthIncrease.gray = true;
}
if (money <= this.#propertyAllocateLimit[0]) {
this.btnMoneyReduce.disabled = this.btnMoneyReduce.gray = true;
} else if (money >= this.#propertyAllocateLimit[1]) {
this.btnMoneyIncrease.disabled = this.btnMoneyIncrease.gray = true;
}
}
check(left, right, value) {
if (value < left) return false;
if (value > right) return false;
return true;
}
random() {
let t = this.#propertyPoints;
const arr = new Array(4).fill(this.#propertyAllocateLimit[1]);
while (t > 0) {
const sub = Math.round(Math.random() * (Math.min(t, this.#propertyAllocateLimit[1]) - 1)) + 1;
while(true) {
const select = Math.floor(Math.random() * 4) % 4;
if(arr[select] - sub <0) continue;
arr[select] -= sub;
t -= sub;
break;
}
}
this.#propertyAllocate[this.#types.CHR] = this.#propertyAllocateLimit[1] - arr[0];
this.#propertyAllocate[this.#types.INT] = this.#propertyAllocateLimit[1] - arr[1];
this.#propertyAllocate[this.#types.STR] = this.#propertyAllocateLimit[1] - arr[2];
this.#propertyAllocate[this.#types.MNY] = this.#propertyAllocateLimit[1] - arr[3];
this.updateAllocate();
}
onPropertyAllocate(type, value) {
if (!this.check(
this.#propertyAllocateLimit[0],
this.#propertyAllocateLimit[1],
this.#propertyAllocate[type] + value
)) {
return;
}
if (!this.check(
0,
this.#propertyPoints,
this.total + value
)) {
return;
}
this.#propertyAllocate[type] += value;
this.updateAllocate();
}
onPropertyAllocateInput(type, inputItem) {
let value = parseInt(inputItem.text) || 0;
const total = this.total;
if (total + value < 0) {
value = this.#propertyAllocateLimit[0] * 4 - total;
} else if (total + value > this.#propertyPoints) {
value = this.#propertyPoints - total;
}
if (value < this.#propertyAllocateLimit[0]) {
value = this.#propertyAllocateLimit[0];
} else if (value > this.#propertyAllocateLimit[1]) {
value = this.#propertyAllocateLimit[1];
}
const alter = value - this.#propertyAllocate[type];
if (alter) {
this.onPropertyAllocate(type, alter);
} else {
this.updateAllocate();
}
}
renderTalent(box, index) {
const dataSource = box.dataSource;
console.debug(index, dataSource, box);
const labTitle = box.getChildByName("labTitle");
const grade1 = box.getChildByName("grade1");
const grade2 = box.getChildByName("grade2");
const grade3 = box.getChildByName("grade3");
const labDescription = box.getChildByName("labDescription");
labTitle.text = dataSource.name;
labDescription.text = dataSource.description;
switch (dataSource.grade) {
case 1:
grade1.visible = true;
grade2.visible = false;
grade3.visible = false;
break;
case 2:
grade1.visible = false;
grade2.visible = true;
grade3.visible = false;
break;
case 3:
grade1.visible = false;
grade2.visible = false;
grade3.visible = true;
break;
default:
grade1.visible = false;
grade2.visible = false;
grade3.visible = false;
break;
}
}
}

View File

@@ -0,0 +1,46 @@
export default class cyberSummary extends CyberSummaryUI {
constructor() {
super();
this.listSelectedTalents.renderHandler = Laya.Handler.create(this, this.renderTalent, null, false);
}
init({talents}) {
this.listSelectedTalents.array = talents;
}
renderTalent(box, index) {
const dataSource = box.dataSource;
console.debug(index, dataSource, box);
const labTitle = box.getChildByName("labTitle");
const grade1 = box.getChildByName("grade1");
const grade2 = box.getChildByName("grade2");
const grade3 = box.getChildByName("grade3");
const labDescription = box.getChildByName("labDescription");
labTitle.text = dataSource.name;
labDescription.text = dataSource.description;
switch (dataSource.grade) {
case 1:
grade1.visible = true;
grade2.visible = false;
grade3.visible = false;
break;
case 2:
grade1.visible = false;
grade2.visible = true;
grade3.visible = false;
break;
case 3:
grade1.visible = false;
grade2.visible = false;
grade3.visible = true;
break;
default:
grade1.visible = false;
grade2.visible = false;
grade3.visible = false;
break;
}
}
}

View File

@@ -3,11 +3,14 @@ export default class CyberTalent extends CyberTalentUI {
super();
this.btnDrawCard.on(Laya.Event.CLICK, this, this.onClickDrawCard);
this.btnNext.on(Laya.Event.CLICK, this, this.onClickNext);
this.listTalents.renderHandler = new Laya.Handler(this, this.renderTalent);
this.listTalents.renderHandler = Laya.Handler.create(this, this.renderTalent, null, false);
this.listTalents.scrollBar.elasticDistance = 150;
}
#selected = new Set();
static load() {
return ['images/background/background_2@3x.png'];
}
init() {
this.pageDrawCard.visible = true;
@@ -24,11 +27,12 @@ export default class CyberTalent extends CyberTalentUI {
}
onClickNext() {
if(this.#selected.size < core.talentSelectLimit) {
return;
}
}
onClickTalent() {
const talents = [...this.#selected].map(index => this.listTalents.array[index]);
UIManager.getInstance().switchView(UIManager.getInstance().themes.PROPERTY, { talents });
}
renderTalent(box, index) {
@@ -85,13 +89,13 @@ export default class CyberTalent extends CyberTalentUI {
if(this.#selected.has(index)) {
this.#selected.delete(index);
} else {
if(this.#selected.size >= 3) {
if(this.#selected.size >= core.talentSelectLimit) {
return;
}
this.#selected.add(index);
}
this.btnNext.label = this.#selected.size === 3
this.btnNext.label = this.#selected.size === core.talentSelectLimit
? 'UI_Next'
: 'UI_Talent_Select_Uncomplete';
unselected.visible = !( selected.visible = this.#selected.has(index) );

View File

@@ -0,0 +1,132 @@
export default class CyberTrajectory extends CyberTrajectoryUI {
constructor() {
super();
let pos1 = [0, 0];
this.panelTrajectory.on(Laya.Event.MOUSE_DOWN, this, e => pos1 = [e.stageX, e.stageY]);
this.panelTrajectory.on(Laya.Event.MOUSE_UP, this, e => {
const distanceX = e.stageX - pos1[0];
const distanceY = e.stageY - pos1[1];
if(Math.sqrt(Math.abs(distanceX) + Math.abs(distanceY)) > 10) {
return;
}
this.onNext();
});
this.btnSummary.on(Laya.Event.CLICK, this, this.onSummary);
this.panelTrajectory.vScrollBar.elasticDistance = 150;
let interval = null;
let timeout = null;
const scroll = alter => {
let value = this.panelTrajectory.vScrollBar.value + alter;
if(value < 0) value = 0;
if(value > this.panelTrajectory.vScrollBar.max) value = this.panelTrajectory.vScrollBar.max;
this.panelTrajectory.scrollTo(0, value);
}
const on = (btn, alter) => {
btn.off(Laya.Event.CLICK, this, scroll);
btn.on(Laya.Event.CLICK, this, scroll, [100*alter]);
timeout = setTimeout(() => {
btn.off(Laya.Event.CLICK, this, scroll);
interval = setInterval(() => scroll(10*alter), 10);
}, 100);
}
const clear = () => {
if(interval) {
clearInterval(interval);
interval = null;
}
if(timeout) {
clearTimeout(timeout);
timeout = null;
}
};
this.btnUp.on(Laya.Event.MOUSE_DOWN, this, on, [this.btnUp, -1]);
this.btnDown.on(Laya.Event.MOUSE_DOWN, this, on, [this.btnDown, 1]);
this.btnUp.on(Laya.Event.MOUSE_UP, this, clear);
this.btnUp.on(Laya.Event.MOUSE_OUT, this, clear);
this.btnDown.on(Laya.Event.MOUSE_UP, this, clear);
this.btnDown.on(Laya.Event.MOUSE_OUT, this, clear);
}
static load() {
return ['images/slider/vslider_1@3x$bar.png'];
}
static #createComponent = plugin.extractComponents(CyberTrajectory.uiView, ['boxTrajectoryItem']);
#createTrajectoryItem() {
const item = CyberTrajectory.#createComponent('boxTrajectoryItem');
item.labContent = item.getChildByName('labContent');
item.labAge = item.getChildByName('hboxAge').getChildByName('labAge');
return item;
}
#isEnd;
#trajectoryItems;
#talents;
init({propertyAllocate, talents}) {
this.#trajectoryItems = [];
this.#isEnd = false;
this.#talents = talents;
core.restart(propertyAllocate);
this.updateProperty();
}
close() {
this.#trajectoryItems.forEach(item => {
item.removeSelf();
item.destroy();
});
this.#trajectoryItems = null;
}
updateProperty() {
const types = core.PropertyTypes;
const propertys = core.propertys;
this.labCharm.text = propertys[types.CHR];
this.labIntelligence.text = propertys[types.INT];
this.labStrength.text = propertys[types.STR];
this.labMoney.text = propertys[types.MNY];
this.labSpirit.text = propertys[types.SPR];
}
onNext() {
if(this.#isEnd) return;
const { age, content, isEnd } = core.next();
this.#isEnd = isEnd;
if(isEnd) {
console.debug('end');
}
const item = this.#createTrajectoryItem();
item.labAge.text = ''+age;
item.labContent.text = content.map(
({type, description, grade, name, postEvent}) => {
switch(type) {
case 'TLT':
return `天赋【${name}】发动:${description}`;
case 'EVT':
return description + (postEvent?`\n${postEvent}`:'');
}
}
).join('\n');
this.vboxTrajectory.addChild(item);
this.#trajectoryItems.push(item);
this.#trajectoryItems.forEach((item, index) => item.y = index);
Laya.timer.frameOnce(1, this, () => {
this.panelTrajectory.scrollTo(0, this.panelTrajectory.contentHeight);
});
this.updateProperty();
}
onSummary() {
const talents = this.#talents;
UIManager.getInstance().switchView(UIManager.getInstance().themes.SUMMARY, {talents});
}
}

17
src/ui/themes/views.js Normal file
View File

@@ -0,0 +1,17 @@
const cyber = {
LOADING: "loading",
MAIN: "cyber/cyberMain",
TALENT: "cyber/cyberTalent",
PROPERTY: "cyber/cyberProperty",
TRAJECTORY: "cyber/cyberTrajectory",
SUMMARY: "cyber/cyberSummary",
ACHIEVEMENT: "cyber/cyberAchievement",
THANKS: "cyber/cyberThanks",
}
const themes = {
default: cyber,
cyber,
};
export default { themes };

View File

@@ -98,7 +98,7 @@ class UIManager {
async loadView(viewName) {
// load view
return (await import(`../view/${viewName}.js`)).default;
return (await import(`./themes/${viewName}.js`)).default;
}
async loadRes(resourceList, preload, onProgress) {
@@ -134,12 +134,57 @@ class UIManager {
this.#dialogLayer.removeChildren();
}
#cutPath(path) {
path = ''+path;
let index = path.length;
do {
index --;
if(path[index] == '.') {
break;
}
} while (index>0)
return [
path.substring(0, index),
path.substring(index, path.length)
];
}
#subSkin(skin, type) {
if(!skin || !skin.replace(/\s/g, '')) return [];
switch (type) {
case 'ProgressBar':
return [ skin, ...this.#progressBarSkin(skin) ];
case 'ScrollBar':
return [ skin, ...this.#scrollBarSkin(skin) ];
default:
return [skin]
}
}
#progressBarSkin(skin) {
if(!skin.replace(/\s/g, '')) return [];
let p = this.#cutPath(skin);
return [`${p[0]}$bar${p[1]}`];
}
#scrollBarSkin(skin) {
if(!skin.replace(/\s/g, '')) return [];
let p = this.#cutPath(skin);
return [
`${p[0]}$bar${p[1]}`,
`${p[0]}$up${p[1]}`,
`${p[0]}$down${p[1]}`
];
}
scanResource(uiView) {
if(!uiView) return [];
const resourceList = [];
if(uiView.props?.skin) {
resourceList.push(uiView.props.skin);
}
resourceList.push(...this.#subSkin(uiView.props?.skin, uiView.type));
resourceList.push(...this.#subSkin(uiView.props?.hScrollBarSkin, 'ScrollBar'));
resourceList.push(...this.#subSkin(uiView.props?.vScrollBarSkin, 'ScrollBar'));
uiView.child?.forEach(child => {
resourceList.push(...this.scanResource(child));
});

View File

@@ -1,5 +0,0 @@
export default class cyberProperty extends CyberPropertyUI {
constructor() {
super();
}
}

View File

@@ -1,5 +0,0 @@
export default class cyberSummary extends CyberSummaryUI {
constructor() {
super();
}
}

View File

@@ -1,5 +0,0 @@
export default class CyberTrojectory extends CyberTrajectoryUI {
constructor() {
super();
}
}

View File

@@ -1,17 +0,0 @@
const cyber = {
LOADING: "loading",
MAIN: "themes/cyber/cyberMain",
TALENT: "themes/cyber/cyberTalent",
PROPERTY: "themes/cyber/cyberProperty",
TROJECTORY: "themes/cyber/cyberTrojectory",
SUMMARY: "themes/cyber/cyberSummary",
ACHIEVEMENT: "themes/cyber/cyberAchievement",
THANKS: "themes/cyber/cyberThanks",
}
const themes = {
default: cyber,
cyber,
};
export default { themes };