Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aaea25bf1f |
@@ -12,8 +12,6 @@ jobs:
|
||||
steps:
|
||||
- name: Pulling the new commit
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setting up Haxe
|
||||
uses: krdlab/setup-haxe@v2
|
||||
with:
|
||||
@@ -37,7 +35,7 @@ jobs:
|
||||
haxe -cp commandline -D analyzer-optimize --run Main setup -s
|
||||
- name: Building the game
|
||||
run: |
|
||||
haxelib run lime build linux -DCOMPILE_EXPERIMENTAL
|
||||
haxelib run lime build linux
|
||||
# - name: Tar files
|
||||
# run: tar -zcvf CodenameEngine.tar.gz -C export/release/linux/bin .
|
||||
- name: Uploading artifact (executable)
|
||||
@@ -146,4 +144,4 @@ jobs:
|
||||
path: |
|
||||
.haxelib/
|
||||
export/debug/linux/haxe/
|
||||
export/debug/linux/obj/
|
||||
export/debug/linux/obj/
|
||||
@@ -12,8 +12,6 @@ jobs:
|
||||
steps:
|
||||
- name: Pulling the new commit
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setting up Haxe
|
||||
uses: krdlab/setup-haxe@v2
|
||||
with:
|
||||
@@ -34,7 +32,7 @@ jobs:
|
||||
haxe -cp commandline -D analyzer-optimize --run Main setup -s
|
||||
- name: Building the game
|
||||
run: |
|
||||
arch -x86_64 haxelib run lime build mac -DCOMPILE_EXPERIMENTAL
|
||||
arch -x86_64 haxelib run lime build mac
|
||||
- name: Tar files
|
||||
run: tar -zcvf CodenameEngine.tar.gz -C export/release/macos/bin .
|
||||
- name: Uploading artifact (executable)
|
||||
@@ -140,4 +138,4 @@ jobs:
|
||||
path: |
|
||||
.haxelib/
|
||||
export/debug/macos/haxe/
|
||||
export/debug/macos/obj/
|
||||
export/debug/macos/obj/
|
||||
@@ -22,8 +22,6 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Download Windows Full Build
|
||||
uses: dawidd6/action-download-artifact@v6
|
||||
|
||||
@@ -12,8 +12,6 @@ jobs:
|
||||
steps:
|
||||
- name: Pulling the new commit
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setting up Haxe
|
||||
uses: krdlab/setup-haxe@v2
|
||||
with:
|
||||
@@ -34,7 +32,7 @@ jobs:
|
||||
haxe -cp commandline -D analyzer-optimize --run Main setup -s --no-vscheck
|
||||
- name: Building the game
|
||||
run: |
|
||||
haxelib run lime build windows -DCOMPILE_EXPERIMENTAL
|
||||
haxelib run lime build windows
|
||||
- name: Uploading artifact (executable)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -136,4 +134,4 @@ jobs:
|
||||
path: |
|
||||
.haxelib/
|
||||
export/debug/windows/haxe/
|
||||
export/debug/windows/obj/
|
||||
export/debug/windows/obj/
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 804 B |
File diff suppressed because it is too large
Load Diff
@@ -1,241 +1,145 @@
|
||||
{"ATLAS":{"SPRITES":[
|
||||
{"SPRITE":{"name":"0","x":2564,"y":2,"w":23,"h":144,"rotated":false}},
|
||||
{"SPRITE":{"name":"1","x":3024,"y":522,"w":42,"h":85,"rotated":false}},
|
||||
{"SPRITE":{"name":"2","x":2598,"y":1211,"w":67,"h":60,"rotated":false}},
|
||||
{"SPRITE":{"name":"3","x":3964,"y":932,"w":93,"h":51,"rotated":false}},
|
||||
{"SPRITE":{"name":"4","x":3691,"y":1016,"w":91,"h":43,"rotated":false}},
|
||||
{"SPRITE":{"name":"5","x":3877,"y":270,"w":111,"h":95,"rotated":false}},
|
||||
{"SPRITE":{"name":"6","x":3449,"y":1124,"w":113,"h":127,"rotated":false}},
|
||||
{"SPRITE":{"name":"7","x":367,"y":1129,"w":382,"h":123,"rotated":false}},
|
||||
{"SPRITE":{"name":"8","x":2,"y":1122,"w":364,"h":131,"rotated":false}},
|
||||
{"SPRITE":{"name":"9","x":2,"y":1122,"w":364,"h":131,"rotated":false}},
|
||||
{"SPRITE":{"name":"10","x":2437,"y":1136,"w":31,"h":31,"rotated":false}},
|
||||
{"SPRITE":{"name":"11","x":1599,"y":1133,"w":350,"h":113,"rotated":false}},
|
||||
{"SPRITE":{"name":"12","x":1599,"y":1133,"w":350,"h":113,"rotated":false}},
|
||||
{"SPRITE":{"name":"13","x":2670,"y":1175,"w":142,"h":94,"rotated":false}},
|
||||
{"SPRITE":{"name":"14","x":3877,"y":366,"w":122,"h":82,"rotated":false}},
|
||||
{"SPRITE":{"name":"15","x":1162,"y":1112,"w":436,"h":151,"rotated":false}},
|
||||
{"SPRITE":{"name":"16","x":1599,"y":985,"w":435,"h":147,"rotated":false}},
|
||||
{"SPRITE":{"name":"17","x":1599,"y":985,"w":435,"h":147,"rotated":false}},
|
||||
{"SPRITE":{"name":"18","x":779,"y":692,"w":440,"h":344,"rotated":false}},
|
||||
{"SPRITE":{"name":"19","x":1550,"y":711,"w":388,"h":273,"rotated":false}},
|
||||
{"SPRITE":{"name":"20","x":2106,"y":2,"w":376,"h":155,"rotated":false}},
|
||||
{"SPRITE":{"name":"21","x":2,"y":2,"w":932,"h":689,"rotated":false}},
|
||||
{"SPRITE":{"name":"22","x":3907,"y":1171,"w":48,"h":36,"rotated":false}},
|
||||
{"SPRITE":{"name":"23","x":3907,"y":1171,"w":48,"h":36,"rotated":false}},
|
||||
{"SPRITE":{"name":"24","x":3858,"y":1206,"w":48,"h":40,"rotated":false}},
|
||||
{"SPRITE":{"name":"25","x":3762,"y":1093,"w":48,"h":64,"rotated":false}},
|
||||
{"SPRITE":{"name":"26","x":3713,"y":1060,"w":48,"h":66,"rotated":false}},
|
||||
{"SPRITE":{"name":"27","x":3885,"y":1095,"w":48,"h":67,"rotated":false}},
|
||||
{"SPRITE":{"name":"28","x":2106,"y":158,"w":48,"h":69,"rotated":false}},
|
||||
{"SPRITE":{"name":"29","x":2481,"y":498,"w":48,"h":71,"rotated":false}},
|
||||
{"SPRITE":{"name":"30","x":1162,"y":1037,"w":48,"h":73,"rotated":false}},
|
||||
{"SPRITE":{"name":"31","x":4018,"y":188,"w":48,"h":76,"rotated":false}},
|
||||
{"SPRITE":{"name":"32","x":3455,"y":856,"w":48,"h":78,"rotated":false}},
|
||||
{"SPRITE":{"name":"33","x":3785,"y":1011,"w":48,"h":81,"rotated":false}},
|
||||
{"SPRITE":{"name":"34","x":4002,"y":1164,"w":48,"h":82,"rotated":false}},
|
||||
{"SPRITE":{"name":"35","x":3953,"y":1083,"w":48,"h":87,"rotated":false}},
|
||||
{"SPRITE":{"name":"36","x":3904,"y":1004,"w":48,"h":90,"rotated":false}},
|
||||
{"SPRITE":{"name":"37","x":4013,"y":1070,"w":48,"h":93,"rotated":false}},
|
||||
{"SPRITE":{"name":"38","x":3964,"y":984,"w":48,"h":98,"rotated":false}},
|
||||
{"SPRITE":{"name":"39","x":1550,"y":985,"w":48,"h":103,"rotated":false}},
|
||||
{"SPRITE":{"name":"40","x":3848,"y":894,"w":50,"h":109,"rotated":false}},
|
||||
{"SPRITE":{"name":"41","x":3797,"y":894,"w":50,"h":116,"rotated":false}},
|
||||
{"SPRITE":{"name":"42","x":2777,"y":452,"w":50,"h":121,"rotated":false}},
|
||||
{"SPRITE":{"name":"43","x":4002,"y":585,"w":50,"h":119,"rotated":false}},
|
||||
{"SPRITE":{"name":"44","x":3913,"y":886,"w":50,"h":117,"rotated":false}},
|
||||
{"SPRITE":{"name":"45","x":3059,"y":2,"w":52,"h":129,"rotated":false}},
|
||||
{"SPRITE":{"name":"46","x":3964,"y":886,"w":123,"h":45,"rotated":false}},
|
||||
{"SPRITE":{"name":"47","x":1770,"y":228,"w":123,"h":43,"rotated":false}},
|
||||
{"SPRITE":{"name":"48","x":3424,"y":486,"w":99,"h":35,"rotated":false}},
|
||||
{"SPRITE":{"name":"49","x":2979,"y":1141,"w":99,"h":34,"rotated":false}},
|
||||
{"SPRITE":{"name":"50","x":2979,"y":1141,"w":99,"h":34,"rotated":false}},
|
||||
{"SPRITE":{"name":"51","x":2590,"y":360,"w":99,"h":36,"rotated":false}},
|
||||
{"SPRITE":{"name":"52","x":3709,"y":783,"w":35,"h":21,"rotated":false}},
|
||||
{"SPRITE":{"name":"53","x":1220,"y":711,"w":329,"h":400,"rotated":false}},
|
||||
{"SPRITE":{"name":"54","x":3042,"y":979,"w":112,"h":161,"rotated":false}},
|
||||
{"SPRITE":{"name":"55","x":2929,"y":163,"w":199,"h":188,"rotated":false}},
|
||||
{"SPRITE":{"name":"56","x":2175,"y":574,"w":96,"h":158,"rotated":false}},
|
||||
{"SPRITE":{"name":"57","x":1623,"y":570,"w":277,"h":134,"rotated":false}},
|
||||
{"SPRITE":{"name":"58","x":1550,"y":1089,"w":38,"h":22,"rotated":false}},
|
||||
{"SPRITE":{"name":"59","x":3666,"y":152,"w":124,"h":165,"rotated":false}},
|
||||
{"SPRITE":{"name":"60","x":1623,"y":272,"w":309,"h":297,"rotated":false}},
|
||||
{"SPRITE":{"name":"61","x":3801,"y":2,"w":121,"h":91,"rotated":false}},
|
||||
{"SPRITE":{"name":"62","x":3281,"y":522,"w":320,"h":77,"rotated":false}},
|
||||
{"SPRITE":{"name":"63","x":3921,"y":755,"w":17,"h":22,"rotated":false}},
|
||||
{"SPRITE":{"name":"64","x":1351,"y":272,"w":162,"h":74,"rotated":false}},
|
||||
{"SPRITE":{"name":"65","x":3801,"y":94,"w":69,"h":50,"rotated":false}},
|
||||
{"SPRITE":{"name":"66","x":2273,"y":574,"w":277,"h":174,"rotated":false}},
|
||||
{"SPRITE":{"name":"67","x":2261,"y":1136,"w":175,"h":123,"rotated":false}},
|
||||
{"SPRITE":{"name":"68","x":4058,"y":932,"w":32,"h":49,"rotated":false}},
|
||||
{"SPRITE":{"name":"69","x":3791,"y":270,"w":66,"h":38,"rotated":false}},
|
||||
{"SPRITE":{"name":"70","x":3079,"y":1141,"w":71,"h":40,"rotated":false}},
|
||||
{"SPRITE":{"name":"71","x":2690,"y":360,"w":82,"h":29,"rotated":false}},
|
||||
{"SPRITE":{"name":"72","x":3602,"y":516,"w":88,"h":69,"rotated":false}},
|
||||
{"SPRITE":{"name":"73","x":4022,"y":806,"w":69,"h":27,"rotated":false}},
|
||||
{"SPRITE":{"name":"74","x":1894,"y":228,"w":30,"h":40,"rotated":false}},
|
||||
{"SPRITE":{"name":"75","x":3987,"y":654,"w":10,"h":13,"rotated":false}},
|
||||
{"SPRITE":{"name":"76","x":3896,"y":1084,"w":7,"h":7,"rotated":false}},
|
||||
{"SPRITE":{"name":"77","x":3834,"y":1074,"w":9,"h":9,"rotated":false}},
|
||||
{"SPRITE":{"name":"78","x":3885,"y":1084,"w":10,"h":10,"rotated":false}},
|
||||
{"SPRITE":{"name":"79","x":3441,"y":736,"w":12,"h":12,"rotated":false}},
|
||||
{"SPRITE":{"name":"80","x":3811,"y":1128,"w":19,"h":17,"rotated":false}},
|
||||
{"SPRITE":{"name":"81","x":3971,"y":654,"w":15,"h":14,"rotated":false}},
|
||||
{"SPRITE":{"name":"82","x":3858,"y":1150,"w":7,"h":7,"rotated":false}},
|
||||
{"SPRITE":{"name":"83","x":3794,"y":452,"w":5,"h":5,"rotated":false}},
|
||||
{"SPRITE":{"name":"84","x":3326,"y":751,"w":32,"h":57,"rotated":false}},
|
||||
{"SPRITE":{"name":"85","x":2583,"y":147,"w":6,"h":7,"rotated":false}},
|
||||
{"SPRITE":{"name":"86","x":935,"y":617,"w":198,"h":66,"rotated":false}},
|
||||
{"SPRITE":{"name":"87","x":426,"y":692,"w":352,"h":436,"rotated":false}},
|
||||
{"SPRITE":{"name":"88","x":3814,"y":452,"w":156,"h":69,"rotated":false}},
|
||||
{"SPRITE":{"name":"89","x":2829,"y":452,"w":194,"h":197,"rotated":false}},
|
||||
{"SPRITE":{"name":"90","x":2670,"y":733,"w":181,"h":216,"rotated":false}},
|
||||
{"SPRITE":{"name":"91","x":3791,"y":150,"w":93,"h":119,"rotated":false}},
|
||||
{"SPRITE":{"name":"92","x":4000,"y":372,"w":86,"h":75,"rotated":false}},
|
||||
{"SPRITE":{"name":"93","x":3587,"y":320,"w":113,"h":195,"rotated":false}},
|
||||
{"SPRITE":{"name":"94","x":2483,"y":2,"w":80,"h":151,"rotated":false}},
|
||||
{"SPRITE":{"name":"95","x":3493,"y":2,"w":177,"h":149,"rotated":false}},
|
||||
{"SPRITE":{"name":"96","x":3327,"y":183,"w":9,"h":8,"rotated":false}},
|
||||
{"SPRITE":{"name":"97","x":3787,"y":452,"w":6,"h":6,"rotated":false}},
|
||||
{"SPRITE":{"name":"98","x":4002,"y":705,"w":57,"h":48,"rotated":false}},
|
||||
{"SPRITE":{"name":"99","x":2574,"y":147,"w":8,"h":8,"rotated":false}},
|
||||
{"SPRITE":{"name":"100","x":3814,"y":605,"w":8,"h":12,"rotated":false}},
|
||||
{"SPRITE":{"name":"101","x":1589,"y":1089,"w":9,"h":10,"rotated":false}},
|
||||
{"SPRITE":{"name":"102","x":3701,"y":318,"w":85,"h":140,"rotated":false}},
|
||||
{"SPRITE":{"name":"103","x":2,"y":692,"w":423,"h":429,"rotated":false}},
|
||||
{"SPRITE":{"name":"104","x":3533,"y":152,"w":132,"h":167,"rotated":false}},
|
||||
{"SPRITE":{"name":"105","x":3249,"y":961,"w":66,"h":16,"rotated":false}},
|
||||
{"SPRITE":{"name":"106","x":3576,"y":808,"w":52,"h":43,"rotated":false}},
|
||||
{"SPRITE":{"name":"107","x":3858,"y":1163,"w":46,"h":42,"rotated":false}},
|
||||
{"SPRITE":{"name":"108","x":3834,"y":1011,"w":13,"h":62,"rotated":false}},
|
||||
{"SPRITE":{"name":"109","x":3654,"y":1025,"w":34,"h":29,"rotated":false}},
|
||||
{"SPRITE":{"name":"110","x":3811,"y":1150,"w":46,"h":65,"rotated":false}},
|
||||
{"SPRITE":{"name":"111","x":3701,"y":459,"w":112,"h":46,"rotated":false}},
|
||||
{"SPRITE":{"name":"112","x":2035,"y":898,"w":226,"h":223,"rotated":false}},
|
||||
{"SPRITE":{"name":"113","x":3233,"y":351,"w":190,"h":170,"rotated":false}},
|
||||
{"SPRITE":{"name":"114","x":3654,"y":1060,"w":58,"h":55,"rotated":false}},
|
||||
{"SPRITE":{"name":"115","x":3885,"y":94,"w":112,"h":94,"rotated":false}},
|
||||
{"SPRITE":{"name":"116","x":3576,"y":706,"w":132,"h":101,"rotated":false}},
|
||||
{"SPRITE":{"name":"117","x":1939,"y":493,"w":235,"h":239,"rotated":false}},
|
||||
{"SPRITE":{"name":"118","x":3242,"y":1150,"w":141,"h":111,"rotated":false}},
|
||||
{"SPRITE":{"name":"119","x":2822,"y":2,"w":236,"h":160,"rotated":false}},
|
||||
{"SPRITE":{"name":"120","x":2475,"y":749,"w":194,"h":236,"rotated":false}},
|
||||
{"SPRITE":{"name":"121","x":3455,"y":736,"w":120,"h":119,"rotated":false}},
|
||||
{"SPRITE":{"name":"122","x":2551,"y":398,"w":225,"h":189,"rotated":false}},
|
||||
{"SPRITE":{"name":"123","x":3923,"y":2,"w":130,"h":81,"rotated":false}},
|
||||
{"SPRITE":{"name":"124","x":3691,"y":621,"w":132,"h":83,"rotated":false}},
|
||||
{"SPRITE":{"name":"125","x":3531,"y":1025,"w":122,"h":80,"rotated":false}},
|
||||
{"SPRITE":{"name":"126","x":3814,"y":522,"w":129,"h":82,"rotated":false}},
|
||||
{"SPRITE":{"name":"127","x":3709,"y":705,"w":125,"h":77,"rotated":false}},
|
||||
{"SPRITE":{"name":"128","x":3885,"y":189,"w":132,"h":76,"rotated":false}},
|
||||
{"SPRITE":{"name":"129","x":2035,"y":1122,"w":225,"h":142,"rotated":false}},
|
||||
{"SPRITE":{"name":"130","x":2777,"y":187,"w":151,"h":264,"rotated":false}},
|
||||
{"SPRITE":{"name":"131","x":2551,"y":588,"w":277,"h":144,"rotated":false}},
|
||||
{"SPRITE":{"name":"132","x":3327,"y":197,"w":205,"h":140,"rotated":false}},
|
||||
{"SPRITE":{"name":"133","x":2175,"y":401,"w":305,"h":172,"rotated":false}},
|
||||
{"SPRITE":{"name":"134","x":2841,"y":1136,"w":137,"h":129,"rotated":false}},
|
||||
{"SPRITE":{"name":"135","x":3129,"y":172,"w":197,"h":178,"rotated":false}},
|
||||
{"SPRITE":{"name":"136","x":2,"y":1122,"w":364,"h":131,"rotated":false}},
|
||||
{"SPRITE":{"name":"137","x":3424,"y":338,"w":162,"h":147,"rotated":false}},
|
||||
{"SPRITE":{"name":"138","x":1933,"y":228,"w":223,"h":264,"rotated":false}},
|
||||
{"SPRITE":{"name":"139","x":1351,"y":2,"w":418,"h":269,"rotated":false}},
|
||||
{"SPRITE":{"name":"140","x":1599,"y":1133,"w":350,"h":113,"rotated":false}},
|
||||
{"SPRITE":{"name":"141","x":1599,"y":985,"w":435,"h":147,"rotated":false}},
|
||||
{"SPRITE":{"name":"142","x":3921,"y":670,"w":80,"h":84,"rotated":false}},
|
||||
{"SPRITE":{"name":"143","x":2564,"y":147,"w":9,"h":8,"rotated":false}},
|
||||
{"SPRITE":{"name":"144","x":2437,"y":1168,"w":31,"h":27,"rotated":false}},
|
||||
{"SPRITE":{"name":"145","x":3664,"y":808,"w":110,"h":88,"rotated":false}},
|
||||
{"SPRITE":{"name":"146","x":3024,"y":608,"w":43,"h":39,"rotated":false}},
|
||||
{"SPRITE":{"name":"147","x":3563,"y":1106,"w":55,"h":58,"rotated":false}},
|
||||
{"SPRITE":{"name":"148","x":3971,"y":619,"w":19,"h":34,"rotated":false}},
|
||||
{"SPRITE":{"name":"149","x":3416,"y":1250,"w":30,"h":23,"rotated":false}},
|
||||
{"SPRITE":{"name":"150","x":1939,"y":898,"w":82,"h":85,"rotated":false}},
|
||||
{"SPRITE":{"name":"151","x":4054,"y":39,"w":34,"h":41,"rotated":false}},
|
||||
{"SPRITE":{"name":"152","x":3691,"y":516,"w":122,"h":104,"rotated":false}},
|
||||
{"SPRITE":{"name":"153","x":3762,"y":1060,"w":17,"h":32,"rotated":false}},
|
||||
{"SPRITE":{"name":"154","x":3745,"y":783,"w":28,"h":20,"rotated":false}},
|
||||
{"SPRITE":{"name":"155","x":3524,"y":486,"w":45,"h":35,"rotated":false}},
|
||||
{"SPRITE":{"name":"156","x":4000,"y":266,"w":74,"h":105,"rotated":false}},
|
||||
{"SPRITE":{"name":"157","x":3775,"y":836,"w":137,"h":57,"rotated":false}},
|
||||
{"SPRITE":{"name":"158","x":3384,"y":1250,"w":31,"h":23,"rotated":false}},
|
||||
{"SPRITE":{"name":"159","x":3504,"y":908,"w":24,"h":24,"rotated":false}},
|
||||
{"SPRITE":{"name":"160","x":4013,"y":984,"w":55,"h":85,"rotated":false}},
|
||||
{"SPRITE":{"name":"161","x":4054,"y":2,"w":40,"h":36,"rotated":false}},
|
||||
{"SPRITE":{"name":"162","x":3775,"y":783,"w":163,"h":52,"rotated":false}},
|
||||
{"SPRITE":{"name":"163","x":1950,"y":1133,"w":73,"h":115,"rotated":false}},
|
||||
{"SPRITE":{"name":"164","x":3531,"y":962,"w":159,"h":62,"rotated":false}},
|
||||
{"SPRITE":{"name":"165","x":3811,"y":1093,"w":20,"h":34,"rotated":false}},
|
||||
{"SPRITE":{"name":"166","x":4067,"y":230,"w":27,"h":32,"rotated":false}},
|
||||
{"SPRITE":{"name":"167","x":4067,"y":188,"w":24,"h":41,"rotated":false}},
|
||||
{"SPRITE":{"name":"168","x":3504,"y":856,"w":26,"h":51,"rotated":false}},
|
||||
{"SPRITE":{"name":"169","x":2929,"y":352,"w":86,"h":98,"rotated":false}},
|
||||
{"SPRITE":{"name":"170","x":3824,"y":605,"w":146,"h":64,"rotated":false}},
|
||||
{"SPRITE":{"name":"171","x":1589,"y":1100,"w":9,"h":10,"rotated":false}},
|
||||
{"SPRITE":{"name":"172","x":3327,"y":172,"w":8,"h":10,"rotated":false}},
|
||||
{"SPRITE":{"name":"173","x":3939,"y":806,"w":82,"h":27,"rotated":false}},
|
||||
{"SPRITE":{"name":"174","x":3944,"y":522,"w":141,"h":62,"rotated":false}},
|
||||
{"SPRITE":{"name":"175","x":3024,"y":352,"w":208,"h":169,"rotated":false}},
|
||||
{"SPRITE":{"name":"176","x":3129,"y":2,"w":208,"h":169,"rotated":false}},
|
||||
{"SPRITE":{"name":"177","x":3042,"y":814,"w":206,"h":164,"rotated":false}},
|
||||
{"SPRITE":{"name":"178","x":3072,"y":522,"w":208,"h":161,"rotated":false}},
|
||||
{"SPRITE":{"name":"179","x":779,"y":1037,"w":382,"h":218,"rotated":false}},
|
||||
{"SPRITE":{"name":"180","x":935,"y":357,"w":237,"h":259,"rotated":false}},
|
||||
{"SPRITE":{"name":"181","x":3155,"y":979,"w":86,"h":203,"rotated":false}},
|
||||
{"SPRITE":{"name":"182","x":3364,"y":751,"w":90,"h":183,"rotated":false}},
|
||||
{"SPRITE":{"name":"183","x":3357,"y":961,"w":91,"h":188,"rotated":false}},
|
||||
{"SPRITE":{"name":"184","x":2852,"y":814,"w":185,"h":122,"rotated":false}},
|
||||
{"SPRITE":{"name":"185","x":3787,"y":318,"w":89,"h":133,"rotated":false}},
|
||||
{"SPRITE":{"name":"186","x":2590,"y":187,"w":183,"h":172,"rotated":false}},
|
||||
{"SPRITE":{"name":"187","x":3242,"y":979,"w":114,"h":151,"rotated":false}},
|
||||
{"SPRITE":{"name":"188","x":4047,"y":834,"w":42,"h":36,"rotated":false}},
|
||||
{"SPRITE":{"name":"189","x":1134,"y":617,"w":53,"h":63,"rotated":false}},
|
||||
{"SPRITE":{"name":"190","x":3166,"y":1183,"w":67,"h":80,"rotated":false}},
|
||||
{"SPRITE":{"name":"191","x":3848,"y":1004,"w":55,"h":79,"rotated":false}},
|
||||
{"SPRITE":{"name":"192","x":3834,"y":1084,"w":50,"h":65,"rotated":false}},
|
||||
{"SPRITE":{"name":"193","x":3629,"y":808,"w":33,"h":43,"rotated":false}},
|
||||
{"SPRITE":{"name":"194","x":3493,"y":152,"w":26,"h":38,"rotated":false}},
|
||||
{"SPRITE":{"name":"195","x":3971,"y":585,"w":23,"h":33,"rotated":false}},
|
||||
{"SPRITE":{"name":"196","x":2530,"y":498,"w":20,"h":24,"rotated":false}},
|
||||
{"SPRITE":{"name":"197","x":3939,"y":755,"w":121,"h":50,"rotated":false}},
|
||||
{"SPRITE":{"name":"198","x":3913,"y":836,"w":133,"h":49,"rotated":false}},
|
||||
{"SPRITE":{"name":"199","x":3971,"y":449,"w":119,"h":69,"rotated":false}},
|
||||
{"SPRITE":{"name":"200","x":3072,"y":684,"w":253,"h":125,"rotated":false}},
|
||||
{"SPRITE":{"name":"201","x":3441,"y":600,"w":116,"h":135,"rotated":false}},
|
||||
{"SPRITE":{"name":"202","x":2475,"y":986,"w":194,"h":224,"rotated":false}},
|
||||
{"SPRITE":{"name":"203","x":1770,"y":2,"w":335,"h":225,"rotated":false}},
|
||||
{"SPRITE":{"name":"204","x":2157,"y":158,"w":217,"h":242,"rotated":false}},
|
||||
{"SPRITE":{"name":"205","x":3249,"y":810,"w":114,"h":150,"rotated":false}},
|
||||
{"SPRITE":{"name":"206","x":3326,"y":600,"w":114,"h":150,"rotated":false}},
|
||||
{"SPRITE":{"name":"207","x":3835,"y":670,"w":85,"h":87,"rotated":false}},
|
||||
{"SPRITE":{"name":"208","x":3671,"y":2,"w":129,"h":147,"rotated":false}},
|
||||
{"SPRITE":{"name":"209","x":2852,"y":650,"w":219,"h":163,"rotated":false}},
|
||||
{"SPRITE":{"name":"210","x":3338,"y":2,"w":154,"h":194,"rotated":false}},
|
||||
{"SPRITE":{"name":"211","x":1514,"y":272,"w":108,"h":68,"rotated":false}},
|
||||
{"SPRITE":{"name":"212","x":3664,"y":897,"w":132,"h":64,"rotated":false}},
|
||||
{"SPRITE":{"name":"213","x":2437,"y":1211,"w":160,"h":62,"rotated":false}},
|
||||
{"SPRITE":{"name":"214","x":3449,"y":935,"w":81,"h":188,"rotated":false}},
|
||||
{"SPRITE":{"name":"215","x":2841,"y":950,"w":200,"h":185,"rotated":false}},
|
||||
{"SPRITE":{"name":"216","x":3384,"y":1150,"w":63,"h":99,"rotated":false}},
|
||||
{"SPRITE":{"name":"217","x":2481,"y":398,"w":63,"h":99,"rotated":false}},
|
||||
{"SPRITE":{"name":"218","x":3558,"y":600,"w":132,"h":105,"rotated":false}},
|
||||
{"SPRITE":{"name":"219","x":3531,"y":856,"w":132,"h":105,"rotated":false}},
|
||||
{"SPRITE":{"name":"220","x":2590,"y":2,"w":231,"h":184,"rotated":false}},
|
||||
{"SPRITE":{"name":"221","x":2670,"y":950,"w":170,"h":224,"rotated":false}},
|
||||
{"SPRITE":{"name":"222","x":2273,"y":749,"w":198,"h":144,"rotated":false}},
|
||||
{"SPRITE":{"name":"223","x":3691,"y":962,"w":93,"h":53,"rotated":false}},
|
||||
{"SPRITE":{"name":"224","x":2979,"y":1183,"w":186,"h":91,"rotated":false}},
|
||||
{"SPRITE":{"name":"225","x":1939,"y":733,"w":333,"h":164,"rotated":false}},
|
||||
{"SPRITE":{"name":"226","x":935,"y":2,"w":415,"h":354,"rotated":false}},
|
||||
{"SPRITE":{"name":"227","x":1220,"y":357,"w":402,"h":353,"rotated":false}},
|
||||
{"SPRITE":{"name":"228","x":3998,"y":84,"w":90,"h":103,"rotated":false}},
|
||||
{"SPRITE":{"name":"229","x":2375,"y":158,"w":214,"h":239,"rotated":false}},
|
||||
{"SPRITE":{"name":"230","x":2262,"y":898,"w":212,"h":237,"rotated":false}}]},
|
||||
"meta":{
|
||||
"app":"Adobe Animate (Better TA Extension)",
|
||||
"version":"22.0.3.179",
|
||||
"image":"spritemap1.png",
|
||||
"format":"RGBA8888",
|
||||
"size":{"w":4096,"h":1280},
|
||||
"resolution":"1"
|
||||
{"ATLAS": {"SPRITES":[
|
||||
{"SPRITE" : {"name": "0000","x":2847,"y":969,"w":327,"h":397,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0001","x":2441,"y":894,"w":110,"h":159,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0002","x":1709,"y":1631,"w":197,"h":185,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0003","x":408,"y":1773,"w":92,"h":155,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0004","x":236,"y":1639,"w":274,"h":132,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0005","x":3427,"y":1495,"w":133,"h":74,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0006","x":3270,"y":540,"w":121,"h":162,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0007","x":359,"y":649,"w":518,"h":294,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0008","x":1957,"y":2,"w":775,"h":483,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0009","x":1014,"y":2,"w":941,"h":607,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0010","x":2,"y":2,"w":1010,"h":645,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0011","x":4059,"y":2,"w":20,"h":142,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0012","x":4035,"y":616,"w":40,"h":83,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0013","x":2755,"y":1508,"w":64,"h":57,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0014","x":3176,"y":1171,"w":91,"h":48,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0015","x":3245,"y":1737,"w":88,"h":41,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0016","x":3064,"y":1368,"w":109,"h":93,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0017","x":3402,"y":2,"w":655,"h":434,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0018","x":1957,"y":487,"w":626,"h":405,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0019","x":3402,"y":438,"w":631,"h":438,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0020","x":1170,"y":1211,"w":393,"h":287,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0021","x":2847,"y":540,"w":421,"h":427,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0022","x":2734,"y":2,"w":666,"h":536,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0023","x":542,"y":1480,"w":224,"h":221,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0024","x":3657,"y":1736,"w":186,"h":175,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0025","x":4035,"y":764,"w":56,"h":52,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0026","x":502,"y":1876,"w":126,"h":104,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0027","x":1709,"y":1818,"w":135,"h":104,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0028","x":2,"y":1440,"w":232,"h":236,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0029","x":3938,"y":1437,"w":139,"h":109,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0030","x":2755,"y":1627,"w":235,"h":158,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0031","x":1147,"y":1500,"w":198,"h":233,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0032","x":2,"y":1860,"w":118,"h":117,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0033","x":1565,"y":1398,"w":262,"h":221,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0034","x":3845,"y":1736,"w":222,"h":145,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0035","x":979,"y":1480,"w":166,"h":292,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0036","x":3657,"y":1592,"w":276,"h":142,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0037","x":925,"y":1774,"w":203,"h":138,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0038","x":236,"y":1467,"w":304,"h":170,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0039","x":4081,"y":2,"w":1,"h":4,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0040","x":2441,"y":1055,"w":135,"h":127,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0041","x":2,"y":1678,"w":195,"h":180,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0042","x":2751,"y":1787,"w":160,"h":144,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0043","x":713,"y":945,"w":243,"h":261,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0044","x":2375,"y":1508,"w":378,"h":121,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0045","x":3064,"y":1495,"w":361,"h":128,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0046","x":713,"y":1211,"w":455,"h":267,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0047","x":2,"y":1112,"w":272,"h":326,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0048","x":3710,"y":878,"w":249,"h":557,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0049","x":2585,"y":540,"w":260,"h":701,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0050","x":1014,"y":611,"w":291,"h":598,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0051","x":1307,"y":611,"w":315,"h":540,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0052","x":2,"y":649,"w":355,"h":461,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0053","x":359,"y":945,"w":352,"h":373,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0054","x":3064,"y":1625,"w":347,"h":110,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0055","x":2039,"y":1248,"w":379,"h":216,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0056","x":2827,"y":1368,"w":235,"h":257,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0057","x":2100,"y":1879,"w":140,"h":92,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0058","x":776,"y":1886,"w":119,"h":79,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0059","x":1565,"y":1249,"w":434,"h":147,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0060","x":276,"y":1320,"w":433,"h":145,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0061","x":3270,"y":878,"w":438,"h":342,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0062","x":3176,"y":1222,"w":385,"h":271,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0063","x":3563,"y":1437,"w":373,"h":153,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0064","x":3245,"y":1786,"w":202,"h":122,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0065","x":3449,"y":1786,"w":202,"h":122,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0066","x":3064,"y":1861,"w":150,"h":91,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0067","x":3938,"y":1548,"w":151,"h":95,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0068","x":3845,"y":1883,"w":140,"h":90,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0069","x":2913,"y":1861,"w":149,"h":92,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0070","x":630,"y":1886,"w":144,"h":87,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0071","x":3935,"y":1645,"w":152,"h":87,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0072","x":2441,"y":1243,"w":384,"h":263,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0073","x":1624,"y":611,"w":248,"h":277,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0074","x":1624,"y":894,"w":413,"h":353,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0075","x":2039,"y":894,"w":400,"h":352,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0076","x":1829,"y":1466,"w":330,"h":163,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0077","x":3987,"y":1883,"w":90,"h":103,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0078","x":2161,"y":1466,"w":212,"h":238,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0079","x":768,"y":1480,"w":209,"h":236,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0080","x":2242,"y":1879,"w":86,"h":84,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0081","x":879,"y":649,"w":126,"h":148,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0082","x":1908,"y":1631,"w":216,"h":168,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0083","x":2575,"y":1631,"w":174,"h":192,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0084","x":1130,"y":1901,"w":106,"h":75,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0085","x":3961,"y":1367,"w":129,"h":63,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0086","x":1829,"y":1398,"w":158,"h":60,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0087","x":3270,"y":704,"w":123,"h":148,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0088","x":3961,"y":878,"w":123,"h":148,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0089","x":199,"y":1773,"w":207,"h":142,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0090","x":1238,"y":1901,"w":91,"h":53,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0091","x":276,"y":1112,"w":65,"h":96,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0092","x":276,"y":1210,"w":65,"h":96,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0093","x":2518,"y":1825,"w":136,"h":102,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0094","x":1537,"y":1857,"w":136,"h":102,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0095","x":3427,"y":1592,"w":228,"h":192,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0096","x":1541,"y":1621,"w":166,"h":234,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0097","x":512,"y":1703,"w":205,"h":171,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0098","x":2126,"y":1706,"w":205,"h":171,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0099","x":719,"y":1718,"w":204,"h":166,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0100","x":1147,"y":1735,"w":206,"h":164,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0101","x":1874,"y":611,"w":79,"h":185,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0102","x":3176,"y":969,"w":83,"h":200,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0103","x":3563,"y":1222,"w":86,"h":180,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0104","x":3961,"y":1028,"w":89,"h":186,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0105","x":2375,"y":1631,"w":198,"h":183,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0106","x":1908,"y":1801,"w":190,"h":120,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0107","x":2656,"y":1825,"w":86,"h":145,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0108","x":1355,"y":1724,"w":180,"h":170,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0109","x":3961,"y":1216,"w":111,"h":149,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0110","x":4035,"y":516,"w":39,"h":98,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0111","x":1307,"y":1153,"w":118,"h":47,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0112","x":1427,"y":1153,"w":120,"h":43,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0113","x":2441,"y":1184,"w":120,"h":41,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0114","x":3216,"y":1910,"w":95,"h":33,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0115","x":3563,"y":1404,"w":95,"h":31,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0116","x":3563,"y":1404,"w":95,"h":31,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0117","x":2330,"y":1906,"w":95,"h":34,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0118","x":2585,"y":487,"w":131,"h":47,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0119","x":4059,"y":258,"w":31,"h":18,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0120","x":1355,"y":1896,"w":122,"h":66,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0121","x":2992,"y":1737,"w":251,"h":122,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0122","x":879,"y":799,"w":114,"h":133,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0123","x":1347,"y":1500,"w":192,"h":222,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0124","x":4035,"y":818,"w":39,"h":34,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0125","x":4035,"y":701,"w":50,"h":61,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0126","x":1874,"y":798,"w":64,"h":78,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0127","x":4035,"y":438,"w":52,"h":76,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0128","x":958,"y":934,"w":46,"h":63,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0129","x":4059,"y":146,"w":30,"h":41,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0130","x":4059,"y":189,"w":23,"h":35,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0131","x":4059,"y":226,"w":20,"h":30,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0132","x":4059,"y":278,"w":17,"h":22,"rotated": false}},
|
||||
{"SPRITE" : {"name": "0133","x":2333,"y":1816,"w":183,"h":88,"rotated": false}}
|
||||
]},
|
||||
"meta": {
|
||||
"app": "Adobe Animate",
|
||||
"version": "21.0.1.37179",
|
||||
"image": "spritemap1.png",
|
||||
"format": "RGBA8888",
|
||||
"size": {"w":4093,"h":1988},
|
||||
"resolution": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 642 KiB |
@@ -203,7 +203,6 @@
|
||||
<str id="paste">Paste</str>
|
||||
<str id="cut">Cut</str>
|
||||
<str id="delete">Delete</str>
|
||||
<str id="deletestacked">Delete Stacked Notes</str>
|
||||
</group>
|
||||
|
||||
<str id="topBar.chart">Chart</str>
|
||||
@@ -224,7 +223,6 @@
|
||||
<str id="resetZoom">Reset Zoom</str>
|
||||
<str id="showSectionsSeparator">Show Sections Separator</str>
|
||||
<str id="showBeatsSeparator">Show Beats Separator</str>
|
||||
<str id="showCameraHighlights">Show Camera Highlights</str>
|
||||
<str id="rainbowWaveforms">Rainbow Waveforms</str>
|
||||
<str id="lowDetailWaveforms">Low Detail Waveforms</str>
|
||||
<str id="scrollLeft">Scroll Left</str>
|
||||
@@ -238,9 +236,8 @@
|
||||
<str id="goEnd">Go forward to the end</str> <!-- used to be "Go to the end" -->
|
||||
<str id="addOpponentCamera">Add camera on Opponent</str>
|
||||
<str id="addPlayerCamera">Add camera on Player</str>
|
||||
<str id="inst">Instrumental</str>
|
||||
<str id="voices">Voices</str>
|
||||
<str id="hitsounds">Hitsounds</str>
|
||||
<str id="muteInst">Mute instrumental</str>
|
||||
<str id="muteVoices">Mute voices</str>
|
||||
</group>
|
||||
|
||||
<group name="BookmarkMenu" prefix="bookmarks.">
|
||||
@@ -253,7 +250,6 @@
|
||||
<str id="editBookmarkListTitle">Bookmark List</str>
|
||||
<str id="editBookmarksTitle">Edit Bookmarks</str>
|
||||
<str id="newBookmarkName">New Bookmark</str>
|
||||
<str id="bookmarkList">Bookmark List</str>
|
||||
</group>
|
||||
|
||||
<str id="topBar.note">Note</str>
|
||||
@@ -262,7 +258,6 @@
|
||||
<str id="subtractSustainLength">Subtract sustain length</str>
|
||||
<str id="selectAll">Select all</str>
|
||||
<str id="selectMeasure">Select measure</str>
|
||||
<str id="noteTypesList">Note Types List</str>
|
||||
<str id="editNoteTypesList">Edit Note Types List</str>
|
||||
</group>
|
||||
<str id="topBar.snap">Snap</str>
|
||||
@@ -313,9 +308,8 @@
|
||||
<group name="StrumlineOptions" prefix="strumLine.">
|
||||
<str id="button-name">Options ↓</str>
|
||||
|
||||
<str id="waveforms">Waveforms</str>
|
||||
<str id="hitsounds">Hitsounds</str>
|
||||
<str id="vocals">Vocals</str>
|
||||
<str id="muteVocals">Mute Vocals</str>
|
||||
<str id="edit">Edit</str>
|
||||
<str id="delete">Delete</str>
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<str id="animation">Animación</str>
|
||||
<str id="atlas">Atlas</str>
|
||||
<str id="spritemap">Mapa de sprites</str>
|
||||
|
||||
|
||||
<str id="directory">Ubicación ({0}/)</str>
|
||||
<str id="found">{0} {1} Encontrado</str>
|
||||
<str id="foundplural">{0} {1} Encontrados</str>
|
||||
@@ -188,7 +188,6 @@
|
||||
<str id="paste">Pegar</str>
|
||||
<str id="cut">Cortar</str>
|
||||
<str id="delete">Eliminar</str>
|
||||
<str id="deletestacked">Eliminar Notas Apiladas</str>
|
||||
</group>
|
||||
|
||||
<str id="topBar.chart">Chart</str>
|
||||
|
||||
@@ -194,7 +194,6 @@
|
||||
<str id="paste">Incolla</str>
|
||||
<str id="cut">Taglia</str>
|
||||
<str id="delete">Elimina</str>
|
||||
<str id="deletestacked">Elimina Note Impilate</str>
|
||||
</group>
|
||||
|
||||
<str id="topBar.chart">Chart</str>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<str id="animation">Animacja</str>
|
||||
<str id="atlas">Atlas</str>
|
||||
<str id="spritemap">Mapa sprite'ów</str>
|
||||
|
||||
|
||||
<str id="directory">Folder ({0}/)</str>
|
||||
<str id="found">{0} {1} Znaleziono</str>
|
||||
<str id="foundplural">{0} {1} Znaleziono</str>
|
||||
@@ -87,7 +87,7 @@
|
||||
<group name="CharterEventScreen" prefix="charterEventScreen.">
|
||||
<str id="title-creating">Stwórz Grupę Wydarzeń</str>
|
||||
<str id="title-editing">Edytuj Grupę Wydarzeń</str>
|
||||
|
||||
|
||||
<str id="noEvent">Brak Wydarzenia</str>
|
||||
|
||||
<str id="strumLine.format">Struma #{0} ({1})</str>
|
||||
@@ -197,7 +197,6 @@
|
||||
<str id="paste">Wklej</str>
|
||||
<str id="cut">Wytnij</str>
|
||||
<str id="delete">Usuń</str>
|
||||
<str id="deletestacked">Usuń Notatki Ułożone w Stos</str>
|
||||
</group>
|
||||
|
||||
<str id="topBar.chart">Mapa</str>
|
||||
@@ -224,7 +223,7 @@
|
||||
<str id="scrollRight">Przewiń w Prawo</str>
|
||||
<str id="scrollReset">Resetuj Przewinięcie</str>
|
||||
</group>
|
||||
|
||||
|
||||
<str id="topBar.song">Ścieżka</str>
|
||||
<group name="SongMenu" prefix="song.">
|
||||
<str id="goStart">Wróć do początku</str>
|
||||
|
||||
@@ -203,7 +203,6 @@
|
||||
<str id="paste">Colar</str>
|
||||
<str id="cut">Cortar</str>
|
||||
<str id="delete">Apagar</str>
|
||||
<str id="deletestacked">Apagar Notas Empilhadas</str>
|
||||
</group>
|
||||
|
||||
<str id="topBar.chart">Mapa</str>
|
||||
|
||||
@@ -12,7 +12,7 @@ function create() {
|
||||
tankman = new FunkinSprite(game.dad.x + game.dad.globalOffset.x + 520, game.dad.y + game.dad.globalOffset.y + 225);
|
||||
tankman.antialiasing = true;
|
||||
tankman.loadSprite(Paths.image('game/cutscenes/tank/guns-tankman'));
|
||||
tankman.addAnim('tank', 'TANK TALK 2', 0, false);
|
||||
tankman.animateAtlas.anim.addBySymbol('tank', 'TANK TALK 2', 0, false);
|
||||
|
||||
game.insert(game.members.indexOf(game.dad), tankman);
|
||||
game.dad.visible = false;
|
||||
@@ -65,4 +65,4 @@ function destroy() {
|
||||
for(thing in [tankman, tankTalk]) thing.destroy();
|
||||
if(destroyDistorto) distorto.destroy();
|
||||
FlxTween.tween(FlxG.camera, {zoom: game.defaultCamZoom}, 0.7, {ease: FlxEase.quadInOut, startDelay: 0});
|
||||
}
|
||||
}
|
||||
@@ -33,20 +33,20 @@ function create() {
|
||||
tankman = new FunkinSprite(game.dad.x + game.dad.globalOffset.x + 520, game.dad.y + game.dad.globalOffset.y + 225);
|
||||
tankman.antialiasing = true;
|
||||
tankman.loadSprite(Paths.image('game/cutscenes/tank/stress-tankman'));
|
||||
tankman.addAnim('p1', 'TANK TALK 3 P1 UNCUT', 0, false);
|
||||
tankman.addAnim('p2', 'TANK TALK 3 P2 UNCUT', 0, false);
|
||||
tankman.animateAtlas.anim.addBySymbol('p1', 'TANK TALK 3 P1 UNCUT', 0, false);
|
||||
tankman.animateAtlas.anim.addBySymbol('p2', 'TANK TALK 3 P2 UNCUT', 0, false);
|
||||
tankman.playAnim('p1');
|
||||
|
||||
pico = new FunkinSprite(game.gf.x + game.gf.globalOffset.x - 615, game.gf.y + game.gf.globalOffset.y - 130);
|
||||
pico = new FunkinSprite(game.gf.x + game.gf.globalOffset.x + 150, game.gf.y + game.gf.globalOffset.y + 395);
|
||||
pico.antialiasing = true;
|
||||
pico.loadSprite(Paths.image('game/cutscenes/tank/stress-pico'));
|
||||
pico.addAnim('die', 'die', 24, false, null, null, 0, 0, null, true);
|
||||
pico.addAnim('saves', 'saves', 24, false, null, null, 0, 0, null, true);
|
||||
pico.addAnim('idle', 'idle', 24, true, null, null, 0, 0, null, true);
|
||||
pico.animateAtlas.anim.addBySymbol('die', 'GF Time to Die sequence', 24, false);
|
||||
pico.animateAtlas.anim.addBySymbol('saves', 'Pico Saves them sequence', 24, false);
|
||||
pico.animateAtlas.anim.addBySymbol('idle', 'Pico Dual Wield on Speaker idle', 24, true);
|
||||
pico.scrollFactor.set(0.95, 0.95);
|
||||
pico.playAnim("idle");
|
||||
pico.visible = false;
|
||||
game.insert(game.members.indexOf(game.gf) + 2, pico);
|
||||
game.insert(game.members.indexOf(game.gf) + 1, pico);
|
||||
|
||||
game.insert(game.members.indexOf(game.dad) + 1, tankman);
|
||||
game.dad.visible = false;
|
||||
@@ -59,11 +59,7 @@ function update(elapsed) {
|
||||
lipSync(tankman, 0, 16750);
|
||||
if (stressCutscene.time > 15100) {
|
||||
step = 1;
|
||||
|
||||
//focusOn(game.gf);
|
||||
game.camFollow.x += 350;
|
||||
game.camFollow.y -= 200;
|
||||
|
||||
focusOn(game.gf);
|
||||
pico.visible = true;
|
||||
pico.playAnim('die', true);
|
||||
|
||||
@@ -122,7 +118,7 @@ function update(elapsed) {
|
||||
}
|
||||
|
||||
function lipSync(char:FunkinSprite, begin:Float, end:Float) {
|
||||
char.anim.curAnim.curFrame = Std.int(FlxMath.remapToRange(stressCutscene.time, begin, end, 0, char.anim.curAnim.numFrames - 1));
|
||||
char.animateAtlas.anim.curFrame = Std.int(FlxMath.remapToRange(stressCutscene.time, begin, end, 0, char.animateAtlas.anim.length-1));
|
||||
}
|
||||
|
||||
function focusOn(char, snap:Bool = false) {
|
||||
|
||||
@@ -12,8 +12,8 @@ function create() {
|
||||
tankman = new FunkinSprite(game.dad.x + game.dad.globalOffset.x + 520, game.dad.y + game.dad.globalOffset.y + 225);
|
||||
tankman.antialiasing = true;
|
||||
tankman.loadSprite(Paths.image('game/cutscenes/tank/ugh-tankman'));
|
||||
tankman.addAnim('1', 'TANK TALK 1 P1', 0, false);
|
||||
tankman.addAnim('2', 'TANK TALK 1 P2', 0, false);
|
||||
tankman.animateAtlas.anim.addBySymbol('1', 'TANK TALK 1 P1', 0, false);
|
||||
tankman.animateAtlas.anim.addBySymbol('2', 'TANK TALK 1 P2', 0, false);
|
||||
|
||||
game.insert(game.members.indexOf(game.dad), tankman);
|
||||
game.dad.visible = false;
|
||||
@@ -77,4 +77,4 @@ function destroy() {
|
||||
for(timer in timers) timer.cancel();
|
||||
for(thing in [tankTalk1, tankTalk2, bfBeep, tankman]) thing.destroy();
|
||||
if(destroyDistorto) distorto.destroy();
|
||||
}
|
||||
}
|
||||
+7
-6
@@ -6,15 +6,16 @@
|
||||
<!-- OpenFL & Lime (Required for Flixel) -->
|
||||
<git name="openfl" url="https://github.com/CodenameCrew/cne-openfl" ref="old" />
|
||||
<lib name="lime" version="8.1.2" />
|
||||
<!-- <git name="lime" url="https://github.com/CodenameCrew/cne-lime" /> disabled for now until fixed -->
|
||||
|
||||
<!-- Flixel -->
|
||||
<git name="flixel" url="https://github.com/CodenameCrew/cne-flixel" ref="old" />
|
||||
<git name="flixel-addons" url="https://github.com/CodenameCrew/cne-flixel-addons" ref="old" />
|
||||
<git name="flixel" url="https://github.com/CodenameCrew/cne-flixel" />
|
||||
<git name="flixel-addons" url="https://github.com/CodenameCrew/cne-flixel-addons" />
|
||||
|
||||
<!-- Other Libraries -->
|
||||
<git name="hscript-improved" url="https://github.com/CodenameCrew/hscript-improved" ref="codename-dev" />
|
||||
<git name="hxdiscord_rpc" url="https://github.com/CodenameCrew/cne-hxdiscord_rpc" ref="old" skipDeps="true" />
|
||||
<lib name="funkin-modchart" skipDeps="true" />
|
||||
<git name="hxdiscord_rpc" url="https://github.com/CodenameCrew/cne-hxdiscord_rpc" skipDeps="true" />
|
||||
<lib name="funkin-modchart" version="1.2.4" skipDeps="true" />
|
||||
<lib name="hxvlc" version="1.9.3" skipDeps="true" />
|
||||
|
||||
<!-- Documentation and other features -->
|
||||
@@ -29,9 +30,9 @@
|
||||
<lib global="true" name="hxp" /> <lib name="hxp" />
|
||||
<lib global="true" name="format" /> <lib name="format" />
|
||||
|
||||
<git name="hxcpp" url="https://github.com/CodenameCrew/cne-hxcpp" ref="old" />
|
||||
<git name="hxcpp" url="https://github.com/CodenameCrew/cne-hxcpp" />
|
||||
|
||||
<git name="flixel-animate" url="https://github.com/CodenameCrew/cne-flixel-animate/" ref="old" skipDeps="true"/>
|
||||
<git name="flixel-animate" url="https://github.com/MaybeMaru/flixel-animate/" skipDeps="true"/>
|
||||
</if>
|
||||
|
||||
<!-- Hxcpp Building -->
|
||||
|
||||
+26
-5
@@ -19,7 +19,7 @@
|
||||
<!--Switch Export with Unique ApplicationID and Icon-->
|
||||
<set name="APP_ID" value="0x0100f6c013bbc000" />
|
||||
|
||||
<!-- DO NOT REMOVE!! ALLOWS ME TO DO REGIONS LIKE IN C# AND KEEP CODE ORGANIZED. REMOVING IT WOULD BREAK THE ENGINE -->
|
||||
<!-- DO NOT REMOVE!! -->
|
||||
<haxedef name="REGION" />
|
||||
|
||||
<!--The flixel preloader is not accurate in Chrome. You can use it regularly if you embed the swf into a html file
|
||||
@@ -72,10 +72,11 @@
|
||||
|
||||
<!-- Comment this out to prevent extending classes in hscript.
|
||||
Reduces compilation time at the cost of limited HScript flexibility. !-->
|
||||
<define name="CUSTOM_CLASSES" unless="STRIPPED_COMPILE" />
|
||||
<define name="CUSTOM_CLASSES" unless="STRIPPED_COMPILE"/>
|
||||
|
||||
<!-- Comment this out to disable abstract support in hscript. !-->
|
||||
<haxedef name="HSCRIPT_ABSTRACT_SUPPORT" unless="STRIPPED_COMPILE" />
|
||||
<!-- Comment this out to disable support for abstracts in hscript.
|
||||
Reduces compilation time at the cost of limited HScript flexibility. !-->
|
||||
<define name="HSCRIPT_ABSTRACT_SUPPORT" unless="STRIPPED_COMPILE"/>
|
||||
|
||||
<!-- Comment this out to disable multithreading !-->
|
||||
<haxedef name="ALLOW_MULTITHREADING" unless="web || flash" />
|
||||
@@ -118,6 +119,24 @@
|
||||
<!-- Disable a optimization, to allow reflection to use more functions -->
|
||||
<define name="FLX_NO_GENERIC" />
|
||||
|
||||
<!-- _______________________________ Display Server ______________________________ -->
|
||||
|
||||
<haxedef name="LIME_CMD" value="${project.command}"/>
|
||||
<define name="LIME_DISPLAY" if="${project.command == update} || ${project.command == display} || display || display_details" />
|
||||
<haxedef name="LIME_DISPLAY" if="LIME_DISPLAY" />
|
||||
|
||||
<section if="LIME_DISPLAY">
|
||||
<!-- For display server -->
|
||||
<undefine name="COMPILE_ALL_CLASSES" />
|
||||
<unset name="COMPILE_ALL_CLASSES" />
|
||||
|
||||
<undefine name="HSCRIPT_ABSTRACT_SUPPORT" />
|
||||
<unset name="HSCRIPT_ABSTRACT_SUPPORT" />
|
||||
|
||||
<undefine name="CUSTOM_CLASSES" />
|
||||
<unset name="CUSTOM_CLASSES" />
|
||||
</section>
|
||||
|
||||
<!-- _______________________________ Libraries ______________________________ -->
|
||||
|
||||
<!-- KEEP BOTH OF THESE AS THERE ARE SOME PARTICULAR CASES! -->
|
||||
@@ -175,7 +194,7 @@
|
||||
|
||||
<!-- ______________________________ Haxedefines _____________________________ -->
|
||||
|
||||
<haxeflag name="--macro" value="funkin.backend.system.macros.BuildInfo.printBuildInfo()" />
|
||||
<haxeflag name="--macro" value="funkin.backend.system.macros.BuildInfo.printBuildInfo()" unless="display" />
|
||||
|
||||
<haxedef name="FLX_NO_FOCUS_LOST_SCREEN" />
|
||||
|
||||
@@ -222,8 +241,10 @@
|
||||
<haxeflag name="--macro" value="modchart.backend.macros.Macro.includeFiles()"/>
|
||||
</section>
|
||||
|
||||
|
||||
<section if="COMPILE_ALL_CLASSES">
|
||||
<haxeflag name="-dce" value="no" />
|
||||
|
||||
<haxeflag name="--macro" value="funkin.backend.system.macros.Macros.addAdditionalClasses()" />
|
||||
</section>
|
||||
|
||||
|
||||
@@ -173,17 +173,6 @@ class FunkinSprite extends FlxAnimate implements IBeatReceiver implements IOffse
|
||||
{
|
||||
}
|
||||
|
||||
public override function draw() {
|
||||
// re-implementing the `onDraw` functionality from `FlxSprite` since `FlxAnimate` didn't have this, so we have to add it back in ourselves
|
||||
if (this.isAnimate && this.__drawOverrided) {
|
||||
this.__drawOverrided = false;
|
||||
this.onDraw(this);
|
||||
this.__drawOverrided = true;
|
||||
return;
|
||||
}
|
||||
super.draw();
|
||||
}
|
||||
|
||||
// ANIMATE ATLAS DRAWING
|
||||
#if REGION
|
||||
|
||||
@@ -366,9 +355,30 @@ class FunkinSprite extends FlxAnimate implements IBeatReceiver implements IOffse
|
||||
}
|
||||
|
||||
override function prepareDrawMatrix(matrix:FlxMatrix, camera:FlxCamera):Void {
|
||||
matrix.translate(-origin.x, -origin.y);
|
||||
|
||||
if (frameOffsetAngle != null && frameOffsetAngle != angle)
|
||||
{
|
||||
var angleOff = (frameOffsetAngle - angle) * FlxAngle.TO_RAD;
|
||||
var cos = Math.cos(angleOff);
|
||||
var sin = Math.sin(angleOff);
|
||||
// cos doesnt need to be negated
|
||||
matrix.rotateWithTrig(cos, -sin);
|
||||
matrix.translate(-frameOffset.x, -frameOffset.y);
|
||||
matrix.rotateWithTrig(cos, sin);
|
||||
}
|
||||
else
|
||||
matrix.translate(-frameOffset.x, -frameOffset.y);
|
||||
|
||||
matrix.translate(origin.x, origin.y);
|
||||
|
||||
super.prepareDrawMatrix(matrix, camera);
|
||||
|
||||
if (__shouldDoZoomFactor()) {
|
||||
applyZoomFactor(matrix, camera);
|
||||
}
|
||||
|
||||
function applyZoomFactor(matrix:FlxMatrix, camera:FlxCamera) {
|
||||
if(__shouldDoZoomFactor()) {
|
||||
__prepareZoomFactor(_rect2, camera);
|
||||
matrix.setTo(
|
||||
matrix.a * _rect2.width, matrix.b * _rect2.height,
|
||||
|
||||
@@ -8,19 +8,7 @@ import lime.utils.AssetLibrary;
|
||||
import haxe.ds.Map;
|
||||
|
||||
class AssetsLibraryList extends AssetLibrary {
|
||||
|
||||
public var libraries:Array<AssetLibrary> = [];
|
||||
public var cleanLibraries(get, never):Array<AssetLibrary>;
|
||||
function get_cleanLibraries():Array<AssetLibrary> {
|
||||
return [for (l in libraries) getCleanLibrary(l)];
|
||||
}
|
||||
|
||||
// is true if any library in `libraries` contains some kind of compressed library.
|
||||
public var hasCompressedLibrary(get, never):Bool;
|
||||
function get_hasCompressedLibrary():Bool {
|
||||
for (l in libraries) if (getCleanLibrary(l).isCompressed) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@:allow(funkin.backend.system.Main)
|
||||
@:allow(funkin.backend.system.MainState)
|
||||
|
||||
@@ -83,11 +83,10 @@ class ModsFolder {
|
||||
*/
|
||||
public static function loadModLib(path:String, force:Bool = false, ?modName:String) {
|
||||
#if MOD_SUPPORT
|
||||
for (ext in Flags.ALLOWED_ZIP_EXTENSIONS) {
|
||||
if (!FileSystem.exists('$path.$ext')) continue;
|
||||
return loadLibraryFromZip('$path'.toLowerCase(), '$path.$ext', force, modName);
|
||||
}
|
||||
return loadLibraryFromFolder('$path'.toLowerCase(), '$path', force, modName);
|
||||
if (FileSystem.exists('$path.zip'))
|
||||
return loadLibraryFromZip('$path'.toLowerCase(), '$path.zip', force, modName);
|
||||
else
|
||||
return loadLibraryFromFolder('$path'.toLowerCase(), '$path', force, modName);
|
||||
|
||||
#else
|
||||
return null;
|
||||
@@ -97,16 +96,27 @@ class ModsFolder {
|
||||
public static function getModsList():Array<String> {
|
||||
var mods:Array<String> = [];
|
||||
#if MOD_SUPPORT
|
||||
// Mods directory does not exist yet, create it
|
||||
if (!FileSystem.exists(modsPath)) FileSystem.createDirectory(modsPath);
|
||||
if (!FileSystem.exists(modsPath)) {
|
||||
// Mods directory does not exist yet, create it
|
||||
FileSystem.createDirectory(modsPath);
|
||||
}
|
||||
|
||||
final modsList:Array<String> = FileSystem.readDirectory(modsPath);
|
||||
|
||||
if (modsList == null || modsList.length <= 0) return mods;
|
||||
if (modsList == null || modsList.length <= 0)
|
||||
return mods;
|
||||
|
||||
for (modFolder in modsList) {
|
||||
if (FileSystem.isDirectory(modsPath + modFolder)) mods.push(modFolder);
|
||||
else if (Flags.ALLOWED_ZIP_EXTENSIONS.contains(Path.extension(modFolder))) mods.push(Path.withoutExtension(modFolder));
|
||||
if (FileSystem.isDirectory(modsPath + modFolder)) {
|
||||
mods.push(modFolder);
|
||||
} else {
|
||||
var ext = Path.extension(modFolder).toLowerCase();
|
||||
switch(ext) {
|
||||
case 'zip':
|
||||
// is a zip mod!!
|
||||
mods.push(Path.withoutExtension(modFolder));
|
||||
}
|
||||
}
|
||||
}
|
||||
#end
|
||||
return mods;
|
||||
@@ -118,9 +128,7 @@ class ModsFolder {
|
||||
#if TRANSLATIONS_SUPPORT
|
||||
if(skipTranslated && (l is TranslatedAssetLibrary)) continue;
|
||||
#end
|
||||
// No need to check for it being a `ScriptedAssetLibrary`, if `ScriptedAssetLibrary` extends ModsFolderLibrary, which implements `IModsAssetLibrary`
|
||||
// If you have to revert this change then uhhhhh wasn't me, trust 🙏
|
||||
if (/*l is ScriptedAssetLibrary ||*/ l is IModsAssetLibrary) libs.push(cast(l, IModsAssetLibrary));
|
||||
if (l is ScriptedAssetLibrary || l is IModsAssetLibrary) libs.push(cast(l, IModsAssetLibrary));
|
||||
}
|
||||
return libs;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
package funkin.backend.assets;
|
||||
|
||||
import funkin.backend.system.Flags;
|
||||
|
||||
import haxe.io.Path;
|
||||
import lime.graphics.Image;
|
||||
import lime.media.AudioBuffer;
|
||||
import lime.text.Font;
|
||||
import lime.utils.Bytes;
|
||||
import openfl.utils.AssetLibrary;
|
||||
import sys.io.File;
|
||||
|
||||
#if MOD_SUPPORT
|
||||
import funkin.backend.utils.SysZip.SysZipEntry;
|
||||
@@ -18,16 +15,15 @@ class ZipFolderLibrary extends AssetLibrary implements IModsAssetLibrary {
|
||||
public var basePath:String;
|
||||
public var modName:String;
|
||||
public var libName:String;
|
||||
public var useImageCache:Bool = false;
|
||||
public var prefix = 'assets/';
|
||||
|
||||
|
||||
public var zip:SysZip;
|
||||
public var assets:Map<String, SysZipEntry> = [];
|
||||
public var lowerCaseAssets:Map<String, SysZipEntry> = [];
|
||||
public var nameMap:Map<String, String> = [];
|
||||
|
||||
public var PRELOAD_VIDEOS:Bool = true;
|
||||
|
||||
public function new(basePath:String, libName:String, ?modName:String, ?preloadVideos:Bool = true) {
|
||||
public function new(basePath:String, libName:String, ?modName:String) {
|
||||
this.libName = libName;
|
||||
|
||||
this.basePath = basePath;
|
||||
@@ -35,59 +31,24 @@ class ZipFolderLibrary extends AssetLibrary implements IModsAssetLibrary {
|
||||
this.modName = (modName == null) ? libName : modName;
|
||||
|
||||
zip = SysZip.openFromFile(basePath);
|
||||
zip.read();
|
||||
for(entry in zip.entries) {
|
||||
if (entry.fileName.length < 0 || entry.fileName.endsWith("/")) continue;
|
||||
if (entry.fileName.length < 0 || entry.fileName.endsWith("/"))
|
||||
continue;
|
||||
|
||||
var name:String = entry.fileName.toLowerCase(); // calling .toLowerCase a million times is never the solution
|
||||
lowerCaseAssets[name] = assets[name] = assets[entry.fileName] = entry;
|
||||
nameMap.set(name, entry.fileName);
|
||||
lowerCaseAssets[entry.fileName.toLowerCase()] = assets[entry.fileName.toLowerCase()] = assets[entry.fileName] = entry;
|
||||
nameMap.set(entry.fileName.toLowerCase(), entry.fileName);
|
||||
}
|
||||
|
||||
super();
|
||||
|
||||
isCompressed = true;
|
||||
|
||||
// don't override default value of true if the file exists.
|
||||
// by default `PRELOAD_VIDEOS` is true so you will never need to add this file, but in the case of it being false this is a backup method.
|
||||
PRELOAD_VIDEOS = (!PRELOAD_VIDEOS) ? exists("assets/data/PRECACHE_VIDEOS", "TEXT") : PRELOAD_VIDEOS;
|
||||
|
||||
// if (PRELOAD_VIDEOS) precacheVideos(); // we do this in `MainState` now to handle for `Flags.VIDEO_EXT` :)
|
||||
}
|
||||
|
||||
public function precacheVideos() {
|
||||
_videoExtensions = [Flags.VIDEO_EXT];
|
||||
|
||||
videoCacheRemap = [];
|
||||
for (entry in zip.entries) {
|
||||
var name = entry.fileName.toLowerCase();
|
||||
if (_videoExtensions.contains(Path.extension(name))) getPath(prefix+name);
|
||||
}
|
||||
|
||||
var count:Int = 0;
|
||||
for (_ in videoCacheRemap.keys()) count++;
|
||||
if (count <= 0) return;
|
||||
trace('Precached $count video${(count == 1) ? "" : "s"}');
|
||||
}
|
||||
|
||||
// Now we have supports for videos in ZIP!!
|
||||
public var _videoExtensions:Array<String> = [Flags.VIDEO_EXT];
|
||||
public var videoCacheRemap:Map<String, String> = [];
|
||||
public function getVideoRemap(originalPath:String):String {
|
||||
if (!_videoExtensions.contains(Path.extension(_parsedAsset))) return originalPath;
|
||||
if (videoCacheRemap.exists(originalPath)) return videoCacheRemap.get(originalPath);
|
||||
|
||||
// We adding the length of the string to counteract folder in folder naming duplicates.
|
||||
var newPath = './.temp/${_parsedAsset.length}-zipvideo-${_parsedAsset.split("/").pop()}';
|
||||
File.saveBytes(newPath, unzip(assets[_parsedAsset]));
|
||||
videoCacheRemap.set(originalPath, newPath);
|
||||
return newPath;
|
||||
}
|
||||
|
||||
function toString():String {
|
||||
return '(ZipFolderLibrary: $libName/$modName | ${zip.entries.length} entries | Detected Video Extensions: ${_videoExtensions.join(", ")})';
|
||||
return '(ZipFolderLibrary: $libName/$modName)';
|
||||
}
|
||||
|
||||
public var _parsedAsset:String;
|
||||
|
||||
public override function getAudioBuffer(id:String):AudioBuffer {
|
||||
__parseAsset(id);
|
||||
return AudioBuffer.fromBytes(unzip(assets[_parsedAsset]));
|
||||
@@ -110,12 +71,15 @@ class ZipFolderLibrary extends AssetLibrary implements IModsAssetLibrary {
|
||||
return getAssetPath();
|
||||
}
|
||||
|
||||
public inline function unzip(f:SysZipEntry) return (f == null) ? null : zip.unzipEntry(f);
|
||||
|
||||
|
||||
public inline function unzip(f:SysZipEntry)
|
||||
return f == null ? null : zip.unzipEntry(f);
|
||||
|
||||
public function __parseAsset(asset:String):Bool {
|
||||
if (!asset.startsWith(prefix)) return false;
|
||||
_parsedAsset = asset.substr(prefix.length);
|
||||
if (ModsFolder.useLibFile) {
|
||||
if(ModsFolder.useLibFile) {
|
||||
var file = new haxe.io.Path(_parsedAsset);
|
||||
if(file.file.startsWith("LIB_")) {
|
||||
var library = file.file.substr(4);
|
||||
@@ -126,7 +90,8 @@ class ZipFolderLibrary extends AssetLibrary implements IModsAssetLibrary {
|
||||
}
|
||||
|
||||
_parsedAsset = _parsedAsset.toLowerCase();
|
||||
if (nameMap.exists(_parsedAsset)) _parsedAsset = nameMap.get(_parsedAsset);
|
||||
if(nameMap.exists(_parsedAsset))
|
||||
_parsedAsset = nameMap.get(_parsedAsset);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -141,8 +106,9 @@ class ZipFolderLibrary extends AssetLibrary implements IModsAssetLibrary {
|
||||
return assets[_parsedAsset] != null;
|
||||
}
|
||||
|
||||
private inline function getAssetPath() {
|
||||
return getVideoRemap('$basePath/$_parsedAsset');
|
||||
private function getAssetPath() {
|
||||
trace('[ZIP]$basePath/$_parsedAsset');
|
||||
return '[ZIP]$basePath/$_parsedAsset';
|
||||
}
|
||||
|
||||
// TODO: rewrite this to 1 function, like ModsFolderLibrary
|
||||
@@ -191,6 +157,18 @@ class ZipFolderLibrary extends AssetLibrary implements IModsAssetLibrary {
|
||||
return content;
|
||||
}
|
||||
|
||||
public override function list(type:String):Array<String> { return [for(k=>e in nameMap) '$prefix$e']; }
|
||||
public override function list(type:String):Array<String> {
|
||||
return[for(k=>e in nameMap) '$prefix$e'];
|
||||
}
|
||||
|
||||
// Backwards compat
|
||||
|
||||
@:noCompletion public var zipPath(get, set):String;
|
||||
@:noCompletion private inline function get_zipPath():String {
|
||||
return basePath;
|
||||
}
|
||||
@:noCompletion private inline function set_zipPath(value:String):String {
|
||||
return basePath = value;
|
||||
}
|
||||
}
|
||||
#end
|
||||
@@ -278,13 +278,9 @@ class Chart {
|
||||
var filteredChart = filterChartForSaving(chart, saveSettings.saveMetaInChart, saveSettings.saveLocalEvents, saveSettings.saveGlobalEvents && saveSettings.seperateGlobalEvents != true);
|
||||
|
||||
#if sys
|
||||
var songPath = saveSettings.songFolder == null ? 'songs/${chart.meta.name}' : saveSettings.songFolder, variantSuffix = variant != null && variant != "" ? '-$variant' : "", difficultySuffix = difficulty != null && difficulty != "" ? '-$difficulty' : "";
|
||||
var metaPath = 'meta$variantSuffix.json', altMetaPath = 'meta${variantSuffix}${difficultySuffix}.json', prettyPrint = saveSettings.prettyPrint == true ? Flags.JSON_PRETTY_PRINT : null, temp:String;
|
||||
if ((temp = Paths.assetsTree.getPath('assets/$songPath/$altMetaPath')) != null) { //check for difficulty specific
|
||||
songPath = temp.substr(0, temp.length - altMetaPath.length - 1);
|
||||
metaPath = temp;
|
||||
}
|
||||
else if ((temp = Paths.assetsTree.getPath('assets/$songPath/$metaPath')) != null) {
|
||||
var songPath = saveSettings.songFolder == null ? 'songs/${chart.meta.name}' : saveSettings.songFolder, variantSuffix = variant != null && variant != "" ? '-$variant' : "";
|
||||
var metaPath = 'meta$variantSuffix.json', prettyPrint = saveSettings.prettyPrint == true ? Flags.JSON_PRETTY_PRINT : null, temp:String;
|
||||
if ((temp = Paths.assetsTree.getPath('assets/$songPath/$metaPath')) != null) {
|
||||
songPath = temp.substr(0, temp.length - metaPath.length - 1);
|
||||
metaPath = temp;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class EventsData {
|
||||
defValue: "In"
|
||||
},
|
||||
{name: "Mode", type: TDropDown(['direct', 'stage']), defValue: "direct"},
|
||||
{name: "Multiplicative?", type: TBool, defValue: false}
|
||||
{name: "Multiplicative?", type: TBool, defValue: true}
|
||||
],
|
||||
"Camera Modulo Change" => [
|
||||
{name: "Modulo Interval", type: TInt(1, 9999999, 1), defValue: 4},
|
||||
|
||||
@@ -106,15 +106,12 @@ class GlobalScript {
|
||||
public static function onModSwitch(newMod:String) {
|
||||
destroy();
|
||||
scripts = new ScriptPack("GlobalScript");
|
||||
for (lib in funkin.backend.assets.ModsFolder.getLoadedModsLibs()) {
|
||||
var modName = lib.modName;
|
||||
var path = Paths.script('data/global/LIB_$modName');
|
||||
for (i in funkin.backend.assets.ModsFolder.getLoadedMods()) {
|
||||
var path = Paths.script('data/global/LIB_$i');
|
||||
var script = Script.create(path);
|
||||
if (script is DummyScript) continue;
|
||||
script.remappedNames.set(script.fileName, '$modName:${script.fileName}');
|
||||
// so you can get the current mod's library in GloablScript :)
|
||||
// you should not make this a static variable then all scripts will try to reference the 1 static variable, which will be overwritten :yoikes:
|
||||
script.set("MOD_LIBRARY", lib);
|
||||
if (script is DummyScript)
|
||||
continue;
|
||||
script.remappedNames.set(script.fileName, '$i:${script.fileName}');
|
||||
scripts.add(script);
|
||||
script.load();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import flixel.util.FlxDestroyUtil.IFlxDestroyable;
|
||||
|
||||
@:allow(funkin.backend.scripting.ScriptPack)
|
||||
@:autoBuild(funkin.backend.system.macros.EventMacro.build())
|
||||
@:noCustomClass
|
||||
class CancellableEvent implements IFlxDestroyable {
|
||||
@:dox(hide) public var cancelled:Bool = false;
|
||||
@:dox(hide) private var __continueCalls:Bool = true;
|
||||
@@ -53,4 +54,4 @@ class CancellableEvent implements IFlxDestroyable {
|
||||
public function destroy() {
|
||||
data = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,10 +19,8 @@ class Flags {
|
||||
|
||||
// -- Codename's Addon Config --
|
||||
@:bypass public static var addonFlags:Map<String, Dynamic> = [];
|
||||
public static var CURRENT_API_VERSION:Int = 2;
|
||||
|
||||
// -- Codename's ZipFolderLibrary Config --
|
||||
public static var ALLOWED_ZIP_EXTENSIONS:Array<String> = ["zip"];
|
||||
public static var CURRENT_API_VERSION:Int = 2;
|
||||
|
||||
// -- Codename's Mod Config --
|
||||
public static var MOD_NAME:String = "";
|
||||
@@ -163,8 +161,6 @@ class Flags {
|
||||
// Font configuration
|
||||
public static var DEFAULT_FONT:String = "vcr.ttf";
|
||||
public static var DEFAULT_FONT_SIZE:Int = 16;
|
||||
|
||||
public static var DEFAULT_ALT_ANIM_SUFFIX:String = "-alt";
|
||||
|
||||
// to translate these you need to convert them into ids
|
||||
// Resume -> pause.resume
|
||||
|
||||
@@ -7,14 +7,12 @@ import flixel.FlxState;
|
||||
import funkin.backend.assets.AssetsLibraryList;
|
||||
import funkin.backend.assets.ModsFolder;
|
||||
import funkin.backend.assets.ModsFolderLibrary;
|
||||
import funkin.backend.assets.ZipFolderLibrary;
|
||||
import funkin.backend.chart.EventsData;
|
||||
import funkin.backend.system.framerate.Framerate;
|
||||
import funkin.editors.ModConfigWarning;
|
||||
import funkin.menus.TitleState;
|
||||
import haxe.io.Path;
|
||||
|
||||
|
||||
@dox(hide)
|
||||
typedef AddonInfo = {
|
||||
var name:String;
|
||||
@@ -59,32 +57,12 @@ class MainState extends FlxState {
|
||||
var _highPriorityAddons:Array<AddonInfo> = [];
|
||||
var _noPriorityAddons:Array<AddonInfo> = [];
|
||||
|
||||
var quick_modsPath = ModsFolder.modsPath + ModsFolder.currentModFolder;
|
||||
|
||||
// handing if the loading mod (before it's properly loaded) is a compressed mod
|
||||
// we just need to use `Paths.assetsTree.hasCompressedLibrary` to complete valid checks for actual loaded compressed mods
|
||||
var isZipMod = false;
|
||||
|
||||
// If we know it's a compressed mod, then we can check if it's using the `cnemod` folder path.
|
||||
// All it is really is a folder with the mod's name, then a compressed file called "cnemod.[zip|7z|rar|etc]"
|
||||
var isCneMod = false;
|
||||
|
||||
// We are doing it like this because think about it: it's 1 for loop lol
|
||||
// We just need to know if any of these values is true, so if only one is true and we are not close to being done in the loop, that's fine.
|
||||
//
|
||||
for (ext in Flags.ALLOWED_ZIP_EXTENSIONS) {
|
||||
if (FileSystem.exists(quick_modsPath+"."+ext)) isZipMod = true;
|
||||
if (FileSystem.exists(quick_modsPath+"/cnemod."+ext)) isCneMod = true;
|
||||
if (isZipMod && isCneMod) break;
|
||||
}
|
||||
|
||||
// We get the addons folder from relative space (`./`) and then our mod's addons.
|
||||
var addonPaths = [
|
||||
ModsFolder.addonsPath,
|
||||
// So to check the mod's addons folder, we need to decompress it. Which is impossible* in this stage of the loading library process.
|
||||
// TODO: Write a function when the library is loaded to decompress the contents and then load the libraries :)
|
||||
( (ModsFolder.currentModFolder != null && !isZipMod) ?
|
||||
quick_modsPath + "/addons/" : null
|
||||
(
|
||||
ModsFolder.currentModFolder != null ?
|
||||
ModsFolder.modsPath + ModsFolder.currentModFolder + "/addons/" :
|
||||
null
|
||||
)
|
||||
];
|
||||
|
||||
@@ -94,8 +72,12 @@ class MainState extends FlxState {
|
||||
|
||||
for (addon in FileSystem.readDirectory(path)) {
|
||||
if (!FileSystem.isDirectory(path + addon)) {
|
||||
if (Flags.ALLOWED_ZIP_EXTENSIONS.contains(Path.extension(addon))) addon = Path.withoutExtension(addon);
|
||||
else continue;
|
||||
switch(Path.extension(addon).toLowerCase()) {
|
||||
case 'zip':
|
||||
addon = Path.withoutExtension(addon);
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
var data:AddonInfo = {
|
||||
@@ -118,14 +100,9 @@ class MainState extends FlxState {
|
||||
#if MOD_SUPPORT
|
||||
for (addon in _lowPriorityAddons)
|
||||
loadLib(addon.path, ltrim(addon.name, "[LOW]"));
|
||||
|
||||
if (ModsFolder.currentModFolder != null) {
|
||||
// isCneMod is a guarentee to be a zip mod because we just checked for it, so this will always load as a CompressedLibrary
|
||||
if (isCneMod)
|
||||
loadLib(quick_modsPath + "/cnemod", ModsFolder.currentModFolder);
|
||||
else
|
||||
loadLib(quick_modsPath, ModsFolder.currentModFolder);
|
||||
}
|
||||
|
||||
if (ModsFolder.currentModFolder != null)
|
||||
loadLib(ModsFolder.modsPath + ModsFolder.currentModFolder, ModsFolder.currentModFolder);
|
||||
|
||||
for (addon in _noPriorityAddons)
|
||||
loadLib(addon.path, addon.name);
|
||||
@@ -157,15 +134,9 @@ class MainState extends FlxState {
|
||||
CoolUtil.safeAddAttributes('./.temp/', NativeAPI.FileAttribute.HIDDEN);
|
||||
#end
|
||||
|
||||
for (lib in ModsFolder.getLoadedModsLibs()) {
|
||||
if (!(lib is ZipFolderLibrary)) continue;
|
||||
if (cast(lib, ZipFolderLibrary).PRELOAD_VIDEOS) cast(lib, ZipFolderLibrary).precacheVideos();
|
||||
}
|
||||
|
||||
var startState:Class<FlxState> = Flags.DISABLE_WARNING_SCREEN ? TitleState : funkin.menus.WarningState;
|
||||
|
||||
// In this case if the mod we just loaded a compressed modpack, we can't edit or modify files without decompressing it.
|
||||
if (Options.devMode && Options.allowConfigWarning && !isZipMod) {
|
||||
if (Options.devMode && Options.allowConfigWarning) {
|
||||
var lib:ModsFolderLibrary;
|
||||
for (e in Paths.assetsTree.libraries) if ((lib = cast AssetsLibraryList.getCleanLibrary(e)) is ModsFolderLibrary
|
||||
&& lib.modName == ModsFolder.currentModFolder)
|
||||
|
||||
@@ -13,13 +13,8 @@ class CodenameBuildField extends TextField {
|
||||
}
|
||||
|
||||
public function reload() {
|
||||
#if COMPILE_EXPERIMENTAL
|
||||
text = '${Flags.VERSION_MESSAGE} (Experimental Build)';
|
||||
#else
|
||||
text = '${Flags.VERSION_MESSAGE}';
|
||||
#end
|
||||
|
||||
#if (debug || COMPILE_EXPERIMENTAL)
|
||||
#if debug
|
||||
text += '\n${Flags.COMMIT_MESSAGE}';
|
||||
#end
|
||||
}
|
||||
|
||||
@@ -53,6 +53,25 @@ class SystemInfo extends FramerateCategory {
|
||||
if (osName != "")
|
||||
osInfo = '${osName} ${osVersion}'.trim();
|
||||
}
|
||||
#elseif windows
|
||||
var windowsCurrentVersionPath = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion";
|
||||
var buildNumber = Std.parseInt(RegistryUtil.get(HKEY_LOCAL_MACHINE, windowsCurrentVersionPath, "CurrentBuildNumber"));
|
||||
var edition = RegistryUtil.get(HKEY_LOCAL_MACHINE, windowsCurrentVersionPath, "ProductName");
|
||||
|
||||
var lcuKey = "WinREVersion"; // Last Cumulative Update Key On Older Windows Versions
|
||||
if (buildNumber >= 22000) { // Windows 11 Initial Release Build Number
|
||||
edition = edition.replace("Windows 10", "Windows 11");
|
||||
lcuKey = "LCUVer"; // Last Cumulative Update Key On Windows 11
|
||||
}
|
||||
|
||||
var lcuVersion = RegistryUtil.get(HKEY_LOCAL_MACHINE, windowsCurrentVersionPath, lcuKey);
|
||||
|
||||
osInfo = edition;
|
||||
|
||||
if (lcuVersion != null && lcuVersion != "")
|
||||
osInfo += ' ${lcuVersion}';
|
||||
else if (lime.system.System.platformVersion != null && lime.system.System.platformVersion != "")
|
||||
osInfo += ' ${lime.system.System.platformVersion}';
|
||||
#else
|
||||
if (lime.system.System.platformLabel != null && lime.system.System.platformLabel != "" && lime.system.System.platformVersion != null && lime.system.System.platformVersion != "")
|
||||
osInfo = '${lime.system.System.platformLabel.replace(lime.system.System.platformVersion, "").trim()} ${lime.system.System.platformVersion}';
|
||||
@@ -62,10 +81,7 @@ class SystemInfo extends FramerateCategory {
|
||||
|
||||
try {
|
||||
#if windows
|
||||
var process = new HiddenProcess("wmic", ["cpu", "get", "name"]);
|
||||
if (process.exitCode() != 0) throw 'Could not fetch CPU information';
|
||||
|
||||
cpuName = process.stdout.readAll().toString().trim().split("\n")[1].trim();
|
||||
cpuName = RegistryUtil.get(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", "ProcessorNameString");
|
||||
#elseif mac
|
||||
var process = new HiddenProcess("sysctl -a | grep brand_string"); // Somehow this isn't able to use the args but it still works
|
||||
if (process.exitCode() != 0) throw 'Could not fetch CPU information';
|
||||
|
||||
@@ -25,7 +25,7 @@ class AliasMacro {
|
||||
}];
|
||||
|
||||
public static function build():Array<Field> {
|
||||
#if display
|
||||
#if LIME_DISPLAY
|
||||
return Context.getBuildFields();
|
||||
#end
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@ class DefinesMacro {
|
||||
|
||||
// INTERNAL MACROS
|
||||
#if REGION
|
||||
private static macro function __getDefines() {
|
||||
private static macro function __getDefines():Expr {
|
||||
#if display
|
||||
return macro $v{[]};
|
||||
return macro $v{([]:Map<String, Dynamic>)};
|
||||
#else
|
||||
return macro $v{Context.getDefines()};
|
||||
#end
|
||||
|
||||
@@ -64,7 +64,7 @@ class GitCommitMacro {
|
||||
// INTERNAL MACROS
|
||||
#if REGION
|
||||
private static macro function __getCommitHash() {
|
||||
#if display
|
||||
#if LIME_DISPLAY
|
||||
return macro $v{"-"};
|
||||
#else
|
||||
try {
|
||||
@@ -78,7 +78,7 @@ class GitCommitMacro {
|
||||
}
|
||||
|
||||
private static macro function __getCommitNumber() {
|
||||
#if display
|
||||
#if LIME_DISPLAY
|
||||
return macro $v{0};
|
||||
#else
|
||||
try {
|
||||
@@ -92,7 +92,7 @@ class GitCommitMacro {
|
||||
}
|
||||
|
||||
private static macro function __getCommitHashLong() {
|
||||
#if display
|
||||
#if LIME_DISPLAY
|
||||
return macro $v{"-"};
|
||||
#else
|
||||
try {
|
||||
@@ -106,7 +106,7 @@ class GitCommitMacro {
|
||||
}
|
||||
|
||||
private static macro function __getCommitMessage() {
|
||||
#if display
|
||||
#if LIME_DISPLAY
|
||||
return macro $v{"-"};
|
||||
#else
|
||||
try {
|
||||
@@ -124,7 +124,7 @@ class GitCommitMacro {
|
||||
}
|
||||
|
||||
private static macro function __getCommitAuthor() {
|
||||
#if display
|
||||
#if LIME_DISPLAY
|
||||
return macro $v{"-"};
|
||||
#else
|
||||
try {
|
||||
@@ -138,8 +138,8 @@ class GitCommitMacro {
|
||||
}
|
||||
|
||||
private static macro function __getCommitDate() {
|
||||
#if display
|
||||
return macro $v{Date.now()};
|
||||
#if LIME_DISPLAY
|
||||
return macro Date.now();
|
||||
#else
|
||||
try {
|
||||
// get the time in UTC format
|
||||
@@ -164,7 +164,7 @@ class GitCommitMacro {
|
||||
}
|
||||
|
||||
private static macro function __getCurrentBranch() {
|
||||
#if display
|
||||
#if LIME_DISPLAY
|
||||
return macro $v{"-"};
|
||||
#else
|
||||
try {
|
||||
@@ -179,7 +179,7 @@ class GitCommitMacro {
|
||||
}
|
||||
|
||||
private static macro function __getHasUncommittedChanges() {
|
||||
#if display
|
||||
#if LIME_DISPLAY
|
||||
return macro $v{false};
|
||||
#else
|
||||
try {
|
||||
|
||||
@@ -69,7 +69,6 @@ class Macros {
|
||||
final fields:Array<Field> = Context.getBuildFields(), pos:Position = Context.currentPos();
|
||||
|
||||
fields.push({name: 'tag', access: [APublic], pos: pos, kind: FVar(macro :funkin.backend.assets.AssetSource)});
|
||||
fields.push({name: 'isCompressed', access: [APublic], pos: pos, kind: FVar(macro :Bool, macro false)});
|
||||
|
||||
return fields;
|
||||
}
|
||||
|
||||
@@ -440,9 +440,11 @@ final class CoolUtil
|
||||
* @param fadeIn
|
||||
*/
|
||||
@:noUsing public static function playMenuSong(fadeIn:Bool = false) {
|
||||
if (FlxG.sound.music == null || !FlxG.sound.music.playing) {
|
||||
if (FlxG.sound.music == null || !FlxG.sound.music.playing)
|
||||
{
|
||||
playMusic(Paths.music(Flags.DEFAULT_MENU_MUSIC), true, fadeIn ? 0 : 1, true, 102);
|
||||
if (fadeIn) FlxG.sound.music.fadeIn(4, 0, 1);
|
||||
if (fadeIn)
|
||||
FlxG.sound.music.fadeIn(4, 0, 0.7);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -878,7 +880,7 @@ final class CoolUtil
|
||||
*/
|
||||
public static inline function browsePath(path:String) {
|
||||
var formattedPath:String = Path.normalize(path);
|
||||
|
||||
|
||||
#if windows
|
||||
formattedPath = formattedPath.replace("/", "\\");
|
||||
Sys.command("explorer", [formattedPath]);
|
||||
@@ -1025,20 +1027,6 @@ final class CoolUtil
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the mouse is overlapping the sprite on a given camera, taking the camera's position, scroll and zoom into account.
|
||||
*
|
||||
* @param sprite Any `FlxObject`
|
||||
* @param camera The camera you want to check overlap on. Uses the sprite's camera by default.
|
||||
* @return Bool
|
||||
*/
|
||||
public static function mouseOverlaps(sprite:FlxObject, ?camera:FlxCamera) {
|
||||
var camToCheck:FlxCamera = camera ?? sprite.camera;
|
||||
var posthing:FlxPoint = FlxG.mouse.getWorldPosition(camToCheck);
|
||||
|
||||
return posthing != null && FlxMath.inBounds(posthing.x, sprite.x, sprite.x + sprite.width) && FlxMath.inBounds(posthing.y, sprite.y, sprite.y + sprite.height);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts an array alphabetically.
|
||||
* @param array Array to sort
|
||||
@@ -1089,7 +1077,7 @@ final class CoolUtil
|
||||
r.add(str);
|
||||
return r.toString();
|
||||
}
|
||||
|
||||
|
||||
public static inline function bound(Value:Float, Min:Float, Max:Float):Float {
|
||||
#if cpp
|
||||
var _hx_tmp1:Float = Value;
|
||||
@@ -1236,8 +1224,8 @@ final class CoolUtil
|
||||
|
||||
/**
|
||||
* ! REQUIRES FULL PATH!!!
|
||||
* @param path
|
||||
* @return Bool
|
||||
* @param path
|
||||
* @return Bool
|
||||
*/
|
||||
public static function imageHasFrameData(path:String):String {
|
||||
if (FileSystem.exists(Path.withExtension(path, "xml"))) return "xml";
|
||||
@@ -1454,7 +1442,6 @@ final class CoolUtil
|
||||
|
||||
return toProperty.setValue(fromProperty.getValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class PropertyInfo {
|
||||
|
||||
@@ -3,220 +3,200 @@ package funkin.backend.utils;
|
||||
import haxe.macro.Expr;
|
||||
|
||||
final class MathUtil {
|
||||
public static inline var EULER:Float = 2.718281828459;
|
||||
/**
|
||||
* Returns the maximum value in the arguments.
|
||||
* @param args Array of values
|
||||
*
|
||||
* @return The maximum value
|
||||
**/
|
||||
public static function maxInt(...args:Int):Int {
|
||||
var max = args[0];
|
||||
for(i in 1...args.length) {
|
||||
var arg = args[i];
|
||||
if(arg > max)
|
||||
max = arg;
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum value in the arguments.
|
||||
* @param args Array of values
|
||||
*
|
||||
* @return The maximum value
|
||||
**/
|
||||
public static function maxInt(...args:Int):Int {
|
||||
var max = args[0];
|
||||
for(i in 1...args.length) {
|
||||
var arg = args[i];
|
||||
if(arg > max)
|
||||
max = arg;
|
||||
}
|
||||
return max;
|
||||
}
|
||||
/**
|
||||
* Returns the minimum value in the arguments.
|
||||
* @param args Array of values
|
||||
*
|
||||
* @return The minimum value
|
||||
**/
|
||||
public static function minInt(...args:Int):Int {
|
||||
var min = args[0];
|
||||
for(i in 1...args.length) {
|
||||
var arg = args[i];
|
||||
if(arg < min)
|
||||
min = arg;
|
||||
}
|
||||
return min;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minimum value in the arguments.
|
||||
* @param args Array of values
|
||||
*
|
||||
* @return The minimum value
|
||||
**/
|
||||
public static function minInt(...args:Int):Int {
|
||||
var min = args[0];
|
||||
for(i in 1...args.length) {
|
||||
var arg = args[i];
|
||||
if(arg < min)
|
||||
min = arg;
|
||||
}
|
||||
return min;
|
||||
}
|
||||
/**
|
||||
* Returns the maximum value in the arguments.
|
||||
*
|
||||
* NOTE: If you are using this in compile time, you should use `MathUtil.maxSmart` instead of this for better performance.
|
||||
*
|
||||
* @param args Array of values
|
||||
*
|
||||
* @return The maximum value
|
||||
**/
|
||||
public static function max(...args:Float):Float {
|
||||
var max = args[0];
|
||||
for(i in 1...args.length) {
|
||||
var arg = args[i];
|
||||
if(arg > max)
|
||||
max = arg;
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum value in the arguments.
|
||||
*
|
||||
* NOTE: If you are using this in compile time, you should use `MathUtil.maxSmart` instead of this for better performance.
|
||||
*
|
||||
* @param args Array of values
|
||||
*
|
||||
* @return The maximum value
|
||||
**/
|
||||
public static function max(...args:Float):Float {
|
||||
var max = args[0];
|
||||
for(i in 1...args.length) {
|
||||
var arg = args[i];
|
||||
if(arg > max)
|
||||
max = arg;
|
||||
}
|
||||
return max;
|
||||
}
|
||||
/**
|
||||
* Returns the minimum value in the arguments.
|
||||
*
|
||||
* NOTE: If you are using this in compile time, you should use `MathUtil.minSmart` instead of this for better performance.
|
||||
*
|
||||
* @param args Array of values
|
||||
*
|
||||
* @return The minimum value
|
||||
**/
|
||||
public static function min(...args:Float):Float {
|
||||
var min = args[0];
|
||||
for(i in 1...args.length) {
|
||||
var arg = args[i];
|
||||
if(arg < min)
|
||||
min = arg;
|
||||
}
|
||||
return min;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minimum value in the arguments.
|
||||
*
|
||||
* NOTE: If you are using this in compile time, you should use `MathUtil.minSmart` instead of this for better performance.
|
||||
*
|
||||
* @param args Array of values
|
||||
*
|
||||
* @return The minimum value
|
||||
**/
|
||||
public static function min(...args:Float):Float {
|
||||
var min = args[0];
|
||||
for(i in 1...args.length) {
|
||||
var arg = args[i];
|
||||
if(arg < min)
|
||||
min = arg;
|
||||
}
|
||||
return min;
|
||||
}
|
||||
/**
|
||||
* Checks if a is less than b with considering a margin of error.
|
||||
*
|
||||
* @param a Float
|
||||
* @param b Float
|
||||
* @param margin Float (Default: EPSILON)
|
||||
*
|
||||
* @return Bool
|
||||
**/
|
||||
public static function lessThan(a:Float, b:Float, margin:Float = 0.0000001):Bool {
|
||||
return a < b - margin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a is less than b with considering a margin of error.
|
||||
* * @param a Float
|
||||
* @param b Float
|
||||
* @param margin Float (Default: EPSILON)
|
||||
* * @return Bool
|
||||
**/
|
||||
public static function lessThan(a:Float, b:Float, margin:Float = 0.0000001):Bool {
|
||||
return a < b - margin;
|
||||
}
|
||||
/**
|
||||
* Checks if a is less than or equally b with considering a margin of error.
|
||||
*
|
||||
* @param a Float
|
||||
* @param b Float
|
||||
* @param margin Float (Default: EPSILON)
|
||||
*
|
||||
* @return Bool
|
||||
**/
|
||||
public static function lessThanEqual(a:Float, b:Float, margin:Float = 0.0000001):Bool {
|
||||
return a <= b - margin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a is less than or equally b with considering a margin of error.
|
||||
* * @param a Float
|
||||
* @param b Float
|
||||
* @param margin Float (Default: EPSILON)
|
||||
* * @return Bool
|
||||
**/
|
||||
public static function lessThanEqual(a:Float, b:Float, margin:Float = 0.0000001):Bool {
|
||||
return a <= b - margin;
|
||||
}
|
||||
/**
|
||||
* Checks if a is greater than b with considering a margin of error.
|
||||
*
|
||||
* @param a Float
|
||||
* @param b Float
|
||||
* @param margin Float (Default: EPSILON)
|
||||
*
|
||||
* @return Bool
|
||||
**/
|
||||
public static function greaterThan(a:Float, b:Float, margin:Float = 0.0000001):Bool {
|
||||
return a > b + margin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a is greater than b with considering a margin of error.
|
||||
* * @param a Float
|
||||
* @param b Float
|
||||
* @param margin Float (Default: EPSILON)
|
||||
* * @return Bool
|
||||
**/
|
||||
public static function greaterThan(a:Float, b:Float, margin:Float = 0.0000001):Bool {
|
||||
return a > b + margin;
|
||||
}
|
||||
/**
|
||||
* Checks if a is greater than or equally b with considering a margin of error.
|
||||
*
|
||||
* @param a Float
|
||||
* @param b Float
|
||||
* @param margin Float (Default: EPSILON)
|
||||
*
|
||||
* @return Bool
|
||||
**/
|
||||
public static function greaterThanEqual(a:Float, b:Float, margin:Float = 0.0000001):Bool {
|
||||
return a >= b + margin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a is greater than or equally b with considering a margin of error.
|
||||
* * @param a Float
|
||||
* @param b Float
|
||||
* @param margin Float (Default: EPSILON)
|
||||
* * @return Bool
|
||||
**/
|
||||
public static function greaterThanEqual(a:Float, b:Float, margin:Float = 0.0000001):Bool {
|
||||
return a >= b + margin;
|
||||
}
|
||||
/**
|
||||
* Checks if a is approximately equal to b.
|
||||
*
|
||||
* @param a Float
|
||||
* @param b Float
|
||||
* @param margin Float (Default: EPSILON)
|
||||
*
|
||||
* @return Bool
|
||||
**/
|
||||
public static function equal(a:Float, b:Float, margin:Float = 0.0000001):Bool {
|
||||
return Math.abs(a - b) <= margin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a is approximately equal to b.
|
||||
* * @param a Float
|
||||
* @param b Float
|
||||
* @param margin Float (Default: EPSILON)
|
||||
* * @return Bool
|
||||
**/
|
||||
public static function equal(a:Float, b:Float, margin:Float = 0.0000001):Bool {
|
||||
return Math.abs(a - b) <= margin;
|
||||
}
|
||||
/**
|
||||
* Checks if a are not approximately equal to b.
|
||||
*
|
||||
* @param a Float
|
||||
* @param b Float
|
||||
* @param margin Float (Default: EPSILON)
|
||||
*
|
||||
* @return Bool
|
||||
**/
|
||||
public static function notEqual(a:Float, b:Float, margin:Float = 0.0000001):Bool {
|
||||
return Math.abs(a - b) > margin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a are not approximately equal to b.
|
||||
* * @param a Float
|
||||
* @param b Float
|
||||
* @param margin Float (Default: EPSILON)
|
||||
* * @return Bool
|
||||
**/
|
||||
public static function notEqual(a:Float, b:Float, margin:Float = 0.0000001):Bool {
|
||||
return Math.abs(a - b) > margin;
|
||||
}
|
||||
/**
|
||||
* Shortcut to `Math.max` but with infinite amount of arguments
|
||||
*
|
||||
* Might not preserve the order of arguments, please test this.
|
||||
*
|
||||
* Dont use this in hscript, it doesnt work, it only works on compile time
|
||||
**/
|
||||
@:dox(hide) public static macro function maxSmart(..._args:Expr):Expr {
|
||||
return genericMinMaxSmart(_args.toArray(), "Math.max");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param edge0 Float
|
||||
* @param edge1 Float
|
||||
* @param x Float
|
||||
* @return Float
|
||||
**/
|
||||
public static function smoothStep(edge0:Float, edge1:Float, x:Float):Float {
|
||||
var t = (x - edge0) / (edge1 - edge0);
|
||||
var clamped = t < 0.0 ? 0.0 : (t > 1.0 ? 1.0 : t);
|
||||
return clamped * clamped * (3.0 - 2.0 * clamped);
|
||||
}
|
||||
/**
|
||||
* Shortcut to `Math.min` but with infinite amount of arguments
|
||||
*
|
||||
* Might not preserve the order of arguments, please test this.
|
||||
*
|
||||
* Dont use this in hscript, it doesnt work, it only works on compile time
|
||||
**/
|
||||
@:dox(hide) public static macro function minSmart(..._args:Expr):Expr {
|
||||
return genericMinMaxSmart(_args.toArray(), "Math.min");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param a Float
|
||||
* @param b Float
|
||||
* @param v Float
|
||||
* @return Float
|
||||
**/
|
||||
public static function inverseLerp(a:Float, b:Float, v:Float):Float {
|
||||
return (v - a) / (b - a);
|
||||
}
|
||||
#if macro
|
||||
@:dox(hide) private static function genericMinMaxSmart(_args:Array<Expr>, funcPath:String):Expr {
|
||||
var args = _args.copy();
|
||||
if (args.length == 0) return macro 0;
|
||||
|
||||
/**
|
||||
* @param v Float
|
||||
* @return Float
|
||||
**/
|
||||
public static function fract(v:Float):Float {
|
||||
return v - Math.floor(v);
|
||||
}
|
||||
var func = funcPath.split(".");
|
||||
|
||||
/**
|
||||
* Shortcut to `Math.max` but with infinite amount of arguments
|
||||
*
|
||||
* Might not preserve the order of arguments, please test this.
|
||||
*
|
||||
* Dont use this in hscript, it doesnt work, it only works on compile time
|
||||
**/
|
||||
@:dox(hide) public static macro function maxSmart(..._args:Expr):Expr {
|
||||
return genericMinMaxSmart(_args.toArray(), "Math.max");
|
||||
}
|
||||
function nested(lst:Array<Expr>):Expr {
|
||||
if (lst.length == 1) {
|
||||
return macro ${lst[0]};
|
||||
} else if (lst.length == 2) {
|
||||
return macro $p{func}(${lst[0]}, ${lst[1]});
|
||||
} else {
|
||||
var mid = Std.int(lst.length / 2);
|
||||
return macro $p{func}(${nested(lst.slice(0, mid))}, ${nested(lst.slice(mid, lst.length))});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut to `Math.min` but with infinite amount of arguments
|
||||
*
|
||||
* Might not preserve the order of arguments, please test this.
|
||||
*
|
||||
* Dont use this in hscript, it doesnt work, it only works on compile time
|
||||
**/
|
||||
@:dox(hide) public static macro function minSmart(..._args:Expr):Expr {
|
||||
return genericMinMaxSmart(_args.toArray(), "Math.min");
|
||||
}
|
||||
var expr = nested(args);
|
||||
|
||||
#if macro
|
||||
@:dox(hide) private static function genericMinMaxSmart(_args:Array<Expr>, funcPath:String):Expr {
|
||||
var args = _args.copy();
|
||||
if (args.length == 0) return macro 0;
|
||||
//var printer = new haxe.macro.Printer();
|
||||
//trace(printer.printExpr(expr));
|
||||
|
||||
var func = funcPath.split(".");
|
||||
|
||||
function nested(lst:Array<Expr>):Expr {
|
||||
if (lst.length == 1) {
|
||||
return macro ${lst[0]};
|
||||
} else if (lst.length == 2) {
|
||||
return macro $p{func}(${lst[0]}, ${lst[1]});
|
||||
} else {
|
||||
var mid = Std.int(lst.length / 2);
|
||||
return macro $p{func}(${nested(lst.slice(0, mid))}, ${nested(lst.slice(mid, lst.length))});
|
||||
}
|
||||
}
|
||||
|
||||
var expr = nested(args);
|
||||
|
||||
//var printer = new haxe.macro.Printer();
|
||||
//trace(printer.printExpr(expr));
|
||||
|
||||
return macro $expr;
|
||||
}
|
||||
#end
|
||||
}
|
||||
return macro $expr;
|
||||
}
|
||||
#end
|
||||
}
|
||||
@@ -127,7 +127,7 @@ final class MemoryUtil {
|
||||
public static function getMemType():String {
|
||||
#if windows
|
||||
var memoryMap:Map<Int, String> = [
|
||||
0 => "Unknown",
|
||||
0 => null,
|
||||
1 => "Other",
|
||||
2 => "DRAM",
|
||||
3 => "Synchronous DRAM",
|
||||
@@ -152,13 +152,23 @@ final class MemoryUtil {
|
||||
22 => "DDR2 FB-DIMM",
|
||||
24 => "DDR3",
|
||||
25 => "FBD2",
|
||||
26 => "DDR4"
|
||||
26 => "DDR4",
|
||||
27 => "LPDDR",
|
||||
28 => "LPDDR2",
|
||||
29 => "LPDDR3",
|
||||
30 => "LPDDR4",
|
||||
31 => "Logical Non-volatile device",
|
||||
32 => "HBM",
|
||||
33 => "HBM2",
|
||||
34 => "DDR5",
|
||||
35 => "LPDDR5",
|
||||
36 => "HBM3",
|
||||
];
|
||||
var memoryOutput:Int = -1;
|
||||
|
||||
var process = new HiddenProcess("wmic", ["memorychip", "get", "SMBIOSMemoryType"]);
|
||||
var process = new HiddenProcess("powershell", ["-Command", "Get-CimInstance Win32_PhysicalMemory | Select-Object -ExpandProperty SMBIOSMemoryType" ]);
|
||||
if (process.exitCode() == 0) memoryOutput = Std.int(Std.parseFloat(process.stdout.readAll().toString().trim().split("\n")[1]));
|
||||
if (memoryOutput != -1) return memoryMap[memoryOutput];
|
||||
if (memoryOutput != -1) return memoryMap[memoryOutput] == null ? 'Unknown ($memoryOutput)' : memoryMap[memoryOutput];
|
||||
#elseif mac
|
||||
var process = new HiddenProcess("system_profiler", ["SPMemoryDataType"]);
|
||||
var reg = ~/Type: (.+)/;
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
package funkin.backend.utils;
|
||||
|
||||
enum abstract RegistryHive(Int) {
|
||||
var HKEY_CLASSES_ROOT = 0x80000000;
|
||||
var HKEY_CURRENT_USER = 0x80000001;
|
||||
var HKEY_LOCAL_MACHINE = 0x80000002;
|
||||
var HKEY_USERS = 0x80000003;
|
||||
var HKEY_CURRENT_CONFIG = 0x80000005;
|
||||
}
|
||||
#if windows
|
||||
@:cppFileCode('
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
')
|
||||
#end
|
||||
class RegistryUtil {
|
||||
#if windows
|
||||
@:functionCode('
|
||||
HKEY hKey;
|
||||
LONG result;
|
||||
DWORD dataSize = 0;
|
||||
DWORD dataType = 0;
|
||||
|
||||
std::wstring subkey = std::wstring(key.wchar_str());
|
||||
std::wstring valname = std::wstring(string.wchar_str());
|
||||
|
||||
result = RegOpenKeyExW((HKEY)reinterpret_cast<HKEY>(static_cast<uintptr_t>(hive)), subkey.c_str(), 0, KEY_READ, &hKey);
|
||||
if (result != ERROR_SUCCESS) return null();
|
||||
|
||||
result = RegQueryValueExW(hKey, valname.c_str(), NULL, &dataType, NULL, &dataSize);
|
||||
if (result != ERROR_SUCCESS || dataSize == 0) {
|
||||
RegCloseKey(hKey);
|
||||
return null();
|
||||
}
|
||||
|
||||
std::vector<wchar_t> buffer(dataSize / sizeof(wchar_t));
|
||||
result = RegQueryValueExW(hKey, valname.c_str(), NULL, NULL, (LPBYTE)buffer.data(), &dataSize);
|
||||
RegCloseKey(hKey);
|
||||
|
||||
if (result == ERROR_SUCCESS) {
|
||||
return ::String(buffer.data());
|
||||
}
|
||||
return null();
|
||||
')
|
||||
#end
|
||||
public static function get(hive:RegistryHive, key:String, string:String):Null<String>
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
#if windows
|
||||
@:functionCode('
|
||||
HKEY hKey;
|
||||
LONG result;
|
||||
|
||||
std::wstring subkey = std::wstring(key.wchar_str());
|
||||
std::wstring valname = std::wstring(string.wchar_str());
|
||||
std::wstring data = std::wstring(value.wchar_str());
|
||||
|
||||
result = RegCreateKeyExW((HKEY)reinterpret_cast<HKEY>(static_cast<uintptr_t>(hive)), subkey.c_str(), 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL);
|
||||
if (result != ERROR_SUCCESS) return false;
|
||||
|
||||
result = RegSetValueExW(hKey, valname.c_str(), 0, REG_SZ, (const BYTE*)data.c_str(), (DWORD)((data.length() + 1) * sizeof(wchar_t)));
|
||||
RegCloseKey(hKey);
|
||||
|
||||
return result == ERROR_SUCCESS;
|
||||
')
|
||||
#end
|
||||
public static function set(hive:RegistryHive, key:String, string:String, value:String):Bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#if windows
|
||||
@:functionCode('
|
||||
HKEY hKey;
|
||||
LONG result;
|
||||
|
||||
std::wstring subkey = std::wstring(key.wchar_str());
|
||||
std::wstring valname = std::wstring(string.wchar_str());
|
||||
|
||||
result = RegOpenKeyExW((HKEY)reinterpret_cast<HKEY>(static_cast<uintptr_t>(hive)), subkey.c_str(), 0, KEY_READ, &hKey);
|
||||
if (result != ERROR_SUCCESS) return false;
|
||||
|
||||
DWORD dataType = 0;
|
||||
result = RegQueryValueExW(hKey, valname.c_str(), NULL, &dataType, NULL, NULL);
|
||||
|
||||
RegCloseKey(hKey);
|
||||
|
||||
return result == ERROR_SUCCESS;
|
||||
')
|
||||
#end
|
||||
public static function exists(hive:RegistryHive, key:String, string:String):Bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#if windows
|
||||
@:functionCode('
|
||||
HKEY hKey;
|
||||
LONG result;
|
||||
|
||||
std::wstring subkey = std::wstring(key.wchar_str());
|
||||
std::wstring valname = std::wstring(string.wchar_str());
|
||||
|
||||
result = RegOpenKeyExW((HKEY)reinterpret_cast<HKEY>(static_cast<uintptr_t>(hive)), subkey.c_str(), 0, KEY_SET_VALUE, &hKey);
|
||||
if (result != ERROR_SUCCESS) return false;
|
||||
|
||||
result = RegDeleteValueW(hKey, valname.c_str());
|
||||
RegCloseKey(hKey);
|
||||
|
||||
return result == ERROR_SUCCESS;
|
||||
')
|
||||
#end
|
||||
public static function delete(hive:RegistryHive, key:String, string:String):Bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -2,143 +2,157 @@ package funkin.backend.utils;
|
||||
|
||||
#if sys
|
||||
import haxe.io.Input;
|
||||
import haxe.zip.Entry;
|
||||
import haxe.zip.InflateImpl;
|
||||
import haxe.zip.Reader;
|
||||
import sys.io.File;
|
||||
import sys.io.FileInput;
|
||||
|
||||
import haxe.io.Bytes;
|
||||
|
||||
/**
|
||||
* Class that extends Reader allowing you to load ZIP entries without blowing your RAM up!!
|
||||
* ~~Half of the code is taken from haxe libraries btw~~ Reworked by ItsLJcool to actually work for zip files.
|
||||
* Half of the code is taken from haxe libraries btw
|
||||
*/
|
||||
class SysZip {
|
||||
class SysZip extends Reader {
|
||||
var input:Input;
|
||||
var fileInput:FileInput;
|
||||
var filePath:String;
|
||||
|
||||
public var entries:List<SysZipEntry> = new List();
|
||||
public var entries:List<SysZipEntry>;
|
||||
|
||||
/**
|
||||
* Opens a zip from a specified path.
|
||||
* @param path Path to the zip file. (With the extension)
|
||||
* @param path Path to the zip file.
|
||||
*/
|
||||
public static function openFromFile(path:String) { return new SysZip(path); } // keeping for compatibility.
|
||||
public static function openFromFile(path:String) {
|
||||
|
||||
return new SysZip(File.read(path, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new SysZip from a specified path.
|
||||
* @param path Path to the zip file. (With the extension)
|
||||
* Creates a new SysZip from a specified file input.
|
||||
* @param input File input.
|
||||
*/
|
||||
public function new(path:String) {
|
||||
this.filePath = path;
|
||||
fileInput = File.read(path, true);
|
||||
public function new(input:FileInput) {
|
||||
super(input);
|
||||
fileInput = input;
|
||||
}
|
||||
|
||||
updateEntries(); // automatic but if you feel like you don't want it to be automatic, you can remove this.
|
||||
/**
|
||||
* Reads all the data present in a specified entry.
|
||||
* NOTE: If the entry is compressed, the data won't be decompressed. For decompression, use `unzipEntry`.
|
||||
* @param e Entry
|
||||
*/
|
||||
public function readEntryData(e:SysZipEntry) {
|
||||
var bytes:haxe.io.Bytes = null;
|
||||
var buf = null;
|
||||
var tmp = null;
|
||||
|
||||
fileInput.seek(e.seekPos, SeekBegin);
|
||||
if (e.crc32 == null) {
|
||||
if (e.compressed) {
|
||||
#if neko
|
||||
// enter progressive mode : we use a different input which has
|
||||
// a temporary buffer, this is necessary since we have to uncompress
|
||||
// progressively, and after that we might have pending read data
|
||||
// that needs to be processed
|
||||
var bufSize = 65536;
|
||||
if (buf == null) {
|
||||
buf = new haxe.io.BufferInput(i, haxe.io.Bytes.alloc(bufSize));
|
||||
tmp = haxe.io.Bytes.alloc(bufSize);
|
||||
i = buf;
|
||||
}
|
||||
var out = new haxe.io.BytesBuffer();
|
||||
var z = new neko.zip.Uncompress(-15);
|
||||
z.setFlushMode(neko.zip.Flush.SYNC);
|
||||
while (true) {
|
||||
if (buf.available == 0)
|
||||
buf.refill();
|
||||
var p = bufSize - buf.available;
|
||||
if (p != buf.pos) {
|
||||
// because of lack of "srcLen" in zip api, we need to always be stuck to the buffer end
|
||||
buf.buf.blit(p, buf.buf, buf.pos, buf.available);
|
||||
buf.pos = p;
|
||||
}
|
||||
var r = z.execute(buf.buf, buf.pos, tmp, 0);
|
||||
out.addBytes(tmp, 0, r.write);
|
||||
buf.pos += r.read;
|
||||
buf.available -= r.read;
|
||||
if (r.done)
|
||||
break;
|
||||
}
|
||||
bytes = out.getBytes();
|
||||
#else
|
||||
var bufSize = 65536;
|
||||
if (tmp == null)
|
||||
tmp = haxe.io.Bytes.alloc(bufSize);
|
||||
var out = new haxe.io.BytesBuffer();
|
||||
var z = new InflateImpl(i, false, false);
|
||||
while (true) {
|
||||
var n = z.readBytes(tmp, 0, bufSize);
|
||||
out.addBytes(tmp, 0, n);
|
||||
if (n < bufSize)
|
||||
break;
|
||||
}
|
||||
bytes = out.getBytes();
|
||||
#end
|
||||
} else
|
||||
bytes = i.read(e.dataSize);
|
||||
e.crc32 = i.readInt32();
|
||||
if (e.crc32 == 0x08074b50)
|
||||
e.crc32 = i.readInt32();
|
||||
e.dataSize = i.readInt32();
|
||||
e.fileSize = i.readInt32();
|
||||
// set data to uncompressed
|
||||
e.dataSize = e.fileSize;
|
||||
e.compressed = false;
|
||||
} else
|
||||
bytes = i.read(e.dataSize);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unzips and returns all of the data present in an entry.
|
||||
* @param f Entry to read from.
|
||||
*/
|
||||
public function unzipEntry(f:SysZipEntry):Bytes {
|
||||
if (f.fileSize <= 0) return Bytes.alloc(0);
|
||||
|
||||
fileInput.seek(f.seekPos, SeekBegin);
|
||||
var data = fileInput.read(f.compressedSize);
|
||||
|
||||
if (!f.compressed) return data;
|
||||
public function unzipEntry(f:SysZipEntry) {
|
||||
var data = readEntryData(f);
|
||||
|
||||
if (!f.compressed)
|
||||
return data;
|
||||
var c = new haxe.zip.Uncompress(-15);
|
||||
var s = Bytes.alloc(f.fileSize);
|
||||
var s = haxe.io.Bytes.alloc(f.fileSize);
|
||||
var r = c.execute(data, 0, s, 0);
|
||||
c.close();
|
||||
|
||||
if (!r.done || r.read != data.length || r.write != f.fileSize) throw 'Invalid compressed data for ${f.fileName} | ${f.compressedSize} -> ${f.fileSize}';
|
||||
return s;
|
||||
if (!r.done || r.read != data.length || r.write != f.fileSize)
|
||||
throw "Invalid compressed data for " + f.fileName;
|
||||
data = s;
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the `entries` list with the current contents of the zip file.
|
||||
* This is done when the zip is read from SysZip the first time, but if you REALLY need to re-update the entries, you can call this again.
|
||||
*
|
||||
* Note: Calling this function will hold up the game as it has to read the ENTIRE zip, so if it's large like 1GiB or more, it might take a second or more.
|
||||
*/
|
||||
public function updateEntries() {
|
||||
if (entries.length > 0) {
|
||||
entries.clear();
|
||||
entries = new List();
|
||||
}
|
||||
|
||||
// --- locate End of Central Directory (EOCD) ---
|
||||
var fileSize:Int = sys.FileSystem.stat(this.filePath).size; // probably need a better way to check the size of the file.
|
||||
var scanSize:Int = (65535 < fileSize) ? 65535 : fileSize;
|
||||
|
||||
// It seems this usually ends up being 0 anyways, but for cases where it might not be?? I'd just make sure. but Someone do some digging I don't know if this required.
|
||||
fileInput.seek(fileSize - scanSize, SeekBegin);
|
||||
|
||||
var buf = fileInput.read(scanSize);
|
||||
var b = new haxe.io.BytesInput(buf);
|
||||
// I LOVE USING MAGIC NUMBERS AND FORGETTING WHAT THEY DO 🔥🔥🔥🔥🔥🔥
|
||||
b.position = (buf.length - 22) + 16; // offset to start of central directory
|
||||
|
||||
// --- read central directory ---
|
||||
fileInput.seek(b.readInt32(), SeekBegin);
|
||||
public override function read():List<Entry> {
|
||||
if (entries != null)
|
||||
return entries;
|
||||
entries = new List();
|
||||
while (true) {
|
||||
if (fileInput.readInt32() != 0x02014b50) break; // central dir file header signature
|
||||
var e = readEntryHeader();
|
||||
if (e == null)
|
||||
break;
|
||||
|
||||
fileInput.seek(6, SeekCur); // version/flags
|
||||
var compression_method = fileInput.readUInt16();
|
||||
fileInput.seek(8, SeekCur); // time/date + CRC32 (4, 4)
|
||||
var compressed_size = fileInput.readInt32();
|
||||
var uncompressed_size = fileInput.readInt32();
|
||||
var nameLen = fileInput.readUInt16();
|
||||
var extraLen = fileInput.readUInt16();
|
||||
var commentLen = fileInput.readUInt16();
|
||||
fileInput.seek(8, SeekCur); // skip disk number/start attrs
|
||||
var localHeaderOffset = fileInput.readInt32();
|
||||
|
||||
var name = fileInput.read(nameLen).toString();
|
||||
|
||||
// skip central directory extra/comment
|
||||
fileInput.seek(extraLen + commentLen, SeekCur);
|
||||
|
||||
// --- compute correct seekPos using local header ---
|
||||
var curPos = fileInput.tell();
|
||||
// I also forgor what the `+ 26` is for, so uh my b chat
|
||||
fileInput.seek(localHeaderOffset + 26, SeekBegin);
|
||||
var localNameLen = fileInput.readUInt16();
|
||||
var localExtraLen = fileInput.readUInt16();
|
||||
fileInput.seek(curPos, SeekBegin);
|
||||
|
||||
// I completely forgot that we don't really need to log the FOLDER of the content because we only care about where the contents are.
|
||||
// the folders are labled as 0 bytes anyways so this will save on storing non-required data.
|
||||
if (name.endsWith("/")) continue;
|
||||
|
||||
var zipEntry:SysZipEntry = {
|
||||
fileName: name,
|
||||
fileSize: uncompressed_size,
|
||||
// I don't remember what the `+ 30` is for, but probably to offset something
|
||||
seekPos: (localHeaderOffset + 30 + localNameLen + localExtraLen),
|
||||
compressedSize: compressed_size,
|
||||
compressed: (compression_method == 8),
|
||||
};
|
||||
var zipEntry:SysZipEntry = cast e;
|
||||
zipEntry.seekPos = fileInput.tell();
|
||||
entries.add(zipEntry);
|
||||
fileInput.seek(e.dataSize, SeekCur);
|
||||
}
|
||||
return entries;
|
||||
}
|
||||
|
||||
/**
|
||||
* calling `dispose` doesn't actually kill the class, you can still access the entries.
|
||||
* disposing of SysZip will free the compressed file from being used by the engine.
|
||||
*/
|
||||
public function dispose() {
|
||||
if (fileInput != null) fileInput.close();
|
||||
if (input != null)
|
||||
input.close();
|
||||
}
|
||||
}
|
||||
|
||||
typedef SysZipEntry = {
|
||||
var fileName:String;
|
||||
var fileSize:Int;
|
||||
> Entry,
|
||||
var seekPos:Int;
|
||||
var compressedSize:Int;
|
||||
var compressed:Bool;
|
||||
}
|
||||
#end
|
||||
@@ -20,8 +20,6 @@ class EditorTreeMenu extends funkin.options.TreeMenu {
|
||||
bg.antialiasing = true;
|
||||
setBackgroundRotation(-5);
|
||||
super.createPost();
|
||||
|
||||
if (Paths.assetsTree.hasCompressedLibrary) warnCompressLibrary();
|
||||
}
|
||||
|
||||
public inline function setBackgroundRotation(rotation:Float) {
|
||||
@@ -60,21 +58,6 @@ class EditorTreeMenu extends funkin.options.TreeMenu {
|
||||
bg.colorTransform.greenMultiplier = FlxMath.lerp(1, color.greenFloat, 0.25);
|
||||
bg.colorTransform.blueMultiplier = FlxMath.lerp(1, color.blueFloat, 0.25);
|
||||
}
|
||||
|
||||
private function warnCompressLibrary() {
|
||||
var warningMessage = "It seems you have libraries loaded that are compressed, and can not have files written to them.\n
|
||||
This is just a friendly reminder that if you're loading a Mod and wish to edit files, you need to uncompress it to be able to use any editors!\n\nCompressed Libraries: ";
|
||||
var compressedList = Paths.assetsTree.libraries.filter(l -> funkin.backend.assets.AssetsLibraryList.getCleanLibrary(l).isCompressed);
|
||||
var modNameList = [for (l in compressedList) {
|
||||
l = funkin.backend.assets.AssetsLibraryList.getCleanLibrary(l);
|
||||
if (l is funkin.backend.assets.IModsAssetLibrary) cast(l, funkin.backend.assets.IModsAssetLibrary).modName;
|
||||
}];
|
||||
warningMessage += modNameList.join(", ");
|
||||
var zipLibraryWarning = new funkin.editors.ui.UIWarningSubstate("Compressed Library Detected!", warningMessage, [{label: "Ok", color: 0x969533, onClick: (state) -> {} }], false);
|
||||
|
||||
openSubState(zipLibraryWarning);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class EditorTreeMenuScreen extends funkin.options.TreeMenuScreen {
|
||||
|
||||
@@ -403,12 +403,12 @@ class CharacterAnimButton extends UIButton {
|
||||
|
||||
public function toggleGhost() {
|
||||
if (valid && parent.ghosts.indexOf(anim) == -1) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_CHARACTER_GHOSTENABLE_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARACTER_GHOSTENABLE_SOUND));
|
||||
parent.ghosts.push(anim);
|
||||
ghostIcon.animation.play("alive", true);
|
||||
ghostIcon.color = 0xFFFFFFFF;
|
||||
} else {
|
||||
UIState.playEditorSound(Flags.DEFAULT_CHARACTER_GHOSTDISABLE_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARACTER_GHOSTDISABLE_SOUND));
|
||||
parent.ghosts.remove(anim);
|
||||
ghostIcon.animation.play("dead", true);
|
||||
ghostIcon.color = 0xFFADADAD;
|
||||
|
||||
@@ -119,7 +119,7 @@ class CharacterAnimsWindow extends UIButtonList<CharacterAnimButton> {
|
||||
}
|
||||
|
||||
public function deleteAnimation(button:CharacterAnimButton, addToUndo:Bool = true) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_DELETE_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_DELETE_SOUND));
|
||||
if (buttons.members.length <= 1) return;
|
||||
if (character.getAnimName() == button.anim)
|
||||
@:privateAccess CharacterEditor.instance._animation_down(null);
|
||||
|
||||
@@ -453,7 +453,7 @@ class CharacterEditor extends UIState {
|
||||
|
||||
function _file_save(_) {
|
||||
#if sys
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);
|
||||
FlxG.sound.play(Paths.sound('editors/save'));
|
||||
CoolUtil.safeSaveFile(
|
||||
'${Paths.getAssetsRoot()}/data/characters/${character.curCharacter}.xml',
|
||||
buildCharacter()
|
||||
@@ -465,7 +465,7 @@ class CharacterEditor extends UIState {
|
||||
}
|
||||
|
||||
function _file_saveas(_) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);
|
||||
FlxG.sound.play(Paths.sound('editors/save'));
|
||||
openSubState(new SaveSubstate(buildCharacter(), {
|
||||
defaultSaveFile: '${character.curCharacter}.xml'
|
||||
}));
|
||||
@@ -499,7 +499,7 @@ class CharacterEditor extends UIState {
|
||||
}
|
||||
|
||||
function _undo(undo:CharacterEditorChange) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_UNDO_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_UNDO_SOUND));
|
||||
switch (undo) {
|
||||
case null: // do nothing
|
||||
case CCharEditPosition(oldPos, newPos):
|
||||
@@ -573,7 +573,7 @@ class CharacterEditor extends UIState {
|
||||
}
|
||||
|
||||
function _redo(redo:CharacterEditorChange) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_REDO_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_REDO_SOUND));
|
||||
switch (redo) {
|
||||
case null: // do nothing
|
||||
case CCharEditPosition(oldPos, newPos):
|
||||
|
||||
@@ -77,10 +77,10 @@ class Charter extends UIState {
|
||||
public var strumlineLockButton:CharterStrumlineButton;
|
||||
|
||||
public var hitsound:FlxSound;
|
||||
public var hitsoundGlobalVolume:Float = 1.0;
|
||||
public var metronome:FlxSound;
|
||||
|
||||
public var vocals:FlxSound;
|
||||
public var voicesMuted:Bool = false;
|
||||
|
||||
public var quant:Int = 16;
|
||||
public var quants:Array<Int> = [4, 8, 12, 16, 20, 24, 32, 48, 64, 192]; // different quants
|
||||
@@ -96,7 +96,6 @@ class Charter extends UIState {
|
||||
public var rightEventRowText:UIText;
|
||||
public var leftEventsGroup:CharterEventGroup = new CharterEventGroup();
|
||||
public var rightEventsGroup:CharterEventGroup = new CharterEventGroup();
|
||||
public var cameraMovementChanges:Array<CameraChange> = [];
|
||||
|
||||
public var charterCamera:FlxCamera;
|
||||
public var uiCamera:FlxCamera;
|
||||
@@ -232,11 +231,6 @@ class Charter extends UIState {
|
||||
label: translate("edit.delete"),
|
||||
keybind: [DELETE],
|
||||
onSelect: _edit_delete
|
||||
},
|
||||
{
|
||||
label: translate("edit.deletestacked"),
|
||||
keybind: [SHIFT,DELETE],
|
||||
onSelect: _edit_deletestacked
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -314,11 +308,6 @@ class Charter extends UIState {
|
||||
onSelect: _view_showeventBeatSeparator,
|
||||
icon: Options.charterShowBeats ? 1 : 0
|
||||
},
|
||||
{
|
||||
label: translate("view.showCameraHighlights"),
|
||||
onSelect: _view_showeventCameraHighlights,
|
||||
icon: Options.charterShowCameraHighlights ? 1 : 0
|
||||
},
|
||||
null,
|
||||
{
|
||||
label: translate("view.rainbowWaveforms"),
|
||||
@@ -464,7 +453,7 @@ class Charter extends UIState {
|
||||
rightEventsGroup.eventsRowText = rightEventRowText;
|
||||
|
||||
// thank you neo for pointing out im stupid -lunar
|
||||
// this is future lunar i completely forgot what neo pointed out but hes awesome go follow him on twitter
|
||||
// this is future lunar i completely forgot what neo pointed out but hes awesome go follow him on twitter
|
||||
|
||||
add(gridBackdropDummy = new CameraHoverDummy(gridBackdrops, FlxPoint.weak(1, 0)));
|
||||
selectionBox = new UISliceSprite(0, 0, 2, 2, 'editors/ui/selection');
|
||||
@@ -526,7 +515,7 @@ class Charter extends UIState {
|
||||
|
||||
strumlineLockButton = new CharterStrumlineButton("editors/charter/lock-strumline", translate("lock-unlock"));
|
||||
strumlineLockButton.onClick = function () {
|
||||
UIState.playEditorSound(!strumLines.draggable ? Flags.DEFAULT_CHARTER_STRUMUNLOCK_SOUND : Flags.DEFAULT_CHARTER_STRUMLOCK_SOUND);
|
||||
FlxG.sound.play(Paths.sound(!strumLines.draggable ? Flags.DEFAULT_CHARTER_STRUMUNLOCK_SOUND : Flags.DEFAULT_CHARTER_STRUMLOCK_SOUND));
|
||||
if (strumLines != null) {
|
||||
strumLines.draggable = !strumLines.draggable;
|
||||
strumlineLockButton.textTweenColor.color = strumLines.draggable ? 0xFF5C95CA : 0xFFE16565;
|
||||
@@ -696,7 +685,6 @@ class Charter extends UIState {
|
||||
CharterGridSeperatorBase.lastConductorSprY = Math.NEGATIVE_INFINITY;
|
||||
|
||||
updateWaveforms();
|
||||
updateCameraChanges();
|
||||
}
|
||||
|
||||
public function getWavesToGenerate():Array<{name:String, sound:FlxSound}> {
|
||||
@@ -752,38 +740,6 @@ class Charter extends UIState {
|
||||
}
|
||||
}
|
||||
|
||||
public function updateCameraChanges() {
|
||||
if (!Options.charterShowCameraHighlights) return;
|
||||
|
||||
cameraMovementChanges = [];
|
||||
for (grp in [leftEventsGroup, rightEventsGroup]) {
|
||||
grp.filterEvents();
|
||||
grp.sortEvents();
|
||||
for(e in grp.members) {
|
||||
for(event in e.events) {
|
||||
if (event.name == "Camera Movement") {
|
||||
cameraMovementChanges.push({
|
||||
strumLineID: event.params[0],
|
||||
step: e.step,
|
||||
endStep: __endStep
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//need to sort again for both local and global events to be used
|
||||
cameraMovementChanges.sort(function(e1, e2) {
|
||||
return FlxSort.byValues(FlxSort.ASCENDING, e1.step, e2.step);
|
||||
});
|
||||
//update previous change
|
||||
if (cameraMovementChanges.length > 0) {
|
||||
for (i in 1...cameraMovementChanges.length) {
|
||||
cameraMovementChanges[i-1].endStep = cameraMovementChanges[i].step;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override function beatHit(curBeat:Int) {
|
||||
super.beatHit(curBeat);
|
||||
if (FlxG.sound.music.playing) {
|
||||
@@ -801,7 +757,6 @@ class Charter extends UIState {
|
||||
public var mousePos:FlxPoint = new FlxPoint();
|
||||
public var selectionDragging:Bool = false;
|
||||
public var isSelecting:Bool = false;
|
||||
public var isAltCopyDrag:Bool = false;
|
||||
|
||||
public function updateSelectionLogic() {
|
||||
function select(s:ICharterSelectable) {
|
||||
@@ -847,7 +802,7 @@ class Charter extends UIState {
|
||||
else
|
||||
Chart.save(PlayState.SONG, __diff.toLowerCase(), __variant, {saveMetaInChart: true, saveLocalEvents: true, seperateGlobalEvents: true, prettyPrint: Options.editorCharterPrettyPrint});
|
||||
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);
|
||||
FlxG.sound.play(Paths.sound('editors/save'));
|
||||
undos.save();
|
||||
}
|
||||
autoSaveNotif.cancelled = false;
|
||||
@@ -966,24 +921,17 @@ class Charter extends UIState {
|
||||
if (!(verticalChange == 0 && horizontalChange == 0)) {
|
||||
notesGroup.sortNotes();
|
||||
|
||||
var changes:Array<CharterChange> = [];
|
||||
if (isAltCopyDrag) {
|
||||
changes.push(CCreateSelection(selection.copy()));
|
||||
isAltCopyDrag = false;
|
||||
}
|
||||
changes.push(CSelectionDrag(undoDrags));
|
||||
changes.push(updateEventsGroups(selection));
|
||||
undos.addToUndo(CChangeBundle(changes));
|
||||
} else if (isAltCopyDrag) {
|
||||
undos.addToUndo(CCreateSelection(selection.copy()));
|
||||
isAltCopyDrag = false;
|
||||
undos.addToUndo(CChangeBundle([
|
||||
CSelectionDrag(undoDrags),
|
||||
updateEventsGroups(selection)
|
||||
]));
|
||||
}
|
||||
|
||||
gridActionType = NONE;
|
||||
currentCursor = ARROW;
|
||||
}
|
||||
case NONE:
|
||||
if (FlxG.mouse.justPressed)
|
||||
if (FlxG.mouse.justPressed)
|
||||
FlxG.mouse.getWorldPosition(charterCamera, dragStartPos);
|
||||
else if (FlxG.mouse.justPressedRight) {
|
||||
closeCurrentContextMenu();
|
||||
@@ -1014,7 +962,7 @@ class Charter extends UIState {
|
||||
notesGroup.add(note);
|
||||
selection = [note];
|
||||
undos.addToUndo(CCreateSelection([note]));
|
||||
UIState.playEditorSound(Flags.DEFAULT_CHARTER_NOTEPLACE_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARTER_NOTEPLACE_SOUND));
|
||||
}
|
||||
isSelecting = false;
|
||||
}
|
||||
@@ -1031,32 +979,7 @@ class Charter extends UIState {
|
||||
}
|
||||
|
||||
if ((Math.abs(mousePos.x - dragStartPos.x) > (noteSusDrag ? 1 : 5) || Math.abs(mousePos.y - dragStartPos.y) > (noteSusDrag ? 1 : 5))) {
|
||||
if (noteHovered) {
|
||||
if (FlxG.keys.pressed.ALT && selection.length > 0) {
|
||||
var newSelection:Array<ICharterSelectable> = [];
|
||||
for (s in selection) {
|
||||
if (s is CharterNote) {
|
||||
var n:CharterNote = cast s;
|
||||
var newNote = new CharterNote();
|
||||
newNote.updatePos(n.step, n.id, n.susLength, n.type, n.strumLine);
|
||||
notesGroup.add(newNote);
|
||||
newSelection.push(newNote);
|
||||
} else if (s is CharterEvent) {
|
||||
var e:CharterEvent = cast s;
|
||||
var newEvent = new CharterEvent(e.step, [for (event in e.events) Reflect.copy(event)], e.global);
|
||||
newEvent.refreshEventIcons();
|
||||
(e.global ? rightEventsGroup : leftEventsGroup).add(newEvent);
|
||||
newSelection.push(newEvent);
|
||||
}
|
||||
}
|
||||
for (s in selection) s.selected = false;
|
||||
selection = newSelection;
|
||||
for (s in selection) s.selected = true;
|
||||
isAltCopyDrag = true;
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_COPY_SOUND);
|
||||
}
|
||||
gridActionType = NOTE_DRAG;
|
||||
}
|
||||
if (noteHovered) gridActionType = noteHovered ? NOTE_DRAG : INVALID_DRAG;
|
||||
if (noteSusDrag) gridActionType = SUSTAIN_DRAG;
|
||||
}
|
||||
}
|
||||
@@ -1168,7 +1091,7 @@ class Charter extends UIState {
|
||||
if (selected == null) return selected;
|
||||
|
||||
if (selected is CharterNote) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_CHARTER_NOTEDELETE_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARTER_NOTEDELETE_SOUND));
|
||||
var note:CharterNote = cast selected;
|
||||
note.strumLineID = strumLines.members.indexOf(note.strumLine);
|
||||
note.strumLine = null; // For static undos :D
|
||||
@@ -1648,20 +1571,20 @@ class Charter extends UIState {
|
||||
else {undos = null; FlxG.switchState(new CharterSelection()); Charter.instance.__clearStatics();}
|
||||
}
|
||||
|
||||
function _file_save_all(_) {saveEverything(); UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);}
|
||||
function _file_save(_) {saveChart(); UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);}
|
||||
function _file_saveas(_) {saveChartAs(); UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);}
|
||||
function _file_events_save(_) {saveEvents(); UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);}
|
||||
function _file_events_saveas(_) {saveEventsAs(); UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);}
|
||||
function _file_save_no_events(_) {saveChart(true, false); UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);}
|
||||
function _file_saveas_no_events(_) {saveChartAs(true, false); UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);}
|
||||
function _file_meta_save(_) {saveMeta(); UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);}
|
||||
function _file_meta_saveas(_) {saveMetaAs(); UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);}
|
||||
function _file_saveas_fnflegacy(_) {saveLegacyChartAs(); UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);}
|
||||
function _file_saveas_psych(_) {savePsychChartAs(); UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);}
|
||||
function _file_save_all(_) {saveEverything(); FlxG.sound.play(Paths.sound('editors/save'));}
|
||||
function _file_save(_) {saveChart(); FlxG.sound.play(Paths.sound('editors/save'));}
|
||||
function _file_saveas(_) {saveChartAs(); FlxG.sound.play(Paths.sound('editors/save'));}
|
||||
function _file_events_save(_) {saveEvents(); FlxG.sound.play(Paths.sound('editors/save'));}
|
||||
function _file_events_saveas(_) {saveEventsAs(); FlxG.sound.play(Paths.sound('editors/save'));}
|
||||
function _file_save_no_events(_) {saveChart(true, false); FlxG.sound.play(Paths.sound('editors/save'));}
|
||||
function _file_saveas_no_events(_) {saveChartAs(true, false); FlxG.sound.play(Paths.sound('editors/save'));}
|
||||
function _file_meta_save(_) {saveMeta(); FlxG.sound.play(Paths.sound('editors/save'));}
|
||||
function _file_meta_saveas(_) {saveMetaAs(); FlxG.sound.play(Paths.sound('editors/save'));}
|
||||
function _file_saveas_fnflegacy(_) {saveLegacyChartAs(); FlxG.sound.play(Paths.sound('editors/save'));}
|
||||
function _file_saveas_psych(_) {savePsychChartAs(); FlxG.sound.play(Paths.sound('editors/save'));}
|
||||
|
||||
function _edit_copy(_, playSFX=true) {
|
||||
if (playSFX) UIState.playEditorSound(Flags.DEFAULT_EDITOR_COPY_SOUND);
|
||||
if (playSFX) FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_COPY_SOUND));
|
||||
if(selection.length == 0) return;
|
||||
|
||||
var minStep:Float = selection[0].step;
|
||||
@@ -1680,7 +1603,7 @@ class Charter extends UIState {
|
||||
];
|
||||
}
|
||||
function _edit_paste(_) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_PASTE_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_PASTE_SOUND));
|
||||
if (clipboard.length <= 0) return;
|
||||
|
||||
var minStep = curStep;
|
||||
@@ -1708,7 +1631,7 @@ class Charter extends UIState {
|
||||
}
|
||||
|
||||
function _edit_cut(_) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_CUT_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_CUT_SOUND));
|
||||
if (selection == null || selection.length == 0) return;
|
||||
|
||||
_edit_copy(_, false);
|
||||
@@ -1716,7 +1639,7 @@ class Charter extends UIState {
|
||||
}
|
||||
|
||||
function _edit_delete(_) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_DELETE_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_DELETE_SOUND));
|
||||
if (selection == null || selection.length == 0) return;
|
||||
selection.loop((n:CharterNote) -> {
|
||||
noteDeleteAnims.deleteNotes.push({note: n, time: noteDeleteAnims.deleteTime});
|
||||
@@ -1724,27 +1647,8 @@ class Charter extends UIState {
|
||||
selection = deleteSelection(selection, true);
|
||||
}
|
||||
|
||||
function _edit_deletestacked(_) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_DELETE_SOUND);
|
||||
if (notesGroup.members.length == 0) return;
|
||||
var oldNote:CharterNote = null;
|
||||
var selectionArray:Array<Dynamic> = ((selection.length != 0) ? selection : notesGroup.members.copy());
|
||||
var toDelete:Selection = new Selection();
|
||||
for (note in selectionArray) {
|
||||
if (oldNote != null && oldNote.step == note.step && oldNote.strumLineID == note.strumLineID && oldNote.id == note.id) {
|
||||
noteDeleteAnims.deleteNotes.push({note: oldNote, time: noteDeleteAnims.deleteTime});
|
||||
toDelete.push(oldNote);
|
||||
}
|
||||
oldNote = note;
|
||||
}
|
||||
if (toDelete.length != 0) {
|
||||
deleteSelection(toDelete);
|
||||
if (selection.length != 0) for (i in toDelete) selection.remove(i); //crash prevention
|
||||
}
|
||||
}
|
||||
|
||||
function _undo(undo:CharterChange) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_UNDO_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_UNDO_SOUND));
|
||||
switch(undo) {
|
||||
case null: // do nothing
|
||||
case CDeleteStrumLine(strumLineID, strumLine):
|
||||
@@ -1793,11 +1697,7 @@ class Charter extends UIState {
|
||||
case CEditSpecNotesType(notes, oldTypes, newTypes):
|
||||
for(i=>note in notes) note.updatePos(note.step, note.id, note.susLength, oldTypes[i]);
|
||||
case CChangeBundle(changes):
|
||||
var i = changes.length - 1;
|
||||
while (i >= 0) {
|
||||
_undo(changes[i]);
|
||||
i--;
|
||||
}
|
||||
for (change in changes) _undo(change);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1809,7 +1709,7 @@ class Charter extends UIState {
|
||||
}
|
||||
|
||||
function _redo(redo:CharterChange) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_REDO_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_REDO_SOUND));
|
||||
switch(redo) {
|
||||
case null: // do nothing
|
||||
case CDeleteStrumLine(strumLineID, strumLine):
|
||||
@@ -1908,24 +1808,14 @@ class Charter extends UIState {
|
||||
function _playback_metronome(t) {
|
||||
t.icon = (Options.charterMetronomeEnabled = !Options.charterMetronomeEnabled) ? 1 : 0;
|
||||
}
|
||||
|
||||
public function _slider_mutetoggle(t:UIContextMenuOption) {
|
||||
if (t.slider == null) return;
|
||||
t.button.slider.value = t.button.slider.value > 0 ? 0 : 1;
|
||||
function _song_muteinst(t) {
|
||||
FlxG.sound.music.volume = FlxG.sound.music.volume > 0 ? 0 : 1;
|
||||
t.icon = 1 - Std.int(Math.ceil(FlxG.sound.music.volume));
|
||||
}
|
||||
|
||||
function _song_instvolume(t) {
|
||||
FlxG.sound.music.volume = t.slider.value;
|
||||
t.icon = t.slider.value > 0.5 ? 7 : (t.slider.value > 0 ? 8 : 9);
|
||||
}
|
||||
function _song_voicesvolume(t) {
|
||||
vocals.volume = t.slider.value;
|
||||
for (strumLine in strumLines.members) strumLine.vocals.volume = t.slider.value * strumLine.vocalsVolume;
|
||||
t.icon = t.slider.value > 0.5 ? 7 : (t.slider.value > 0 ? 8 : 9);
|
||||
}
|
||||
function _song_hitsoundvolume(t) {
|
||||
hitsoundGlobalVolume = t.slider.value;
|
||||
t.icon = t.slider.value > 0.5 ? 7 : (t.slider.value > 0 ? 8 : 9);
|
||||
function _song_mutevoices(t) {
|
||||
vocals.volume = (voicesMuted = !voicesMuted) ? 0 : 1;
|
||||
for (strumLine in strumLines.members) strumLine.updateVoicesVolume();
|
||||
t.icon = voicesMuted ? 1 : 0;
|
||||
}
|
||||
function _playback_back(_) {
|
||||
if (FlxG.sound.music.playing) return;
|
||||
@@ -1970,7 +1860,6 @@ class Charter extends UIState {
|
||||
__event.refreshEventIcons();
|
||||
(__event.global ? rightEventsGroup : leftEventsGroup).add(__event);
|
||||
undos.addToUndo(CEditEvent(__event, [], __event.events));
|
||||
updateCameraChanges();
|
||||
}
|
||||
|
||||
public function getBookmarkList():Array<ChartBookmark> {
|
||||
@@ -1979,7 +1868,7 @@ class Charter extends UIState {
|
||||
if (PlayState.SONG.bookmarks != null)
|
||||
bookmarks = PlayState.SONG.bookmarks;
|
||||
} catch (e) {}
|
||||
|
||||
|
||||
return bookmarks;
|
||||
}
|
||||
|
||||
@@ -1989,9 +1878,9 @@ class Charter extends UIState {
|
||||
var currentBookmarks:Array<ChartBookmark> = getBookmarkList();
|
||||
var newBookmarks:Array<ChartBookmark> = getBookmarkList();
|
||||
newBookmarks.push({time: daStep, name: name, color: color.toWebString()});
|
||||
|
||||
|
||||
PlayState.SONG.bookmarks = newBookmarks;
|
||||
updateBookmarks();
|
||||
updateBookmarks();
|
||||
undos.addToUndo(CEditBookmarks(currentBookmarks, newBookmarks));
|
||||
}
|
||||
|
||||
@@ -2016,7 +1905,7 @@ class Charter extends UIState {
|
||||
{
|
||||
var bars:Array<FlxSprite> = bs[0];
|
||||
var text:UIText = bs[1];
|
||||
|
||||
|
||||
if (bars != null) {
|
||||
for (spr in bars) {
|
||||
if (spr == null) continue;
|
||||
@@ -2070,7 +1959,7 @@ class Charter extends UIState {
|
||||
0,
|
||||
scrollBar.height
|
||||
);
|
||||
|
||||
|
||||
var bookmarkspr = new FlxSprite(scrollBar.x - 10, yPos).makeSolid(40, 4, bookmarkcolor);
|
||||
uiGroup.add(bookmarkspr);
|
||||
sprites.push(bookmarkspr);
|
||||
@@ -2122,56 +2011,26 @@ class Charter extends UIState {
|
||||
|
||||
if (bookmarks.length > 0)
|
||||
{
|
||||
var bookmarkOptions:Array<UIContextMenuOption> = [];
|
||||
var goToBookmark = TU.getRaw("charter.bookmarks.goTo");
|
||||
for (b in bookmarks)
|
||||
{
|
||||
bookmarkOptions.push({
|
||||
newChilds.push({
|
||||
label: goToBookmark.format([b.name]),
|
||||
onSelect: function(_) { Conductor.songPosition = Conductor.getTimeForStep(b.time); }
|
||||
});
|
||||
}
|
||||
newChilds.push({
|
||||
label: translate("bookmarks.bookmarkList"),
|
||||
childs: bookmarkOptions
|
||||
});
|
||||
newChilds.push(null);
|
||||
}
|
||||
|
||||
|
||||
newChilds.push({
|
||||
label: translate("song.inst"),
|
||||
slider: {
|
||||
min: 0,
|
||||
max: 1,
|
||||
value: 1,
|
||||
onChange: _song_instvolume
|
||||
},
|
||||
onIconClick: _slider_mutetoggle,
|
||||
icon: 7
|
||||
label: translate("song.muteInst"),
|
||||
onSelect: _song_muteinst
|
||||
});
|
||||
|
||||
newChilds.push({
|
||||
label: translate("song.voices"),
|
||||
slider: {
|
||||
min: 0,
|
||||
max: 1,
|
||||
value: 1,
|
||||
onChange: _song_voicesvolume
|
||||
},
|
||||
onIconClick: _slider_mutetoggle,
|
||||
icon: 7
|
||||
});
|
||||
|
||||
newChilds.push({
|
||||
label: translate("song.hitsounds"),
|
||||
slider: {
|
||||
min: 0,
|
||||
max: 1,
|
||||
value: 1,
|
||||
onChange: _song_hitsoundvolume
|
||||
},
|
||||
onIconClick: _slider_mutetoggle,
|
||||
icon: 7
|
||||
label: translate("song.muteVoices"),
|
||||
onSelect: _song_mutevoices
|
||||
});
|
||||
|
||||
if (songTopButton != null) songTopButton.contextMenu = newChilds;
|
||||
@@ -2196,10 +2055,6 @@ class Charter extends UIState {
|
||||
function _view_showeventBeatSeparator(t) {
|
||||
t.icon = (Options.charterShowBeats = !Options.charterShowBeats) ? 1 : 0;
|
||||
}
|
||||
function _view_showeventCameraHighlights(t) {
|
||||
t.icon = (Options.charterShowCameraHighlights = !Options.charterShowCameraHighlights) ? 1 : 0;
|
||||
updateCameraChanges();
|
||||
}
|
||||
function _view_switchWaveformRainbow(t) {
|
||||
t.icon = (Options.charterRainbowWaveforms = !Options.charterRainbowWaveforms) ? 1 : 0;
|
||||
|
||||
@@ -2225,8 +2080,8 @@ class Charter extends UIState {
|
||||
inline function _snap_decreasesnap(_) changequant(-1);
|
||||
inline function _snap_resetsnap(_) setquant(16);
|
||||
|
||||
inline function changequant(change:Int) {UIState.playEditorSound(Flags.DEFAULT_CHARTER_SNAPPINGCHANGE_SOUND); quant = quants[FlxMath.wrap(quants.indexOf(quant) + change, 0, quants.length-1)]; buildSnapsUI();};
|
||||
inline function setquant(newQuant:Int) {UIState.playEditorSound(Flags.DEFAULT_CHARTER_SNAPPINGCHANGE_SOUND); quant = newQuant; buildSnapsUI();}
|
||||
inline function changequant(change:Int) {FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARTER_SNAPPINGCHANGE_SOUND)); quant = quants[FlxMath.wrap(quants.indexOf(quant) + change, 0, quants.length-1)]; buildSnapsUI();};
|
||||
inline function setquant(newQuant:Int) {FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARTER_SNAPPINGCHANGE_SOUND)); quant = newQuant; buildSnapsUI();}
|
||||
|
||||
function buildSnapsUI():Array<UIContextMenuOption> {
|
||||
var snapsTopButton:UITopMenuButton = topMenuSpr == null ? null : cast topMenuSpr.members[snapIndex];
|
||||
@@ -2262,12 +2117,12 @@ class Charter extends UIState {
|
||||
}
|
||||
|
||||
inline function _note_addsustain(t) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_CHARTER_SUSTAINADD_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARTER_SUSTAINADD_SOUND));
|
||||
changeNoteSustain(1);
|
||||
}
|
||||
|
||||
inline function _note_subtractsustain(t) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_CHARTER_SUSTAINDELETE_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARTER_SUSTAINDELETE_SOUND));
|
||||
changeNoteSustain(-1);
|
||||
}
|
||||
|
||||
@@ -2344,18 +2199,16 @@ class Charter extends UIState {
|
||||
keybind: [CONTROL, SHIFT, A],
|
||||
onSelect: _note_selectmeasure
|
||||
},
|
||||
null
|
||||
null,
|
||||
{
|
||||
label: "(0) " + translate("noteTypes.default"),
|
||||
keybind: [ZERO],
|
||||
onSelect: (_) -> {changeNoteType(0);},
|
||||
icon: this.noteType == 0 ? 1 : 0
|
||||
}
|
||||
];
|
||||
|
||||
var noteTypeOptions:Array<UIContextMenuOption> = [{
|
||||
label: "(0) " + translate("noteTypes.default"),
|
||||
keybind: [ZERO],
|
||||
onSelect: (_) -> {changeNoteType(0);},
|
||||
icon: this.noteType == 0 ? 1 : 0
|
||||
}];
|
||||
|
||||
final noteKeys:Array<Array<Array<FlxKey>>> = [[[ZERO], [NUMPADZERO]], [[ONE], [NUMPADONE]], [[TWO], [NUMPADTWO]], [[THREE], [NUMPADTHREE]], [[FOUR], [NUMPADFOUR]], [[FIVE], [NUMPADFIVE]],
|
||||
[[SIX], [NUMPADSIX]], [[SEVEN], [NUMPADSEVEN]], [[EIGHT], [NUMPADEIGHT]], [[NINE], [NUMPADNINE]]];
|
||||
var noteKeys:Array<FlxKey> = [ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE];
|
||||
for (i=>type in noteTypes) {
|
||||
var realNoteID:Int = i+1; // Default Note not stored
|
||||
var newChild:UIContextMenuOption = {
|
||||
@@ -2364,13 +2217,9 @@ class Charter extends UIState {
|
||||
onSelect: (_) -> {changeNoteType(realNoteID);},
|
||||
icon: this.noteType == realNoteID ? 1 : 0
|
||||
};
|
||||
if (realNoteID <= 9) newChild.keybinds = noteKeys[realNoteID];
|
||||
noteTypeOptions.push(newChild);
|
||||
if (realNoteID <= 9) newChild.keybind = [noteKeys[realNoteID]];
|
||||
newChilds.push(newChild);
|
||||
}
|
||||
newChilds.push({
|
||||
label: translate("note.noteTypesList"),
|
||||
childs: noteTypeOptions
|
||||
});
|
||||
newChilds.push({
|
||||
label: translate("note.editNoteTypesList"),
|
||||
color: 0xFF959829, icon: 4,
|
||||
@@ -2378,7 +2227,6 @@ class Charter extends UIState {
|
||||
onSelect: editNoteTypesList
|
||||
});
|
||||
if (noteTopButton != null) noteTopButton.contextMenu = newChilds;
|
||||
if (topMenu != null && topMenu[noteIndex] != null) topMenu[noteIndex].childs = newChilds;
|
||||
return newChilds;
|
||||
}
|
||||
|
||||
@@ -2466,12 +2314,8 @@ class Charter extends UIState {
|
||||
}
|
||||
}
|
||||
|
||||
public inline function playHitsound(id:Int) {
|
||||
if (strumLines.members[id] != null && strumLines.members[id].hitsoundVolume > 0 && hitsoundGlobalVolume > 0) {
|
||||
hitsound.volume = hitsoundGlobalVolume * strumLines.members[id].hitsoundVolume;
|
||||
hitsound.replay();
|
||||
}
|
||||
}
|
||||
public inline function hitsoundsEnabled(id:Int)
|
||||
return strumLines.members[id] != null && strumLines.members[id].hitsounds;
|
||||
|
||||
public inline function __fixSelection(selection:Selection):Selection {
|
||||
var newSelection:Selection = new Selection();
|
||||
@@ -2562,7 +2406,7 @@ class Charter extends UIState {
|
||||
quantSelected: quant,
|
||||
noteTypeSelected: noteType,
|
||||
strumlinesDraggable: strumLines.draggable,
|
||||
hitSounds: [for (strumLine in strumLines.members) strumLine.hitsoundVolume > 0],
|
||||
hitSounds: [for (strumLine in strumLines.members) strumLine.hitsounds],
|
||||
mutedVocals: [for (strumLine in strumLines.members) !(strumLine.vocals.volume > 0)],
|
||||
waveforms: [for (strumLine in strumLines.members) strumLine.selectedWaveform]
|
||||
}
|
||||
@@ -2578,7 +2422,7 @@ class Charter extends UIState {
|
||||
strumLines.draggable = playtestInfo.strumlinesDraggable;
|
||||
|
||||
for (i => strumLine in strumLines.members)
|
||||
strumLine.hitsoundVolume = playtestInfo.hitSounds[i] ? 1 : 0;
|
||||
strumLine.hitsounds = playtestInfo.hitSounds[i];
|
||||
for (i => strumLine in strumLines.members)
|
||||
strumLine.vocals.volume = playtestInfo.mutedVocals[i] ? 0 : 1;
|
||||
for (i => strumLine in strumLines.members)
|
||||
@@ -2670,9 +2514,3 @@ typedef PlaytestInfo = {
|
||||
var mutedVocals:Array<Bool>;
|
||||
var waveforms:Array<Int>;
|
||||
}
|
||||
|
||||
typedef CameraChange = {
|
||||
var strumLineID:Int;
|
||||
var step:Float;
|
||||
var endStep:Float;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ class CharterAutoSaveUI extends UISliceSprite {
|
||||
icon.animation.curAnim.curFrame = 1;
|
||||
for (member in [this, progressBar, progressBarBack, autosavingText]) member.color = 0xFFA3EC95;
|
||||
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_AUTOSAVE_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_AUTOSAVE_SOUND));
|
||||
|
||||
(new FlxTimer()).start(1, (_) -> {disappearAnimation();});
|
||||
});
|
||||
|
||||
@@ -178,8 +178,6 @@ class CharterBackdrop extends FlxTypedGroup<FlxBasic> {
|
||||
public var gridShader:CustomShader = new CustomShader("engine/charterGrid");
|
||||
var __lastKeyCount:Int = 4;
|
||||
|
||||
public var cameraHighlight:CameraHighlight;
|
||||
|
||||
public function new() {
|
||||
super();
|
||||
|
||||
@@ -189,10 +187,6 @@ class CharterBackdrop extends FlxTypedGroup<FlxBasic> {
|
||||
add(gridBackDrop);
|
||||
gridShader.hset("segments", 4);
|
||||
|
||||
cameraHighlight = new CameraHighlight(this);
|
||||
cameraHighlight.makeSolid(1, 1, 0xFFFFFFFF);
|
||||
add(cameraHighlight);
|
||||
|
||||
waveformSprite = new FlxSprite().makeSolid(1, 1, 0xFF000000);
|
||||
waveformSprite.scale.set(160, 1);
|
||||
waveformSprite.updateHitbox();
|
||||
@@ -253,11 +247,10 @@ class CharterBackdrop extends FlxTypedGroup<FlxBasic> {
|
||||
x = strumLine.x;
|
||||
alpha = strumLine.strumLine.visible ? 0.9 : 0.4;
|
||||
keyCount = strumLine.keyCount;
|
||||
cameraHighlight.color = strumLine.highlightColor;
|
||||
} else alpha = 0.9;
|
||||
|
||||
for (spr in [gridBackDrop, beatSeparator, topLimit, bottomLimit,
|
||||
topSeparator, bottomSeparator, conductorFollowerSpr, waveformSprite, cameraHighlight]) {
|
||||
topSeparator, bottomSeparator, conductorFollowerSpr, waveformSprite]) {
|
||||
spr.x = x; if (spr != waveformSprite) spr.alpha = alpha;
|
||||
spr.cameras = this.cameras;
|
||||
}
|
||||
@@ -279,9 +272,6 @@ class CharterBackdrop extends FlxTypedGroup<FlxBasic> {
|
||||
spr.updateHitbox();
|
||||
}
|
||||
|
||||
cameraHighlight.scale.x = (keyCount * 40)-2;
|
||||
cameraHighlight.x += 1;
|
||||
|
||||
waveformSprite.visible = waveformSprite.shader != null;
|
||||
if (waveformSprite.shader == null) return;
|
||||
|
||||
@@ -321,19 +311,16 @@ class CharterGridSeperatorBase extends FlxSprite {
|
||||
private static var lastMaxMeasure:Float = -1;
|
||||
|
||||
public static var lastConductorSprY:Float = Math.NEGATIVE_INFINITY;
|
||||
public static var lastCameraZoom:Float = -1;
|
||||
|
||||
private static var beatStepTimes:Array<Float> = [];
|
||||
private static var measureStepTimes:Array<Float> = [];
|
||||
private static var timeSignatureChangeGaps:Array<Float> = [];
|
||||
|
||||
private function recalculateBeats() {
|
||||
@:privateAccess
|
||||
var currentZoom = Charter.instance.__camZoom;
|
||||
var conductorSprY = Charter.instance.gridBackdrops.conductorSprY;
|
||||
if (conductorSprY == lastConductorSprY && currentZoom == lastCameraZoom) return; //only update if song pos or camera zoom has changed
|
||||
if (conductorSprY == lastConductorSprY) return;
|
||||
|
||||
var zoomOffset = ((FlxG.height * (1/currentZoom)) * 0.5);
|
||||
var zoomOffset = ((FlxG.height * (1/cameras[0].zoom)) * 0.5);
|
||||
|
||||
minStep = (conductorSprY - zoomOffset)/40;
|
||||
maxStep = (conductorSprY + zoomOffset)/40;
|
||||
@@ -372,7 +359,6 @@ class CharterGridSeperatorBase extends FlxSprite {
|
||||
}
|
||||
|
||||
lastConductorSprY = conductorSprY;
|
||||
lastCameraZoom = currentZoom;
|
||||
}
|
||||
|
||||
private inline function calculateTimeSignatureGaps() {
|
||||
@@ -460,77 +446,6 @@ class CharterGridSeperator extends CharterGridSeperatorBase {
|
||||
}
|
||||
}
|
||||
|
||||
class CameraHighlight extends FlxSprite {
|
||||
|
||||
private var grid:CharterBackdrop;
|
||||
private var _currentCameraMovementIndex:Int = 0;
|
||||
public function new(grid:CharterBackdrop) {
|
||||
this.grid = grid;
|
||||
super();
|
||||
}
|
||||
|
||||
override public function draw() {
|
||||
if (!Options.charterShowCameraHighlights || grid.strumLine == null) return;
|
||||
|
||||
@:privateAccess
|
||||
var minStep = CharterGridSeperatorBase.minStep;
|
||||
@:privateAccess
|
||||
var maxStep = CharterGridSeperatorBase.maxStep;
|
||||
@:privateAccess
|
||||
var strumLineID = Charter.instance.strumLines.isDragging ? Charter.instance.strumLines.__pastStrumlines.indexOf(grid.strumLine) : Charter.instance.gridBackdrops.members.indexOf(grid);
|
||||
|
||||
//first default camera change
|
||||
if ((Charter.instance.cameraMovementChanges[0] == null || Charter.instance.cameraMovementChanges[0].step != 0) && strumLineID == 0) {
|
||||
var endStep = Charter.instance.cameraMovementChanges[0] != null ? Charter.instance.cameraMovementChanges[0].step : Charter.instance.__endStep;
|
||||
|
||||
if (endStep >= minStep) {
|
||||
setupHighlight(0, endStep); super.draw();
|
||||
setupLine(endStep); super.draw();
|
||||
}
|
||||
}
|
||||
|
||||
//update index if gone backwards
|
||||
while(_currentCameraMovementIndex > 0) {
|
||||
if (Charter.instance.cameraMovementChanges[_currentCameraMovementIndex] == null || Charter.instance.cameraMovementChanges[_currentCameraMovementIndex].endStep >= minStep) {
|
||||
_currentCameraMovementIndex--;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var seenFirstVisible = false;
|
||||
for (i in _currentCameraMovementIndex...Charter.instance.cameraMovementChanges.length) {
|
||||
var change = Charter.instance.cameraMovementChanges[i];
|
||||
if (change.endStep >= minStep) {
|
||||
if (!seenFirstVisible) {
|
||||
_currentCameraMovementIndex = i; //remember the index for the next frame, so we dont need to loop through everything every time
|
||||
seenFirstVisible = true;
|
||||
}
|
||||
if (change.strumLineID == strumLineID) {
|
||||
setupHighlight(change.step, change.endStep); super.draw();
|
||||
setupLine(change.step); super.draw();
|
||||
setupLine(change.endStep); super.draw();
|
||||
}
|
||||
}
|
||||
if (change.endStep > maxStep) break;
|
||||
}
|
||||
}
|
||||
|
||||
private inline function setupHighlight(step:Float, endStep:Float) {
|
||||
y = step * 40;
|
||||
alpha = 0.15;
|
||||
scale.y = (endStep -step) * 40;
|
||||
updateHitbox();
|
||||
}
|
||||
|
||||
private inline function setupLine(step:Float) {
|
||||
y = (step * 40)-1;
|
||||
alpha = 0.8;
|
||||
scale.y = 2;
|
||||
updateHitbox();
|
||||
}
|
||||
}
|
||||
|
||||
class EventBackdrop extends FlxBackdrop {
|
||||
public var eventBeatSeparator:CharterEventGridSeperator;
|
||||
|
||||
|
||||
@@ -161,9 +161,8 @@ class CharterNote extends UISprite implements ICharterSelectable {
|
||||
}
|
||||
|
||||
if (__passed != (__passed = step < Conductor.curStepFloat + (Options.songOffsetAffectEditors ? (Conductor.songOffset / Conductor.stepCrochet) : 0))) {
|
||||
if (__passed && FlxG.sound.music.playing) {
|
||||
Charter.instance.playHitsound(strumLineID);
|
||||
}
|
||||
if (__passed && FlxG.sound.music.playing && Charter.instance.hitsoundsEnabled(strumLineID))
|
||||
Charter.instance.hitsound.replay();
|
||||
}
|
||||
|
||||
if (strumLine != null) {
|
||||
|
||||
@@ -21,7 +21,7 @@ class CharterPreviewStrumLine extends FlxTypedGroup<FlxSprite>
|
||||
for (i in 0...keyCount){
|
||||
var strum = new FlxSprite();
|
||||
strum.frames = Paths.getFrames("game/notes/default");
|
||||
strum.setGraphicSize(Std.int((strum.width * Flags.DEFAULT_NOTE_SCALE) * scale));
|
||||
strum.setGraphicSize(Std.int((strum.width * 0.7) * scale));
|
||||
strum.updateHitbox();
|
||||
|
||||
var animPrefix = strumAnimPrefix[i % 4];
|
||||
@@ -33,7 +33,7 @@ class CharterPreviewStrumLine extends FlxTypedGroup<FlxSprite>
|
||||
|
||||
note = new FlxSprite();
|
||||
note.frames = Paths.getFrames("game/notes/default");
|
||||
note.setGraphicSize(Std.int((note.width * Flags.DEFAULT_NOTE_SCALE) * scale));
|
||||
note.setGraphicSize(Std.int((note.width * 0.7) * scale));
|
||||
note.updateHitbox();
|
||||
note.animation.addByPrefix('purple', 'purple0');
|
||||
note.animation.play('purple');
|
||||
@@ -41,7 +41,7 @@ class CharterPreviewStrumLine extends FlxTypedGroup<FlxSprite>
|
||||
add(note);
|
||||
}
|
||||
|
||||
var noteTime:Float = FlxG.initialHeight;
|
||||
var noteTime:Float = FlxG.height;
|
||||
var scroll:Float = 1.0;
|
||||
|
||||
public function updatePos(x:Float, y:Float, scale:Float, spacing:Float, keyCount:Int, scrollSpeed:Float){
|
||||
@@ -53,7 +53,7 @@ class CharterPreviewStrumLine extends FlxTypedGroup<FlxSprite>
|
||||
|
||||
strum.x = CoolUtil.fpsLerp(strum.x, x + (Note.swagWidth * scale * spacing * i), 0.2);
|
||||
strum.y = CoolUtil.fpsLerp(strum.y, y + (Note.swagWidth*0.5) - (Note.swagWidth * scale * 0.5), 0.2);
|
||||
strum.scale.x = strum.scale.y = CoolUtil.fpsLerp(strum.scale.x, Flags.DEFAULT_NOTE_SCALE * scale, 0.2);
|
||||
strum.scale.x = strum.scale.y = CoolUtil.fpsLerp(strum.scale.x, 0.7 * scale, 0.2);
|
||||
strum.updateHitbox();
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ class CharterPreviewStrumLine extends FlxTypedGroup<FlxSprite>
|
||||
scroll = CoolUtil.fpsLerp(scroll, scrollSpeed, 0.2);
|
||||
noteTime -= FlxG.elapsed * scroll * 1000 * 0.45;
|
||||
if (noteTime <= 0.0)
|
||||
noteTime = FlxG.initialHeight;
|
||||
noteTime = FlxG.height;
|
||||
|
||||
note.x = members[0].x;
|
||||
note.y = members[0].y + noteTime;
|
||||
|
||||
@@ -146,10 +146,11 @@ class CharterSelectionScreen extends EditorTreeMenuScreen {
|
||||
|
||||
var screen = parent.tree.last();
|
||||
var idx = 0;
|
||||
while (!(screen.members[idx] is Separator || idx >= screen.members.length)) idx++;
|
||||
while (!(screen.members[idx] is Separator)) idx++;
|
||||
screen.insert(idx, makeChartOption(name, curSong.variant != null && curSong.variant != "" ? curSong.variant : null, curSong.name));
|
||||
|
||||
// Add to Meta
|
||||
var metaPath = '$songFolder/meta${curSong.variant != null && curSong.variant != "" ? "-" + curSong.variant : ""}.json';
|
||||
var metaPath = '$songFolder/meta${curSong.variant != null && curSong.variant == "" ? "-" + curSong.variant : ""}.json';
|
||||
CoolUtil.safeSaveFile(metaPath, Chart.makeMetaSaveable(curSong));
|
||||
}
|
||||
#end
|
||||
|
||||
@@ -105,7 +105,6 @@ class CharterStrumLineGroup extends FlxTypedGroup<CharterStrumline> {
|
||||
draggingObj = null;
|
||||
fixEvents();
|
||||
refreshStrumlineIDs();
|
||||
Charter.instance.updateCameraChanges();
|
||||
}
|
||||
|
||||
public inline function fixEvents() {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package funkin.editors.charter;
|
||||
|
||||
import funkin.editors.ui.UIContextMenu.UIContextMenuOption;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.group.FlxSpriteGroup;
|
||||
import flixel.sound.FlxSound;
|
||||
import funkin.backend.chart.ChartData.ChartStrumLine;
|
||||
@@ -12,11 +10,11 @@ import funkin.game.HealthIcon;
|
||||
|
||||
class CharterStrumline extends UISprite {
|
||||
public var strumLine:ChartStrumLine;
|
||||
public var hitsounds:Bool = true;
|
||||
|
||||
public var draggingSprite:UISprite;
|
||||
public var healthIcons:FlxSpriteGroup;
|
||||
public var button:CharterStrumlineOptions;
|
||||
public var highlightColor:FlxColor;
|
||||
|
||||
public var draggable:Bool = false;
|
||||
public var dragging:Bool = false;
|
||||
@@ -24,9 +22,7 @@ class CharterStrumline extends UISprite {
|
||||
public var curMenu:UIContextMenu = null;
|
||||
|
||||
public var vocals:FlxSound;
|
||||
public var hasVocals:Bool = false;
|
||||
public var vocalsVolume:Float = 1;
|
||||
public var hitsoundVolume:Float = 1;
|
||||
public var voicesMuted:Bool = false;
|
||||
|
||||
public var keyCount:Int = 4;
|
||||
public var startingID(get, null):Int;
|
||||
@@ -146,22 +142,15 @@ class CharterStrumline extends UISprite {
|
||||
if (asset != null) {
|
||||
vocals.reset();
|
||||
vocals.loadEmbedded(asset);
|
||||
hasVocals = true;
|
||||
}
|
||||
else {
|
||||
vocals.destroy();
|
||||
hasVocals = false;
|
||||
}
|
||||
vocals.group = FlxG.sound.defaultMusicGroup;
|
||||
}
|
||||
|
||||
highlightColor = 0xFFFFFFFF;
|
||||
if (icons[0] != null) {
|
||||
var characterXML = Character.getXMLFromCharName(icons[0]);
|
||||
if (characterXML != null && characterXML.x.exists("color")) highlightColor = FlxColor.fromString(characterXML.x.get("color"));
|
||||
|
||||
//make darker colors more visible for the highlight
|
||||
highlightColor.brightness = Math.max(highlightColor.brightness, 0.65);
|
||||
}
|
||||
public function updateVoicesVolume() {
|
||||
vocals.volume = (voicesMuted || (Charter.instance?.voicesMuted ?? false)) ? 0 : 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,17 +173,18 @@ class CharterStrumlineOptions extends UITopMenuButton {
|
||||
contextMenu = [
|
||||
{
|
||||
label: TU.translate("charter.strumLine.hitsounds"),
|
||||
slider: {
|
||||
min: 0,
|
||||
max: 1,
|
||||
value: strLine.hitsoundVolume,
|
||||
onChange: function(t) {
|
||||
strLine.hitsoundVolume = t.slider.value;
|
||||
t.icon = t.slider.value > 0.5 ? 7 : (t.slider.value > 0 ? 8 : 9);
|
||||
}
|
||||
onSelect: function(_) {
|
||||
strLine.hitsounds = !strLine.hitsounds;
|
||||
},
|
||||
onIconClick: Charter.instance._slider_mutetoggle,
|
||||
icon: 7
|
||||
icon: strLine.hitsounds ? 1 : 0
|
||||
},
|
||||
{
|
||||
label: TU.translate("charter.strumLine.muteVocals"),
|
||||
onSelect: function(_) {
|
||||
strLine.voicesMuted = !strLine.voicesMuted;
|
||||
strLine.updateVoicesVolume();
|
||||
},
|
||||
icon: strLine.voicesMuted ? 1 : 0
|
||||
},
|
||||
null,
|
||||
{
|
||||
@@ -215,44 +205,20 @@ class CharterStrumlineOptions extends UITopMenuButton {
|
||||
}
|
||||
];
|
||||
|
||||
if (strLine.hasVocals) {
|
||||
contextMenu.insert(1, {
|
||||
label: TU.translate("charter.strumLine.vocals"),
|
||||
slider: {
|
||||
min: 0,
|
||||
max: 1,
|
||||
value: strLine.vocalsVolume,
|
||||
onChange: function(t) {
|
||||
strLine.vocalsVolume = t.slider.value;
|
||||
strLine.vocals.volume = Charter.instance.vocals.volume * strLine.vocalsVolume;
|
||||
t.icon = t.slider.value > 0.5 ? 7 : (t.slider.value > 0 ? 8 : 9);
|
||||
}
|
||||
},
|
||||
onIconClick: Charter.instance._slider_mutetoggle,
|
||||
icon: 7
|
||||
});
|
||||
}
|
||||
|
||||
var waveformOptions:Array<UIContextMenuOption> = [
|
||||
{
|
||||
label: TU.translate("charter.strumLine.noWaveform"),
|
||||
onSelect: function(_) {strLine.selectedWaveform = -1;},
|
||||
icon: strLine.selectedWaveform == -1 ? 1 : 0
|
||||
}
|
||||
];
|
||||
contextMenu.insert(0, {
|
||||
label: TU.translate("charter.strumLine.noWaveform"),
|
||||
onSelect: function(_) {strLine.selectedWaveform = -1;},
|
||||
icon: strLine.selectedWaveform == -1 ? 1 : 0
|
||||
});
|
||||
|
||||
for (i => name in Charter.waveformHandler.waveformList)
|
||||
waveformOptions.push({
|
||||
contextMenu.insert(1+i, {
|
||||
label: name,
|
||||
onSelect: function(_) {strLine.selectedWaveform = i;},
|
||||
icon: strLine.selectedWaveform == i ? 6 : 5
|
||||
});
|
||||
|
||||
contextMenu.insert(0, {
|
||||
label: TU.translate("charter.strumLine.waveforms"),
|
||||
childs: waveformOptions
|
||||
});
|
||||
contextMenu.insert(1, null);
|
||||
contextMenu.insert(1+Charter.waveformHandler.waveformList.length, null);
|
||||
|
||||
var cam = Charter.instance.charterCamera;
|
||||
var point = CoolUtil.worldToScreenPosition(this, cam);
|
||||
|
||||
@@ -33,8 +33,6 @@ class CharterStrumlineScreen extends UISubstateWindow {
|
||||
|
||||
public var strumLineCam:HudCamera;
|
||||
public var previewStrumLine:CharterPreviewStrumLine;
|
||||
public var previewBorder:Array<FlxSprite> = [];
|
||||
private final borderGap:Int = 5;
|
||||
|
||||
private var onSave:ChartStrumLine -> Void = null;
|
||||
|
||||
@@ -178,30 +176,20 @@ class CharterStrumlineScreen extends UISubstateWindow {
|
||||
addLabelOn(vocalsSuffixDropDown, TU.translate("charterStrumLine.vocalSuffix"));
|
||||
|
||||
keyCountStepper = new UINumericStepper(stagePositionDropdown.x, vocalsSuffixDropDown.y, strumLine.keyCount != null ? strumLine.keyCount : 4, 1, 0, 1, 1000, 84);
|
||||
add(keyCountStepper);
|
||||
addLabelOn(keyCountStepper, TU.translate("charterStrumLine.keyCount"));
|
||||
// if (Flags.CHARTER_ADVANCED_SETTINGS) {
|
||||
add(keyCountStepper);
|
||||
addLabelOn(keyCountStepper, TU.translate("charterStrumLine.keyCount"));
|
||||
// }
|
||||
|
||||
strumLineCam = new HudCamera();
|
||||
strumLineCam.downscroll = Options.downscroll;
|
||||
strumLineCam.bgColor = 0;
|
||||
strumLineCam.alpha = 0;
|
||||
FlxG.cameras.add(strumLineCam, false);
|
||||
updateStrumlineCam(FlxG.width, FlxG.height);
|
||||
|
||||
previewStrumLine = new CharterPreviewStrumLine(0, 0, 0, 1, 4, 0);
|
||||
previewStrumLine.camera = strumLineCam;
|
||||
add(previewStrumLine);
|
||||
FlxTween.tween(strumLineCam, {alpha: 1}, 0.25, {ease: FlxEase.cubeOut});
|
||||
|
||||
//preview border
|
||||
previewBorder.push(new FlxSprite(-borderGap, -borderGap).makeSolid(FlxG.initialWidth + (borderGap*2), borderGap, 0x88FFFFFF));
|
||||
previewBorder.push(new FlxSprite(-borderGap, 0).makeSolid(borderGap, FlxG.initialHeight, 0x88FFFFFF));
|
||||
previewBorder.push(new FlxSprite(FlxG.initialWidth, 0).makeSolid(borderGap, FlxG.initialHeight, 0x88FFFFFF));
|
||||
previewBorder.push(new FlxSprite(-borderGap, FlxG.initialHeight).makeSolid(FlxG.initialWidth + (borderGap*2), borderGap, 0x88FFFFFF));
|
||||
for (border in previewBorder) {
|
||||
border.camera = strumLineCam;
|
||||
add(border);
|
||||
}
|
||||
}
|
||||
|
||||
function saveStrumline() {
|
||||
@@ -234,7 +222,7 @@ class CharterStrumlineScreen extends UISubstateWindow {
|
||||
|
||||
previewStrumLine.visible = visibleCheckbox.checked;
|
||||
|
||||
var xOffset:Float = StrumLine.calculateStartingXPosFromInitialWidth(hudXStepper.value, hudScaleStepper.value, hudSpacingStepper.value, Std.int(keyCountStepper.value));
|
||||
var xOffset:Float = StrumLine.calculateStartingXPos(hudXStepper.value, hudScaleStepper.value, hudSpacingStepper.value, Std.int(keyCountStepper.value));
|
||||
previewStrumLine.updatePos(xOffset, hudYStepper.value, hudScaleStepper.value, hudSpacingStepper.value, Std.int(keyCountStepper.value), scrollSpeed);
|
||||
|
||||
super.update(elapsed);
|
||||
@@ -245,26 +233,6 @@ class CharterStrumlineScreen extends UISubstateWindow {
|
||||
FlxTween.cancelTweensOf(strumLineCam);
|
||||
FlxG.cameras.remove(strumLineCam);
|
||||
}
|
||||
|
||||
public override function onResize(width:Int, height:Int) {
|
||||
super.onResize(width, height);
|
||||
if (!UIState.resolutionAware) return;
|
||||
|
||||
if ((width < FlxG.initialWidth || height < FlxG.initialHeight) && !Options.bypassEditorsResize) {
|
||||
width = FlxG.initialWidth; height = FlxG.initialHeight;
|
||||
}
|
||||
|
||||
updateStrumlineCam(width, height);
|
||||
}
|
||||
|
||||
private function updateStrumlineCam(windowWidth:Int, windowHeight:Int) {
|
||||
strumLineCam.width = FlxG.initialWidth + (borderGap*2);
|
||||
strumLineCam.height = FlxG.initialHeight + (borderGap*2);
|
||||
strumLineCam.x = (windowWidth/2) - (strumLineCam.width/2);
|
||||
strumLineCam.y = (windowHeight/2) - (strumLineCam.height/2);
|
||||
strumLineCam.scroll.x = -borderGap;
|
||||
strumLineCam.scroll.y = -borderGap;
|
||||
}
|
||||
}
|
||||
|
||||
class CharacterButton extends UIButton {
|
||||
|
||||
@@ -508,7 +508,7 @@ class StageEditor extends UIState {
|
||||
|
||||
function _file_save(_) {
|
||||
#if sys
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);
|
||||
FlxG.sound.play(Paths.sound('editors/save'));
|
||||
CoolUtil.safeSaveFile(
|
||||
'${Paths.getAssetsRoot()}/data/stages/${__stage}.xml',
|
||||
buildStage()
|
||||
@@ -520,7 +520,7 @@ class StageEditor extends UIState {
|
||||
}
|
||||
|
||||
function _file_saveas(_) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_SAVE_SOUND);
|
||||
FlxG.sound.play(Paths.sound('editors/save'));
|
||||
openSubState(new SaveSubstate(buildStage(), {
|
||||
defaultSaveFile: '${__stage}.xml'
|
||||
}));
|
||||
@@ -730,7 +730,7 @@ class StageEditor extends UIState {
|
||||
}
|
||||
|
||||
function _edit_undo(_) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_UNDO_SOUND);
|
||||
FlxG.sound.play(Flags.DEFAULT_EDITOR_UNDO_SOUND);
|
||||
var undo = undos.undo();
|
||||
switch(undo) {
|
||||
case null:
|
||||
@@ -756,7 +756,7 @@ class StageEditor extends UIState {
|
||||
}
|
||||
|
||||
function _edit_redo(_) {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_REDO_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_REDO_SOUND));
|
||||
var redo = undos.redo();
|
||||
switch(redo) {
|
||||
case null:
|
||||
|
||||
@@ -30,7 +30,7 @@ class UIButton extends UISliceSprite {
|
||||
super.onHovered();
|
||||
if (FlxG.mouse.justPressed) {
|
||||
hasBeenPressed = true;
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_BUTTONCLICK_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_BUTTONCLICK_SOUND));
|
||||
}
|
||||
if (FlxG.mouse.justReleased && callback != null && shouldPress && hasBeenPressed) {
|
||||
callback();
|
||||
|
||||
@@ -16,12 +16,6 @@ class UIContextMenu extends MusicBeatSubstate {
|
||||
public var contextMenuOptions:Array<UIContextMenuOptionSpr> = [];
|
||||
public var separators:Array<FlxSprite> = [];
|
||||
|
||||
public var childContextMenu:UIContextMenu = null;
|
||||
public var parentContextMenu:UIContextMenu = null;
|
||||
private var childContextMenuOptionIndex:Int = -1;
|
||||
@:allow(funkin.editors.ui.UIContextMenu)
|
||||
private var lastHoveredOptionIndex:Int = -1;
|
||||
|
||||
var scroll:Float = 0.0;
|
||||
var flipped:Bool = false;
|
||||
|
||||
@@ -102,10 +96,6 @@ class UIContextMenu extends MusicBeatSubstate {
|
||||
for(o in separators)
|
||||
o.x -= bg.bWidth;
|
||||
}
|
||||
|
||||
for(o in contextMenuOptions) {
|
||||
o.postCreate();
|
||||
}
|
||||
}
|
||||
|
||||
public function select(option:UIContextMenuOption) {
|
||||
@@ -115,12 +105,12 @@ class UIContextMenu extends MusicBeatSubstate {
|
||||
if (callback != null)
|
||||
callback(this, index, option);
|
||||
if (option.closeOnSelect == null ? true : option.closeOnSelect)
|
||||
closeWithParents();
|
||||
close();
|
||||
}
|
||||
|
||||
public override function update(elapsed:Float) {
|
||||
if (__oobDeletion && FlxG.mouse.justPressed && !bg.hoveredByChild && !hoveringAnyChildren())
|
||||
closeWithParents();
|
||||
if (__oobDeletion && FlxG.mouse.justPressed && !bg.hoveredByChild)
|
||||
close();
|
||||
|
||||
__oobDeletion = true;
|
||||
|
||||
@@ -131,14 +121,6 @@ class UIContextMenu extends MusicBeatSubstate {
|
||||
|
||||
contextCam.scroll.y = CoolUtil.fpsLerp(contextCam.scroll.y, scroll, 0.5);
|
||||
contextCam.alpha = CoolUtil.fpsLerp(contextCam.alpha, 1, 0.25);
|
||||
|
||||
if (parentContextMenu != null) {
|
||||
if (hoveringAnyParents() && parentContextMenu.lastHoveredOptionIndex != parentContextMenu.childContextMenuOptionIndex) {
|
||||
closeWithChildren();
|
||||
parentContextMenu.childContextMenuOptionIndex = -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override function destroy() {
|
||||
@@ -147,56 +129,6 @@ class UIContextMenu extends MusicBeatSubstate {
|
||||
if (UIState.state.curContextMenu == this)
|
||||
UIState.state.curContextMenu = null;
|
||||
}
|
||||
|
||||
public function openChildContextMenu(optionSpr:UIContextMenuOptionSpr) {
|
||||
var index = contextMenuOptions.indexOf(optionSpr);
|
||||
if (index != childContextMenuOptionIndex) {
|
||||
childContextMenuOptionIndex = index;
|
||||
var child = new UIContextMenu(optionSpr.option.childs, null, optionSpr.x + optionSpr.bWidth + 4, optionSpr.y - 4);
|
||||
persistentDraw = true;
|
||||
persistentUpdate = true;
|
||||
child.parentContextMenu = this;
|
||||
childContextMenu = child;
|
||||
openSubState(child);
|
||||
}
|
||||
}
|
||||
public function closeWithParents() {
|
||||
close();
|
||||
if (parentContextMenu != null) {
|
||||
parentContextMenu.closeWithParents();
|
||||
}
|
||||
}
|
||||
public function closeWithChildren() {
|
||||
if (childContextMenu != null) {
|
||||
childContextMenu.closeWithChildren();
|
||||
}
|
||||
close();
|
||||
}
|
||||
public function hoveringAnyParents() {
|
||||
if (parentContextMenu != null) {
|
||||
return parentContextMenu.bg.hoveredByChild || parentContextMenu.hoveringAnyParents();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public function hoveringAnyChildren() {
|
||||
if (childContextMenu != null) {
|
||||
return childContextMenu.bg.hoveredByChild || childContextMenu.hoveringAnyChildren();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
typedef UIContextMenuSliderOptionData = {
|
||||
var min:Float;
|
||||
var max:Float;
|
||||
var value:Float;
|
||||
var ?onChange:UIContextMenuOption->Void;
|
||||
//default = 120, ignored if sameLine = false
|
||||
var ?width:Float;
|
||||
//disables stepper and text if false, default = false
|
||||
var ?showValues:Bool;
|
||||
//if true, the slider will be on the same line as the label text, otherwise it will be on the next line below the label
|
||||
var ?sameLine:Bool;
|
||||
}
|
||||
|
||||
typedef UIContextMenuCallback = UIContextMenu->Int->UIContextMenuOption->Void;
|
||||
@@ -212,24 +144,13 @@ typedef UIContextMenuOption = {
|
||||
var ?button:UIContextMenuOptionSpr;
|
||||
var ?onCreate:UIContextMenuOptionSpr->Void;
|
||||
var ?childs:Array<UIContextMenuOption>;
|
||||
var ?slider:UIContextMenuSliderOptionData;
|
||||
var ?onIconClick:UIContextMenuOption->Void;
|
||||
}
|
||||
|
||||
enum abstract UIContextMenuOptionType(Int) from Int {
|
||||
var DEFAULT = 0;
|
||||
var SUBMENU = 1;
|
||||
var SLIDER = 2;
|
||||
}
|
||||
|
||||
class UIContextMenuOptionSpr extends UISliceSprite {
|
||||
public var label:UIText;
|
||||
public var labelKeybind:UIText;
|
||||
public var icon:UIContextMenuOptionIcon;
|
||||
public var icon:FlxSprite;
|
||||
public var option:UIContextMenuOption;
|
||||
public var optionType:UIContextMenuOptionType = DEFAULT;
|
||||
|
||||
public var slider:UISlider = null;
|
||||
|
||||
var parent:UIContextMenu;
|
||||
|
||||
@@ -239,96 +160,40 @@ class UIContextMenuOptionSpr extends UISliceSprite {
|
||||
this.parent = parent;
|
||||
this.color = option.color;
|
||||
|
||||
var w:Int = label.frameWidth + 22;
|
||||
var h:Int = label.frameHeight;
|
||||
|
||||
if (option.childs != null) optionType = SUBMENU;
|
||||
if (option.slider != null) optionType = SLIDER;
|
||||
|
||||
switch(optionType) {
|
||||
|
||||
case SUBMENU:
|
||||
labelKeybind = new UIText(label.x + label.frameWidth + 10, 2, 0, ">");
|
||||
case SLIDER:
|
||||
labelKeybind = new UIText(label.x + label.frameWidth + 10, 2, 0, "");
|
||||
//slider needs to be created after so that it can match the menu width (when not on the same line)
|
||||
if (option.slider.sameLine != null && option.slider.sameLine) {
|
||||
var sliderWidth = option.slider.width != null ? Std.int(option.slider.width) : 120;
|
||||
w += 120 + slider.barWidth;
|
||||
} else {
|
||||
h *= 2;
|
||||
}
|
||||
|
||||
default:
|
||||
if (option.keybinds == null) {
|
||||
if (option.keybind != null) {
|
||||
option.keybinds = [option.keybind];
|
||||
}
|
||||
}
|
||||
|
||||
if (option.keybinds != null || option.keybindText != null) {
|
||||
var text = if(option.keybindText == null) {
|
||||
var textKeys:Array<String> = [];
|
||||
for (o in option.keybinds[0]) {
|
||||
if (Std.int(o) > 0) {
|
||||
textKeys.push(o.toUIString());
|
||||
}
|
||||
}
|
||||
textKeys.join("+");
|
||||
} else {
|
||||
option.keybindText;
|
||||
}
|
||||
labelKeybind = new UIText(label.x + label.frameWidth + 10, 2, 0, text);
|
||||
labelKeybind.alpha = 0.75;
|
||||
|
||||
w = Std.int(labelKeybind.x + labelKeybind.frameWidth + 10);
|
||||
}
|
||||
if (option.icon != null && option.icon > 0) {
|
||||
icon = new FlxSprite(0, 0).loadGraphic(Paths.image('editors/ui/context-icons'), true, 20, 20);
|
||||
icon.animation.add('icon', [option.icon-1], 0, true);
|
||||
icon.animation.play('icon');
|
||||
}
|
||||
|
||||
super(x, y, w, h, 'editors/ui/menu-item');
|
||||
if (option.keybinds == null) {
|
||||
if (option.keybind != null) {
|
||||
option.keybinds = [option.keybind];
|
||||
}
|
||||
}
|
||||
|
||||
if (option.keybinds != null || option.keybindText != null) {
|
||||
var text = if(option.keybindText == null) {
|
||||
var textKeys:Array<String> = [];
|
||||
for (o in option.keybinds[0]) {
|
||||
if (Std.int(o) > 0) {
|
||||
textKeys.push(o.toUIString());
|
||||
}
|
||||
}
|
||||
textKeys.join("+");
|
||||
} else {
|
||||
option.keybindText;
|
||||
}
|
||||
labelKeybind = new UIText(label.x + label.frameWidth + 10, 2, 0, text);
|
||||
labelKeybind.alpha = 0.75;
|
||||
}
|
||||
|
||||
super(x, y, labelKeybind != null ? Std.int(labelKeybind.x + labelKeybind.frameWidth + 10) : (label.frameWidth + 22), label.frameHeight, 'editors/ui/menu-item');
|
||||
members.push(label);
|
||||
updateIcon();
|
||||
|
||||
if (icon != null)
|
||||
members.push(icon);
|
||||
if (labelKeybind != null)
|
||||
members.push(labelKeybind);
|
||||
}
|
||||
|
||||
//Called after all options are created and the context menu width/height is final
|
||||
public function postCreate() {
|
||||
switch(optionType) {
|
||||
case SLIDER:
|
||||
|
||||
var sliderWidth = bWidth-50;
|
||||
if (option.slider.sameLine != null && option.slider.sameLine) {
|
||||
option.slider.width != null ? Std.int(option.slider.width) : 120;
|
||||
}
|
||||
|
||||
slider = new UISlider(0, 0, sliderWidth, option.slider.value,
|
||||
[{start: option.slider.min, end: option.slider.max, size: option.slider.max-option.slider.min}], false);
|
||||
|
||||
slider.onChange = function(v) {
|
||||
option.slider.value = v;
|
||||
if (option.slider.onChange != null) option.slider.onChange(option);
|
||||
updateIcon(); //check if icon has changed
|
||||
@:privateAccess
|
||||
labelKeybind.text = '${CoolUtil.quantize(slider.__barProgress * 100, 1)}%';
|
||||
};
|
||||
slider.value = option.slider.value;
|
||||
|
||||
if (option.slider.showValues == null || !option.slider.showValues) {
|
||||
slider.startText.visible = false;
|
||||
slider.endText.visible = false;
|
||||
slider.valueStepper.visible = false;
|
||||
slider.valueStepper.selectable = false;
|
||||
}
|
||||
|
||||
members.push(slider);
|
||||
case SUBMENU:
|
||||
|
||||
default:
|
||||
|
||||
}
|
||||
members.push(labelKeybind);
|
||||
}
|
||||
|
||||
public override function draw() {
|
||||
@@ -340,71 +205,12 @@ class UIContextMenuOptionSpr extends UISliceSprite {
|
||||
icon.follow(this, 0, 0);
|
||||
if (labelKeybind != null)
|
||||
labelKeybind.follow(this, bWidth - 10 - labelKeybind.frameWidth, 2);
|
||||
if (slider != null) {
|
||||
if (option.slider.sameLine != null && option.slider.sameLine) {
|
||||
slider.follow(this, bWidth - 18 - slider.barWidth - (slider.endText.visible ? slider.endText.width : 0), 5);
|
||||
} else {
|
||||
slider.follow(this, 20, 5 + label.frameHeight);
|
||||
}
|
||||
}
|
||||
super.draw();
|
||||
}
|
||||
|
||||
public override function onHovered() {
|
||||
super.onHovered();
|
||||
|
||||
parent.lastHoveredOptionIndex = parent.contextMenuOptions.indexOf(this);
|
||||
|
||||
switch(optionType) {
|
||||
case SUBMENU:
|
||||
parent.openChildContextMenu(this);
|
||||
case SLIDER:
|
||||
|
||||
default:
|
||||
if (FlxG.mouse.justReleased)
|
||||
parent.select(option);
|
||||
}
|
||||
}
|
||||
|
||||
public function updateIcon() {
|
||||
var currentIcon = option.icon != null ? option.icon : 0;
|
||||
|
||||
if (icon == null && currentIcon > 0) {
|
||||
members.push(icon = new UIContextMenuOptionIcon(option));
|
||||
}
|
||||
if (icon != null) {
|
||||
icon.updateIconState(currentIcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class UIContextMenuOptionIcon extends UISprite {
|
||||
private var option:UIContextMenuOption;
|
||||
private var _lastState:Int = 0;
|
||||
override public function new(option:UIContextMenuOption) {
|
||||
super();
|
||||
this.option = option;
|
||||
loadGraphic(Paths.image('editors/ui/context-icons'), true, 20, 20);
|
||||
selectable = option.onIconClick != null;
|
||||
cursor = option.onIconClick != null ? CLICK : ARROW;
|
||||
}
|
||||
|
||||
public function updateIconState(state:Int) {
|
||||
if (_lastState == state) return;
|
||||
_lastState = state;
|
||||
|
||||
visible = state > 0;
|
||||
if (state > 0) {
|
||||
animation.add('icon', [state-1], 0, true);
|
||||
animation.play('icon');
|
||||
}
|
||||
}
|
||||
|
||||
public override function onHovered() {
|
||||
super.onHovered();
|
||||
|
||||
if (FlxG.mouse.justReleased && option.onIconClick != null) {
|
||||
option.onIconClick(option);
|
||||
}
|
||||
if (FlxG.mouse.justReleased)
|
||||
parent.select(option);
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ class UIDropDown extends UISliceSprite {
|
||||
}
|
||||
|
||||
public function openContextMenu() {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_DROPDOWNAPPEAR_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_DROPDOWNAPPEAR_SOUND));
|
||||
var screenPos = getScreenPosition(null, __lastDrawCameras[0] == null ? FlxG.camera : __lastDrawCameras[0]);
|
||||
curMenu = UIState.state.openContextMenu([
|
||||
for(k=>o in items) {
|
||||
|
||||
@@ -106,7 +106,7 @@ class UIState extends MusicBeatState {
|
||||
}
|
||||
|
||||
if (FlxG.mouse.justPressed) {
|
||||
playEditorSound(Flags.DEFAULT_EDITOR_CLICK_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_CLICK_SOUND));
|
||||
}
|
||||
|
||||
if (FlxG.mouse.justReleased)
|
||||
@@ -147,7 +147,7 @@ class UIState extends MusicBeatState {
|
||||
}
|
||||
|
||||
public function closeCurrentContextMenu() {
|
||||
playEditorSound(Flags.DEFAULT_EDITOR_WINDOWCLOSE_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_WINDOWCLOSE_SOUND));
|
||||
if(curContextMenu != null) {
|
||||
curContextMenu.close();
|
||||
curContextMenu = null;
|
||||
@@ -155,7 +155,7 @@ class UIState extends MusicBeatState {
|
||||
}
|
||||
|
||||
public function openContextMenu(options:Array<UIContextMenuOption>, ?callback:UIContextMenuCallback, ?x:Float, ?y:Float, ?w:Int) {
|
||||
playEditorSound(Flags.DEFAULT_EDITOR_WINDOWAPPEAR_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_WINDOWAPPEAR_SOUND));
|
||||
var state = FlxG.state;
|
||||
while(state.subState != null && !(state._requestSubStateReset && state._requestedSubState == null))
|
||||
state = state.subState;
|
||||
@@ -191,9 +191,4 @@ class UIState extends MusicBeatState {
|
||||
resolutionAware = true;
|
||||
FlxG.scaleMode = uiScaleMode;
|
||||
}
|
||||
|
||||
public static function playEditorSound(path:String) {
|
||||
if (!Options.editorSFX) return;
|
||||
FlxG.sound.play(Paths.sound(path));
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ class UISubstateWindow extends MusicBeatSubstate {
|
||||
}
|
||||
|
||||
public override function destroy() {
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_WINDOWCLOSE_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_WINDOWCLOSE_SOUND));
|
||||
super.destroy();
|
||||
for(e in camShaders)
|
||||
e.removeShader(blurShader);
|
||||
|
||||
@@ -60,7 +60,7 @@ class UITextBox extends UISliceSprite implements IUIFocusable {
|
||||
|
||||
var selected = selectable && focused;
|
||||
if (autoAlpha) {
|
||||
if (selectable) {
|
||||
if(selectable) {
|
||||
alpha = label.alpha = 1;
|
||||
} else {
|
||||
alpha = label.alpha = 0.4;
|
||||
@@ -68,19 +68,19 @@ class UITextBox extends UISliceSprite implements IUIFocusable {
|
||||
}
|
||||
|
||||
var off = multiline ? 4 : ((bHeight - label.height) / 2);
|
||||
label.follow(this, label.autoSize ? (bWidth - label.textField.width) / 2 : 4, off);
|
||||
label.follow(this, label.autoSize ? (bWidth-label.textField.width)/2 : 4, off);
|
||||
framesOffset = (selected ? 18 : (hovered ? 9 : 0));
|
||||
@:privateAccess {
|
||||
if (selected) {
|
||||
__wasFocused = true;
|
||||
caretSpr.alpha = (FlxG.game.ticks % 666) >= 333 ? 1 : 0;
|
||||
|
||||
var curPos = switch (position) {
|
||||
var curPos = switch(position) {
|
||||
case 0:
|
||||
FlxPoint.get(0, 0);
|
||||
default:
|
||||
if (position >= label.text.length) {
|
||||
label.textField.__getCharBoundaries(label.text.length - 1, cacheRect);
|
||||
label.textField.__getCharBoundaries(label.text.length-1, cacheRect);
|
||||
FlxPoint.get(cacheRect.x + cacheRect.width, cacheRect.y);
|
||||
} else {
|
||||
label.textField.__getCharBoundaries(position, cacheRect);
|
||||
@@ -100,160 +100,60 @@ class UITextBox extends UISliceSprite implements IUIFocusable {
|
||||
}
|
||||
}
|
||||
|
||||
private static var seperators:Array<String> = [
|
||||
" ", "\n", "\t", "\r", "-", "_", "=", "+", "/", "\\", "|", ",", ".", ";", ":", "!", "?", "@", "#", "$", "%", "^", "&", "*", "(", ")", "[", "]", "{",
|
||||
"}",
|
||||
];
|
||||
|
||||
public inline static function isSeperator(char:String):Bool
|
||||
return seperators.contains(char);
|
||||
|
||||
public inline static function findWholeWord(text:String, pos:Int, ?isDelete:Bool = false):Null<Array<Int>> {
|
||||
if (text.length == 0)
|
||||
return null;
|
||||
|
||||
var start = pos;
|
||||
var end = pos;
|
||||
|
||||
while (!isDelete && start > 0 && !isSeperator(text.charAt(start - 1)))
|
||||
start--;
|
||||
|
||||
while (end < text.length && !isSeperator(text.charAt(end)))
|
||||
end++;
|
||||
|
||||
if (end == pos && isSeperator(text.charAt(end - 1)))
|
||||
start--;
|
||||
|
||||
return [start, end];
|
||||
}
|
||||
|
||||
public function onKeyDown(e:KeyCode, modifier:KeyModifier) {
|
||||
switch (e) {
|
||||
switch(e) {
|
||||
case RETURN:
|
||||
focused = false;
|
||||
if (onChange != null)
|
||||
onChange(label.text);
|
||||
if (onChange != null) onChange(label.text);
|
||||
case LEFT:
|
||||
if (modifier.ctrlKey) {
|
||||
if (position == 0)
|
||||
return;
|
||||
|
||||
var wordBounds = findWholeWord(label.text, position);
|
||||
if (wordBounds != null) {
|
||||
position = position == wordBounds[0] ? wordBounds[0] - 1 : wordBounds[0];
|
||||
} else {
|
||||
position = 0;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
changeSelection(-1);
|
||||
case RIGHT:
|
||||
if (modifier.ctrlKey) {
|
||||
if (position == label.text.length)
|
||||
return;
|
||||
|
||||
var wordBounds = findWholeWord(label.text, position);
|
||||
if (wordBounds != null) {
|
||||
position = position == wordBounds[1] ? wordBounds[1] + 1 : wordBounds[1];
|
||||
} else {
|
||||
position = label.text.length;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
changeSelection(1);
|
||||
case BACKSPACE:
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_TEXTREMOVE_SOUND);
|
||||
|
||||
if (modifier.ctrlKey) {
|
||||
var wordBounds = findWholeWord(label.text, position);
|
||||
if (wordBounds != null) {
|
||||
label.text = label.text.substr(0, wordBounds[0]) + label.text.substr(wordBounds[1]);
|
||||
position = wordBounds[0];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_TEXTREMOVE_SOUND));
|
||||
if (position > 0) {
|
||||
label.text = label.text.substr(0, position - 1) + label.text.substr(position);
|
||||
label.text = label.text.substr(0, position-1) + label.text.substr(position);
|
||||
changeSelection(-1);
|
||||
}
|
||||
case DELETE:
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_TEXTREMOVE_SOUND);
|
||||
|
||||
if (modifier.ctrlKey) {
|
||||
var wordBounds = findWholeWord(label.text, position, true);
|
||||
if (wordBounds != null) {
|
||||
label.text = label.text.substr(0, wordBounds[0]) + label.text.substr(wordBounds[1]);
|
||||
position = wordBounds[0];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (position < label.text.length) {
|
||||
label.text = label.text.substr(0, position) + label.text.substr(position + 1);
|
||||
}
|
||||
case HOME:
|
||||
position = 0;
|
||||
case END:
|
||||
position = label.text.length;
|
||||
case V:
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_PASTE_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_TEXTTYPE_SOUND));
|
||||
// Hey lj here, fixed copying because before we checked if the modifier was left or right ctrl
|
||||
// but somehow it gave a int outside of the KeyModifier's range :sob:
|
||||
// apparently there is a boolean that just checks for you. yw :D
|
||||
|
||||
// if we are not holding ctrl, ignore
|
||||
if (!modifier.ctrlKey)
|
||||
return;
|
||||
if (!modifier.ctrlKey) return;
|
||||
// we pasting
|
||||
var data:String = Clipboard.generalClipboard.getData(TEXT_FORMAT);
|
||||
if (data != null)
|
||||
onTextInput(data);
|
||||
if (data != null) onTextInput(data);
|
||||
case C:
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_COPY_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_TEXTTYPE_SOUND));
|
||||
// if we are not holding ctrl, ignore
|
||||
if (!modifier.ctrlKey)
|
||||
return;
|
||||
if (!modifier.ctrlKey) return;
|
||||
|
||||
// copying
|
||||
Clipboard.generalClipboard.setData(TEXT_FORMAT, label.text);
|
||||
case X:
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_CUT_SOUND);
|
||||
|
||||
// if we are not holding ctrl, ignore
|
||||
if (!modifier.ctrlKey)
|
||||
return;
|
||||
|
||||
// cutting
|
||||
Clipboard.generalClipboard.setData(TEXT_FORMAT, label.text);
|
||||
position = 0;
|
||||
label.text = "";
|
||||
default:
|
||||
if (modifier.ctrlKey || modifier.altKey || modifier.shiftKey)
|
||||
return;
|
||||
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_TEXTTYPE_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_TEXTTYPE_SOUND));
|
||||
}
|
||||
}
|
||||
|
||||
public function changeSelection(change:Int) {
|
||||
position = Std.int(FlxMath.bound(position + change, 0, label.text.length));
|
||||
position = FlxMath.wrap(position + change, 0, label.text.length);
|
||||
}
|
||||
|
||||
public function onKeyUp(e:KeyCode, modifier:KeyModifier) {}
|
||||
|
||||
public function onTextInput(text:String):Void {
|
||||
label.text = label.text.substr(0, position) + text + label.text.substr(position);
|
||||
position += text.length;
|
||||
}
|
||||
|
||||
// untested, but this should be a fix for if the text wont type
|
||||
public function onTextEdit(text:String, start:Int, end:Int):Void {
|
||||
label.text = label.text.substr(0, position) + text + label.text.substr(position);
|
||||
position += text.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ class UIWindow extends UISliceSprite {
|
||||
|
||||
content = new FlxTypedGroup<FlxBasic>();
|
||||
members.push(content);
|
||||
UIState.playEditorSound(Flags.DEFAULT_EDITOR_WINDOWAPPEAR_SOUND);
|
||||
FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_WINDOWAPPEAR_SOUND));
|
||||
}
|
||||
|
||||
public override function update(elapsed:Float) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package funkin.game;
|
||||
|
||||
import sys.FileSystem;
|
||||
import flixel.util.FlxSpriteUtil;
|
||||
import openfl.display.Graphics;
|
||||
import flixel.util.typeLimit.OneOfTwo;
|
||||
@@ -90,6 +89,8 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
|
||||
scripts.call("create");
|
||||
buildCharacter(xml);
|
||||
scripts.call("postCreate");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@:noCompletion var __swappedLeftRightAnims:Bool = false;
|
||||
@@ -158,14 +159,14 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
|
||||
if (event.cancelled) return;
|
||||
|
||||
if (isDanceLeftDanceRight)
|
||||
playAnim(((danced = !danced) ? 'danceLeft' : 'danceRight') + idleSuffix, DANCE);
|
||||
playAnim(((danced = !danced) ? 'danceLeft' : 'danceRight') + idleSuffix, false, DANCE);
|
||||
else
|
||||
playAnim('idle' + idleSuffix, DANCE);
|
||||
playAnim('idle' + idleSuffix, false, DANCE);
|
||||
}
|
||||
|
||||
public function tryDance() {
|
||||
var event = new CancellableEvent();
|
||||
scripts.call("onTryDance", [event]);
|
||||
script.call("onTryDance", [event]);
|
||||
if (event.cancelled)
|
||||
return;
|
||||
|
||||
@@ -197,7 +198,7 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
|
||||
}
|
||||
|
||||
public override function measureHit(curMeasure:Int)
|
||||
scripts.call("measureHit", [curMeasure]);
|
||||
script.call("measureHit", [curMeasure]);
|
||||
|
||||
public override function stepHit(curStep:Int)
|
||||
scripts.call("stepHit", [curStep]);
|
||||
@@ -254,13 +255,13 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
|
||||
public var ghostDraw:Bool = false;
|
||||
public override function draw() {
|
||||
var e = EventManager.get(DrawEvent).recycle();
|
||||
scripts.call("draw", [e]);
|
||||
script.call("draw", [e]);
|
||||
|
||||
preDraw();
|
||||
super.draw();
|
||||
postDraw();
|
||||
|
||||
scripts.call("postDraw", [e]);
|
||||
script.call("postDraw", [e]);
|
||||
}
|
||||
|
||||
public var singAnims = ["singLEFT", "singDOWN", "singUP", "singRIGHT"];
|
||||
@@ -273,7 +274,7 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
|
||||
public function playSingAnim(direction:Int, suffix:String = "", Context:PlayAnimContext = SING, ?Force:Null<Bool> = null, Reversed:Bool = false, Frame:Int = 0)
|
||||
{
|
||||
var event = EventManager.get(DirectionAnimEvent).recycle(getSingAnim(direction, suffix), direction, suffix, Context, Reversed, Frame, Force);
|
||||
scripts.call("onPlaySingAnim", [event]);
|
||||
script.call("onPlaySingAnim", [event]);
|
||||
if (event.cancelled) return;
|
||||
|
||||
playSingAnimUnsafe(event.direction, hasAnimation(event.animName) ? event.suffix : "", event.context, event.force, event.reversed, event.frame);
|
||||
@@ -281,7 +282,7 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
|
||||
|
||||
public function playSingAnimUnsafe(direction:Int, suffix:String = "", Context:PlayAnimContext = SING, Force:Bool = true, Reversed:Bool = false, Frame:Int = 0) {
|
||||
var event = EventManager.get(DirectionAnimEvent).recycle(getSingAnim(direction, suffix), direction, suffix, Context, Reversed, Frame, Force);
|
||||
scripts.call("playSingAnimUnsafe", [event]);
|
||||
script.call("playSingAnimUnsafe", [event]);
|
||||
if (event.cancelled) return;
|
||||
|
||||
playAnim(event.animName, event.force, event.context, event.reversed, event.frame);
|
||||
|
||||
+43
-79
@@ -1,7 +1,6 @@
|
||||
package funkin.game;
|
||||
|
||||
import flixel.math.FlxPoint;
|
||||
import flixel.math.FlxAngle;
|
||||
import flixel.math.FlxRect;
|
||||
import funkin.backend.chart.ChartData;
|
||||
import funkin.backend.scripting.events.note.NoteCreationEvent;
|
||||
@@ -126,7 +125,8 @@ class Note extends FlxSprite
|
||||
|
||||
static var DEFAULT_FIELDS:Array<String> = ["time", "id", "type", "sLen"];
|
||||
|
||||
public function new(strumLine:StrumLine, noteData:ChartNote, sustain:Bool = false, sustainLength:Float = 0, sustainOffset:Float = 0, ?prev:Note) {
|
||||
public function new(strumLine:StrumLine, noteData:ChartNote, sustain:Bool = false, sustainLength:Float = 0, sustainOffset:Float = 0, ?prev:Note)
|
||||
{
|
||||
super();
|
||||
|
||||
moves = false;
|
||||
@@ -240,83 +240,57 @@ class Note extends FlxSprite
|
||||
*/
|
||||
public var strumRelativePos:Bool = true;
|
||||
|
||||
@:dox(hide) static var __lastAngle:Float = Math.NaN;
|
||||
@:dox(hide) static var __lastAngleSin:Float = 0;
|
||||
@:dox(hide) static var __lastAngleCos:Float = 0;
|
||||
@:dox(hide) static var __lastStrumW:Float = Math.NaN;
|
||||
@:dox(hide) static var __lastStrumH:Float = Math.NaN;
|
||||
@:dox(hide) static var __lastStrumHalfW:Float = 0;
|
||||
@:dox(hide) static var __lastStrumHalfH:Float = 0;
|
||||
override function drawComplex(camera:FlxCamera) {
|
||||
var downscrollCam = (camera is HudCamera ? ({var _:HudCamera=cast camera;_;}).downscroll : false);
|
||||
if (updateFlipY) flipY = (isSustainNote && flipSustain) && (downscrollCam != (__strum != null && __strum.getScrollSpeed(this) < 0));
|
||||
if (downscrollCam) {
|
||||
frameOffset.y += __notePosFrameOffset.y * 2;
|
||||
super.drawComplex(camera);
|
||||
frameOffset.y -= __notePosFrameOffset.y * 2;
|
||||
} else
|
||||
super.drawComplex(camera);
|
||||
}
|
||||
|
||||
static var __notePosFrameOffset:FlxPoint = new FlxPoint();
|
||||
static var __posPoint:FlxPoint = new FlxPoint();
|
||||
|
||||
override function draw() {
|
||||
@:privateAccess var oldDefaultCameras = FlxCamera._defaultCameras;
|
||||
@:privateAccess if (__strumCameras != null) FlxCamera._defaultCameras = __strumCameras;
|
||||
|
||||
var negativeScroll = isSustainNote && strumRelativePos && lastScrollSpeed < 0;
|
||||
if (negativeScroll) y -= height;
|
||||
var negativeScroll = isSustainNote && nextSustain != null && lastScrollSpeed < 0;
|
||||
if (negativeScroll) offset.y *= -1;
|
||||
|
||||
if (__strum != null && strumRelativePos) {
|
||||
final originalX = x;
|
||||
final originalY = y;
|
||||
var pos = __posPoint.set(x, y);
|
||||
|
||||
if (__noteAngle != __lastAngle) {
|
||||
__lastAngle = __noteAngle;
|
||||
final result = FlxMath.fastSinCos((__noteAngle + 90) * FlxAngle.TO_RAD);
|
||||
__lastAngleSin = result.sin;
|
||||
__lastAngleCos = result.cos;
|
||||
}
|
||||
setPosition(__strum.x, __strum.y);
|
||||
|
||||
if (__strum.width != __lastStrumW || __strum.height != __lastStrumH) {
|
||||
__lastStrumW = __strum.width;
|
||||
__lastStrumH = __strum.height;
|
||||
__lastStrumHalfW = __strum.width * 0.5;
|
||||
__lastStrumHalfH = __strum.height * 0.5;
|
||||
}
|
||||
__notePosFrameOffset.set(pos.x / scale.x, pos.y / scale.y);
|
||||
|
||||
frameOffset.x -= __notePosFrameOffset.x;
|
||||
frameOffset.y -= __notePosFrameOffset.y;
|
||||
|
||||
this.frameOffsetAngle = __noteAngle;
|
||||
|
||||
x = -origin.x + offset.x + (originalY * __lastAngleCos) + __strum.x + __lastStrumHalfW;
|
||||
y = -origin.y + offset.y + (originalY * __lastAngleSin) + __strum.y + __lastStrumHalfH;
|
||||
super.draw();
|
||||
x = originalX;
|
||||
y = originalY;
|
||||
|
||||
this.frameOffsetAngle = 0;
|
||||
|
||||
frameOffset.x += __notePosFrameOffset.x;
|
||||
frameOffset.y += __notePosFrameOffset.y;
|
||||
|
||||
setPosition(pos.x, pos.y);
|
||||
//pos.put();
|
||||
} else {
|
||||
__notePosFrameOffset.set(0, 0);
|
||||
super.draw();
|
||||
}
|
||||
if (negativeScroll) y += height;
|
||||
|
||||
if (negativeScroll) offset.y *= -1;
|
||||
@:privateAccess FlxCamera._defaultCameras = oldDefaultCameras;
|
||||
}
|
||||
|
||||
var __lastDownscrollCam:Bool = false;
|
||||
var __lastX:Float = 0;
|
||||
|
||||
@:noCompletion @:dox(hide) override function isOnScreen(?camera:FlxCamera):Bool {
|
||||
var downscrollCam = (Std.isOfType(camera, HudCamera) ? cast(camera, HudCamera).downscroll : false);
|
||||
|
||||
if (downscrollCam == __lastDownscrollCam)
|
||||
return super.isOnScreen(camera);
|
||||
else
|
||||
__lastX = x;
|
||||
|
||||
if (updateFlipY) flipY = (isSustainNote && flipSustain) && (downscrollCam != (__strum != null && __strum.getScrollSpeed(this) < 0));
|
||||
if (downscrollCam && __strum != null) {
|
||||
x = -x + 2 * (__strum.x - origin.x + offset.x) + __strum.width;
|
||||
}
|
||||
final isOnScreen = super.isOnScreen(camera);
|
||||
return isOnScreen;
|
||||
}
|
||||
|
||||
override function drawComplex(camera:FlxCamera):Void {
|
||||
super.drawComplex(camera);
|
||||
|
||||
if (__lastDownscrollCam) {
|
||||
__lastDownscrollCam = false;
|
||||
x = __lastX;
|
||||
}
|
||||
}
|
||||
|
||||
public function isOnScreenOriginal(?camera:FlxCamera):Bool {
|
||||
return super.isOnScreen(camera);
|
||||
}
|
||||
|
||||
// The * 0.5 is so that it's easier to hit them too late, instead of too early
|
||||
public var earlyPressWindow:Float = 0.5;
|
||||
public var latePressWindow:Float = 1;
|
||||
@@ -338,27 +312,17 @@ class Note extends FlxSprite
|
||||
|
||||
public function updateSustainClip() if (wasGoodHit && !noSustainClip) {
|
||||
var t = CoolUtil.bound((Conductor.songPosition - strumTime) / height * 0.45 * lastScrollSpeed, 0, 1);
|
||||
@:bypassAccessor {
|
||||
if (clipRect == null) clipRect = FlxRect.get();
|
||||
clipRect.set(0, frameHeight * t, frameWidth, frameHeight * (1 - t));
|
||||
}
|
||||
@:privateAccess {
|
||||
if (frame != null && _frame != null)
|
||||
_frame = frame.clipTo(clipRect, _frame);
|
||||
}
|
||||
var rect = clipRect == null ? FlxRect.get() : clipRect;
|
||||
clipRect = rect.set(0, frameHeight * t, frameWidth, frameHeight * (1 - t));
|
||||
}
|
||||
|
||||
@:noCompletion
|
||||
override function set_clipRect(rect:FlxRect):FlxRect {
|
||||
@:bypassAccessor clipRect = rect;
|
||||
override function set_clipRect(rect:FlxRect):FlxRect
|
||||
{
|
||||
clipRect = rect;
|
||||
|
||||
@:privateAccess if (frame != null) {
|
||||
if (rect != null && _frame != null)
|
||||
_frame = frame.clipTo(rect, _frame);
|
||||
else if (_frame != null)
|
||||
_frame = frame.copyTo(_frame);
|
||||
dirty = true;
|
||||
}
|
||||
if (frames != null)
|
||||
frame = frames.frames[animation.frameIndex];
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
@@ -623,18 +623,6 @@ class PlayState extends MusicBeatState
|
||||
curRating = event.rating;
|
||||
}
|
||||
|
||||
private function onRatingChange(rating:Rating) {
|
||||
if (!hits.exists(rating.name))
|
||||
hits.set(rating.name, 0);
|
||||
|
||||
if (Options.ghostTapping) {
|
||||
comboBreaks = false;
|
||||
for (rating in ratingManager.ratingData)
|
||||
comboBreaks = comboBreaks || rating.breaksCombo;
|
||||
} else
|
||||
comboBreaks = true;
|
||||
}
|
||||
|
||||
private inline function set_health(v:Float)
|
||||
return health = FlxMath.bound(v, 0, maxHealth);
|
||||
private inline function set_maxHealth(v:Float) {
|
||||
@@ -655,7 +643,7 @@ class PlayState extends MusicBeatState
|
||||
public inline function callOnCharacters(func:String, ?parameters:Array<Dynamic>) {
|
||||
if(strumLines != null) strumLines.forEachAlive(function (strLine:StrumLine) {
|
||||
if (strLine.characters != null) for (character in strLine.characters)
|
||||
if (character != null) character.scripts.call(func, parameters);
|
||||
if (character != null) character.script.call(func, parameters);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -702,14 +690,6 @@ class PlayState extends MusicBeatState
|
||||
detailsText = isStoryMode ? ("Story Mode: " + storyWeek.name) : "Freeplay";
|
||||
|
||||
for (rating in [for (i in ratingManager.ratingData) i.name]) hits.set(rating, 0); // Ensure all keys exist as to prevent null errors.
|
||||
if (Options.ghostTapping) {
|
||||
comboBreaks = false;
|
||||
for (rating in ratingManager.ratingData)
|
||||
comboBreaks = comboBreaks || rating.breaksCombo;
|
||||
} else
|
||||
comboBreaks = true;
|
||||
ratingManager.onRatingAdded.add(onRatingChange);
|
||||
ratingManager.onRatingRemoved.add(onRatingChange);
|
||||
|
||||
// Checks if cutscene files exists
|
||||
var cutscenePath = Paths.script('songs/${SONG.meta.name}/cutscene');
|
||||
@@ -1687,7 +1667,7 @@ class PlayState extends MusicBeatState
|
||||
if (strLine.characters != null) // Alt anim Idle
|
||||
for (character in strLine.characters) {
|
||||
if (character == null) continue;
|
||||
character.idleSuffix = event.params[1] ? strLine.defaultAnimSuffix : "";
|
||||
character.idleSuffix = event.params[1] ? "-alt" : "";
|
||||
}
|
||||
}
|
||||
case "Play Animation":
|
||||
@@ -1696,8 +1676,6 @@ class PlayState extends MusicBeatState
|
||||
if (char != null && char.hasAnim(event.params[1])) char.playAnim(event.params[1], event.params[2], event.params[3] == "NONE" ? null : event.params[3]);
|
||||
case "Unknown": // nothing
|
||||
}
|
||||
|
||||
gameAndCharsEvent("onPostEvent", e);
|
||||
}
|
||||
|
||||
@:dox(hide)
|
||||
@@ -1966,9 +1944,9 @@ class PlayState extends MusicBeatState
|
||||
|
||||
var event:NoteHitEvent;
|
||||
if (strumLine != null && !strumLine.cpu)
|
||||
event = EventManager.get(NoteHitEvent).recycle(rating.breaksCombo, !note.isSustainNote, !note.isSustainNote, null, defaultDisplayRating, defaultDisplayCombo, note, strumLine.characters, true, note.noteType, note.animSuffix.getDefault(note.strumID < strumLine.members.length ? strumLine.members[note.strumID].animSuffix : strumLine.animSuffix), "game/score/", "", note.strumID, rating.score, note.isSustainNote ? null : rating.accuracy, rating.health, rating.name, Options.splashesEnabled && !note.isSustainNote && rating.splash, 0.5, true, 0.7, true, true, iconP1);
|
||||
event = EventManager.get(NoteHitEvent).recycle(false, !note.isSustainNote, !note.isSustainNote, null, defaultDisplayRating, defaultDisplayCombo, note, strumLine.characters, true, note.noteType, note.animSuffix.getDefault(note.strumID < strumLine.members.length ? strumLine.members[note.strumID].animSuffix : strumLine.animSuffix), "game/score/", "", note.strumID, rating.score, note.isSustainNote ? null : rating.accuracy, 0.023, rating.name, Options.splashesEnabled && !note.isSustainNote && rating.splash, 0.5, true, 0.7, true, true, iconP1);
|
||||
else
|
||||
event = EventManager.get(NoteHitEvent).recycle(rating.breaksCombo, false, false, null, defaultDisplayRating, defaultDisplayCombo, note, strumLine.characters, false, note.noteType, note.animSuffix.getDefault(note.strumID < strumLine.members.length ? strumLine.members[note.strumID].animSuffix : strumLine.animSuffix), "game/score/", "", note.strumID, 0, null, 0, rating.name, false, 0.5, true, 0.7, true, true, iconP2);
|
||||
event = EventManager.get(NoteHitEvent).recycle(false, false, false, null, defaultDisplayRating, defaultDisplayCombo, note, strumLine.characters, false, note.noteType, note.animSuffix.getDefault(note.strumID < strumLine.members.length ? strumLine.members[note.strumID].animSuffix : strumLine.animSuffix), "game/score/", "", note.strumID, 0, null, 0, rating.name, false, 0.5, true, 0.7, true, true, iconP2);
|
||||
event.deleteNote = !note.isSustainNote; // work around, to allow sustain notes to be deleted
|
||||
event = scripts.event(strumLine != null && !strumLine.cpu ? "onPlayerHit" : "onDadHit", event);
|
||||
strumLine.onHit.dispatch(event);
|
||||
@@ -1984,11 +1962,7 @@ class PlayState extends MusicBeatState
|
||||
totalAccuracyAmount += event.accuracy;
|
||||
updateRating();
|
||||
}
|
||||
if (event.misses) {
|
||||
combo = 0;
|
||||
misses++;
|
||||
} else if (event.countAsCombo)
|
||||
combo++;
|
||||
if (event.countAsCombo) combo++;
|
||||
|
||||
if (event.showRating || (event.showRating == null && event.player))
|
||||
{
|
||||
|
||||
+34
-71
@@ -1,8 +1,6 @@
|
||||
package funkin.game;
|
||||
|
||||
import flixel.math.FlxPoint;
|
||||
import flixel.math.FlxAngle;
|
||||
import flixel.util.typeLimit.OneOfTwo;
|
||||
import funkin.backend.system.Conductor;
|
||||
|
||||
class Strum extends FlxSprite {
|
||||
@@ -53,27 +51,8 @@ class Strum extends FlxSprite {
|
||||
public var updateNotesPosY:Bool = true;
|
||||
public var extraCopyFields(default, set):Array<String> = [];
|
||||
|
||||
@:noCompletion public var __cachedCopyFields:Array<Array<OneOfTwo<String, Int>>> = null;
|
||||
|
||||
private function set_extraCopyFields(val:Array<String>) {
|
||||
extraCopyFields = val == null ? [] : val;
|
||||
__cachedCopyFields = null;
|
||||
return extraCopyFields;
|
||||
}
|
||||
|
||||
private inline function __initCachedCopyFields() {
|
||||
if (__cachedCopyFields != null) return;
|
||||
__cachedCopyFields = [for (field in extraCopyFields) CoolUtil.parsePropertyString(field)];
|
||||
}
|
||||
|
||||
private inline function __applyCopyFields(daNote:Note) {
|
||||
for (i in 0...extraCopyFields.length) {
|
||||
final parsed = __cachedCopyFields[i];
|
||||
final fromProp = CoolUtil.parseProperty(this, parsed);
|
||||
final toProp = CoolUtil.parseProperty(daNote, parsed);
|
||||
toProp.setValue(fromProp.getValue());
|
||||
}
|
||||
}
|
||||
private inline function set_extraCopyFields(val:Array<String>)
|
||||
return extraCopyFields = val == null ? [] : val;
|
||||
|
||||
/**
|
||||
* Whenever the strum is pressed.
|
||||
@@ -149,28 +128,13 @@ class Strum extends FlxSprite {
|
||||
}
|
||||
|
||||
public override function draw() {
|
||||
if (cameras.length == 1) {
|
||||
if (lastDrawCameras.length != 1 || lastDrawCameras[0] != cameras[0]) {
|
||||
lastDrawCameras = [cameras[0]];
|
||||
}
|
||||
} else {
|
||||
lastDrawCameras = cameras.copy();
|
||||
}
|
||||
lastDrawCameras = cameras.copy();
|
||||
super.draw();
|
||||
}
|
||||
|
||||
@:noCompletion public static inline final PIX180:Float = 565.4866776461628; // 180 * Math.PI
|
||||
@:noCompletion public static final N_WIDTHDIV2:Float = Note.swagWidth / 2; // DEPRECATED
|
||||
|
||||
static var __lastStrumW:Float = Math.NaN;
|
||||
static var __lastStrumH:Float = Math.NaN;
|
||||
static var __lastStrumHalfW:Float = 0;
|
||||
static var __lastStrumHalfH:Float = 0;
|
||||
static var __noteOffset:FlxPoint = FlxPoint.get();
|
||||
static var __lastNoteAngle:Float = Math.NaN;
|
||||
static var __lastAngleCos:Float = 0;
|
||||
static var __lastAngleSin:Float = 0;
|
||||
|
||||
/**
|
||||
* Updates the position of a note.
|
||||
* @param daNote The note
|
||||
@@ -188,10 +152,8 @@ class Strum extends FlxSprite {
|
||||
}
|
||||
|
||||
updateNotePos(daNote);
|
||||
if (extraCopyFields.length > 0) {
|
||||
__initCachedCopyFields();
|
||||
__applyCopyFields(daNote);
|
||||
}
|
||||
for (field in extraCopyFields)
|
||||
CoolUtil.cloneProperty(daNote, field, this); // TODO: make this cached to reduce the reflection calls - Neo
|
||||
}
|
||||
|
||||
private inline function updateNotePos(daNote:Note) {
|
||||
@@ -200,40 +162,41 @@ class Strum extends FlxSprite {
|
||||
|
||||
if (shouldX || shouldY) {
|
||||
if (daNote.strumRelativePos) {
|
||||
if (shouldX) daNote.x = 0;
|
||||
if (shouldX) daNote.x = (this.width - daNote.width) * 0.5;
|
||||
if (shouldY) {
|
||||
daNote.y = ((daNote.strumTime - Conductor.songPosition) * 0.45 * getScrollSpeed(daNote));
|
||||
if (daNote.isSustainNote) daNote.y += daNote.height * 0.5;
|
||||
daNote.y = (daNote.strumTime - Conductor.songPosition) * (0.45 * getScrollSpeed(daNote));
|
||||
if (daNote.isSustainNote) daNote.y += height * 0.5;
|
||||
}
|
||||
} else {
|
||||
if (width != __lastStrumW || height != __lastStrumH) {
|
||||
__lastStrumW = width;
|
||||
__lastStrumH = height;
|
||||
__lastStrumHalfW = width * 0.5;
|
||||
__lastStrumHalfH = height * 0.5;
|
||||
}
|
||||
var offset = FlxPoint.get(0, (Conductor.songPosition - daNote.strumTime) * (0.45 * getScrollSpeed(daNote)));
|
||||
var realOffset = FlxPoint.get(0, 0);
|
||||
|
||||
if (daNote.__noteAngle != __lastNoteAngle) {
|
||||
__lastNoteAngle = daNote.__noteAngle;
|
||||
final result = FlxMath.fastSinCos((__lastNoteAngle + 90) * FlxAngle.TO_RAD);
|
||||
__lastAngleCos = result.cos;
|
||||
__lastAngleSin = result.sin;
|
||||
}
|
||||
if (daNote.isSustainNote) offset.y -= height * 0.5;
|
||||
|
||||
final speed = getScrollSpeed(daNote);
|
||||
final distance = (daNote.strumTime - Conductor.songPosition) * 0.45 * speed;
|
||||
__noteOffset.set(__lastAngleCos * distance, __lastAngleSin * distance);
|
||||
__noteOffset.x += -daNote.origin.x + daNote.offset.x;
|
||||
__noteOffset.y += -daNote.origin.y + daNote.offset.y;
|
||||
if (daNote.isSustainNote) {
|
||||
final m = (daNote.height * 0.5 * (speed < 0 ? -1 : 1));
|
||||
__noteOffset.x += __lastAngleCos * m;
|
||||
__noteOffset.y += __lastAngleSin * m;
|
||||
if (Std.int(daNote.__noteAngle % 360) != 0) {
|
||||
var noteAngle = FlxMath.fastSinCos(daNote.__noteAngle / PIX180);
|
||||
var noteAngleCos = noteAngle.cos;
|
||||
var noteAngleSin = noteAngle.sin;
|
||||
|
||||
var aOffset:FlxPoint = FlxPoint.get(
|
||||
(daNote.origin.x / daNote.scale.x) - daNote.offset.x,
|
||||
(daNote.origin.y / daNote.scale.y) - daNote.offset.y
|
||||
);
|
||||
realOffset.x = -aOffset.x + (noteAngleCos * (offset.x + aOffset.x)) + (noteAngleSin * (offset.y + aOffset.y));
|
||||
realOffset.y = -aOffset.y + (noteAngleSin * (offset.x + aOffset.x)) + (noteAngleCos * (offset.y + aOffset.y));
|
||||
|
||||
aOffset.put();
|
||||
} else {
|
||||
realOffset.x = offset.x;
|
||||
realOffset.y = offset.y;
|
||||
}
|
||||
__noteOffset.x += x + __lastStrumHalfW;
|
||||
__noteOffset.y += y + __lastStrumHalfH;
|
||||
if (shouldX) daNote.x = __noteOffset.x;
|
||||
if (shouldY) daNote.y = __noteOffset.y;
|
||||
realOffset.y *= -1;
|
||||
|
||||
if (shouldX) daNote.x = x + realOffset.x;
|
||||
if (shouldY) daNote.y = y + realOffset.y;
|
||||
|
||||
offset.put();
|
||||
realOffset.put();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,10 +74,6 @@ class StrumLine extends FlxTypedGroup<Strum> {
|
||||
* Which animation suffix on characters that should be used when hitting notes.
|
||||
*/
|
||||
public var animSuffix(default, set):String = "";
|
||||
/**
|
||||
* The current animation suffix the strumline should use. Note that setting this will only take effect upon the alt. animation being reset.
|
||||
*/
|
||||
public var defaultAnimSuffix:String = Flags.DEFAULT_ALT_ANIM_SUFFIX;
|
||||
/**
|
||||
* TODO: Write documentation about this being a variable that can help when making multi key
|
||||
*/
|
||||
@@ -262,28 +258,21 @@ class StrumLine extends FlxTypedGroup<Strum> {
|
||||
}
|
||||
}
|
||||
function __inputProcessJustPressed(note:Note) {
|
||||
var strumID = note.strumID;
|
||||
if (!__justPressed[strumID] || note.isSustainNote || note.wasGoodHit || !note.canBeHit) return;
|
||||
|
||||
var cur = __notePerStrum[strumID];
|
||||
if (cur == null) {
|
||||
__notePerStrum[strumID] = note;
|
||||
return;
|
||||
if (__justPressed[note.strumID] && !note.isSustainNote && !note.wasGoodHit && note.canBeHit) {
|
||||
var cur = __notePerStrum[note.strumID];
|
||||
var songPos = __updateNote_songPos;
|
||||
|
||||
var noteDist = Math.abs(note.strumTime - songPos);
|
||||
var curDist = cur != null ? Math.abs(cur.strumTime - songPos) : 999999;
|
||||
|
||||
var notePenalty = note.avoid ? 1 : 0;
|
||||
var curPenalty = (cur != null && cur.avoid) ? 1 : 0;
|
||||
|
||||
if (cur == null
|
||||
|| notePenalty < curPenalty
|
||||
|| (notePenalty == curPenalty && noteDist < curDist))
|
||||
__notePerStrum[note.strumID] = note;
|
||||
}
|
||||
|
||||
var songPos = __updateNote_songPos;
|
||||
var noteDist = Math.abs(note.strumTime - songPos);
|
||||
|
||||
var noteShouldAvoid = note.avoid;
|
||||
var curShouldAvoid = cur.avoid;
|
||||
if (!noteShouldAvoid && curShouldAvoid) {
|
||||
__notePerStrum[strumID] = note;
|
||||
return;
|
||||
}
|
||||
|
||||
var curDist = Math.abs(cur.strumTime - songPos);
|
||||
if (noteShouldAvoid == curShouldAvoid && noteDist < curDist)
|
||||
__notePerStrum[strumID] = note;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -295,18 +284,13 @@ class StrumLine extends FlxTypedGroup<Strum> {
|
||||
|
||||
if (cpu) return;
|
||||
|
||||
final membersLength = members.length;
|
||||
|
||||
if (__pressed.length != membersLength) {
|
||||
__pressed.resize(membersLength);
|
||||
__justPressed.resize(membersLength);
|
||||
__justReleased.resize(membersLength);
|
||||
if (__pressed.length != members.length) {
|
||||
__pressed.resize(members.length);
|
||||
__justPressed.resize(members.length);
|
||||
__justReleased.resize(members.length);
|
||||
}
|
||||
|
||||
if (__notePerStrum.length != membersLength)
|
||||
__notePerStrum = cast new haxe.ds.Vector(membersLength); // [for(_ in 0...members.length) null];
|
||||
|
||||
for (i in 0...membersLength) {
|
||||
for (i in 0...members.length) {
|
||||
__pressed[i] = members[i].__getPressed(this);
|
||||
__justPressed[i] = members[i].__getJustPressed(this);
|
||||
__justReleased[i] = members[i].__getJustReleased(this);
|
||||
@@ -320,20 +304,18 @@ class StrumLine extends FlxTypedGroup<Strum> {
|
||||
__justPressed = CoolUtil.getDefault(event.justPressed, []);
|
||||
__justReleased = CoolUtil.getDefault(event.justReleased, []);
|
||||
|
||||
__notePerStrum = cast new haxe.ds.Vector(members.length); // [for(_ in 0...members.length) null];
|
||||
|
||||
if (__pressed.contains(true)) {
|
||||
if (__justPressed.contains(true)) {
|
||||
notes.forEachAlive(__inputProcessJustPressed);
|
||||
|
||||
for (k => pr in __justPressed)
|
||||
{
|
||||
var note = __notePerStrum[k];
|
||||
if (!ghostTapping) for (k => pr in __justPressed) if (pr && __notePerStrum[k] == null)
|
||||
PlayState.instance.noteMiss(this, null, k, ID); // FUCK YOU
|
||||
|
||||
if (note != null) {
|
||||
PlayState.instance.goodNoteHit(this, note);
|
||||
__notePerStrum[k] = null;
|
||||
} else if (pr && !ghostTapping)
|
||||
PlayState.instance.noteMiss(this, null, k, ID);
|
||||
}
|
||||
for (e in __notePerStrum)
|
||||
if (e != null)
|
||||
PlayState.instance.goodNoteHit(this, e);
|
||||
}
|
||||
|
||||
for (c in characters)
|
||||
@@ -451,9 +433,6 @@ class StrumLine extends FlxTypedGroup<Strum> {
|
||||
public static inline function calculateStartingXPos(hudXRatio:Float, scale:Float, spacing:Float, keyCount:Int) {
|
||||
return (FlxG.width * hudXRatio) - ((Note.swagWidth * scale * ((keyCount/2)-0.5) * spacing) + Note.swagWidth * 0.5 * scale);
|
||||
}
|
||||
public static inline function calculateStartingXPosFromInitialWidth(hudXRatio:Float, scale:Float, spacing:Float, keyCount:Int) {
|
||||
return (FlxG.initialWidth * hudXRatio) - ((Note.swagWidth * scale * ((keyCount/2)-0.5) * spacing) + Note.swagWidth * 0.5 * scale);
|
||||
}
|
||||
|
||||
/**
|
||||
* SETTERS & GETTERS
|
||||
@@ -472,11 +451,11 @@ class StrumLine extends FlxTypedGroup<Strum> {
|
||||
return animSuffix = str;
|
||||
}
|
||||
private inline function set_altAnim(b:Bool):Bool {
|
||||
animSuffix = b ? defaultAnimSuffix : "";
|
||||
animSuffix = b ? "-alt" : "";
|
||||
return b;
|
||||
}
|
||||
private inline function get_altAnim():Bool {
|
||||
return animSuffix == defaultAnimSuffix;
|
||||
return animSuffix == "-alt";
|
||||
}
|
||||
#end
|
||||
}
|
||||
@@ -103,9 +103,14 @@ class VideoCutscene extends Cutscene {
|
||||
FlxTween.tween(loadingBackdrop, {alpha: 1}, 0.5, {ease: FlxEase.sineInOut});
|
||||
|
||||
Main.execAsync(function() {
|
||||
if (video.load(localPath)) new FlxTimer().start(0.001, function(_) {
|
||||
mutex.acquire(); onReady(); mutex.release();
|
||||
});
|
||||
if (localPath.startsWith("[ZIP]")) {
|
||||
// ZIP PATH: EXPORT
|
||||
// TODO: this but better and more ram friendly
|
||||
localPath = './.temp/video-${curVideo++}.mp4';
|
||||
File.saveBytes(localPath, Assets.getBytes(path));
|
||||
}
|
||||
|
||||
if (video.load(localPath)) new FlxTimer().start(0.001, function(_) { mutex.acquire(); onReady(); mutex.release(); });
|
||||
else { mutex.acquire(); close(); mutex.release(); }
|
||||
});
|
||||
|
||||
@@ -177,7 +182,6 @@ class VideoCutscene extends Cutscene {
|
||||
}
|
||||
|
||||
public inline function onReady() {
|
||||
trace("VideoCutscene: Ready");
|
||||
FlxTween.cancelTweensOf(loadingBackdrop);
|
||||
FlxTween.tween(loadingBackdrop, {alpha: 0}, 0.7, {ease: FlxEase.sineInOut, onComplete: function(_) {
|
||||
loadingBackdrop.destroy();
|
||||
|
||||
@@ -2,7 +2,6 @@ package funkin.game.scoring;
|
||||
|
||||
import funkin.game.scoring.*;
|
||||
import funkin.game.scoring.HitWindowData.WindowPreset;
|
||||
import flixel.util.FlxSignal;
|
||||
|
||||
import haxe.ds.StringMap;
|
||||
|
||||
@@ -11,9 +10,6 @@ import haxe.ds.StringMap;
|
||||
*/
|
||||
class RatingManager
|
||||
{
|
||||
public var onRatingAdded:FlxTypedSignal<Rating->Void> = new FlxTypedSignal();
|
||||
public var onRatingRemoved:FlxTypedSignal<Rating->Void> = new FlxTypedSignal();
|
||||
|
||||
public var hitWindows:StringMap<Float>;
|
||||
public var ratingData:Array<Rating> = [];
|
||||
public var lastHitWindow:Float = -1;
|
||||
@@ -54,9 +50,9 @@ class RatingManager
|
||||
}
|
||||
|
||||
addRating({name: "sick", window: getWindow("sick"), accuracy: 1, score: 300, splash: true});
|
||||
addRating({name: "good", window: getWindow("good"), accuracy: 0.75, score: 200, health: 0.015});
|
||||
addRating({name: "bad", window: getWindow("bad"), accuracy: 0.45, score: 100, health: 0});
|
||||
addRating({name: "shit", window: getWindow("shit"), accuracy: 0.25, score: 50, health: -0.05, breaksCombo: true});
|
||||
addRating({name: "good", window: getWindow("good"), accuracy: 0.75, score: 200});
|
||||
addRating({name: "bad", window: getWindow("bad"), accuracy: 0.45, score: 100});
|
||||
addRating({name: "shit", window: getWindow("shit"), accuracy: 0.25, score: 50});
|
||||
}
|
||||
|
||||
public function addRating(data:Dynamic)
|
||||
@@ -75,9 +71,7 @@ class RatingManager
|
||||
window: window,
|
||||
accuracy: data.accuracy != null ? data.accuracy : 1,
|
||||
score: data.score != null ? data.score : 0,
|
||||
health: data.health != null ? data.health : 0.023,
|
||||
splash: data.splash == true,
|
||||
breaksCombo: data.breaksCombo == true,
|
||||
hittable: data.hittable != null ? data.hittable : true
|
||||
};
|
||||
|
||||
@@ -92,18 +86,13 @@ class RatingManager
|
||||
ratingData.push(newRating);
|
||||
|
||||
ratingData.sort((a, b) -> Reflect.compare(a.window, b.window));
|
||||
onRatingAdded.dispatch(newRating);
|
||||
}
|
||||
|
||||
public function removeRating(name:String):Void
|
||||
{
|
||||
if (name == null) return;
|
||||
name = name.toLowerCase();
|
||||
var toRemove = ratingData.filter(r -> r.name == name);
|
||||
for (rating in toRemove) {
|
||||
ratingData.remove(rating);
|
||||
onRatingRemoved.dispatch(rating);
|
||||
}
|
||||
ratingData = ratingData.filter(r -> r.name != name);
|
||||
}
|
||||
|
||||
public function getHitWindow(name:String):Float
|
||||
@@ -137,21 +126,11 @@ final class Rating
|
||||
*/
|
||||
public var score:Int = 0;
|
||||
|
||||
/**
|
||||
* Amount of health given when earning this rating.
|
||||
*/
|
||||
public var health:Float = 0.023;
|
||||
|
||||
/**
|
||||
* If this rating was hit, a note splash will appear.
|
||||
*/
|
||||
@:optional public var splash:Bool = false;
|
||||
|
||||
/**
|
||||
* Whether the rating will break your combo or not.
|
||||
*/
|
||||
@:optional public var breaksCombo:Bool = false;
|
||||
|
||||
/**
|
||||
* Whether the rating is hittable or not.
|
||||
*/
|
||||
|
||||
@@ -261,7 +261,7 @@ class FreeplayState extends MusicBeatState
|
||||
if (!disableAutoPlay && !songInstPlaying && (autoplayElapsed > timeUntilAutoplay)) {
|
||||
if (curPlayingInst != (curPlayingInst = Paths.inst(curSong.name, curDifficulties[curDifficulty], curSong.instSuffix))) {
|
||||
var streamed = false;
|
||||
/*if (Options.streamedMusic) {
|
||||
if (Options.streamedMusic) {
|
||||
var sound = Assets.getMusic(curPlayingInst, true, false);
|
||||
streamed = sound != null;
|
||||
|
||||
@@ -269,7 +269,7 @@ class FreeplayState extends MusicBeatState
|
||||
FlxG.sound.playMusic(sound, 0);
|
||||
Conductor.changeBPM(curSong.bpm, curSong.beatsPerMeasure, curSong.stepsPerBeat);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
if (!streamed) {
|
||||
var huh:Void->Void = function() {
|
||||
@@ -290,7 +290,7 @@ class FreeplayState extends MusicBeatState
|
||||
}
|
||||
}
|
||||
songInstPlaying = true;
|
||||
if (disableAsyncLoading/* && !Options.streamedMusic*/) dontPlaySongThisFrame = true;
|
||||
if (disableAsyncLoading && !Options.streamedMusic) dontPlaySongThisFrame = true;
|
||||
}
|
||||
#end
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class ModSwitchMenu extends MusicBeatSubstate {
|
||||
|
||||
alphabets = new FlxTypedGroup<Alphabet>();
|
||||
for(mod in mods) {
|
||||
var a = new Alphabet(0, 0, mod == null ? TU.translate("mods.disableMods") : Path.withoutExtension(mod), "bold");
|
||||
var a = new Alphabet(0, 0, mod == null ? TU.translate("mods.disableMods") : mod, "bold");
|
||||
if(mod == ModsFolder.currentModFolder)
|
||||
a.color = FlxColor.LIME;
|
||||
a.isMenuItem = true;
|
||||
|
||||
@@ -36,7 +36,7 @@ final class AlphabetComponent {
|
||||
public var cos:Float;
|
||||
public var scaleX:Float;
|
||||
public var scaleY:Float;
|
||||
|
||||
|
||||
public var flipX:Bool;
|
||||
public var flipY:Bool;
|
||||
|
||||
@@ -281,7 +281,7 @@ class Alphabet extends FlxSprite {
|
||||
var anim = getLetterAnim(letter, data, __component, i);
|
||||
//if (cantrace)
|
||||
//trace(anim.name + " | " + __component.anim + " | " + frames.frames[anim.frames[0]]);
|
||||
advance = (Math.isNaN(advance) && i >= data.startIndex) ? getAdvance(letter, anim, data) : advance;
|
||||
advance = (Math.isNaN(advance)) ? getAdvance(letter, anim, data) : advance;
|
||||
|
||||
if (anim == null || __renderData.alpha <= 0.0)
|
||||
continue;
|
||||
@@ -551,7 +551,7 @@ class Alphabet extends FlxSprite {
|
||||
angle: angle,
|
||||
cos: angleCos,
|
||||
sin: angleSin,
|
||||
|
||||
|
||||
flipX: node.get("flipX") == "true",
|
||||
flipY: node.get("flipY") == "true",
|
||||
|
||||
@@ -607,7 +607,7 @@ class Alphabet extends FlxSprite {
|
||||
angle: angle,
|
||||
cos: angleCos,
|
||||
sin: angleSin,
|
||||
|
||||
|
||||
flipX: xFlip,
|
||||
flipY: yFlip,
|
||||
|
||||
@@ -630,7 +630,7 @@ class Alphabet extends FlxSprite {
|
||||
angle: angle,
|
||||
cos: angleCos,
|
||||
sin: angleSin,
|
||||
|
||||
|
||||
flipX: xFlip,
|
||||
flipY: yFlip,
|
||||
|
||||
@@ -664,7 +664,7 @@ class Alphabet extends FlxSprite {
|
||||
var xScale:Float = Std.parseFloat(node.get("scaleX")).getDefaultFloat(1.0);
|
||||
var yScale:Float = Std.parseFloat(node.get("scaleY")).getDefaultFloat(1.0);
|
||||
var advance:Float = Std.parseFloat(node.get("advance"));
|
||||
|
||||
|
||||
var xFlip = node.get("flipX") == "true";
|
||||
var yFlip = node.get("flipY") == "true";
|
||||
|
||||
@@ -685,7 +685,7 @@ class Alphabet extends FlxSprite {
|
||||
angle: angle,
|
||||
cos: angleCos,
|
||||
sin: angleSin,
|
||||
|
||||
|
||||
flipX: xFlip,
|
||||
flipY: yFlip,
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ class Options
|
||||
public static var framerate:Int = 120;
|
||||
public static var gpuOnlyBitmaps:Bool = #if (mac || web) false #else true #end; // causes issues on mac and web
|
||||
public static var language = "en"; // default to english, Flags.DEFAULT_LANGUAGE should not modify this
|
||||
public static var streamedMusic:Bool = false;
|
||||
public static var streamedVocals:Bool = false;
|
||||
public static var streamedMusic:Bool = true;
|
||||
public static var streamedVocals:Bool = true;
|
||||
public static var quality:Int = 1;
|
||||
public static var allowConfigWarning:Bool = true;
|
||||
#if MODCHARTING_FEATURES
|
||||
@@ -84,7 +84,6 @@ class Options
|
||||
public static var charterMetronomeEnabled:Bool = false;
|
||||
public static var charterShowSections:Bool = true;
|
||||
public static var charterShowBeats:Bool = true;
|
||||
public static var charterShowCameraHighlights:Bool = true;
|
||||
public static var charterEnablePlaytestScripts:Bool = true;
|
||||
public static var charterRainbowWaveforms:Bool = false;
|
||||
public static var charterLowDetailWaveforms:Bool = false;
|
||||
|
||||
@@ -202,8 +202,8 @@ class OptionsMenu extends TreeMenu {
|
||||
Logs.warn("A radio option requires an \"id\" for option saving.");
|
||||
continue;
|
||||
}
|
||||
var f = Std.parseFloat(node.att.value);
|
||||
options.push(new RadioButton(screen, name, desc, node.att.id, Math.isNaN(f) ? node.att.value : f, null, FlxG.save.data, node.has.forId ? node.att.forId : null));
|
||||
var v:Dynamic = Std.parseFloat(node.att.value);
|
||||
options.push(new RadioButton(screen, name, desc, node.att.id, v != null ? v : node.att.value, null, FlxG.save.data, node.has.forId ? node.att.forId : null));
|
||||
case 'slider':
|
||||
if (!node.has.id) {
|
||||
Logs.warn("A slider option requires an \"id\" for option saving.");
|
||||
@@ -223,4 +223,4 @@ class OptionsMenu extends TreeMenu {
|
||||
|
||||
return options;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import flixel.util.FlxTimer;
|
||||
import funkin.backend.system.Conductor;
|
||||
|
||||
class GameplayOptions extends TreeMenuScreen {
|
||||
var __metronome = FlxG.sound.load(Paths.sound(Flags.DEFAULT_CHARTER_METRONOME_SOUND));
|
||||
var __metronome = FlxG.sound.load(Paths.sound('editors/charter/metronome'));
|
||||
var offsetSetting:NumOption;
|
||||
|
||||
public function new() {
|
||||
@@ -67,14 +67,7 @@ class AdvancedGameplayOptions extends TreeMenuScreen {
|
||||
public function new() {
|
||||
super('optionsMenu.advanced', 'optionsTree.gameplay.advanced-desc', 'GameplayOptions.Advanced.');
|
||||
|
||||
// Remove locked whenever this PR from FunkinCrew is merged.
|
||||
// https://github.com/FunkinCrew/lime/pull/57
|
||||
for (checkbox in [
|
||||
new Checkbox(getNameID('streamedMusic'), getDescID('streamedMusic'), 'streamedMusic'),
|
||||
new Checkbox(getNameID('streamedVocals'), getDescID('streamedVocals'), 'streamedVocals')
|
||||
]) {
|
||||
checkbox.locked = true;
|
||||
add(checkbox);
|
||||
}
|
||||
add(new Checkbox(getNameID('streamedMusic'), getDescID('streamedMusic'), 'streamedMusic'));
|
||||
add(new Checkbox(getNameID('streamedVocals'), getDescID('streamedVocals'), 'streamedVocals'));
|
||||
}
|
||||
}
|
||||
@@ -247,15 +247,14 @@ class Assets
|
||||
var sound = cache.getSound(id);
|
||||
if (isValidSound(sound)) return sound;
|
||||
}
|
||||
/*#if (lime_vorbis && lime > "7.9.0" && !macro)
|
||||
#if (lime_vorbis && lime > "7.9.0" && !macro)
|
||||
if (Options.streamedMusic) {
|
||||
var bytes = getBytes(id);
|
||||
if (bytes == null) return null;
|
||||
var path = getPath(id);
|
||||
// TODO: What if it is a WAV or non-Vorbis file?
|
||||
var vorbisFile = VorbisFile.fromBytes(bytes);
|
||||
var vorbisFile = VorbisFile.fromFile(path);
|
||||
if (vorbisFile != null) return Sound.fromAudioBuffer(AudioBuffer.fromVorbisFile(vorbisFile));
|
||||
}
|
||||
#end*/
|
||||
#end
|
||||
return if (staticFallback) getSound(id, useCache); else null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user