diff --git a/Project.xml b/Project.xml
index bd24a41e..7f7d28a8 100644
--- a/Project.xml
+++ b/Project.xml
@@ -98,11 +98,6 @@
-
-
-
-
-
@@ -133,12 +128,9 @@
-
-
-
diff --git a/assets/BASE_GAME/shared/data/2hot/2hot-easy.json b/assets/BASE_GAME/shared/data/2hot/2hot-easy.json
index b0969cbf..3c3800d2 100644
--- a/assets/BASE_GAME/shared/data/2hot/2hot-easy.json
+++ b/assets/BASE_GAME/shared/data/2hot/2hot-easy.json
@@ -1357,7 +1357,7 @@
}
],
"gfVersion": "nene",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"bpm": 182,
"needsVoices": true,
"song": "2Hot",
diff --git a/assets/BASE_GAME/shared/data/2hot/2hot-hard.json b/assets/BASE_GAME/shared/data/2hot/2hot-hard.json
index bd605b51..fdcb9a01 100644
--- a/assets/BASE_GAME/shared/data/2hot/2hot-hard.json
+++ b/assets/BASE_GAME/shared/data/2hot/2hot-hard.json
@@ -1586,7 +1586,7 @@
}
],
"gfVersion": "nene",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"bpm": 182,
"needsVoices": true,
"song": "2Hot",
diff --git a/assets/BASE_GAME/shared/data/2hot/2hot.json b/assets/BASE_GAME/shared/data/2hot/2hot.json
index 7b374c61..46fb72af 100644
--- a/assets/BASE_GAME/shared/data/2hot/2hot.json
+++ b/assets/BASE_GAME/shared/data/2hot/2hot.json
@@ -1449,7 +1449,7 @@
}
],
"gfVersion": "nene",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"bpm": 182,
"needsVoices": true,
"song": "2Hot",
diff --git a/assets/BASE_GAME/shared/data/blammed/blammed-easy.json b/assets/BASE_GAME/shared/data/blammed/blammed-easy.json
index e7ad314a..ccc04a96 100644
--- a/assets/BASE_GAME/shared/data/blammed/blammed-easy.json
+++ b/assets/BASE_GAME/shared/data/blammed/blammed-easy.json
@@ -1461,6 +1461,6 @@
"needsVoices": true,
"bpm": 165,
"speed": 1.2,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/blammed/blammed-hard.json b/assets/BASE_GAME/shared/data/blammed/blammed-hard.json
index dfa9f050..86bbf5d9 100644
--- a/assets/BASE_GAME/shared/data/blammed/blammed-hard.json
+++ b/assets/BASE_GAME/shared/data/blammed/blammed-hard.json
@@ -2436,6 +2436,6 @@
"needsVoices": true,
"bpm": 165,
"speed": 2.3,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/blammed/blammed.json b/assets/BASE_GAME/shared/data/blammed/blammed.json
index bd1313a7..9038f40b 100644
--- a/assets/BASE_GAME/shared/data/blammed/blammed.json
+++ b/assets/BASE_GAME/shared/data/blammed/blammed.json
@@ -1781,6 +1781,6 @@
"needsVoices": true,
"bpm": 165,
"speed": 1.5,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/blammed/events.json b/assets/BASE_GAME/shared/data/blammed/events.json
index 061208da..a1122039 100644
--- a/assets/BASE_GAME/shared/data/blammed/events.json
+++ b/assets/BASE_GAME/shared/data/blammed/events.json
@@ -959,6 +959,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/blazin/blazin-easy.json b/assets/BASE_GAME/shared/data/blazin/blazin-easy.json
index ca6a2867..bcef4beb 100644
--- a/assets/BASE_GAME/shared/data/blazin/blazin-easy.json
+++ b/assets/BASE_GAME/shared/data/blazin/blazin-easy.json
@@ -958,7 +958,7 @@
}
],
"gfVersion": "nene",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"bpm": 180,
"needsVoices": false,
"song": "Blazin'",
diff --git a/assets/BASE_GAME/shared/data/blazin/blazin-hard.json b/assets/BASE_GAME/shared/data/blazin/blazin-hard.json
index ffd24923..8df70aa1 100644
--- a/assets/BASE_GAME/shared/data/blazin/blazin-hard.json
+++ b/assets/BASE_GAME/shared/data/blazin/blazin-hard.json
@@ -976,7 +976,7 @@
}
],
"gfVersion": "nene",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"bpm": 180,
"needsVoices": false,
"song": "Blazin'",
diff --git a/assets/BASE_GAME/shared/data/blazin/blazin.json b/assets/BASE_GAME/shared/data/blazin/blazin.json
index 8d8ddb7a..8b78576f 100644
--- a/assets/BASE_GAME/shared/data/blazin/blazin.json
+++ b/assets/BASE_GAME/shared/data/blazin/blazin.json
@@ -962,7 +962,7 @@
}
],
"gfVersion": "nene",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"bpm": 180,
"needsVoices": false,
"song": "Blazin'",
diff --git a/assets/BASE_GAME/shared/data/bopeebo/bopeebo-easy.json b/assets/BASE_GAME/shared/data/bopeebo/bopeebo-easy.json
index f9059395..021b722c 100644
--- a/assets/BASE_GAME/shared/data/bopeebo/bopeebo-easy.json
+++ b/assets/BASE_GAME/shared/data/bopeebo/bopeebo-easy.json
@@ -805,7 +805,7 @@
"song": "Bopeebo",
"needsVoices": true,
"validScore": true,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1,
"bpm": 100
}
diff --git a/assets/BASE_GAME/shared/data/bopeebo/bopeebo-hard.json b/assets/BASE_GAME/shared/data/bopeebo/bopeebo-hard.json
index ba85c7a7..eb11c842 100644
--- a/assets/BASE_GAME/shared/data/bopeebo/bopeebo-hard.json
+++ b/assets/BASE_GAME/shared/data/bopeebo/bopeebo-hard.json
@@ -822,6 +822,6 @@
"needsVoices": true,
"bpm": 100,
"speed": 1.3,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/bopeebo/bopeebo.json b/assets/BASE_GAME/shared/data/bopeebo/bopeebo.json
index b0085344..a5709c77 100644
--- a/assets/BASE_GAME/shared/data/bopeebo/bopeebo.json
+++ b/assets/BASE_GAME/shared/data/bopeebo/bopeebo.json
@@ -845,7 +845,7 @@
"song": "Bopeebo",
"needsVoices": true,
"validScore": true,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"bpm": 100,
"speed": 1
}
diff --git a/assets/BASE_GAME/shared/data/bopeebo/events.json b/assets/BASE_GAME/shared/data/bopeebo/events.json
index f4506d94..2f3a999c 100644
--- a/assets/BASE_GAME/shared/data/bopeebo/events.json
+++ b/assets/BASE_GAME/shared/data/bopeebo/events.json
@@ -162,6 +162,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/cocoa/cocoa-easy.json b/assets/BASE_GAME/shared/data/cocoa/cocoa-easy.json
index 582154b6..fb7adf10 100644
--- a/assets/BASE_GAME/shared/data/cocoa/cocoa-easy.json
+++ b/assets/BASE_GAME/shared/data/cocoa/cocoa-easy.json
@@ -1483,7 +1483,7 @@
"song": "Cocoa",
"needsVoices": true,
"stage": "mall",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.3,
"bpm": 100
}
diff --git a/assets/BASE_GAME/shared/data/cocoa/cocoa-hard.json b/assets/BASE_GAME/shared/data/cocoa/cocoa-hard.json
index b217dd4e..ae3ce0ec 100644
--- a/assets/BASE_GAME/shared/data/cocoa/cocoa-hard.json
+++ b/assets/BASE_GAME/shared/data/cocoa/cocoa-hard.json
@@ -2542,7 +2542,7 @@
"song": "Cocoa",
"needsVoices": true,
"stage": "mall",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.5,
"bpm": 100
}
diff --git a/assets/BASE_GAME/shared/data/cocoa/cocoa.json b/assets/BASE_GAME/shared/data/cocoa/cocoa.json
index 99a4e063..8a1d7806 100644
--- a/assets/BASE_GAME/shared/data/cocoa/cocoa.json
+++ b/assets/BASE_GAME/shared/data/cocoa/cocoa.json
@@ -1863,7 +1863,7 @@
"song": "Cocoa",
"needsVoices": true,
"stage": "mall",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.3,
"bpm": 100
}
diff --git a/assets/BASE_GAME/shared/data/cocoa/events.json b/assets/BASE_GAME/shared/data/cocoa/events.json
index 2593e57c..1c66eb1a 100644
--- a/assets/BASE_GAME/shared/data/cocoa/events.json
+++ b/assets/BASE_GAME/shared/data/cocoa/events.json
@@ -52,6 +52,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/dad-battle/dad-battle-easy.json b/assets/BASE_GAME/shared/data/dad-battle/dad-battle-easy.json
index d0e62f86..6942c636 100644
--- a/assets/BASE_GAME/shared/data/dad-battle/dad-battle-easy.json
+++ b/assets/BASE_GAME/shared/data/dad-battle/dad-battle-easy.json
@@ -1491,6 +1491,6 @@
"needsVoices": true,
"bpm": 180,
"speed": 1.3,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/dad-battle/dad-battle-hard.json b/assets/BASE_GAME/shared/data/dad-battle/dad-battle-hard.json
index 950e6a6b..896fa11e 100644
--- a/assets/BASE_GAME/shared/data/dad-battle/dad-battle-hard.json
+++ b/assets/BASE_GAME/shared/data/dad-battle/dad-battle-hard.json
@@ -2006,6 +2006,6 @@
"needsVoices": true,
"bpm": 180,
"speed": 2.3,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/dad-battle/dad-battle.json b/assets/BASE_GAME/shared/data/dad-battle/dad-battle.json
index e6ba4baa..0a068a2d 100644
--- a/assets/BASE_GAME/shared/data/dad-battle/dad-battle.json
+++ b/assets/BASE_GAME/shared/data/dad-battle/dad-battle.json
@@ -1766,6 +1766,6 @@
"needsVoices": true,
"bpm": 180,
"speed": 1.5,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/dad-battle/events.json b/assets/BASE_GAME/shared/data/dad-battle/events.json
index 4360065a..15a61d64 100644
--- a/assets/BASE_GAME/shared/data/dad-battle/events.json
+++ b/assets/BASE_GAME/shared/data/dad-battle/events.json
@@ -232,6 +232,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/darnell/darnell-easy.json b/assets/BASE_GAME/shared/data/darnell/darnell-easy.json
index eb884b7c..fcf7128f 100644
--- a/assets/BASE_GAME/shared/data/darnell/darnell-easy.json
+++ b/assets/BASE_GAME/shared/data/darnell/darnell-easy.json
@@ -1090,7 +1090,7 @@
"generatedBy": "Psych Engine v1.0b - Chart Editor V-Slice Importer",
"stage": "phillyStreets",
"bpm": 155,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.8,
"artist": "Kawai Sprite"
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/darnell/darnell-hard.json b/assets/BASE_GAME/shared/data/darnell/darnell-hard.json
index 2e4aaa58..a1d06afd 100644
--- a/assets/BASE_GAME/shared/data/darnell/darnell-hard.json
+++ b/assets/BASE_GAME/shared/data/darnell/darnell-hard.json
@@ -1234,7 +1234,7 @@
"generatedBy": "Psych Engine v1.0b - Chart Editor V-Slice Importer",
"stage": "phillyStreets",
"bpm": 155,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 2.4,
"artist": "Kawai Sprite"
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/darnell/darnell.json b/assets/BASE_GAME/shared/data/darnell/darnell.json
index f4d62bdd..cdc31597 100644
--- a/assets/BASE_GAME/shared/data/darnell/darnell.json
+++ b/assets/BASE_GAME/shared/data/darnell/darnell.json
@@ -1130,7 +1130,7 @@
"generatedBy": "Psych Engine v1.0b - Chart Editor V-Slice Importer",
"stage": "phillyStreets",
"bpm": 155,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 2,
"artist": "Kawai Sprite"
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/eggnog/eggnog-easy.json b/assets/BASE_GAME/shared/data/eggnog/eggnog-easy.json
index f373f7bd..4664a2d5 100644
--- a/assets/BASE_GAME/shared/data/eggnog/eggnog-easy.json
+++ b/assets/BASE_GAME/shared/data/eggnog/eggnog-easy.json
@@ -1934,7 +1934,7 @@
"song": "Eggnog",
"needsVoices": true,
"stage": "mall",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.4,
"bpm": 150
}
diff --git a/assets/BASE_GAME/shared/data/eggnog/eggnog-hard.json b/assets/BASE_GAME/shared/data/eggnog/eggnog-hard.json
index 5c15e237..99aa7b8e 100644
--- a/assets/BASE_GAME/shared/data/eggnog/eggnog-hard.json
+++ b/assets/BASE_GAME/shared/data/eggnog/eggnog-hard.json
@@ -2669,7 +2669,7 @@
"song": "Eggnog",
"needsVoices": true,
"stage": "mall",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.9,
"bpm": 150
}
diff --git a/assets/BASE_GAME/shared/data/eggnog/eggnog.json b/assets/BASE_GAME/shared/data/eggnog/eggnog.json
index 3013d897..3f719e67 100644
--- a/assets/BASE_GAME/shared/data/eggnog/eggnog.json
+++ b/assets/BASE_GAME/shared/data/eggnog/eggnog.json
@@ -2259,7 +2259,7 @@
"song": "Eggnog",
"needsVoices": true,
"stage": "mall",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.6,
"bpm": 150
}
diff --git a/assets/BASE_GAME/shared/data/eggnog/events.json b/assets/BASE_GAME/shared/data/eggnog/events.json
index 3d772eb9..ed5a9dc5 100644
--- a/assets/BASE_GAME/shared/data/eggnog/events.json
+++ b/assets/BASE_GAME/shared/data/eggnog/events.json
@@ -232,6 +232,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/fresh/events.json b/assets/BASE_GAME/shared/data/fresh/events.json
index 0ca48f2b..6e3d4711 100644
--- a/assets/BASE_GAME/shared/data/fresh/events.json
+++ b/assets/BASE_GAME/shared/data/fresh/events.json
@@ -42,6 +42,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/fresh/fresh-easy.json b/assets/BASE_GAME/shared/data/fresh/fresh-easy.json
index b869f047..76198897 100644
--- a/assets/BASE_GAME/shared/data/fresh/fresh-easy.json
+++ b/assets/BASE_GAME/shared/data/fresh/fresh-easy.json
@@ -1250,6 +1250,6 @@
"needsVoices": true,
"bpm": 120,
"speed": 1,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/fresh/fresh-hard.json b/assets/BASE_GAME/shared/data/fresh/fresh-hard.json
index 222e7c1d..448a78bc 100644
--- a/assets/BASE_GAME/shared/data/fresh/fresh-hard.json
+++ b/assets/BASE_GAME/shared/data/fresh/fresh-hard.json
@@ -1580,6 +1580,6 @@
"needsVoices": true,
"bpm": 120,
"speed": 1.8,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/fresh/fresh.json b/assets/BASE_GAME/shared/data/fresh/fresh.json
index ed848e4b..05e3afb3 100644
--- a/assets/BASE_GAME/shared/data/fresh/fresh.json
+++ b/assets/BASE_GAME/shared/data/fresh/fresh.json
@@ -1450,6 +1450,6 @@
"needsVoices": true,
"bpm": 120,
"speed": 1.3,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/guns/guns-easy.json b/assets/BASE_GAME/shared/data/guns/guns-easy.json
index a0f0eca4..ed4ac940 100644
--- a/assets/BASE_GAME/shared/data/guns/guns-easy.json
+++ b/assets/BASE_GAME/shared/data/guns/guns-easy.json
@@ -2996,7 +2996,7 @@
"song": "Guns",
"needsVoices": true,
"stage": "tank",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.4,
"bpm": 185
}
diff --git a/assets/BASE_GAME/shared/data/guns/guns-hard.json b/assets/BASE_GAME/shared/data/guns/guns-hard.json
index 96692b9c..ebed4d55 100644
--- a/assets/BASE_GAME/shared/data/guns/guns-hard.json
+++ b/assets/BASE_GAME/shared/data/guns/guns-hard.json
@@ -5141,7 +5141,7 @@
"validScore": true,
"needsVoices": true,
"stage": "tank",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 2.5,
"bpm": 185
}
diff --git a/assets/BASE_GAME/shared/data/guns/guns.json b/assets/BASE_GAME/shared/data/guns/guns.json
index 5b59267d..b477c48f 100644
--- a/assets/BASE_GAME/shared/data/guns/guns.json
+++ b/assets/BASE_GAME/shared/data/guns/guns.json
@@ -4456,7 +4456,7 @@
"song": "Guns",
"needsVoices": true,
"stage": "tank",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 2,
"bpm": 185
}
diff --git a/assets/BASE_GAME/shared/data/high/events.json b/assets/BASE_GAME/shared/data/high/events.json
index a13994d3..c1ee2d4e 100644
--- a/assets/BASE_GAME/shared/data/high/events.json
+++ b/assets/BASE_GAME/shared/data/high/events.json
@@ -62,6 +62,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/high/high-easy.json b/assets/BASE_GAME/shared/data/high/high-easy.json
index 1338c447..0d5577b7 100644
--- a/assets/BASE_GAME/shared/data/high/high-easy.json
+++ b/assets/BASE_GAME/shared/data/high/high-easy.json
@@ -1854,7 +1854,7 @@
"song": "High",
"needsVoices": true,
"stage": "limo",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.3,
"bpm": 125
}
diff --git a/assets/BASE_GAME/shared/data/high/high-hard.json b/assets/BASE_GAME/shared/data/high/high-hard.json
index 2060f16b..f5c33355 100644
--- a/assets/BASE_GAME/shared/data/high/high-hard.json
+++ b/assets/BASE_GAME/shared/data/high/high-hard.json
@@ -2789,7 +2789,7 @@
"song": "High",
"needsVoices": true,
"stage": "limo",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 2,
"bpm": 125
}
diff --git a/assets/BASE_GAME/shared/data/high/high.json b/assets/BASE_GAME/shared/data/high/high.json
index da99eabf..6b603f07 100644
--- a/assets/BASE_GAME/shared/data/high/high.json
+++ b/assets/BASE_GAME/shared/data/high/high.json
@@ -2229,7 +2229,7 @@
"song": "High",
"needsVoices": true,
"stage": "limo",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.8,
"bpm": 125
}
diff --git a/assets/BASE_GAME/shared/data/lit-up/lit-up-easy.json b/assets/BASE_GAME/shared/data/lit-up/lit-up-easy.json
index 6383b6e5..8f7c813d 100644
--- a/assets/BASE_GAME/shared/data/lit-up/lit-up-easy.json
+++ b/assets/BASE_GAME/shared/data/lit-up/lit-up-easy.json
@@ -1143,7 +1143,7 @@
}
],
"gfVersion": "nene",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"bpm": 176,
"needsVoices": true,
"song": "Lit Up",
diff --git a/assets/BASE_GAME/shared/data/lit-up/lit-up-hard.json b/assets/BASE_GAME/shared/data/lit-up/lit-up-hard.json
index 85a78a89..93bde641 100644
--- a/assets/BASE_GAME/shared/data/lit-up/lit-up-hard.json
+++ b/assets/BASE_GAME/shared/data/lit-up/lit-up-hard.json
@@ -1314,7 +1314,7 @@
}
],
"gfVersion": "nene",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"bpm": 176,
"needsVoices": true,
"song": "Lit Up",
diff --git a/assets/BASE_GAME/shared/data/lit-up/lit-up.json b/assets/BASE_GAME/shared/data/lit-up/lit-up.json
index daa3e42e..cecffcea 100644
--- a/assets/BASE_GAME/shared/data/lit-up/lit-up.json
+++ b/assets/BASE_GAME/shared/data/lit-up/lit-up.json
@@ -1238,7 +1238,7 @@
}
],
"gfVersion": "nene",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"bpm": 176,
"needsVoices": true,
"song": "Lit Up",
diff --git a/assets/BASE_GAME/shared/data/milf/events.json b/assets/BASE_GAME/shared/data/milf/events.json
index e203e83b..9ae8e9e0 100644
--- a/assets/BASE_GAME/shared/data/milf/events.json
+++ b/assets/BASE_GAME/shared/data/milf/events.json
@@ -262,6 +262,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/milf/milf-easy.json b/assets/BASE_GAME/shared/data/milf/milf-easy.json
index a49579f7..91999894 100644
--- a/assets/BASE_GAME/shared/data/milf/milf-easy.json
+++ b/assets/BASE_GAME/shared/data/milf/milf-easy.json
@@ -2654,7 +2654,7 @@
"song": "Milf",
"needsVoices": true,
"stage": "limo",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.4,
"bpm": 180
}
diff --git a/assets/BASE_GAME/shared/data/milf/milf-hard.json b/assets/BASE_GAME/shared/data/milf/milf-hard.json
index 3f5c714f..47fa70ac 100644
--- a/assets/BASE_GAME/shared/data/milf/milf-hard.json
+++ b/assets/BASE_GAME/shared/data/milf/milf-hard.json
@@ -3939,7 +3939,7 @@
"song": "Milf",
"needsVoices": true,
"stage": "limo",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 2.6,
"bpm": 180
}
diff --git a/assets/BASE_GAME/shared/data/milf/milf.json b/assets/BASE_GAME/shared/data/milf/milf.json
index 0dec0b08..0ff811d8 100644
--- a/assets/BASE_GAME/shared/data/milf/milf.json
+++ b/assets/BASE_GAME/shared/data/milf/milf.json
@@ -3134,7 +3134,7 @@
"song": "Milf",
"needsVoices": true,
"stage": "limo",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.7,
"bpm": 180
}
diff --git a/assets/BASE_GAME/shared/data/monster/monster-easy.json b/assets/BASE_GAME/shared/data/monster/monster-easy.json
index db2e4196..c402eede 100644
--- a/assets/BASE_GAME/shared/data/monster/monster-easy.json
+++ b/assets/BASE_GAME/shared/data/monster/monster-easy.json
@@ -2250,6 +2250,6 @@
"needsVoices": true,
"bpm": 95,
"speed": 1.3,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/monster/monster-hard.json b/assets/BASE_GAME/shared/data/monster/monster-hard.json
index bfa9b178..e8df6209 100644
--- a/assets/BASE_GAME/shared/data/monster/monster-hard.json
+++ b/assets/BASE_GAME/shared/data/monster/monster-hard.json
@@ -2685,6 +2685,6 @@
"needsVoices": true,
"bpm": 95,
"speed": 1.6,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/monster/monster.json b/assets/BASE_GAME/shared/data/monster/monster.json
index fbf870ea..9b1a7103 100644
--- a/assets/BASE_GAME/shared/data/monster/monster.json
+++ b/assets/BASE_GAME/shared/data/monster/monster.json
@@ -2505,6 +2505,6 @@
"needsVoices": true,
"bpm": 95,
"speed": 1.3,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/philly-nice/events.json b/assets/BASE_GAME/shared/data/philly-nice/events.json
index 6280cda4..be79b241 100644
--- a/assets/BASE_GAME/shared/data/philly-nice/events.json
+++ b/assets/BASE_GAME/shared/data/philly-nice/events.json
@@ -82,6 +82,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/philly-nice/philly-nice-easy.json b/assets/BASE_GAME/shared/data/philly-nice/philly-nice-easy.json
index 432fd5ca..826e2544 100644
--- a/assets/BASE_GAME/shared/data/philly-nice/philly-nice-easy.json
+++ b/assets/BASE_GAME/shared/data/philly-nice/philly-nice-easy.json
@@ -1395,6 +1395,6 @@
"needsVoices": true,
"bpm": 175,
"speed": 1,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/philly-nice/philly-nice-hard.json b/assets/BASE_GAME/shared/data/philly-nice/philly-nice-hard.json
index f0450974..44178705 100644
--- a/assets/BASE_GAME/shared/data/philly-nice/philly-nice-hard.json
+++ b/assets/BASE_GAME/shared/data/philly-nice/philly-nice-hard.json
@@ -2675,6 +2675,6 @@
"needsVoices": true,
"bpm": 175,
"speed": 2,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/philly-nice/philly-nice.json b/assets/BASE_GAME/shared/data/philly-nice/philly-nice.json
index 0e7888f3..913c06f5 100644
--- a/assets/BASE_GAME/shared/data/philly-nice/philly-nice.json
+++ b/assets/BASE_GAME/shared/data/philly-nice/philly-nice.json
@@ -1975,6 +1975,6 @@
"needsVoices": true,
"bpm": 175,
"speed": 1.3,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/pico/pico-easy.json b/assets/BASE_GAME/shared/data/pico/pico-easy.json
index b141f92d..3cbf3c13 100644
--- a/assets/BASE_GAME/shared/data/pico/pico-easy.json
+++ b/assets/BASE_GAME/shared/data/pico/pico-easy.json
@@ -1158,6 +1158,6 @@
"needsVoices": true,
"bpm": 150,
"speed": 1.2,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/pico/pico-hard.json b/assets/BASE_GAME/shared/data/pico/pico-hard.json
index 4b01b18c..a22cc055 100644
--- a/assets/BASE_GAME/shared/data/pico/pico-hard.json
+++ b/assets/BASE_GAME/shared/data/pico/pico-hard.json
@@ -1943,6 +1943,6 @@
"needsVoices": true,
"bpm": 150,
"speed": 1.6,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/pico/pico.json b/assets/BASE_GAME/shared/data/pico/pico.json
index 141669a9..0133b38b 100644
--- a/assets/BASE_GAME/shared/data/pico/pico.json
+++ b/assets/BASE_GAME/shared/data/pico/pico.json
@@ -1568,6 +1568,6 @@
"needsVoices": true,
"bpm": 150,
"speed": 1.4,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/ridge/ridge.json b/assets/BASE_GAME/shared/data/ridge/ridge.json
index e8807e2e..48a12d8f 100644
--- a/assets/BASE_GAME/shared/data/ridge/ridge.json
+++ b/assets/BASE_GAME/shared/data/ridge/ridge.json
@@ -1881,7 +1881,7 @@
"song": "Ridge",
"sections": 0,
"needsVoices": true,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.3,
"bpm": 145
}
diff --git a/assets/BASE_GAME/shared/data/roses/events.json b/assets/BASE_GAME/shared/data/roses/events.json
index 0b746e61..496339fd 100644
--- a/assets/BASE_GAME/shared/data/roses/events.json
+++ b/assets/BASE_GAME/shared/data/roses/events.json
@@ -12,6 +12,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/roses/roses-easy.json b/assets/BASE_GAME/shared/data/roses/roses-easy.json
index c90637f6..a7d56586 100644
--- a/assets/BASE_GAME/shared/data/roses/roses-easy.json
+++ b/assets/BASE_GAME/shared/data/roses/roses-easy.json
@@ -1454,7 +1454,7 @@
"song": "Roses",
"needsVoices": true,
"stage": "school",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.2,
"bpm": 120
}
diff --git a/assets/BASE_GAME/shared/data/roses/roses-hard.json b/assets/BASE_GAME/shared/data/roses/roses-hard.json
index bc97b8c8..2eb3d70b 100644
--- a/assets/BASE_GAME/shared/data/roses/roses-hard.json
+++ b/assets/BASE_GAME/shared/data/roses/roses-hard.json
@@ -2614,7 +2614,7 @@
"song": "Roses",
"needsVoices": true,
"stage": "school",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.5,
"bpm": 120
}
diff --git a/assets/BASE_GAME/shared/data/roses/roses.json b/assets/BASE_GAME/shared/data/roses/roses.json
index 85b7461f..a806aeee 100644
--- a/assets/BASE_GAME/shared/data/roses/roses.json
+++ b/assets/BASE_GAME/shared/data/roses/roses.json
@@ -2044,7 +2044,7 @@
"song": "Roses",
"needsVoices": true,
"stage": "school",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.3,
"bpm": 120
}
diff --git a/assets/BASE_GAME/shared/data/satin-panties/events.json b/assets/BASE_GAME/shared/data/satin-panties/events.json
index 741303d1..fbd8995a 100644
--- a/assets/BASE_GAME/shared/data/satin-panties/events.json
+++ b/assets/BASE_GAME/shared/data/satin-panties/events.json
@@ -22,6 +22,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/satin-panties/satin-panties-easy.json b/assets/BASE_GAME/shared/data/satin-panties/satin-panties-easy.json
index f453bdf8..9ec90023 100644
--- a/assets/BASE_GAME/shared/data/satin-panties/satin-panties-easy.json
+++ b/assets/BASE_GAME/shared/data/satin-panties/satin-panties-easy.json
@@ -1816,7 +1816,7 @@
"song": "Satin Panties",
"needsVoices": true,
"stage": "limo",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.3,
"bpm": 110
}
diff --git a/assets/BASE_GAME/shared/data/satin-panties/satin-panties-hard.json b/assets/BASE_GAME/shared/data/satin-panties/satin-panties-hard.json
index 44c96e6f..36a009ce 100644
--- a/assets/BASE_GAME/shared/data/satin-panties/satin-panties-hard.json
+++ b/assets/BASE_GAME/shared/data/satin-panties/satin-panties-hard.json
@@ -2881,7 +2881,7 @@
"song": "Satin Panties",
"needsVoices": true,
"stage": "limo",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.8,
"bpm": 110
}
diff --git a/assets/BASE_GAME/shared/data/satin-panties/satin-panties.json b/assets/BASE_GAME/shared/data/satin-panties/satin-panties.json
index d8cf97e3..b496fe3d 100644
--- a/assets/BASE_GAME/shared/data/satin-panties/satin-panties.json
+++ b/assets/BASE_GAME/shared/data/satin-panties/satin-panties.json
@@ -2336,7 +2336,7 @@
"song": "Satin Panties",
"needsVoices": true,
"stage": "limo",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.6,
"bpm": 110
}
diff --git a/assets/BASE_GAME/shared/data/senpai/senpai-easy.json b/assets/BASE_GAME/shared/data/senpai/senpai-easy.json
index a975d03f..71d00766 100644
--- a/assets/BASE_GAME/shared/data/senpai/senpai-easy.json
+++ b/assets/BASE_GAME/shared/data/senpai/senpai-easy.json
@@ -1792,7 +1792,7 @@
"song": "Senpai",
"needsVoices": true,
"stage": "school",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1,
"bpm": 144
}
diff --git a/assets/BASE_GAME/shared/data/senpai/senpai-hard.json b/assets/BASE_GAME/shared/data/senpai/senpai-hard.json
index bd9fc813..6c5805a2 100644
--- a/assets/BASE_GAME/shared/data/senpai/senpai-hard.json
+++ b/assets/BASE_GAME/shared/data/senpai/senpai-hard.json
@@ -2287,7 +2287,7 @@
"song": "Senpai",
"needsVoices": true,
"stage": "school",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.3,
"bpm": 144
}
diff --git a/assets/BASE_GAME/shared/data/senpai/senpai.json b/assets/BASE_GAME/shared/data/senpai/senpai.json
index 0631f803..29eddd06 100644
--- a/assets/BASE_GAME/shared/data/senpai/senpai.json
+++ b/assets/BASE_GAME/shared/data/senpai/senpai.json
@@ -2067,7 +2067,7 @@
"song": "Senpai",
"needsVoices": true,
"stage": "school",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.2,
"bpm": 144
}
diff --git a/assets/BASE_GAME/shared/data/smash/smash.json b/assets/BASE_GAME/shared/data/smash/smash.json
index c15e44df..8a8232cd 100644
--- a/assets/BASE_GAME/shared/data/smash/smash.json
+++ b/assets/BASE_GAME/shared/data/smash/smash.json
@@ -2028,7 +2028,7 @@
"song": "Smash",
"needsVoices": false,
"validScore": true,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"bpm": 144,
"speed": 2
}
diff --git a/assets/BASE_GAME/shared/data/south/south-easy.json b/assets/BASE_GAME/shared/data/south/south-easy.json
index 12cf5c94..fc972de6 100644
--- a/assets/BASE_GAME/shared/data/south/south-easy.json
+++ b/assets/BASE_GAME/shared/data/south/south-easy.json
@@ -1633,6 +1633,6 @@
"needsVoices": true,
"bpm": 165,
"speed": 1.1,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/south/south-hard.json b/assets/BASE_GAME/shared/data/south/south-hard.json
index 0cbc40c3..e0ea5412 100644
--- a/assets/BASE_GAME/shared/data/south/south-hard.json
+++ b/assets/BASE_GAME/shared/data/south/south-hard.json
@@ -2113,6 +2113,6 @@
"needsVoices": true,
"bpm": 165,
"speed": 2.2,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/south/south.json b/assets/BASE_GAME/shared/data/south/south.json
index ee553896..90ef75ba 100644
--- a/assets/BASE_GAME/shared/data/south/south.json
+++ b/assets/BASE_GAME/shared/data/south/south.json
@@ -2093,6 +2093,6 @@
"needsVoices": true,
"bpm": 165,
"speed": 1.5,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/spookeez/spookeez-easy.json b/assets/BASE_GAME/shared/data/spookeez/spookeez-easy.json
index 0905e037..5af3a679 100644
--- a/assets/BASE_GAME/shared/data/spookeez/spookeez-easy.json
+++ b/assets/BASE_GAME/shared/data/spookeez/spookeez-easy.json
@@ -1863,7 +1863,7 @@
"song": "Spookeez",
"validScore": true,
"needsVoices": true,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1,
"bpm": 150
}
diff --git a/assets/BASE_GAME/shared/data/spookeez/spookeez-hard.json b/assets/BASE_GAME/shared/data/spookeez/spookeez-hard.json
index d5330187..763fa1f5 100644
--- a/assets/BASE_GAME/shared/data/spookeez/spookeez-hard.json
+++ b/assets/BASE_GAME/shared/data/spookeez/spookeez-hard.json
@@ -2408,7 +2408,7 @@
"song": "Spookeez",
"validScore": true,
"needsVoices": true,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 2.4,
"bpm": 150
}
diff --git a/assets/BASE_GAME/shared/data/spookeez/spookeez.json b/assets/BASE_GAME/shared/data/spookeez/spookeez.json
index 7a2b1fd8..b74f80e9 100644
--- a/assets/BASE_GAME/shared/data/spookeez/spookeez.json
+++ b/assets/BASE_GAME/shared/data/spookeez/spookeez.json
@@ -2208,7 +2208,7 @@
"song": "Spookeez",
"validScore": true,
"needsVoices": true,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.7,
"bpm": 150
}
diff --git a/assets/BASE_GAME/shared/data/stress/events.json b/assets/BASE_GAME/shared/data/stress/events.json
index 4cacfdf0..c2766216 100644
--- a/assets/BASE_GAME/shared/data/stress/events.json
+++ b/assets/BASE_GAME/shared/data/stress/events.json
@@ -37,6 +37,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/stress/stress-easy.json b/assets/BASE_GAME/shared/data/stress/stress-easy.json
index 52be3bb5..e4eaa0c2 100644
--- a/assets/BASE_GAME/shared/data/stress/stress-easy.json
+++ b/assets/BASE_GAME/shared/data/stress/stress-easy.json
@@ -3027,7 +3027,7 @@
"stage": "tank",
"needsVoices": true,
"validScore": true,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"bpm": 178,
"speed": 1.75
}
diff --git a/assets/BASE_GAME/shared/data/stress/stress-hard.json b/assets/BASE_GAME/shared/data/stress/stress-hard.json
index 9a0ae313..02e9a139 100644
--- a/assets/BASE_GAME/shared/data/stress/stress-hard.json
+++ b/assets/BASE_GAME/shared/data/stress/stress-hard.json
@@ -5077,7 +5077,7 @@
"stage": "tank",
"needsVoices": true,
"validScore": true,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"bpm": 178,
"speed": 2.6
}
diff --git a/assets/BASE_GAME/shared/data/stress/stress.json b/assets/BASE_GAME/shared/data/stress/stress.json
index ed68650d..8a94852a 100644
--- a/assets/BASE_GAME/shared/data/stress/stress.json
+++ b/assets/BASE_GAME/shared/data/stress/stress.json
@@ -4282,7 +4282,7 @@
"stage": "tank",
"needsVoices": true,
"validScore": true,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"bpm": 178,
"speed": 2.2
}
diff --git a/assets/BASE_GAME/shared/data/test/test.json b/assets/BASE_GAME/shared/data/test/test.json
index ab656183..1385edde 100644
--- a/assets/BASE_GAME/shared/data/test/test.json
+++ b/assets/BASE_GAME/shared/data/test/test.json
@@ -2806,6 +2806,6 @@
"needsVoices": true,
"bpm": 150,
"speed": 1.6,
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/thorns/events.json b/assets/BASE_GAME/shared/data/thorns/events.json
index 10d07e17..b3e32517 100644
--- a/assets/BASE_GAME/shared/data/thorns/events.json
+++ b/assets/BASE_GAME/shared/data/thorns/events.json
@@ -482,6 +482,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/thorns/thorns-easy.json b/assets/BASE_GAME/shared/data/thorns/thorns-easy.json
index b12d6471..901e8922 100644
--- a/assets/BASE_GAME/shared/data/thorns/thorns-easy.json
+++ b/assets/BASE_GAME/shared/data/thorns/thorns-easy.json
@@ -1915,7 +1915,7 @@
"song": "Thorns",
"needsVoices": true,
"stage": "schoolEvil",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.1,
"bpm": 190
}
diff --git a/assets/BASE_GAME/shared/data/thorns/thorns-hard.json b/assets/BASE_GAME/shared/data/thorns/thorns-hard.json
index 5c19b385..b0ac5dad 100644
--- a/assets/BASE_GAME/shared/data/thorns/thorns-hard.json
+++ b/assets/BASE_GAME/shared/data/thorns/thorns-hard.json
@@ -3295,7 +3295,7 @@
"song": "Thorns",
"needsVoices": true,
"stage": "schoolEvil",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.5,
"bpm": 190
}
diff --git a/assets/BASE_GAME/shared/data/thorns/thorns.json b/assets/BASE_GAME/shared/data/thorns/thorns.json
index 623eb2bf..dfd8b15a 100644
--- a/assets/BASE_GAME/shared/data/thorns/thorns.json
+++ b/assets/BASE_GAME/shared/data/thorns/thorns.json
@@ -2535,7 +2535,7 @@
"song": "Thorns",
"needsVoices": true,
"stage": "schoolEvil",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.3,
"bpm": 190
}
diff --git a/assets/BASE_GAME/shared/data/tutorial/events.json b/assets/BASE_GAME/shared/data/tutorial/events.json
index 5b99c77b..92327b22 100644
--- a/assets/BASE_GAME/shared/data/tutorial/events.json
+++ b/assets/BASE_GAME/shared/data/tutorial/events.json
@@ -22,6 +22,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/tutorial/tutorial-easy.json b/assets/BASE_GAME/shared/data/tutorial/tutorial-easy.json
index 390140a0..5d1e3df5 100644
--- a/assets/BASE_GAME/shared/data/tutorial/tutorial-easy.json
+++ b/assets/BASE_GAME/shared/data/tutorial/tutorial-easy.json
@@ -468,7 +468,7 @@
"song": "Tutorial",
"sections": 0,
"needsVoices": true,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1,
"bpm": 100
}
diff --git a/assets/BASE_GAME/shared/data/tutorial/tutorial-hard.json b/assets/BASE_GAME/shared/data/tutorial/tutorial-hard.json
index 1a9b143c..25bb8eb9 100644
--- a/assets/BASE_GAME/shared/data/tutorial/tutorial-hard.json
+++ b/assets/BASE_GAME/shared/data/tutorial/tutorial-hard.json
@@ -557,7 +557,7 @@
"song": "Tutorial",
"sections": 0,
"needsVoices": true,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1,
"bpm": 100
}
diff --git a/assets/BASE_GAME/shared/data/tutorial/tutorial.json b/assets/BASE_GAME/shared/data/tutorial/tutorial.json
index 390140a0..5d1e3df5 100644
--- a/assets/BASE_GAME/shared/data/tutorial/tutorial.json
+++ b/assets/BASE_GAME/shared/data/tutorial/tutorial.json
@@ -468,7 +468,7 @@
"song": "Tutorial",
"sections": 0,
"needsVoices": true,
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1,
"bpm": 100
}
diff --git a/assets/BASE_GAME/shared/data/ugh/events.json b/assets/BASE_GAME/shared/data/ugh/events.json
index fdb86898..665973d1 100644
--- a/assets/BASE_GAME/shared/data/ugh/events.json
+++ b/assets/BASE_GAME/shared/data/ugh/events.json
@@ -112,6 +112,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/ugh/ugh-easy.json b/assets/BASE_GAME/shared/data/ugh/ugh-easy.json
index 3248b0a9..d09878f5 100644
--- a/assets/BASE_GAME/shared/data/ugh/ugh-easy.json
+++ b/assets/BASE_GAME/shared/data/ugh/ugh-easy.json
@@ -1840,7 +1840,7 @@
"song": "Ugh",
"needsVoices": true,
"stage": "tank",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.25,
"bpm": 160
}
diff --git a/assets/BASE_GAME/shared/data/ugh/ugh-hard.json b/assets/BASE_GAME/shared/data/ugh/ugh-hard.json
index 3728333d..b11d47ef 100644
--- a/assets/BASE_GAME/shared/data/ugh/ugh-hard.json
+++ b/assets/BASE_GAME/shared/data/ugh/ugh-hard.json
@@ -2990,7 +2990,7 @@
"song": "Ugh",
"needsVoices": true,
"stage": "tank",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 2.3,
"bpm": 160
}
diff --git a/assets/BASE_GAME/shared/data/ugh/ugh.json b/assets/BASE_GAME/shared/data/ugh/ugh.json
index 50c63ea3..ef8d3650 100644
--- a/assets/BASE_GAME/shared/data/ugh/ugh.json
+++ b/assets/BASE_GAME/shared/data/ugh/ugh.json
@@ -2700,7 +2700,7 @@
"song": "Ugh",
"needsVoices": true,
"stage": "tank",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.8,
"bpm": 160
}
diff --git a/assets/BASE_GAME/shared/data/winter-horrorland/events.json b/assets/BASE_GAME/shared/data/winter-horrorland/events.json
index cc52db69..057a4d43 100644
--- a/assets/BASE_GAME/shared/data/winter-horrorland/events.json
+++ b/assets/BASE_GAME/shared/data/winter-horrorland/events.json
@@ -62,6 +62,6 @@
]
]
],
- "format": "psych_v1_convert"
+ "format": "astro_v0.3_convert"
}
}
\ No newline at end of file
diff --git a/assets/BASE_GAME/shared/data/winter-horrorland/winter-horrorland-easy.json b/assets/BASE_GAME/shared/data/winter-horrorland/winter-horrorland-easy.json
index a056271f..9860b56b 100644
--- a/assets/BASE_GAME/shared/data/winter-horrorland/winter-horrorland-easy.json
+++ b/assets/BASE_GAME/shared/data/winter-horrorland/winter-horrorland-easy.json
@@ -2054,7 +2054,7 @@
"song": "Winter Horrorland",
"needsVoices": true,
"stage": "mallEvil",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1,
"bpm": 159
}
diff --git a/assets/BASE_GAME/shared/data/winter-horrorland/winter-horrorland-hard.json b/assets/BASE_GAME/shared/data/winter-horrorland/winter-horrorland-hard.json
index 1fcf6d58..9059c2fa 100644
--- a/assets/BASE_GAME/shared/data/winter-horrorland/winter-horrorland-hard.json
+++ b/assets/BASE_GAME/shared/data/winter-horrorland/winter-horrorland-hard.json
@@ -2764,7 +2764,7 @@
"song": "Winter Horrorland",
"needsVoices": true,
"stage": "mallEvil",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.3,
"bpm": 159
}
diff --git a/assets/BASE_GAME/shared/data/winter-horrorland/winter-horrorland.json b/assets/BASE_GAME/shared/data/winter-horrorland/winter-horrorland.json
index 889e981a..e02a5ac8 100644
--- a/assets/BASE_GAME/shared/data/winter-horrorland/winter-horrorland.json
+++ b/assets/BASE_GAME/shared/data/winter-horrorland/winter-horrorland.json
@@ -2304,7 +2304,7 @@
"song": "Winter Horrorland",
"needsVoices": true,
"stage": "mallEvil",
- "format": "psych_v1_convert",
+ "format": "astro_v0.3_convert",
"speed": 1.1,
"bpm": 159
}
diff --git a/assets/shared/images/UI/default/countdown/go.png b/assets/shared/images/go.png
similarity index 100%
rename from assets/shared/images/UI/default/countdown/go.png
rename to assets/shared/images/go.png
diff --git a/assets/shared/images/UI/default/countdown/ready.png b/assets/shared/images/ready.png
similarity index 100%
rename from assets/shared/images/UI/default/countdown/ready.png
rename to assets/shared/images/ready.png
diff --git a/assets/shared/images/UI/default/countdown/set.png b/assets/shared/images/set.png
similarity index 100%
rename from assets/shared/images/UI/default/countdown/set.png
rename to assets/shared/images/set.png
diff --git a/setup/unix.sh b/setup/unix.sh
index 955bdf2b..e06c96a7 100644
--- a/setup/unix.sh
+++ b/setup/unix.sh
@@ -18,6 +18,6 @@ haxelib git flxanimate https://github.com/Dot-Stuff/flxanimate 768740a56b26aa0c0
haxelib git linc_luajit https://github.com/superpowers04/linc_luajit 633fcc051399afed6781dd60cbf30ed8c3fe2c5a
haxelib git hxdiscord_rpc https://github.com/MAJigsaw77/hxdiscord_rpc 3538a1c2bb07b04208cd014220207f8173acdb21
haxelib git hxvlc https://github.com/MAJigsaw77/hxvlc 70e7f5f3e76d526ac6fb8f0e6665efe7dfda589d
-haxelib git funkin.vis https://github.com/FunkinCrew/funkVis d5361037efa3a02c4ab20b5bd14ca11e7d00f519
+haxelib git funkin.vis https://github.com/FunkinCrew/funkVis 22b1ce089dd924f15cdc4632397ef3504d464e90
haxelib git grig.audio https://gitlab.com/haxe-grig/grig.audio.git cbf91e2180fd2e374924fe74844086aab7891666
echo Finished!
diff --git a/setup/windows.bat b/setup/windows.bat
index fb8515bb..129a6025 100644
--- a/setup/windows.bat
+++ b/setup/windows.bat
@@ -21,7 +21,7 @@ haxelib git flxanimate https://github.com/Dot-Stuff/flxanimate 768740a56b26aa0c0
haxelib git linc_luajit https://github.com/superpowers04/linc_luajit 633fcc051399afed6781dd60cbf30ed8c3fe2c5a
haxelib git hxdiscord_rpc https://github.com/MAJigsaw77/hxdiscord_rpc 3538a1c2bb07b04208cd014220207f8173acdb21
haxelib git hxvlc https://github.com/MAJigsaw77/hxvlc 70e7f5f3e76d526ac6fb8f0e6665efe7dfda589d
-haxelib git funkin.vis https://github.com/FunkinCrew/funkVis d5361037efa3a02c4ab20b5bd14ca11e7d00f519
+haxelib git funkin.vis https://github.com/FunkinCrew/funkVis 22b1ce089dd924f15cdc4632397ef3504d464e90
haxelib git grig.audio https://gitlab.com/haxe-grig/grig.audio.git cbf91e2180fd2e374924fe74844086aab7891666
echo Finished!
pause
diff --git a/source/flixel/addons/ui/FlxInputText.hx b/source/flixel/addons/ui/FlxInputText.hx
deleted file mode 100644
index 4ea12ecf..00000000
--- a/source/flixel/addons/ui/FlxInputText.hx
+++ /dev/null
@@ -1,1081 +0,0 @@
-package flixel.addons.ui;
-
-import lime.system.Clipboard;
-import flash.errors.Error;
-import flash.events.KeyboardEvent;
-import flash.geom.Rectangle;
-import flixel.addons.ui.FlxUI.NamedString;
-import flixel.FlxG;
-import flixel.FlxSprite;
-import flixel.math.FlxPoint;
-import flixel.math.FlxRect;
-import flixel.text.FlxText;
-import flixel.util.FlxColor;
-import flixel.util.FlxDestroyUtil;
-import flixel.util.FlxTimer;
-
-/**
- * FlxInputText v1.11, ported to Haxe
- * @author larsiusprime, (Lars Doucet)
- * @link http://github.com/haxeflixel/flixel-ui
- *
- * FlxInputText v1.10, Input text field extension for Flixel
- * @author Gama11, Mr_Walrus, nitram_cero (Martín Sebastián Wain)
- * @link http://forums.flixel.org/index.php/topic,272.0.html
- *
- * Copyright (c) 2009 Martín Sebastián Wain
- * License: Creative Commons Attribution 3.0 United game.states
- * @link http://creativecommons.org/licenses/by/3.0/us/
- *
- * Modified by PlankDev to support cut/copy/paste
- */
-class FlxInputText extends FlxText
-{
- public static inline var NO_FILTER:Int = 0;
- public static inline var ONLY_ALPHA:Int = 1;
- public static inline var ONLY_NUMERIC:Int = 2;
- public static inline var ONLY_ALPHANUMERIC:Int = 3;
- public static inline var CUSTOM_FILTER:Int = 4;
-
- public static inline var ALL_CASES:Int = 0;
- public static inline var UPPER_CASE:Int = 1;
- public static inline var LOWER_CASE:Int = 2;
-
- public static inline var BACKSPACE_ACTION:String = "backspace"; // press backspace
- public static inline var DELETE_ACTION:String = "delete"; // press delete
- public static inline var ENTER_ACTION:String = "enter"; // press enter
- public static inline var INPUT_ACTION:String = "input"; // manually edit
- public static inline var PASTE_ACTION:String = "paste"; // text paste
- public static inline var COPY_ACTION:String = "copy"; // text copy
- public static inline var CUT_ACTION:String = "cut"; // text copy
-
- /**
- * This regular expression will filter out (remove) everything that matches.
- * Automatically sets filterMode = FlxInputText.CUSTOM_FILTER.
- */
- public var customFilterPattern(default, set):EReg;
-
- function set_customFilterPattern(cfp:EReg)
- {
- customFilterPattern = cfp;
- filterMode = CUSTOM_FILTER;
- return customFilterPattern;
- }
-
- /**
- * A function called whenever the value changes from user input, or enter is pressed
- */
- public var callback:String->String->Void;
-
- /**
- * Whether or not the textbox has a background
- */
- public var background:Bool = false;
-
- /**
- * The caret's color. Has the same color as the text by default.
- */
- public var caretColor(default, set):Int;
-
- function set_caretColor(i:Int):Int
- {
- caretColor = i;
- dirty = true;
- return caretColor;
- }
-
- public var caretWidth(default, set):Int = 1;
-
- function set_caretWidth(i:Int):Int
- {
- caretWidth = i;
- dirty = true;
- return caretWidth;
- }
-
- public var params(default, set):Array;
-
- /**
- * Whether or not the textfield is a password textfield
- */
- public var passwordMode(get, set):Bool;
-
- /**
- * Whether or not the text box is the active object on the screen.
- */
- public var hasFocus(default, set):Bool = false;
-
- /**
- * The position of the selection cursor. An index of 0 means the carat is before the character at index 0.
- */
- public var caretIndex(default, set):Int = 0;
-
- /**
- * callback that is triggered when this text field gets focus
- * @since 2.2.0
- */
- public var focusGained:Void->Void;
-
- /**
- * callback that is triggered when this text field loses focus
- * @since 2.2.0
- */
- public var focusLost:Void->Void;
-
- /**
- * The Case that's being enforced. Either ALL_CASES, UPPER_CASE or LOWER_CASE.
- */
- public var forceCase(default, set):Int = ALL_CASES;
-
- /**
- * Set the maximum length for the field (e.g. "3"
- * for Arcade type hi-score initials). 0 means unlimited.
- */
- public var maxLength(default, set):Int = 0;
-
- /**
- * Change the amount of lines that are allowed.
- */
- public var lines(default, set):Int;
-
- /**
- * Defines what text to filter. It can be NO_FILTER, ONLY_ALPHA, ONLY_NUMERIC, ONLY_ALPHA_NUMERIC or CUSTOM_FILTER
- * (Remember to append "FlxInputText." as a prefix to those constants)
- */
- public var filterMode(default, set):Int = NO_FILTER;
-
- /**
- * The color of the fieldBorders
- */
- public var fieldBorderColor(default, set):Int = FlxColor.BLACK;
-
- /**
- * The thickness of the fieldBorders
- */
- public var fieldBorderThickness(default, set):Int = 1;
-
- /**
- * The color of the background of the textbox.
- */
- public var backgroundColor(default, set):Int = FlxColor.WHITE;
-
- /**
- * A FlxSprite representing the background sprite
- */
- private var backgroundSprite:FlxSprite;
-
- /**
- * A timer for the flashing caret effect.
- */
- private var _caretTimer:FlxTimer;
-
- /**
- * A FlxSprite representing the flashing caret when editing text.
- */
- private var caret:FlxSprite;
-
- /**
- * A FlxSprite representing the fieldBorders.
- */
- private var fieldBorderSprite:FlxSprite;
-
- /**
- * The left- and right- most fully visible character indeces
- */
- private var _scrollBoundIndeces:{left:Int, right:Int} = {left: 0, right: 0};
-
- // workaround to deal with non-availability of getCharIndexAtPoint or getCharBoundaries on cpp/neko targets
- private var _charBoundaries:Array;
-
- /**
- * Stores last input text scroll.
- */
- private var lastScroll:Int;
-
- /**
- * @param X The X position of the text.
- * @param Y The Y position of the text.
- * @param Width The width of the text object (height is determined automatically).
- * @param Text The actual text you would like to display initially.
- * @param size Initial size of the font
- * @param TextColor The color of the text
- * @param BackgroundColor The color of the background (FlxColor.TRANSPARENT for no background color)
- * @param EmbeddedFont Whether this text field uses embedded fonts or not
- */
- public function new(X:Float = 0, Y:Float = 0, Width:Int = 150, ?Text:String, size:Int = 8, TextColor:Int = FlxColor.BLACK,
- BackgroundColor:Int = FlxColor.WHITE, EmbeddedFont:Bool = true)
- {
- super(X, Y, Width, Text, size, EmbeddedFont);
- backgroundColor = BackgroundColor;
-
- if (BackgroundColor != FlxColor.TRANSPARENT)
- {
- background = true;
- }
-
- color = TextColor;
- caretColor = TextColor;
-
- caret = new FlxSprite();
- caret.makeGraphic(caretWidth, Std.int(size + 2));
- _caretTimer = new FlxTimer();
-
- caretIndex = 0;
- hasFocus = false;
- if (background)
- {
- fieldBorderSprite = new FlxSprite(X, Y);
- backgroundSprite = new FlxSprite(X, Y);
- }
-
- lines = 1;
- FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
-
- if (Text == null)
- {
- Text = "";
- }
-
- text = Text; // ensure set_text is called to avoid bugs (like not preparing _charBoundaries on sys target, making it impossible to click)
-
- calcFrame();
- }
-
- /**
- * Clean up memory
- */
- override public function destroy():Void
- {
- FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
-
- backgroundSprite = FlxDestroyUtil.destroy(backgroundSprite);
- fieldBorderSprite = FlxDestroyUtil.destroy(fieldBorderSprite);
- callback = null;
-
- #if sys
- if (_charBoundaries != null)
- {
- while (_charBoundaries.length > 0)
- {
- _charBoundaries.pop();
- }
- _charBoundaries = null;
- }
- #end
-
- super.destroy();
- }
-
- /**
- * Draw the caret in addition to the text.
- */
- override public function draw():Void
- {
- drawSprite(fieldBorderSprite);
- drawSprite(backgroundSprite);
-
- super.draw();
-
- // In case caretColor was changed
- if (caretColor != caret.color || caret.height != size + 2)
- {
- caret.color = caretColor;
- }
-
- drawSprite(caret);
- }
-
- /**
- * Helper function that makes sure sprites are drawn up even though they haven't been added.
- * @param Sprite The Sprite to be drawn.
- */
- private function drawSprite(Sprite:FlxSprite):Void
- {
- if (Sprite != null && Sprite.visible)
- {
- Sprite.scrollFactor = scrollFactor;
- Sprite.cameras = cameras;
- Sprite.draw();
- }
- }
-
- /**
- * Check for mouse input every tick.
- */
- override public function update(elapsed:Float):Void
- {
- super.update(elapsed);
-
- #if FLX_MOUSE
- // Set focus and caretIndex as a response to mouse press
- if (FlxG.mouse.justPressed)
- {
- var hadFocus:Bool = hasFocus;
- if (mouseOverlapping())
- {
- caretIndex = getCaretIndex();
- hasFocus = true;
- if (!hadFocus && focusGained != null)
- focusGained();
- }
- else
- {
- hasFocus = false;
- if (hadFocus && focusLost != null)
- focusLost();
- }
- }
- #end
- }
-
- function mouseOverlapping()
- {
- var mousePoint = FlxG.mouse.getScreenPosition(camera);
- var objPoint = this.getScreenPosition(null, camera);
- if(mousePoint.x >= objPoint.x && mousePoint.y >= objPoint.y &&
- mousePoint.x < objPoint.x + this.width && mousePoint.y < objPoint.y + this.height)
- {
- return true;
- }
- return false;
- }
-
- /**
- * Handles keypresses generated on the stage.
- */
- private function onKeyDown(e:KeyboardEvent):Void
- {
- var key:Int = e.keyCode;
-
- if (hasFocus)
- {
-
- //// Crtl/Cmd + C to copy text to the clipboard
- // This copies the entire input, because i'm too lazy to do caret selection, and if i did it i whoud probabbly make it a pr in flixel-ui.
-
- #if (macos)
- if (key == 67 && e.commandKey) {
- #else
- if (key == 67 && e.ctrlKey) {
- #end
- Clipboard.text = text;
-
- onChange(COPY_ACTION);
-
- // Stops the function to go further, because it whoud type in a c to the input
- return;
- }
-
- //// Crtl/Cmd + V to paste in the clipboard text to the input
- #if (macos)
- if (key == 86 && e.commandKey) {
- #else
- if (key == 86 && e.ctrlKey) {
- #end
- var newText:String = filter(Clipboard.text);
-
- if (newText.length > 0 && (maxLength == 0 || (text.length + newText.length) < maxLength)) {
- text = insertSubstring(text, newText, caretIndex);
- caretIndex += newText.length;
- onChange(INPUT_ACTION);
- onChange(PASTE_ACTION);
- }
-
- // Same as before, but prevents typing out a v
- return;
- }
-
- //// Crtl/Cmd + X to cut the text from the input to the clipboard
- // Again, this copies the entire input text because there is no caret selection.
- #if (macos)
- if (key == 88 && e.commandKey) {
- #else
- if (key == 88 && e.ctrlKey) {
- #end
- Clipboard.text = text;
- text = '';
- caretIndex = 0;
-
- onChange(INPUT_ACTION);
- onChange(CUT_ACTION);
-
- // Same as before, but prevents typing out a x
- return;
- }
-
- // Do nothing for Shift, Ctrl, Esc, and flixel console hotkey
- if (key == 16 || key == 17 || key == 220 || key == 27)
- {
- return;
- }
- // Left arrow
- else if (key == 37)
- {
- if (caretIndex > 0)
- {
- caretIndex--;
- text = text; // forces scroll update
- }
- }
- // Right arrow
- else if (key == 39)
- {
- if (caretIndex < text.length)
- {
- caretIndex++;
- text = text; // forces scroll update
- }
- }
- // End key
- else if (key == 35)
- {
- caretIndex = text.length;
- text = text; // forces scroll update
- }
- // Home key
- else if (key == 36)
- {
- caretIndex = 0;
- text = text;
- }
- // Backspace
- else if (key == 8)
- {
- if (caretIndex > 0)
- {
- caretIndex--;
- text = text.substring(0, caretIndex) + text.substring(caretIndex + 1);
- onChange(BACKSPACE_ACTION);
- }
- }
- // Delete
- else if (key == 46)
- {
- if (text.length > 0 && caretIndex < text.length)
- {
- text = text.substring(0, caretIndex) + text.substring(caretIndex + 1);
- onChange(DELETE_ACTION);
- }
- }
- // Enter
- else if (key == 13)
- {
- onChange(ENTER_ACTION);
- }
- // Actually add some text
- else
- {
- if (e.charCode == 0) // non-printable characters crash String.fromCharCode
- {
- return;
- }
- var newText:String = filter(String.fromCharCode(e.charCode));
-
- if (newText.length > 0 && (maxLength == 0 || (text.length + newText.length) < maxLength))
- {
- text = insertSubstring(text, newText, caretIndex);
- caretIndex++;
- onChange(INPUT_ACTION);
- }
- }
- }
- }
-
- private function onChange(action:String):Void
- {
- if (callback != null)
- {
- callback(text, action);
- }
- }
-
- /**
- * Inserts a substring into a string at a specific index
- *
- * @param Insert The string to have something inserted into
- * @param Insert The string to insert
- * @param Index The index to insert at
- * @return Returns the joined string for chaining.
- */
- private function insertSubstring(Original:String, Insert:String, Index:Int):String
- {
- if (Index != Original.length)
- {
- Original = Original.substring(0, Index) + (Insert) + (Original.substring(Index));
- }
- else
- {
- Original = Original + (Insert);
- }
- return Original;
- }
-
- /**
- * Gets the index of the character in this box under the mouse cursor
- * @return The index of the character.
- * between 0 and the length of the text
- */
- private function getCaretIndex():Int
- {
- #if FLX_MOUSE
- var hit = FlxPoint.get(FlxG.mouse.x - x, FlxG.mouse.y - y);
- return getCharIndexAtPoint(hit.x, hit.y);
- #else
- return 0;
- #end
- }
-
- private function getCharBoundaries(charIndex:Int):Rectangle
- {
- if (_charBoundaries != null && charIndex >= 0 && _charBoundaries.length > 0)
- {
- var r:Rectangle = new Rectangle();
- if (charIndex >= _charBoundaries.length)
- {
- _charBoundaries[_charBoundaries.length - 1].copyToFlash(r);
- }
- else
- {
- _charBoundaries[charIndex].copyToFlash(r);
- }
- return r;
- }
- return null;
- }
-
- private override function set_text(Text:String):String
- {
- #if !js
- if (textField != null)
- {
- lastScroll = textField.scrollH;
- }
- #end
- var return_text:String = super.set_text(Text);
-
- if (textField == null)
- {
- return return_text;
- }
-
- var numChars:Int = Text.length;
- prepareCharBoundaries(numChars);
- textField.text = "";
- var textH:Float = 0;
- var textW:Float = 0;
- var lastW:Float = 0;
-
- // Flash textFields have a "magic number" 2 pixel gutter all around
- // It does not seem to vary with font, size, border, etc, and does not seem to be customizable.
- // We simply reproduce this behavior here
- var magicX:Float = 2;
- var magicY:Float = 2;
-
- for (i in 0...numChars)
- {
- textField.appendText(Text.substr(i, 1)); // add a character
- textW = textField.textWidth; // count up total text width
- if (i == 0)
- {
- textH = textField.textHeight; // count height after first char
- }
- _charBoundaries[i].x = magicX + lastW; // place x at end of last character
- _charBoundaries[i].y = magicY; // place y at zero
- _charBoundaries[i].width = (textW - lastW); // place width at (width so far) minus (last char's end point)
- _charBoundaries[i].height = textH;
- lastW = textW;
- }
- textField.text = Text;
- onSetTextCheck();
- return return_text;
- }
-
- private function getCharIndexAtPoint(X:Float, Y:Float):Int
- {
- var i:Int = 0;
- #if !js
- X += textField.scrollH + 2;
- #end
-
- // offset X according to text alignment when there is no scroll.
- if (_charBoundaries != null && _charBoundaries.length > 0)
- {
- if (textField.textWidth <= textField.width)
- {
- switch (getAlignStr())
- {
- case RIGHT:
- X = X - textField.width + textField.textWidth
- ;
- case CENTER:
- X = X - textField.width / 2 + textField.textWidth / 2
- ;
- default:
- }
- }
- }
-
- // place caret at matching char position
- if (_charBoundaries != null)
- {
- for (r in _charBoundaries)
- {
- if (X >= r.left && X <= r.right)
- {
- return i;
- }
- i++;
- }
- }
-
- // place caret at rightmost position
- if (_charBoundaries != null && _charBoundaries.length > 0)
- {
- if (X > textField.textWidth)
- {
- return _charBoundaries.length;
- }
- }
-
- // place caret at leftmost position
- return 0;
- }
-
- private function prepareCharBoundaries(numChars:Int):Void
- {
- if (_charBoundaries == null)
- {
- _charBoundaries = [];
- }
-
- if (_charBoundaries.length > numChars)
- {
- var diff:Int = _charBoundaries.length - numChars;
- for (i in 0...diff)
- {
- _charBoundaries.pop();
- }
- }
-
- for (i in 0...numChars)
- {
- if (_charBoundaries.length - 1 < i)
- {
- _charBoundaries.push(FlxRect.get(0, 0, 0, 0));
- }
- }
- }
-
- /**
- * Called every time the text is changed (for both flash/cpp) to update scrolling, etc
- */
- private function onSetTextCheck():Void
- {
- #if !js
- var boundary:Rectangle = null;
- if (caretIndex == -1)
- {
- boundary = getCharBoundaries(text.length - 1);
- }
- else
- {
- boundary = getCharBoundaries(caretIndex);
- }
-
- if (boundary != null)
- {
- // Checks if carret is out of textfield bounds
- // if it is update scroll, otherwise maintain the same scroll as last check.
- var diffW:Int = 0;
- if (boundary.right > lastScroll + textField.width - 2)
- {
- diffW = -Std.int((textField.width - 2) - boundary.right); // caret to the right of textfield.
- }
- else if (boundary.left < lastScroll)
- {
- diffW = Std.int(boundary.left) - 2; // caret to the left of textfield
- }
- else
- {
- diffW = lastScroll; // no scroll change
- }
-
- #if !js
- textField.scrollH = diffW;
- #end
- calcFrame();
- }
- #end
- }
-
- /**
- * Draws the frame of animation for the input text.
- *
- * @param RunOnCpp Whether the frame should also be recalculated if we're on a non-flash target
- */
- private override function calcFrame(RunOnCpp:Bool = false):Void
- {
- super.calcFrame(RunOnCpp);
-
- if (fieldBorderSprite != null)
- {
- if (fieldBorderThickness > 0)
- {
- fieldBorderSprite.makeGraphic(Std.int(width + fieldBorderThickness * 2), Std.int(height + fieldBorderThickness * 2), fieldBorderColor);
- fieldBorderSprite.x = x - fieldBorderThickness;
- fieldBorderSprite.y = y - fieldBorderThickness;
- }
- else if (fieldBorderThickness == 0)
- {
- fieldBorderSprite.visible = false;
- }
- }
-
- if (backgroundSprite != null)
- {
- if (background)
- {
- backgroundSprite.makeGraphic(Std.int(width), Std.int(height), backgroundColor);
- backgroundSprite.x = x;
- backgroundSprite.y = y;
- }
- else
- {
- backgroundSprite.visible = false;
- }
- }
-
- if (caret != null)
- {
- // Generate the properly sized caret and also draw a border that matches that of the textfield (if a border style is set)
- // borderQuality can be safely ignored since the caret is always a rectangle
-
- var cw:Int = caretWidth; // Basic size of the caret
- var ch:Int = Std.int(size + 2);
-
- // Make sure alpha channels are correctly set
- var borderC:Int = (0xff000000 | (borderColor & 0x00ffffff));
- var caretC:Int = (0xff000000 | (caretColor & 0x00ffffff));
-
- // Generate unique key for the caret so we don't cause weird bugs if someone makes some random flxsprite of this size and color
- var caretKey:String = "caret" + cw + "x" + ch + "c:" + caretC + "b:" + borderStyle + "," + borderSize + "," + borderC;
- switch (borderStyle)
- {
- case NONE:
- // No border, just make the caret
- caret.makeGraphic(cw, ch, caretC, false, caretKey);
- caret.offset.x = caret.offset.y = 0;
-
- case SHADOW:
- // Shadow offset to the lower-right
- cw += Std.int(borderSize);
- ch += Std.int(borderSize); // expand canvas on one side for shadow
- caret.makeGraphic(cw, ch, FlxColor.TRANSPARENT, false, caretKey); // start with transparent canvas
- var r:Rectangle = new Rectangle(borderSize, borderSize, caretWidth, Std.int(size + 2));
- caret.pixels.fillRect(r, borderC); // draw shadow
- r.x = r.y = 0;
- caret.pixels.fillRect(r, caretC); // draw caret
- caret.offset.x = caret.offset.y = 0;
-
- case OUTLINE_FAST, OUTLINE:
- // Border all around it
- cw += Std.int(borderSize * 2);
- ch += Std.int(borderSize * 2); // expand canvas on both sides
- caret.makeGraphic(cw, ch, borderC, false, caretKey); // start with borderColor canvas
- var r = new Rectangle(borderSize, borderSize, caretWidth, Std.int(size + 2));
- caret.pixels.fillRect(r, caretC); // draw caret
- // we need to offset caret's drawing position since the caret is now larger than normal
- caret.offset.x = caret.offset.y = borderSize;
- }
- // Update width/height so caret's dimensions match its pixels
- caret.width = cw;
- caret.height = ch;
-
- caretIndex = caretIndex; // force this to update
- }
- }
-
- /**
- * Turns the caret on/off for the caret flashing animation.
- */
- private function toggleCaret(timer:FlxTimer):Void
- {
- caret.visible = !caret.visible;
- }
-
- /**
- * Checks an input string against the current
- * filter and returns a filtered string
- */
- private function filter(text:String):String
- {
- if (forceCase == UPPER_CASE)
- {
- text = text.toUpperCase();
- }
- else if (forceCase == LOWER_CASE)
- {
- text = text.toLowerCase();
- }
-
- if (filterMode != NO_FILTER)
- {
- var pattern:EReg;
- switch (filterMode)
- {
- case ONLY_ALPHA:
- pattern = ~/[^a-zA-Z]*/g;
- case ONLY_NUMERIC:
- pattern = ~/[^0-9]*/g;
- case ONLY_ALPHANUMERIC:
- pattern = ~/[^a-zA-Z0-9]*/g;
- case CUSTOM_FILTER:
- pattern = customFilterPattern;
- default:
- throw new Error("FlxInputText: Unknown filterMode (" + filterMode + ")");
- }
- text = pattern.replace(text, "");
- }
- return text;
- }
-
- private function set_params(p:Array):Array
- {
- params = p;
- if (params == null)
- {
- params = [];
- }
- var namedValue:NamedString = {name: "value", value: text};
- params.push(namedValue);
- return p;
- }
-
- private override function set_x(X:Float):Float
- {
- if ((fieldBorderSprite != null) && fieldBorderThickness > 0)
- {
- fieldBorderSprite.x = X - fieldBorderThickness;
- }
- if ((backgroundSprite != null) && background)
- {
- backgroundSprite.x = X;
- }
- return super.set_x(X);
- }
-
- private override function set_y(Y:Float):Float
- {
- if ((fieldBorderSprite != null) && fieldBorderThickness > 0)
- {
- fieldBorderSprite.y = Y - fieldBorderThickness;
- }
- if ((backgroundSprite != null) && background)
- {
- backgroundSprite.y = Y;
- }
- return super.set_y(Y);
- }
-
- private function set_hasFocus(newFocus:Bool):Bool
- {
- if (newFocus)
- {
- if (hasFocus != newFocus)
- {
- _caretTimer = new FlxTimer().start(0.5, toggleCaret, 0);
- caret.visible = true;
- caretIndex = text.length;
- }
- }
- else
- {
- // Graphics
- caret.visible = false;
- if (_caretTimer != null)
- {
- _caretTimer.cancel();
- }
- }
-
- if (newFocus != hasFocus)
- {
- calcFrame();
- }
- return hasFocus = newFocus;
- }
-
- private function getAlignStr():FlxTextAlign
- {
- var alignStr:FlxTextAlign = LEFT;
- if (_defaultFormat != null && _defaultFormat.align != null)
- {
- alignStr = alignment;
- }
- return alignStr;
- }
-
- private function set_caretIndex(newCaretIndex:Int):Int
- {
- var offx:Float = 0;
-
- var alignStr:FlxTextAlign = getAlignStr();
-
- switch (alignStr)
- {
- case RIGHT:
- offx = textField.width - 2 - textField.textWidth - 2;
- if (offx < 0)
- offx = 0; // hack, fix negative offset.
-
- case CENTER:
- #if !js
- offx = (textField.width - 2 - textField.textWidth) / 2 + textField.scrollH / 2;
- #end
- if (offx <= 1)
- offx = 0; // hack, fix ofset rounding alignment.
-
- default:
- offx = 0;
- }
-
- caretIndex = newCaretIndex;
-
- // If caret is too far to the right something is wrong
- if (caretIndex > (text.length + 1))
- {
- caretIndex = -1;
- }
-
- // Caret is OK, proceed to position
- if (caretIndex != -1)
- {
- var boundaries:Rectangle = null;
-
- // Caret is not to the right of text
- if (caretIndex < text.length)
- {
- boundaries = getCharBoundaries(caretIndex);
- if (boundaries != null)
- {
- caret.x = offx + boundaries.left + x;
- caret.y = boundaries.top + y;
- }
- }
- // Caret is to the right of text
- else
- {
- boundaries = getCharBoundaries(caretIndex - 1);
- if (boundaries != null)
- {
- caret.x = offx + boundaries.right + x;
- caret.y = boundaries.top + y;
- }
- // Text box is empty
- else if (text.length == 0)
- {
- // 2 px gutters
- caret.x = x + offx + 2;
- caret.y = y + 2;
- }
- }
- }
-
- #if !js
- caret.x -= textField.scrollH;
- #end
-
- // Make sure the caret doesn't leave the textfield on single-line input texts
- if ((lines == 1) && (caret.x + caret.width) > (x + width))
- {
- caret.x = x + width - 2;
- }
-
- return caretIndex;
- }
-
- private function set_forceCase(Value:Int):Int
- {
- forceCase = Value;
- text = filter(text);
- return forceCase;
- }
-
- override private function set_size(Value:Int):Int
- {
- super.size = Value;
- caret.makeGraphic(1, Std.int(size + 2));
- return Value;
- }
-
- private function set_maxLength(Value:Int):Int
- {
- maxLength = Value;
- if (text.length > maxLength)
- {
- text = text.substring(0, maxLength);
- }
- return maxLength;
- }
-
- private function set_lines(Value:Int):Int
- {
- if (Value == 0)
- return 0;
-
- if (Value > 1)
- {
- textField.wordWrap = true;
- textField.multiline = true;
- }
- else
- {
- textField.wordWrap = false;
- textField.multiline = false;
- }
-
- lines = Value;
- calcFrame();
- return lines;
- }
-
- private function get_passwordMode():Bool
- {
- return textField.displayAsPassword;
- }
-
- private function set_passwordMode(value:Bool):Bool
- {
- textField.displayAsPassword = value;
- calcFrame();
- return value;
- }
-
- private function set_filterMode(Value:Int):Int
- {
- filterMode = Value;
- text = filter(text);
- return filterMode;
- }
-
- private function set_fieldBorderColor(Value:Int):Int
- {
- fieldBorderColor = Value;
- calcFrame();
- return fieldBorderColor;
- }
-
- private function set_fieldBorderThickness(Value:Int):Int
- {
- fieldBorderThickness = Value;
- calcFrame();
- return fieldBorderThickness;
- }
-
- private function set_backgroundColor(Value:Int):Int
- {
- backgroundColor = Value;
- calcFrame();
- return backgroundColor;
- }
-}
diff --git a/source/flixel/addons/ui/FlxUIInputText.hx b/source/flixel/addons/ui/FlxUIInputText.hx
deleted file mode 100644
index 11afefc9..00000000
--- a/source/flixel/addons/ui/FlxUIInputText.hx
+++ /dev/null
@@ -1,58 +0,0 @@
-package flixel.addons.ui;
-
-import flixel.addons.ui.interfaces.IFlxUIWidget;
-import flixel.addons.ui.interfaces.IHasParams;
-import flixel.addons.ui.interfaces.IResizable;
-
-/**
- * @author Lars Doucet
- * Modified by PlankDev to support cut/copy/paste
- */
-class FlxUIInputText extends FlxInputText implements IResizable implements IFlxUIWidget implements IHasParams
-{
- public var name:String;
-
- public var broadcastToFlxUI:Bool = true;
-
- public static inline var CHANGE_EVENT:String = "change_input_text"; // change in any way
- public static inline var ENTER_EVENT:String = "enter_input_text"; // hit enter in this text field
- public static inline var DELETE_EVENT:String = "delete_input_text"; // delete text in this text field
- public static inline var INPUT_EVENT:String = "input_input_text"; // input text in this text field
- public static inline var COPY_EVENT:String = "copy_input_text"; // copy text in this text field
- public static inline var PASTE_EVENT:String = "paste_input_text"; // paste text in this text field
- public static inline var CUT_EVENT:String = "cut_input_text"; // cut text in this text field
-
- public function resize(w:Float, h:Float):Void
- {
- width = w;
- height = h;
- calcFrame();
- }
-
- private override function onChange(action:String):Void
- {
- super.onChange(action);
- if (broadcastToFlxUI)
- {
- switch (action)
- {
- case FlxInputText.ENTER_ACTION: // press enter
- FlxUI.event(ENTER_EVENT, this, text, params);
- case FlxInputText.DELETE_ACTION, FlxInputText.BACKSPACE_ACTION: // deleted some text
- FlxUI.event(DELETE_EVENT, this, text, params);
- FlxUI.event(CHANGE_EVENT, this, text, params);
- case FlxInputText.INPUT_ACTION: // text was input
- FlxUI.event(INPUT_EVENT, this, text, params);
- FlxUI.event(CHANGE_EVENT, this, text, params);
- case FlxInputText.COPY_ACTION: // text was copied
- FlxUI.event(COPY_EVENT, this, text, params);
- case FlxInputText.PASTE_ACTION: // text was pasted
- FlxUI.event(PASTE_EVENT, this, text, params);
- FlxUI.event(CHANGE_EVENT, this, text, params);
- case FlxInputText.CUT_ACTION: // text was cut
- FlxUI.event(CUT_EVENT, this, text, params);
- FlxUI.event(CHANGE_EVENT, this, text, params);
- }
- }
- }
-}
diff --git a/source/funkin/backend/Song.hx b/source/funkin/backend/Song.hx
index 5b71b7a8..00f8dd24 100644
--- a/source/funkin/backend/Song.hx
+++ b/source/funkin/backend/Song.hx
@@ -173,7 +173,7 @@ class Song
switch(convertTo)
{
case 'astro_v0.3':
- if(!fmt.startsWith('astro_v0.3')) //Convert to Psych 1.0 format
+ if(!fmt.toLowerCase().startsWith('astro_v0.3')) //Convert to Psych 1.0 format
{
trace('converting chart $nameForError with format $fmt to astro_v0.3 format...');
songJson.format = 'astro_v0.3_convert';
diff --git a/source/funkin/backend/funkinLua/FunkinLua.hx b/source/funkin/backend/funkinLua/FunkinLua.hx
index b656a894..a1b7cfcc 100644
--- a/source/funkin/backend/funkinLua/FunkinLua.hx
+++ b/source/funkin/backend/funkinLua/FunkinLua.hx
@@ -1367,10 +1367,6 @@ class FunkinLua
}
PlayState.cancelMusicFadeTween();
- FadeTransition.nextCamera = game.camOther;
- if (FlxTransitionableState.skipNextTransIn)
- FadeTransition.nextCamera = null;
-
if (PlayState.isStoryMode)
MusicBeatState.switchState(new funkin.game.states.StoryMenuState());
else
diff --git a/source/funkin/backend/objects/AstroCamera.hx b/source/funkin/backend/objects/AstroCamera.hx
index e77925b7..0bcca165 100644
--- a/source/funkin/backend/objects/AstroCamera.hx
+++ b/source/funkin/backend/objects/AstroCamera.hx
@@ -55,7 +55,7 @@ class AstroCamera extends FlxCamera
{
_scrollTarget.y -= viewHeight;
}
-
+
// without this we see weird behavior when switching to SCREEN_BY_SCREEN at arbitrary scroll positions
bindScrollPos(_scrollTarget);
}
@@ -98,14 +98,14 @@ class AstroCamera extends FlxCamera
}
}
- var mult:Float = 1 - Math.exp(-elapsed * followLerp / (1/60));
+ var mult:Float = 1 - Math.exp(-elapsed * followLerp / (1 / 60));
scroll.x += (_scrollTarget.x - scroll.x) * mult;
scroll.y += (_scrollTarget.y - scroll.y) * mult;
- //trace('lerp on this frame: $mult');
+ // trace('lerp on this frame: $mult');
}
override function set_followLerp(value:Float)
{
return followLerp = value;
}
-}
\ No newline at end of file
+}
diff --git a/source/funkin/backend/objects/editers/VSlice.hx b/source/funkin/backend/objects/editers/VSlice.hx
index bf15d6b0..77aa9946 100644
--- a/source/funkin/backend/objects/editers/VSlice.hx
+++ b/source/funkin/backend/objects/editers/VSlice.hx
@@ -257,7 +257,7 @@ class VSlice
player2: metadata.playData.characters.opponent,
gfVersion: metadata.playData.characters.girlfriend,
stage: stage,
- format: 'psych_v1_convert'
+ format: 'astro_v0.3_convert'
}
Reflect.setField(swagSong, 'artist', metadata.artist);
@@ -307,7 +307,7 @@ class VSlice
fileEvents.push([event.t, [fields]]);
}
fileEvents.sort(sortByTime);
- pack.events = {events: fileEvents, format: 'psych_v1_convert'};
+ pack.events = {events: fileEvents, format: 'astro_v0.3_convert'};
}
return pack;
}
diff --git a/source/funkin/backend/system/MusicBeatState.hx b/source/funkin/backend/system/MusicBeatState.hx
index e6ea139b..8c397a6d 100644
--- a/source/funkin/backend/system/MusicBeatState.hx
+++ b/source/funkin/backend/system/MusicBeatState.hx
@@ -1,7 +1,6 @@
package funkin.backend.system;
import flixel.FlxG;
-import flixel.addons.ui.FlxUIState;
import funkin.game.states.PlayState;
import funkin.backend.Conductor;
import flixel.addons.transition.FlxTransitionableState;
@@ -10,7 +9,7 @@ import funkin.backend.utils.Controls;
import flixel.FlxCamera;
import flixel.FlxBasic;
-class MusicBeatState extends FlxUIState
+class MusicBeatState extends FlxState
{
private var curSection:Int = 0;
private var stepsToDo:Int = 0;
@@ -52,7 +51,6 @@ class MusicBeatState extends FlxUIState
FlxG.cameras.reset(camera);
FlxG.cameras.setDefaultDrawTarget(camera, true);
_astroCameraInitialized = true;
- //trace('initialized psych camera ' + Sys.cpuTime());
return camera;
}
@@ -149,40 +147,37 @@ class MusicBeatState extends FlxUIState
}
public static function switchState(nextState:FlxState)
- {
- // Custom made Trans in
- var curState:Dynamic = FlxG.state;
- var leState:MusicBeatState = curState;
- if (!FlxTransitionableState.skipNextTransIn)
{
- leState.openSubState(new FadeTransition(0.6, false));
- if (nextState == FlxG.state)
+ if(nextState == null) nextState = FlxG.state;
+ if(nextState == FlxG.state)
{
- FadeTransition.finishCallback = function()
- {
- FlxG.resetState();
- };
- // trace('resetted');
+ resetState();
+ return;
}
+
+ if(FlxTransitionableState.skipNextTransIn) FlxG.switchState(nextState);
+ else startTransition(nextState);
+ FlxTransitionableState.skipNextTransIn = false;
+ }
+
+ public static function resetState() {
+ if(FlxTransitionableState.skipNextTransIn) FlxG.resetState();
+ else startTransition();
+ FlxTransitionableState.skipNextTransIn = false;
+ }
+
+ // Custom made Trans in
+ public static function startTransition(nextState:FlxState = null)
+ {
+ if(nextState == null)
+ nextState = FlxG.state;
+
+ FlxG.state.openSubState(new FadeTransition(0.6, false));
+ if(nextState == FlxG.state)
+ FadeTransition.finishCallback = function() FlxG.resetState();
else
- {
- FadeTransition.finishCallback = function()
- {
- FlxG.switchState(nextState);
- };
- // trace('changed state');
- }
- return;
+ FadeTransition.finishCallback = function() FlxG.switchState(nextState);
}
- FlxTransitionableState.skipNextTransIn = false;
- FlxG.switchState(nextState);
- }
-
- public static function resetState()
- {
- MusicBeatState.switchState(FlxG.state);
- }
-
public static function getState():MusicBeatState
{
return cast (FlxG.state, MusicBeatState);
diff --git a/source/funkin/backend/utils/CacheUtils.hx b/source/funkin/backend/utils/CacheUtils.hx
index c9d5605e..24c30f50 100644
--- a/source/funkin/backend/utils/CacheUtils.hx
+++ b/source/funkin/backend/utils/CacheUtils.hx
@@ -20,19 +20,16 @@ class CacheUtils
{
final introStuffix = PlayState.instance.introSoundsSuffix;
- var introAssets:Map> = new Map>();
- introAssets.set('default', [
- 'UI/default/countdown/ready',
- 'UI/default/countdown/set',
- 'UI/default/countdown/go'
- ]);
- introAssets.set('pixel', ['UI/pixel/countdown/ready', 'UI/pixel/countdown/set', 'UI/pixel/countdown/date']);
-
- var introAlts:Array = introAssets.get('default');
- if (PlayState.isPixelStage)
- introAlts = introAssets.get('pixel');
+ var stageUI = PlayState?.stageUI;
+ var introAssets:Map> = new Map>();
+ var introImagesArray:Array = switch(stageUI) {
+ case "pixel": ['${stageUI}UI/ready-pixel', '${stageUI}UI/set-pixel', '${stageUI}UI/date-pixel'];
+ case "normal": ["ready", "set" ,"go"];
+ default: ['${stageUI}UI/ready', '${stageUI}UI/set', '${stageUI}UI/go'];
+ }
+ introAssets.set(stageUI, introImagesArray);
- for (asset in introAlts)
+ for (asset in introAssets.get(stageUI))
Paths.image(asset);
Paths.sound('intro3' + introStuffix);
diff --git a/source/funkin/backend/utils/ClientPrefs.hx b/source/funkin/backend/utils/ClientPrefs.hx
index 1e929aad..7eb18170 100644
--- a/source/funkin/backend/utils/ClientPrefs.hx
+++ b/source/funkin/backend/utils/ClientPrefs.hx
@@ -10,7 +10,7 @@ import funkin.game.Init.Volume;
@:structInit class SaveVariables
{
// if u use psych
- @:deprecated public var antialiasing:Bool = true;
+ @:deprecated("uhh psych") public var antialiasing:Bool = true;
public var globalAntialiasing(default,set):Bool = true;
private function set_globalAntialiasing (owo:Bool)
return globalAntialiasing = antialiasing = owo;
@@ -228,8 +228,9 @@ class ClientPrefs
{
keyBinds.set(control, keys);
}
- reloadControls();
}
+
+ reloadVolumeKeys();
}
public static function init()
@@ -239,7 +240,6 @@ class ClientPrefs
loadPrefs();
saveSettings();
#if windows WindowUtil.darkMode(data.darkMode); #end
-
trace("Initialization Successful");
}
catch (e)
@@ -254,15 +254,21 @@ class ClientPrefs
defaultValue = defaultData.gameplaySettings.get(name);
return (data.gameplaySettings.exists(name) ? data.gameplaySettings.get(name) : defaultValue);
}
-
- public static function reloadControls()
+
+ public static function reloadVolumeKeys()
+ {
+ Volume.muteKeys = copyKey(keyBinds.get('volume_mute'));
+ Volume.volumeDownKeys = copyKey(keyBinds.get('volume_down'));
+ Volume.volumeUpKeys = copyKey(keyBinds.get('volume_up'));
+
+ toggleVolumeKeys(true);
+ }
+ public static function toggleVolumeKeys(?turnOn:Bool = true)
{
- Volume.muteKeys = copyKey(keyBinds.get('volume_mute'));
- Volume.volumeDownKeys = copyKey(keyBinds.get('volume_down'));
- Volume.volumeUpKeys = copyKey(keyBinds.get('volume_up'));
- FlxG.sound.muteKeys = Volume.muteKeys;
- FlxG.sound.volumeDownKeys = Volume.volumeDownKeys;
- FlxG.sound.volumeUpKeys = Volume.volumeUpKeys;
+ final emptyArray = [];
+ FlxG.sound.muteKeys = turnOn ? Volume.muteKeys : emptyArray;
+ FlxG.sound.volumeDownKeys = turnOn ? Volume.volumeDownKeys : emptyArray;
+ FlxG.sound.volumeUpKeys = turnOn ? Volume.volumeUpKeys : emptyArray;
}
public static function copyKey(arrayToCopy:Array):Array
diff --git a/source/funkin/backend/utils/Paths.hx b/source/funkin/backend/utils/Paths.hx
index 7349e824..4bee8165 100644
--- a/source/funkin/backend/utils/Paths.hx
+++ b/source/funkin/backend/utils/Paths.hx
@@ -275,6 +275,7 @@ class Paths
localTrackedAssets.push(key);
return graph;
}
+
inline static public function getTextFromFile(key:String, ?ignoreMods:Bool = false):String
{
var path:String = getPath(key, TEXT, true);
diff --git a/source/funkin/game/Init.hx b/source/funkin/game/Init.hx
index 9b6b7bdd..21d9290e 100644
--- a/source/funkin/game/Init.hx
+++ b/source/funkin/game/Init.hx
@@ -23,7 +23,6 @@ class Init extends flixel.FlxState
Controls.instance = new Controls();
Logs.init();
- Volume.init();
funkin.backend.Highscore.init();
funkin.backend.utils.ClientPrefs.init();
MusicBeatState.init();
@@ -75,14 +74,6 @@ class Volume
public static var muteKeys:Array = [FlxKey.ZERO];
public static var volumeDownKeys:Array = [FlxKey.NUMPADMINUS, FlxKey.MINUS];
public static var volumeUpKeys:Array = [FlxKey.NUMPADPLUS, FlxKey.PLUS];
-
- public static function init():Void
- {
- FlxG.sound.muteKeys = muteKeys;
- FlxG.sound.volumeDownKeys = volumeDownKeys;
- FlxG.sound.volumeUpKeys = volumeUpKeys;
- FlxG.keys.preventDefaultKeys = [TAB];
- }
}
class Logs // Modded trace func
diff --git a/source/funkin/game/editors/CharacterEditorState.hx b/source/funkin/game/editors/CharacterEditorState.hx
index 9af7fc37..6da02ff8 100644
--- a/source/funkin/game/editors/CharacterEditorState.hx
+++ b/source/funkin/game/editors/CharacterEditorState.hx
@@ -873,6 +873,14 @@ class CharacterEditorState extends MusicBeatState implements FlxUIEventHandler.F
{
super.update(elapsed);
+
+ if(FlxUIInputText.focusOn != null)
+ {
+ ClientPrefs.toggleVolumeKeys(false);
+ return;
+ }
+ ClientPrefs.toggleVolumeKeys(true);
+
var shiftMult:Float = 1;
var ctrlMult:Float = 1;
var shiftMultBig:Float = 1;
diff --git a/source/funkin/game/editors/ChartingState.hx b/source/funkin/game/editors/ChartingState.hx
index 4f5b99fa..50ace1b9 100644
--- a/source/funkin/game/editors/ChartingState.hx
+++ b/source/funkin/game/editors/ChartingState.hx
@@ -25,11 +25,9 @@ import funkin.backend.Song.SwagSong;
import flixel.FlxG;
import flixel.FlxObject;
import flixel.util.FlxSave;
-import funkin.game.objects.FlxUIDropDownMenuCustom;
import flixel.FlxSprite;
import flixel.addons.display.FlxGridOverlay;
import flixel.addons.transition.FlxTransitionableState;
-import flixel.addons.ui.FlxUI9SliceSprite;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.group.FlxGroup;
import flixel.group.FlxSpriteGroup;
@@ -765,6 +763,9 @@ class ChartingState extends MusicBeatState implements FlxUIEventHandler.FlxUIEve
}
}
+ ClientPrefs.toggleVolumeKeys(FlxUIInputText.focusOn == null);
+
+
var lastTime:Float = Conductor.songPosition;
outputAlpha = Math.max(0, outputAlpha - elapsed);
var holdingAlt:Bool = FlxG.keys.pressed.ALT;
@@ -3608,7 +3609,7 @@ class ChartingState extends MusicBeatState implements FlxUIEventHandler.FlxUIEve
updateChartData();
var pack:VSlicePackage = VSlice.export(PlayState.SONG);
-
+ ClientPrefs.toggleVolumeKeys(false);
openSubState(new BasePrompt('Metadata',
function(state:BasePrompt)
{
@@ -3695,7 +3696,7 @@ class ChartingState extends MusicBeatState implements FlxUIEventHandler.FlxUIEve
return;
}
-
+ ClientPrefs.toggleVolumeKeys(false);
openSubState(new BasePrompt('Metadata',
function(state:BasePrompt)
{
@@ -4213,7 +4214,7 @@ class ChartingState extends MusicBeatState implements FlxUIEventHandler.FlxUIEve
btnY += 20;
var btn:FlxUIButton = new FlxUIButton(btnX, btnY, ' Waveform...', function()
{
-
+ ClientPrefs.toggleVolumeKeys(false);
openSubState(new BasePrompt(320, 200, 'Waveform Settings',
function(state:BasePrompt) {
upperBox.isMinimized = true;
@@ -4658,6 +4659,7 @@ class ChartingState extends MusicBeatState implements FlxUIEventHandler.FlxUIEve
override function closeSubState()
{
+ ClientPrefs.toggleVolumeKeys(true);
super.closeSubState();
upperBox.isMinimized = true;
upperBox.visible = mainBox.visible = infoBox.visible = true;
diff --git a/source/funkin/game/editors/DialogueCharacterEditorState.hx b/source/funkin/game/editors/DialogueCharacterEditorState.hx
index 13cb031a..ac1d9e0b 100644
--- a/source/funkin/game/editors/DialogueCharacterEditorState.hx
+++ b/source/funkin/game/editors/DialogueCharacterEditorState.hx
@@ -1,6 +1,6 @@
package funkin.game.editors;
-import funkin.game.objects.FlxUIDropDownMenuCustom;
+
import funkin.game.objects.TypedAlphabet;
#if desktop
import funkin.backend.client.Discord.DiscordClient;
@@ -14,13 +14,6 @@ import flixel.math.FlxMath;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import flixel.sound.FlxSound;
-import flixel.addons.ui.FlxInputText;
-import flixel.addons.ui.FlxUI9SliceSprite;
-import flixel.addons.ui.FlxUI;
-import flixel.addons.ui.FlxUICheckBox;
-import flixel.addons.ui.FlxUIInputText;
-import flixel.addons.ui.FlxUINumericStepper;
-import flixel.addons.ui.FlxUITabMenu;
import flixel.ui.FlxButton;
import openfl.net.FileReference;
import openfl.events.Event;
@@ -41,7 +34,7 @@ import funkin.backend.system.MusicBeatState;
import funkin.game.objects.stages.Stage;
-class DialogueCharacterEditorState extends MusicBeatState
+class DialogueCharacterEditorState extends MusicBeatState implements FlxUIEventHandler.FlxUIEvent
{
var box:FlxSprite;
var daText:TypedAlphabet = null;
@@ -78,15 +71,16 @@ class DialogueCharacterEditorState extends MusicBeatState
var ghostIdle:DialogueCharacter;
var curAnim:Int = 0;
+ var unsavedProgress:Bool = false;
override function create() {
persistentUpdate = persistentDraw = true;
camGame = initAstroCamera();
+ camGame.bgColor = FlxColor.fromHSL(0, 0, 0.5);
camHUD = new FlxCamera();
camHUD.bgColor.alpha = 0;
-
FlxG.cameras.add(camHUD, false);
-
+
Paths.setCurrentLevel('week1');
new Stage();
var uhh = new FlxSprite().makeGraphic(FlxG.width,FlxG.height,FlxColor.BLACK);//im lazy to day Fuck types
@@ -110,7 +104,7 @@ class DialogueCharacterEditorState extends MusicBeatState
ghostLoop.isGhost = true;
ghostLoop.jsonFile = character.jsonFile;
ghostLoop.cameras = [camGame];
- add(ghostLoop);
+ mainGroup.add(ghostLoop);
ghostIdle = new DialogueCharacter();
ghostIdle.alpha = 0;
@@ -118,12 +112,12 @@ class DialogueCharacterEditorState extends MusicBeatState
ghostIdle.isGhost = true;
ghostIdle.jsonFile = character.jsonFile;
ghostIdle.cameras = [camGame];
- add(ghostIdle);
+ mainGroup.add(ghostIdle);
box = new FlxSprite(70, 370);
+ box.antialiasing = ClientPrefs.data.antialiasing;
box.frames = Paths.getSparrowAtlas('speech_bubble');
box.scrollFactor.set();
- box.antialiasing = funkin.backend.utils.ClientPrefs.data.globalAntialiasing;
box.animation.addByPrefix('normal', 'speech bubble normal', 24);
box.animation.addByPrefix('center', 'speech bubble middle', 24);
box.animation.play('normal', true);
@@ -161,8 +155,7 @@ class DialogueCharacterEditorState extends MusicBeatState
updateTextBox();
daText = new TypedAlphabet(DialogueBoxPsych.DEFAULT_TEXT_X, DialogueBoxPsych.DEFAULT_TEXT_Y, '', 0.05, false);
- daText.scaleX = 0.7;
- daText.scaleY = 0.7;
+ daText.setScale(0.7);
daText.text = DEFAULT_TEXT;
hudGroup.add(daText);
@@ -173,89 +166,61 @@ class DialogueCharacterEditorState extends MusicBeatState
super.create();
}
- var UI_typebox:FlxUITabMenu;
- var UI_mainbox:FlxUITabMenu;
+ var UI_typebox:FlxUIBox;
+ var UI_mainbox:FlxUIBox;
function addEditorBox() {
- var tabs = [
- {name: 'Character Type', label: 'Character Type'},
- ];
- UI_typebox = new FlxUITabMenu(null, tabs, true);
- UI_typebox.resize(120, 180);
- UI_typebox.x = 900;
- UI_typebox.y = FlxG.height - UI_typebox.height - 50;
+ UI_typebox = new FlxUIBox(900, FlxG.height - 230, 120, 180, ['Character Type']);
UI_typebox.scrollFactor.set();
- UI_typebox.camera = camHUD;
+ UI_typebox.cameras = [camHUD];
addTypeUI();
add(UI_typebox);
- var tabs = [
- {name: 'Animations', label: 'Animations'},
- {name: 'Character', label: 'Character'},
- ];
- UI_mainbox = new FlxUITabMenu(null, tabs, true);
- UI_mainbox.resize(200, 250);
- UI_mainbox.x = UI_typebox.x + UI_typebox.width;
- UI_mainbox.y = FlxG.height - UI_mainbox.height - 50;
+ UI_mainbox = new FlxUIBox(UI_typebox.x + UI_typebox.width + 10, FlxG.height - 300, 200, 250, ['Animations', 'Character']);
UI_mainbox.scrollFactor.set();
- UI_mainbox.camera = camHUD;
+ UI_mainbox.cameras = [camHUD];
addAnimationsUI();
addCharacterUI();
add(UI_mainbox);
- UI_mainbox.selected_tab_id = 'Character';
- lastTab = UI_mainbox.selected_tab_id;
+ UI_mainbox.selectedName = 'Character';
+ lastTab = UI_mainbox.selectedName;
}
- var leftCheckbox:FlxUICheckBox;
- var centerCheckbox:FlxUICheckBox;
- var rightCheckbox:FlxUICheckBox;
+ var characterTypeRadio:FlxUIRadioGroup;
function addTypeUI() {
- var tab_group = new FlxUI(null, UI_typebox);
- tab_group.name = "Character Type";
-
- leftCheckbox = new FlxUICheckBox(10, 20, null, null, "Left", 100);
- leftCheckbox.callback = function()
- {
- character.jsonFile.dialogue_pos = 'left';
- updateCharTypeBox();
- };
-
- centerCheckbox = new FlxUICheckBox(leftCheckbox.x, leftCheckbox.y + 40, null, null, "Center", 100);
- centerCheckbox.callback = function()
- {
- character.jsonFile.dialogue_pos = 'center';
- updateCharTypeBox();
- };
-
- rightCheckbox = new FlxUICheckBox(centerCheckbox.x, centerCheckbox.y + 40, null, null, "Right", 100);
- rightCheckbox.callback = function()
- {
- character.jsonFile.dialogue_pos = 'right';
+ var tab_group = UI_typebox.getTab('Character Type').menu;
+
+ characterTypeRadio = new FlxUIRadioGroup(10, 20, ['Left', 'Center', 'Right'], 40);
+ characterTypeRadio.checked = 0;
+ characterTypeRadio.onClick = function() {
+ switch(characterTypeRadio.checked)
+ {
+ case 0:
+ character.jsonFile.dialogue_pos = 'left';
+ case 1:
+ character.jsonFile.dialogue_pos = 'center';
+ case 2:
+ character.jsonFile.dialogue_pos = 'right';
+ }
updateCharTypeBox();
- };
-
- tab_group.add(leftCheckbox);
- tab_group.add(centerCheckbox);
- tab_group.add(rightCheckbox);
- UI_typebox.addGroup(tab_group);
+ }
+ tab_group.add(characterTypeRadio);
}
var curSelectedAnim:String;
var animationArray:Array = [];
- var animationDropDown:FlxUIDropDownMenuCustom;
+ var animationDropDown:FlxUIDropDownMenu;
var animationInputText:FlxUIInputText;
var loopInputText:FlxUIInputText;
var idleInputText:FlxUIInputText;
function addAnimationsUI() {
- var tab_group = new FlxUI(null, UI_mainbox);
- tab_group.name = "Animations";
+ var tab_group = UI_mainbox.getTab('Animations').menu;
- animationDropDown = new FlxUIDropDownMenuCustom(10, 30, FlxUIDropDownMenuCustom.makeStrIdLabelArray([''], true), function(animation:String) {
- var anim:String = animationArray[Std.parseInt(animation)];
- if(character.dialogueAnimations.exists(anim)) {
- ghostLoop.playAnim(anim);
- ghostIdle.playAnim(anim, true);
+ animationDropDown = new FlxUIDropDownMenu(10, 30, [''], function(id:Int, animation:String) {
+ if(character.dialogueAnimations.exists(animation)) {
+ ghostLoop.playAnim(animation);
+ ghostIdle.playAnim(animation, true);
- curSelectedAnim = anim;
+ curSelectedAnim = animation;
var animShit:DialogueAnimArray = character.dialogueAnimations.get(curSelectedAnim);
offsetLoopText.text = 'Loop: ' + animShit.loop_offsets;
offsetIdleText.text = 'Idle: ' + animShit.idle_offsets;
@@ -267,13 +232,10 @@ class DialogueCharacterEditorState extends MusicBeatState
});
animationInputText = new FlxUIInputText(15, 85, 80, '', 8);
- blockPressWhileTypingOn.push(animationInputText);
loopInputText = new FlxUIInputText(animationInputText.x, animationInputText.y + 35, 150, '', 8);
- blockPressWhileTypingOn.push(loopInputText);
idleInputText = new FlxUIInputText(loopInputText.x, loopInputText.y + 40, 150, '', 8);
- blockPressWhileTypingOn.push(idleInputText);
- var addUpdateButton:FlxButton = new FlxButton(10, idleInputText.y + 30, "Add/Update", function() {
+ var addUpdateButton:FlxUIButton = new FlxUIButton(10, idleInputText.y + 30, "Add/Update", function() {
var theAnim:String = animationInputText.text.trim();
if(character.dialogueAnimations.exists(theAnim)) //Update
{
@@ -314,7 +276,7 @@ class DialogueCharacterEditorState extends MusicBeatState
}
});
- var removeUpdateButton:FlxButton = new FlxButton(100, addUpdateButton.y, "Remove", function() {
+ var removeUpdateButton:FlxUIButton = new FlxUIButton(100, addUpdateButton.y, "Remove", function() {
for (i in 0...character.jsonFile.animations.length) {
var animArray:DialogueAnimArray = character.jsonFile.animations[i];
if(animArray != null && animArray.anim.trim() == animationInputText.text.trim()) {
@@ -348,7 +310,6 @@ class DialogueCharacterEditorState extends MusicBeatState
tab_group.add(addUpdateButton);
tab_group.add(removeUpdateButton);
tab_group.add(animationDropDown);
- UI_mainbox.addGroup(tab_group);
reloadAnimationsDropDown();
}
@@ -359,27 +320,24 @@ class DialogueCharacterEditorState extends MusicBeatState
}
if(animationArray.length < 1) animationArray = [''];
- animationDropDown.setData(FlxUIDropDownMenuCustom.makeStrIdLabelArray(animationArray, true));
+ animationDropDown.list = animationArray;
}
var imageInputText:FlxUIInputText;
var scaleStepper:FlxUINumericStepper;
var xStepper:FlxUINumericStepper;
var yStepper:FlxUINumericStepper;
- var blockPressWhileTypingOn:Array = [];
function addCharacterUI() {
- var tab_group = new FlxUI(null, UI_mainbox);
- tab_group.name = "Character";
+ var tab_group = UI_mainbox.getTab('Character').menu;
imageInputText = new FlxUIInputText(10, 30, 80, character.jsonFile.image, 8);
- blockPressWhileTypingOn.push(imageInputText);
xStepper = new FlxUINumericStepper(imageInputText.x, imageInputText.y + 50, 10, character.jsonFile.position[0], -2000, 2000, 0);
yStepper = new FlxUINumericStepper(imageInputText.x + 80, xStepper.y, 10, character.jsonFile.position[1], -2000, 2000, 0);
scaleStepper = new FlxUINumericStepper(imageInputText.x, xStepper.y + 50, 0.05, character.jsonFile.scale, 0.1, 10, 2);
- var noAntialiasingCheckbox:FlxUICheckBox = new FlxUICheckBox(scaleStepper.x + 80, scaleStepper.y, null, null, "No Antialiasing", 100);
+ var noAntialiasingCheckbox:FlxUICheckBox = new FlxUICheckBox(scaleStepper.x + 80, scaleStepper.y, "No Antialiasing", 100);
noAntialiasingCheckbox.checked = (character.jsonFile.no_antialiasing == true);
- noAntialiasingCheckbox.callback = function()
+ noAntialiasingCheckbox.onClick = function()
{
character.jsonFile.no_antialiasing = noAntialiasingCheckbox.checked;
character.antialiasing = !character.jsonFile.no_antialiasing;
@@ -394,34 +352,31 @@ class DialogueCharacterEditorState extends MusicBeatState
tab_group.add(scaleStepper);
tab_group.add(noAntialiasingCheckbox);
- var reloadImageButton:FlxButton = new FlxButton(10, scaleStepper.y + 60, "Reload Image", function() {
+ var reloadImageButton:FlxUIButton = new FlxUIButton(10, scaleStepper.y + 60, "Reload Image", function() {
reloadCharacter();
});
- var loadButton:FlxButton = new FlxButton(reloadImageButton.x + 100, reloadImageButton.y, "Load Character", function() {
+ var loadButton:FlxUIButton = new FlxUIButton(reloadImageButton.x + 100, reloadImageButton.y, "Load Character", function() {
loadCharacter();
});
- var saveButton:FlxButton = new FlxButton(loadButton.x, reloadImageButton.y - 25, "Save Character", function() {
+ var saveButton:FlxUIButton = new FlxUIButton(loadButton.x, reloadImageButton.y - 25, "Save Character", function() {
saveCharacter();
});
tab_group.add(reloadImageButton);
tab_group.add(loadButton);
tab_group.add(saveButton);
- UI_mainbox.addGroup(tab_group);
}
- function updateCharTypeBox() {
- leftCheckbox.checked = false;
- centerCheckbox.checked = false;
- rightCheckbox.checked = false;
-
- switch(character.jsonFile.dialogue_pos) {
+ function updateCharTypeBox()
+ {
+ switch(character.jsonFile.dialogue_pos)
+ {
case 'left':
- leftCheckbox.checked = true;
+ characterTypeRadio.checked = 0;
case 'center':
- centerCheckbox.checked = true;
- case 'right':
- rightCheckbox.checked = true;
+ characterTypeRadio.checked = 1;
+ default:
+ characterTypeRadio.checked = 2;
}
reloadCharacter();
updateTextBox();
@@ -464,7 +419,7 @@ class DialogueCharacterEditorState extends MusicBeatState
curAnim = 0;
animText.text = 'Animation: ' + character.jsonFile.animations[curAnim].anim + ' (' + (curAnim + 1) +' / ' + character.jsonFile.animations.length + ') - Press W or S to scroll';
- #if desktop
+ #if DISCORD_ALLOWED
// Updating Discord Rich Presence
DiscordClient.changePresence("Dialogue Character Editor", "Editting: " + character.jsonFile.image);
#end
@@ -483,9 +438,14 @@ class DialogueCharacterEditorState extends MusicBeatState
DialogueBoxPsych.updateBoxOffsets(box);
}
- override function getEvent(id:String, sender:Dynamic, data:Dynamic, ?params:Array) {
+ public function UIEvent(id:String, sender:Dynamic) {
+ //trace(id, sender);
+ if(id == FlxUICheckBox.CLICK_EVENT)
+ unsavedProgress = true;
+
if(id == FlxUIInputText.CHANGE_EVENT && sender == imageInputText) {
character.jsonFile.image = imageInputText.text;
+ unsavedProgress = true;
} else if(id == FlxUINumericStepper.CHANGE_EVENT && (sender is FlxUINumericStepper)) {
if(sender == scaleStepper) {
character.jsonFile.scale = scaleStepper.value;
@@ -497,6 +457,7 @@ class DialogueCharacterEditorState extends MusicBeatState
character.jsonFile.position[1] = yStepper.value;
reloadCharacter();
}
+ unsavedProgress = true;
}
}
@@ -504,10 +465,9 @@ class DialogueCharacterEditorState extends MusicBeatState
var lastTab:String = 'Character';
var transitioning:Bool = false;
override function update(elapsed:Float) {
- if(transitioning) {
- super.update(elapsed);
+ super.update(elapsed);
+ if(transitioning)
return;
- }
if(character.animation.curAnim != null) {
if(daText.finishedText) {
@@ -519,24 +479,10 @@ class DialogueCharacterEditorState extends MusicBeatState
}
}
- var blockInput:Bool = false;
- for (inputText in blockPressWhileTypingOn) {
- if(inputText.hasFocus) {
- FlxG.sound.muteKeys = [];
- FlxG.sound.volumeDownKeys = [];
- FlxG.sound.volumeUpKeys = [];
- blockInput = true;
-
- if(FlxG.keys.justPressed.ENTER) inputText.hasFocus = false;
- break;
- }
- }
-
- if(!blockInput && !animationDropDown.dropPanel.visible) {
- FlxG.sound.muteKeys = funkin.game.Init.Volume.muteKeys;
- FlxG.sound.volumeDownKeys = funkin.game.Init.Volume.volumeDownKeys;
- FlxG.sound.volumeUpKeys = funkin.game.Init.Volume.volumeUpKeys;
- if(FlxG.keys.justPressed.SPACE && UI_mainbox.selected_tab_id == 'Character') {
+ if(FlxUIInputText.focusOn == null)
+ {
+ ClientPrefs.toggleVolumeKeys(true);
+ if(FlxG.keys.justPressed.SPACE && UI_mainbox.selectedName == 'Character') {
character.playAnim(character.jsonFile.animations[curAnim].anim);
daText.resetDialogue();
updateTextBox();
@@ -562,7 +508,7 @@ class DialogueCharacterEditorState extends MusicBeatState
}
}
- if(UI_mainbox.selected_tab_id == 'Animations' && curSelectedAnim != null && character.dialogueAnimations.exists(curSelectedAnim)) {
+ if(UI_mainbox.selectedName == 'Animations' && curSelectedAnim != null && character.dialogueAnimations.exists(curSelectedAnim)) {
var moved:Bool = false;
var animShit:DialogueAnimArray = character.dialogueAnimations.get(curSelectedAnim);
var controlArrayLoop:Array = [FlxG.keys.justPressed.A, FlxG.keys.justPressed.W, FlxG.keys.justPressed.D, FlxG.keys.justPressed.S];
@@ -605,7 +551,7 @@ class DialogueCharacterEditorState extends MusicBeatState
if(camGame.zoom > 1) camGame.zoom = 1;
}
if(FlxG.keys.justPressed.H) {
- if(UI_mainbox.selected_tab_id == 'Animations') {
+ if(UI_mainbox.selectedName == 'Animations') {
currentGhosts++;
if(currentGhosts > 2) currentGhosts = 0;
@@ -623,8 +569,8 @@ class DialogueCharacterEditorState extends MusicBeatState
hudGroup.visible = true;
}
- if(UI_mainbox.selected_tab_id != lastTab) {
- if(UI_mainbox.selected_tab_id == 'Animations') {
+ if(UI_mainbox.selectedName != lastTab) {
+ if(UI_mainbox.selectedName == 'Animations') {
hudGroup.alpha = 0;
mainGroup.alpha = 0;
ghostLoop.alpha = 0.6;
@@ -652,11 +598,11 @@ class DialogueCharacterEditorState extends MusicBeatState
character.playAnim(character.jsonFile.animations[curAnim].anim);
animText.text = 'Animation: ' + character.jsonFile.animations[curAnim].anim + ' (' + (curAnim + 1) +' / ' + character.jsonFile.animations.length + ') - Press W or S to scroll';
}
- lastTab = UI_mainbox.selected_tab_id;
+ lastTab = UI_mainbox.selectedName;
currentGhosts = 0;
}
- if(UI_mainbox.selected_tab_id == 'Character')
+ if(UI_mainbox.selectedName == 'Character')
{
var negaMult:Array = [1, -1];
var controlAnim:Array = [FlxG.keys.justPressed.W, FlxG.keys.justPressed.S];
@@ -680,9 +626,13 @@ class DialogueCharacterEditorState extends MusicBeatState
}
if(FlxG.keys.justPressed.ESCAPE) {
- MusicBeatState.switchState(new funkin.game.editors.MasterEditorMenu());
- FlxG.sound.playMusic(Paths.music('freakyMenu'), 1);
- transitioning = true;
+ if(!unsavedProgress)
+ {
+ MusicBeatState.switchState(new MasterEditorMenu());
+ FlxG.sound.playMusic(Paths.music('freakyMenu'));
+ transitioning = true;
+ }
+ else openSubState(new ExitConfirmationPrompt(function() transitioning = true));
}
ghostLoop.setPosition(character.x, character.y);
@@ -690,14 +640,14 @@ class DialogueCharacterEditorState extends MusicBeatState
hudGroup.x = mainGroup.x;
hudGroup.y = mainGroup.y;
}
- super.update(elapsed);
+ else ClientPrefs.toggleVolumeKeys(false);
}
var _file:FileReference = null;
function loadCharacter() {
var jsonFilter:FileFilter = new FileFilter('JSON', 'json');
_file = new FileReference();
- _file.addEventListener(Event.SELECT, onLoadComplete);
+ _file.addEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.addEventListener(Event.CANCEL, onLoadCancel);
_file.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file.browse([jsonFilter]);
@@ -705,7 +655,7 @@ class DialogueCharacterEditorState extends MusicBeatState
function onLoadComplete(_):Void
{
- _file.removeEventListener(Event.SELECT, onLoadComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.removeEventListener(Event.CANCEL, onLoadCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
@@ -748,7 +698,7 @@ class DialogueCharacterEditorState extends MusicBeatState
*/
function onLoadCancel(_):Void
{
- _file.removeEventListener(Event.SELECT, onLoadComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.removeEventListener(Event.CANCEL, onLoadCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file = null;
@@ -760,7 +710,7 @@ class DialogueCharacterEditorState extends MusicBeatState
*/
function onLoadError(_):Void
{
- _file.removeEventListener(Event.SELECT, onLoadComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.removeEventListener(Event.CANCEL, onLoadCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file = null;
@@ -768,14 +718,14 @@ class DialogueCharacterEditorState extends MusicBeatState
}
function saveCharacter() {
- var data:String = Json.stringify(character.jsonFile, "\t");
+ var data:String = haxe.Json.stringify(character.jsonFile, "\t");
if (data.length > 0)
{
var splittedImage:Array = imageInputText.text.trim().split('_');
var characterName:String = splittedImage[0].toLowerCase().replace(' ', '');
_file = new FileReference();
- _file.addEventListener(Event.COMPLETE, onSaveComplete);
+ _file.addEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.addEventListener(Event.CANCEL, onSaveCancel);
_file.addEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file.save(data, characterName + ".json");
@@ -784,7 +734,7 @@ class DialogueCharacterEditorState extends MusicBeatState
function onSaveComplete(_):Void
{
- _file.removeEventListener(Event.COMPLETE, onSaveComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
@@ -796,7 +746,7 @@ class DialogueCharacterEditorState extends MusicBeatState
*/
function onSaveCancel(_):Void
{
- _file.removeEventListener(Event.COMPLETE, onSaveComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
@@ -807,7 +757,7 @@ class DialogueCharacterEditorState extends MusicBeatState
*/
function onSaveError(_):Void
{
- _file.removeEventListener(Event.COMPLETE, onSaveComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
diff --git a/source/funkin/game/editors/DialogueEditorState.hx b/source/funkin/game/editors/DialogueEditorState.hx
index 298498bc..7448942c 100644
--- a/source/funkin/game/editors/DialogueEditorState.hx
+++ b/source/funkin/game/editors/DialogueEditorState.hx
@@ -13,13 +13,6 @@ import flixel.math.FlxMath;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import flixel.sound.FlxSound;
-import flixel.addons.ui.FlxInputText;
-import flixel.addons.ui.FlxUI9SliceSprite;
-import flixel.addons.ui.FlxUI;
-import flixel.addons.ui.FlxUICheckBox;
-import flixel.addons.ui.FlxUIInputText;
-import flixel.addons.ui.FlxUINumericStepper;
-import flixel.addons.ui.FlxUITabMenu;
import flixel.ui.FlxButton;
import openfl.net.FileReference;
@@ -39,7 +32,7 @@ import funkin.backend.system.MusicBeatState;
import funkin.game.objects.stages.Stage;
-class DialogueEditorState extends MusicBeatState
+class DialogueEditorState extends MusicBeatState implements FlxUIEventHandler.FlxUIEvent
{
var character:DialogueCharacter;
var box:FlxSprite;
@@ -50,10 +43,11 @@ class DialogueEditorState extends MusicBeatState
var defaultLine:DialogueLine;
var dialogueFile:DialogueFile = null;
+ var unsavedProgress:Bool = false;
override function create() {
persistentUpdate = persistentDraw = true;
- //FlxG.camera.bgColor = FlxColor.fromHSL(0, 0, 0.5);
+ FlxG.camera.bgColor = FlxColor.fromHSL(0, 0, 0.5);
Paths.setCurrentLevel('week1');
new Stage();
@@ -81,9 +75,9 @@ class DialogueEditorState extends MusicBeatState
add(character);
box = new FlxSprite(70, 370);
+ box.antialiasing = ClientPrefs.data.antialiasing;
box.frames = Paths.getSparrowAtlas('speech_bubble');
box.scrollFactor.set();
- box.antialiasing = funkin.backend.utils.ClientPrefs.data.globalAntialiasing;
box.animation.addByPrefix('normal', 'speech bubble normal', 24);
box.animation.addByPrefix('angry', 'AHH speech bubble', 24);
box.animation.addByPrefix('center', 'speech bubble middle', 24);
@@ -112,24 +106,17 @@ class DialogueEditorState extends MusicBeatState
add(animText);
daText = new TypedAlphabet(DialogueBoxPsych.DEFAULT_TEXT_X, DialogueBoxPsych.DEFAULT_TEXT_Y, DEFAULT_TEXT);
- daText.scaleX = 0.7;
- daText.scaleY = 0.7;
+ daText.setScale(0.7);
add(daText);
changeText();
super.create();
}
- var UI_box:FlxUITabMenu;
- function addEditorBox() {
- var tabs = [
- {name: 'Dialogue Line', label: 'Dialogue Line'},
- ];
- UI_box = new FlxUITabMenu(null, tabs, true);
- UI_box.resize(250, 210);
- UI_box.x = FlxG.width - UI_box.width - 10;
- UI_box.y = 10;
+ var UI_box:FlxUIBox;
+ function addEditorBox()
+ {
+ UI_box = new FlxUIBox(FlxG.width - 260, 10, 250, 210, ['Dialogue Line']);
UI_box.scrollFactor.set();
- UI_box.alpha = 0.8;
addDialogueLineUI();
add(UI_box);
}
@@ -140,31 +127,34 @@ class DialogueEditorState extends MusicBeatState
var speedStepper:FlxUINumericStepper;
var soundInputText:FlxUIInputText;
function addDialogueLineUI() {
- var tab_group = new FlxUI(null, UI_box);
- tab_group.name = "Dialogue Line";
+ var tab_group = UI_box.getTab('Dialogue Line').menu;
characterInputText = new FlxUIInputText(10, 20, 80, DialogueCharacter.DEFAULT_CHARACTER, 8);
- blockPressWhileTypingOn.push(characterInputText);
-
speedStepper = new FlxUINumericStepper(10, characterInputText.y + 40, 0.005, 0.05, 0, 0.5, 3);
- angryCheckbox = new FlxUICheckBox(speedStepper.x + 120, speedStepper.y, null, null, "Angry Textbox", 200);
- angryCheckbox.callback = function()
+ angryCheckbox = new FlxUICheckBox(speedStepper.x + 120, speedStepper.y, "Angry Textbox", 200);
+ angryCheckbox.onClick = function()
{
updateTextBox();
dialogueFile.dialogue[curSelected].boxState = (angryCheckbox.checked ? 'angry' : 'normal');
};
soundInputText = new FlxUIInputText(10, speedStepper.y + 40, 150, '', 8);
- blockPressWhileTypingOn.push(soundInputText);
-
lineInputText = new FlxUIInputText(10, soundInputText.y + 35, 200, DEFAULT_TEXT, 8);
- blockPressWhileTypingOn.push(lineInputText);
+ lineInputText.onPressEnter = function(e)
+ {
+ if(e.shiftKey)
+ {
+ lineInputText.text += '\n';
+ lineInputText.caretIndex++;
+ }
+ else FlxUIInputText.focusOn = null;
+ };
- var loadButton:FlxButton = new FlxButton(20, lineInputText.y + 25, "Load Dialogue", function() {
+ var loadButton:FlxUIButton = new FlxUIButton(20, lineInputText.y + 25, "Load Dialogue", function() {
loadDialogue();
});
- var saveButton:FlxButton = new FlxButton(loadButton.x + 120, loadButton.y, "Save Dialogue", function() {
+ var saveButton:FlxUIButton = new FlxUIButton(loadButton.x + 120, loadButton.y, "Save Dialogue", function() {
saveDialogue();
});
@@ -179,7 +169,6 @@ class DialogueEditorState extends MusicBeatState
tab_group.add(lineInputText);
tab_group.add(loadButton);
tab_group.add(saveButton);
- UI_box.addGroup(tab_group);
}
function copyDefaultLine():DialogueLine {
@@ -250,7 +239,6 @@ class DialogueEditorState extends MusicBeatState
if(textToType == null || textToType.length < 1) textToType = ' ';
daText.text = textToType;
- daText.resetDialogue();
if(skipDialogue)
daText.finishText();
@@ -265,7 +253,7 @@ class DialogueEditorState extends MusicBeatState
daText.y = DialogueBoxPsych.DEFAULT_TEXT_Y;
if(daText.rows > 2) daText.y -= DialogueBoxPsych.LONG_TEXT_ADD;
- #if desktop
+ #if DISCORD_ALLOWED
// Updating Discord Rich Presence
var rpcText:String = lineInputText.text;
if(rpcText == null || rpcText.length < 1) rpcText = '(Empty)';
@@ -274,7 +262,10 @@ class DialogueEditorState extends MusicBeatState
#end
}
- override function getEvent(id:String, sender:Dynamic, data:Dynamic, ?params:Array) {
+ public function UIEvent(id:String, sender:Dynamic) {
+ if(id == FlxUICheckBox.CLICK_EVENT)
+ unsavedProgress = true;
+
if(id == FlxUIInputText.CHANGE_EVENT && (sender is FlxUIInputText)) {
if (sender == characterInputText)
{
@@ -309,6 +300,7 @@ class DialogueEditorState extends MusicBeatState
daText.sound = soundInputText.text;
if(daText.sound == null) daText.sound = '';
}
+ unsavedProgress = true;
} else if(id == FlxUINumericStepper.CHANGE_EVENT && (sender == speedStepper)) {
dialogueFile.dialogue[curSelected].speed = speedStepper.value;
if(Math.isNaN(dialogueFile.dialogue[curSelected].speed) || dialogueFile.dialogue[curSelected].speed == null || dialogueFile.dialogue[curSelected].speed < 0.001) {
@@ -316,12 +308,12 @@ class DialogueEditorState extends MusicBeatState
}
daText.delay = dialogueFile.dialogue[curSelected].speed;
reloadText(false);
+ unsavedProgress = true;
}
}
var curSelected:Int = 0;
var curAnim:Int = 0;
- var blockPressWhileTypingOn:Array = [];
var transitioning:Bool = false;
override function update(elapsed:Float) {
if(transitioning) {
@@ -339,37 +331,21 @@ class DialogueEditorState extends MusicBeatState
}
}
- var blockInput:Bool = false;
- for (inputText in blockPressWhileTypingOn) {
- if(inputText.hasFocus) {
- FlxG.sound.muteKeys = [];
- FlxG.sound.volumeDownKeys = [];
- FlxG.sound.volumeUpKeys = [];
- blockInput = true;
-
- if(FlxG.keys.justPressed.ENTER) {
- if(inputText == lineInputText) {
- inputText.text += '\\n';
- inputText.caretIndex += 2;
- } else {
- inputText.hasFocus = false;
- }
- }
- break;
- }
- }
-
- if(!blockInput) {
- FlxG.sound.muteKeys = funkin.game.Init.Volume.muteKeys;
- FlxG.sound.volumeDownKeys = funkin.game.Init.Volume.volumeDownKeys;
- FlxG.sound.volumeUpKeys = funkin.game.Init.Volume.volumeUpKeys;
+ if(FlxUIInputText.focusOn == null)
+ {
+ ClientPrefs.toggleVolumeKeys(true);
if(FlxG.keys.justPressed.SPACE) {
reloadText(false);
}
if(FlxG.keys.justPressed.ESCAPE) {
- MusicBeatState.switchState(new funkin.game.editors.MasterEditorMenu());
- FlxG.sound.playMusic(Paths.music('freakyMenu'), 1);
- transitioning = true;
+ if(!unsavedProgress)
+ {
+ MusicBeatState.switchState(new MasterEditorMenu());
+ FlxG.sound.playMusic(Paths.music('freakyMenu'));
+ transitioning = true;
+ }
+ else openSubState(new ExitConfirmationPrompt(function() transitioning = true));
+ return;
}
var negaMult:Array = [1, -1];
var controlAnim:Array = [FlxG.keys.justPressed.W, FlxG.keys.justPressed.S];
@@ -406,13 +382,12 @@ class DialogueEditorState extends MusicBeatState
changeText(1);
}
}
+ else ClientPrefs.toggleVolumeKeys(false);
super.update(elapsed);
}
function changeText(add:Int = 0) {
- curSelected += add;
- if(curSelected < 0) curSelected = dialogueFile.dialogue.length - 1;
- else if(curSelected >= dialogueFile.dialogue.length) curSelected = 0;
+ curSelected = FlxMath.wrap(curSelected + add, 0, dialogueFile.dialogue.length - 1);
var curDialogue:DialogueLine = dialogueFile.dialogue[curSelected];
characterInputText.text = curDialogue.portrait;
@@ -433,20 +408,22 @@ class DialogueEditorState extends MusicBeatState
reloadText(false);
updateTextBox();
- var leLength:Int = character.jsonFile.animations.length;
- if(leLength > 0) {
- for (i in 0...leLength) {
- var leAnim:DialogueAnimArray = character.jsonFile.animations[i];
- if(leAnim != null && leAnim.anim == curDialogue.expression) {
- curAnim = i;
+ if(character.jsonFile.animations.length > 0)
+ {
+ for (num => animData in character.jsonFile.animations)
+ {
+ if(animData != null && animData.anim == curDialogue.expression)
+ {
+ curAnim = num;
break;
}
}
- character.playAnim(character.jsonFile.animations[curAnim].anim, daText.finishedText);
- animText.text = 'Animation: ' + character.jsonFile.animations[curAnim].anim + ' (' + (curAnim + 1) +' / ' + leLength + ') - Press W or S to scroll';
- } else {
- animText.text = 'ERROR! NO ANIMATIONS FOUND';
+
+ var selectedAnim:String = character.jsonFile.animations[curAnim].anim;
+ character.playAnim(selectedAnim, daText.finishedText);
+ animText.text = 'Animation: $selectedAnim (${curAnim + 1} / ${character.jsonFile.animations.length} ) - Press W or S to scroll';
}
+ else animText.text = 'ERROR! NO ANIMATIONS FOUND';
characterAnimSpeed();
selectedText.text = 'Line: (' + (curSelected + 1) + ' / ' + dialogueFile.dialogue.length + ') - Press A or D to scroll';
@@ -466,7 +443,7 @@ class DialogueEditorState extends MusicBeatState
function loadDialogue() {
var jsonFilter:FileFilter = new FileFilter('JSON', 'json');
_file = new FileReference();
- _file.addEventListener(Event.SELECT, onLoadComplete);
+ _file.addEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.addEventListener(Event.CANCEL, onLoadCancel);
_file.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file.browse([jsonFilter]);
@@ -474,7 +451,7 @@ class DialogueEditorState extends MusicBeatState
function onLoadComplete(_):Void
{
- _file.removeEventListener(Event.SELECT, onLoadComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.removeEventListener(Event.CANCEL, onLoadCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
@@ -509,7 +486,7 @@ class DialogueEditorState extends MusicBeatState
*/
function onLoadCancel(_):Void
{
- _file.removeEventListener(Event.SELECT, onLoadComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.removeEventListener(Event.CANCEL, onLoadCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file = null;
@@ -521,7 +498,7 @@ class DialogueEditorState extends MusicBeatState
*/
function onLoadError(_):Void
{
- _file.removeEventListener(Event.SELECT, onLoadComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.removeEventListener(Event.CANCEL, onLoadCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file = null;
@@ -529,11 +506,11 @@ class DialogueEditorState extends MusicBeatState
}
function saveDialogue() {
- var data:String = Json.stringify(dialogueFile, "\t");
+ var data:String = haxe.Json.stringify(dialogueFile, "\t");
if (data.length > 0)
{
_file = new FileReference();
- _file.addEventListener(Event.COMPLETE, onSaveComplete);
+ _file.addEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.addEventListener(Event.CANCEL, onSaveCancel);
_file.addEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file.save(data, "dialogue.json");
@@ -542,7 +519,7 @@ class DialogueEditorState extends MusicBeatState
function onSaveComplete(_):Void
{
- _file.removeEventListener(Event.COMPLETE, onSaveComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
@@ -554,7 +531,7 @@ class DialogueEditorState extends MusicBeatState
*/
function onSaveCancel(_):Void
{
- _file.removeEventListener(Event.COMPLETE, onSaveComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
@@ -565,7 +542,7 @@ class DialogueEditorState extends MusicBeatState
*/
function onSaveError(_):Void
{
- _file.removeEventListener(Event.COMPLETE, onSaveComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
diff --git a/source/funkin/game/editors/MenuCharacterEditorState.hx b/source/funkin/game/editors/MenuCharacterEditorState.hx
index 4e206dc6..10c044ae 100644
--- a/source/funkin/game/editors/MenuCharacterEditorState.hx
+++ b/source/funkin/game/editors/MenuCharacterEditorState.hx
@@ -13,13 +13,6 @@ import flixel.math.FlxMath;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import flixel.sound.FlxSound;
-import flixel.addons.ui.FlxInputText;
-import flixel.addons.ui.FlxUI9SliceSprite;
-import flixel.addons.ui.FlxUI;
-import flixel.addons.ui.FlxUICheckBox;
-import flixel.addons.ui.FlxUIInputText;
-import flixel.addons.ui.FlxUINumericStepper;
-import flixel.addons.ui.FlxUITabMenu;
import flixel.ui.FlxButton;
import openfl.net.FileReference;
import openfl.events.Event;
@@ -34,23 +27,27 @@ import funkin.backend.system.MusicBeatState;
-class MenuCharacterEditorState extends MusicBeatState
+class MenuCharacterEditorState extends MusicBeatState implements FlxUIEventHandler.FlxUIEvent
{
var grpWeekCharacters:FlxTypedGroup;
var characterFile:MenuCharacterFile = null;
var txtOffsets:FlxText;
var defaultCharacters:Array = ['dad', 'bf', 'gf'];
+ var unsavedProgress:Bool = false;
override function create() {
- characterFile = {
+ characterFile =
+ {
image: 'Menu_Dad',
scale: 1,
position: [0, 0],
idle_anim: 'M Dad Idle',
confirm_anim: 'M Dad Idle',
- flipX: false
+ flipX: false,
+ antialiasing: true
};
- #if desktop
+
+ #if DISCORD_ALLOWED
// Updating Discord Rich Presence
DiscordClient.changePresence("Menu Character Editor", "Editting: " + characterFile.image);
#end
@@ -81,45 +78,33 @@ class MenuCharacterEditorState extends MusicBeatState
addEditorBox();
FlxG.mouse.visible = true;
- updateCharTypeBox();
+ updateCharacters();
super.create();
}
- var UI_typebox:FlxUITabMenu;
- var UI_mainbox:FlxUITabMenu;
- var blockPressWhileTypingOn:Array = [];
+ var UI_typebox:FlxUIBox;
+ var UI_mainbox:FlxUIBox;
function addEditorBox() {
- var tabs = [
- {name: 'Character Type', label: 'Character Type'},
- ];
- UI_typebox = new FlxUITabMenu(null, tabs, true);
- UI_typebox.resize(120, 180);
- UI_typebox.x = 100;
- UI_typebox.y = FlxG.height - UI_typebox.height - 50;
+ UI_typebox = new FlxUIBox(100, FlxG.height - 230, 120, 180, ['Character Type']);
UI_typebox.scrollFactor.set();
addTypeUI();
add(UI_typebox);
- var tabs = [
- {name: 'Character', label: 'Character'},
- ];
- UI_mainbox = new FlxUITabMenu(null, tabs, true);
- UI_mainbox.resize(240, 180);
- UI_mainbox.x = FlxG.width - UI_mainbox.width - 100;
- UI_mainbox.y = FlxG.height - UI_mainbox.height - 50;
+
+ UI_mainbox = new FlxUIBox(FlxG.width - 340, FlxG.height - 265, 240, 215, ['Character']);
UI_mainbox.scrollFactor.set();
addCharacterUI();
add(UI_mainbox);
- var loadButton:FlxButton = new FlxButton(0, 480, "Load Character", function() {
+ var loadButton:FlxUIButton = new FlxUIButton(0, 480, "Load Character", function() {
loadCharacter();
});
loadButton.screenCenter(X);
loadButton.x -= 60;
add(loadButton);
- var saveButton:FlxButton = new FlxButton(0, 480, "Save Character", function() {
+ var saveButton:FlxUIButton = new FlxUIButton(0, 480, "Save Character", function() {
saveCharacter();
});
saveButton.screenCenter(X);
@@ -127,39 +112,14 @@ class MenuCharacterEditorState extends MusicBeatState
add(saveButton);
}
- var opponentCheckbox:FlxUICheckBox;
- var boyfriendCheckbox:FlxUICheckBox;
- var girlfriendCheckbox:FlxUICheckBox;
- var curTypeSelected:Int = 0; //0 = Dad, 1 = BF, 2 = GF
+ var characterTypeRadio:FlxUIRadioGroup;
function addTypeUI() {
- var tab_group = new FlxUI(null, UI_typebox);
- tab_group.name = "Character Type";
+ var tab_group = UI_typebox.getTab('Character Type').menu;
- opponentCheckbox = new FlxUICheckBox(10, 20, null, null, "Opponent", 100);
- opponentCheckbox.callback = function()
- {
- curTypeSelected = 0;
- updateCharTypeBox();
- };
-
- boyfriendCheckbox = new FlxUICheckBox(opponentCheckbox.x, opponentCheckbox.y + 40, null, null, "Boyfriend", 100);
- boyfriendCheckbox.callback = function()
- {
- curTypeSelected = 1;
- updateCharTypeBox();
- };
-
- girlfriendCheckbox = new FlxUICheckBox(boyfriendCheckbox.x, boyfriendCheckbox.y + 40, null, null, "Girlfriend", 100);
- girlfriendCheckbox.callback = function()
- {
- curTypeSelected = 2;
- updateCharTypeBox();
- };
-
- tab_group.add(opponentCheckbox);
- tab_group.add(boyfriendCheckbox);
- tab_group.add(girlfriendCheckbox);
- UI_typebox.addGroup(tab_group);
+ characterTypeRadio = new FlxUIRadioGroup(10, 20, ['Opponent', 'Boyfriend', 'Girlfriend'], 40);
+ characterTypeRadio.checked = 0;
+ characterTypeRadio.onClick = updateCharacters;
+ tab_group.add(characterTypeRadio);
}
var imageInputText:FlxUIInputText;
@@ -167,25 +127,30 @@ class MenuCharacterEditorState extends MusicBeatState
var confirmInputText:FlxUIInputText;
var scaleStepper:FlxUINumericStepper;
var flipXCheckbox:FlxUICheckBox;
+ var antialiasingCheckbox:FlxUICheckBox;
function addCharacterUI() {
- var tab_group = new FlxUI(null, UI_mainbox);
- tab_group.name = "Character";
+ var tab_group = UI_mainbox.getTab('Character').menu;
imageInputText = new FlxUIInputText(10, 20, 80, characterFile.image, 8);
- blockPressWhileTypingOn.push(imageInputText);
idleInputText = new FlxUIInputText(10, imageInputText.y + 35, 100, characterFile.idle_anim, 8);
- blockPressWhileTypingOn.push(idleInputText);
confirmInputText = new FlxUIInputText(10, idleInputText.y + 35, 100, characterFile.confirm_anim, 8);
- blockPressWhileTypingOn.push(confirmInputText);
- flipXCheckbox = new FlxUICheckBox(10, confirmInputText.y + 30, null, null, "Flip X", 100);
- flipXCheckbox.callback = function()
+ flipXCheckbox = new FlxUICheckBox(10, confirmInputText.y + 30, "Flip X", 100);
+ flipXCheckbox.onClick = function()
{
- grpWeekCharacters.members[curTypeSelected].flipX = flipXCheckbox.checked;
+ grpWeekCharacters.members[characterTypeRadio.checked].flipX = flipXCheckbox.checked;
characterFile.flipX = flipXCheckbox.checked;
};
- var reloadImageButton:FlxButton = new FlxButton(140, confirmInputText.y + 30, "Reload Char", function() {
+ antialiasingCheckbox = new FlxUICheckBox(10, flipXCheckbox.y + 30, "Antialiasing", 100);
+ antialiasingCheckbox.checked = grpWeekCharacters.members[characterTypeRadio.checked].antialiasing;
+ antialiasingCheckbox.onClick = function()
+ {
+ grpWeekCharacters.members[characterTypeRadio.checked].antialiasing = antialiasingCheckbox.checked;
+ characterFile.antialiasing = antialiasingCheckbox.checked;
+ };
+
+ var reloadImageButton:FlxUIButton = new FlxUIButton(140, confirmInputText.y + 30, "Reload Char", function() {
reloadSelectedCharacter();
});
@@ -196,30 +161,13 @@ class MenuCharacterEditorState extends MusicBeatState
tab_group.add(new FlxText(10, idleInputText.y - 18, 0, 'Idle animation on the .XML:'));
tab_group.add(new FlxText(scaleStepper.x, scaleStepper.y - 18, 0, 'Scale:'));
tab_group.add(flipXCheckbox);
+ tab_group.add(antialiasingCheckbox);
tab_group.add(reloadImageButton);
tab_group.add(confirmDescText);
tab_group.add(imageInputText);
tab_group.add(idleInputText);
tab_group.add(confirmInputText);
tab_group.add(scaleStepper);
- UI_mainbox.addGroup(tab_group);
- }
-
- function updateCharTypeBox() {
- opponentCheckbox.checked = false;
- boyfriendCheckbox.checked = false;
- girlfriendCheckbox.checked = false;
-
- switch(curTypeSelected) {
- case 0:
- opponentCheckbox.checked = true;
- case 1:
- boyfriendCheckbox.checked = true;
- case 2:
- girlfriendCheckbox.checked = true;
- }
-
- updateCharacters();
}
function updateCharacters() {
@@ -233,12 +181,12 @@ class MenuCharacterEditorState extends MusicBeatState
}
function reloadSelectedCharacter() {
- var char:MenuCharacter = grpWeekCharacters.members[curTypeSelected];
+ var char:MenuCharacter = grpWeekCharacters.members[characterTypeRadio.checked];
char.alpha = 1;
char.frames = Paths.getSparrowAtlas('menucharacters/' + characterFile.image);
char.animation.addByPrefix('idle', characterFile.idle_anim, 24);
- if(curTypeSelected == 1) char.animation.addByPrefix('confirm', characterFile.confirm_anim, 24, false);
+ if(characterTypeRadio.checked == 1) char.animation.addByPrefix('confirm', characterFile.confirm_anim, 24, false);
char.flipX = (characterFile.flipX == true);
char.scale.set(characterFile.scale, characterFile.scale);
@@ -246,50 +194,47 @@ class MenuCharacterEditorState extends MusicBeatState
char.animation.play('idle');
updateOffset();
- #if desktop
+ #if DISCORD_ALLOWED
// Updating Discord Rich Presence
DiscordClient.changePresence("Menu Character Editor", "Editting: " + characterFile.image);
#end
}
- override function getEvent(id:String, sender:Dynamic, data:Dynamic, ?params:Array) {
+ public function UIEvent(id:String, sender:Dynamic) {
+ if(id == FlxUICheckBox.CLICK_EVENT)
+ unsavedProgress = true;
+
if(id == FlxUIInputText.CHANGE_EVENT && (sender is FlxUIInputText)) {
if(sender == imageInputText) {
characterFile.image = imageInputText.text;
+ unsavedProgress = true;
} else if(sender == idleInputText) {
characterFile.idle_anim = idleInputText.text;
+ unsavedProgress = true;
} else if(sender == confirmInputText) {
characterFile.confirm_anim = confirmInputText.text;
+ unsavedProgress = true;
}
} else if(id == FlxUINumericStepper.CHANGE_EVENT && (sender is FlxUINumericStepper)) {
if (sender == scaleStepper) {
characterFile.scale = scaleStepper.value;
reloadSelectedCharacter();
+ unsavedProgress = true;
}
}
}
override function update(elapsed:Float) {
- var blockInput:Bool = false;
- for (inputText in blockPressWhileTypingOn) {
- if(inputText.hasFocus) {
- FlxG.sound.muteKeys = [];
- FlxG.sound.volumeDownKeys = [];
- FlxG.sound.volumeUpKeys = [];
- blockInput = true;
-
- if(FlxG.keys.justPressed.ENTER) inputText.hasFocus = false;
- break;
- }
- }
-
- if(!blockInput) {
- FlxG.sound.muteKeys = funkin.game.Init.Volume.muteKeys;
- FlxG.sound.volumeDownKeys = funkin.game.Init.Volume.volumeDownKeys;
- FlxG.sound.volumeUpKeys = funkin.game.Init.Volume.volumeUpKeys;
+ if(FlxUIInputText.focusOn == null)
+ {
+ ClientPrefs.toggleVolumeKeys(true);
if(FlxG.keys.justPressed.ESCAPE) {
- MusicBeatState.switchState(new funkin.game.editors.MasterEditorMenu());
- FlxG.sound.playMusic(Paths.music('freakyMenu'));
+ if(!unsavedProgress)
+ {
+ MusicBeatState.switchState(new MasterEditorMenu());
+ FlxG.sound.playMusic(Paths.music('freakyMenu'));
+ }
+ else openSubState(new ExitConfirmationPrompt());
}
var shiftMult:Int = 1;
@@ -312,21 +257,22 @@ class MenuCharacterEditorState extends MusicBeatState
updateOffset();
}
- if(FlxG.keys.justPressed.SPACE && curTypeSelected == 1) {
- grpWeekCharacters.members[curTypeSelected].animation.play('confirm', true);
+ if(FlxG.keys.justPressed.SPACE && characterTypeRadio.checked == 1) {
+ grpWeekCharacters.members[characterTypeRadio.checked].animation.play('confirm', true);
}
}
+ else ClientPrefs.toggleVolumeKeys(false);
var char:MenuCharacter = grpWeekCharacters.members[1];
- if(char.animation.curAnim != null && char.animation.curAnim.name == 'confirm' && char.animation.curAnim.finished) {
+ if(char.animation.curAnim != null && char.animation.curAnim.name == 'confirm' && char.animation.curAnim.finished)
char.animation.play('idle', true);
- }
super.update(elapsed);
}
- function updateOffset() {
- var char:MenuCharacter = grpWeekCharacters.members[curTypeSelected];
+ function updateOffset()
+ {
+ var char:MenuCharacter = grpWeekCharacters.members[characterTypeRadio.checked];
char.offset.set(characterFile.position[0], characterFile.position[1]);
txtOffsets.text = '' + characterFile.position;
}
@@ -335,7 +281,7 @@ class MenuCharacterEditorState extends MusicBeatState
function loadCharacter() {
var jsonFilter:FileFilter = new FileFilter('JSON', 'json');
_file = new FileReference();
- _file.addEventListener(Event.SELECT, onLoadComplete);
+ _file.addEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.addEventListener(Event.CANCEL, onLoadCancel);
_file.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file.browse([jsonFilter]);
@@ -343,7 +289,7 @@ class MenuCharacterEditorState extends MusicBeatState
function onLoadComplete(_):Void
{
- _file.removeEventListener(Event.SELECT, onLoadComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.removeEventListener(Event.CANCEL, onLoadCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
@@ -383,7 +329,7 @@ class MenuCharacterEditorState extends MusicBeatState
*/
function onLoadCancel(_):Void
{
- _file.removeEventListener(Event.SELECT, onLoadComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.removeEventListener(Event.CANCEL, onLoadCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file = null;
@@ -395,7 +341,7 @@ class MenuCharacterEditorState extends MusicBeatState
*/
function onLoadError(_):Void
{
- _file.removeEventListener(Event.SELECT, onLoadComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.removeEventListener(Event.CANCEL, onLoadCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file = null;
@@ -403,14 +349,14 @@ class MenuCharacterEditorState extends MusicBeatState
}
function saveCharacter() {
- var data:String = Json.stringify(characterFile, "\t");
+ var data:String = AstroJsonPrinter.print(characterFile, ['position']);
if (data.length > 0)
{
var splittedImage:Array = imageInputText.text.trim().split('_');
var characterName:String = splittedImage[splittedImage.length-1].toLowerCase().replace(' ', '');
_file = new FileReference();
- _file.addEventListener(Event.COMPLETE, onSaveComplete);
+ _file.addEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.addEventListener(Event.CANCEL, onSaveCancel);
_file.addEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file.save(data, characterName + ".json");
@@ -419,7 +365,7 @@ class MenuCharacterEditorState extends MusicBeatState
function onSaveComplete(_):Void
{
- _file.removeEventListener(Event.COMPLETE, onSaveComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
@@ -431,7 +377,7 @@ class MenuCharacterEditorState extends MusicBeatState
*/
function onSaveCancel(_):Void
{
- _file.removeEventListener(Event.COMPLETE, onSaveComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
@@ -442,7 +388,7 @@ class MenuCharacterEditorState extends MusicBeatState
*/
function onSaveError(_):Void
{
- _file.removeEventListener(Event.COMPLETE, onSaveComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
diff --git a/source/funkin/game/editors/WeekEditorState.hx b/source/funkin/game/editors/WeekEditorState.hx
index 516f6e12..dbffd0b4 100644
--- a/source/funkin/game/editors/WeekEditorState.hx
+++ b/source/funkin/game/editors/WeekEditorState.hx
@@ -19,13 +19,6 @@ import flixel.text.FlxText;
import flixel.util.FlxColor;
import flixel.sound.FlxSound;
import openfl.utils.Assets;
-import flixel.addons.ui.FlxInputText;
-import flixel.addons.ui.FlxUI9SliceSprite;
-import flixel.addons.ui.FlxUI;
-import flixel.addons.ui.FlxUICheckBox;
-import flixel.addons.ui.FlxUIInputText;
-import flixel.addons.ui.FlxUINumericStepper;
-import flixel.addons.ui.FlxUITabMenu;
import flixel.ui.FlxButton;
import openfl.net.FileReference;
import openfl.events.Event;
@@ -43,7 +36,7 @@ import funkin.backend.system.MusicBeatState;
-class WeekEditorState extends MusicBeatState
+class WeekEditorState extends MusicBeatState implements FlxUIEventHandler.FlxUIEvent
{
var txtWeekTitle:FlxText;
var bgSprite:FlxSprite;
@@ -53,6 +46,8 @@ class WeekEditorState extends MusicBeatState
var weekThing:MenuItem;
var missingFileText:FlxText;
+ public static var unsavedProgress:Bool = false;
+
var weekFile:WeekFile = null;
public function new(weekFile:WeekFile = null)
{
@@ -70,11 +65,11 @@ class WeekEditorState extends MusicBeatState
var ui_tex = Paths.getSparrowAtlas('storymenu/props/campaign_menu_UI_assets');
var bgYellow:FlxSprite = new FlxSprite(0, 56).makeGraphic(FlxG.width, 386, 0xFFF9CF51);
bgSprite = new FlxSprite(0, 56);
- bgSprite.antialiasing = ClientPrefs.data.globalAntialiasing;
+ bgSprite.antialiasing = ClientPrefs.data.antialiasing;
weekThing = new MenuItem(0, bgSprite.y + 396, weekFileName);
weekThing.y += weekThing.height + 20;
- weekThing.antialiasing = ClientPrefs.data.globalAntialiasing;
+ weekThing.antialiasing = ClientPrefs.data.antialiasing;
add(weekThing);
var blackBarThingie:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, 56, FlxColor.BLACK);
@@ -86,7 +81,7 @@ class WeekEditorState extends MusicBeatState
lock.frames = ui_tex;
lock.animation.addByPrefix('lock', 'lock');
lock.animation.play('lock');
- lock.antialiasing = ClientPrefs.data.globalAntialiasing;
+ lock.antialiasing = ClientPrefs.data.antialiasing;
add(lock);
missingFileText = new FlxText(0, 0, FlxG.width, "");
@@ -108,7 +103,7 @@ class WeekEditorState extends MusicBeatState
add(grpWeekCharacters);
var tracksSprite:FlxSprite = new FlxSprite(FlxG.width * 0.07, bgSprite.y + 435).loadGraphic(Paths.image('storymenu/props/Menu_Tracks'));
- tracksSprite.antialiasing = ClientPrefs.data.globalAntialiasing;
+ tracksSprite.antialiasing = ClientPrefs.data.antialiasing;
add(tracksSprite);
txtTracklist = new FlxText(FlxG.width * 0.05, tracksSprite.y + 60, 0, "", 32);
@@ -126,41 +121,29 @@ class WeekEditorState extends MusicBeatState
super.create();
}
- var UI_box:FlxUITabMenu;
- var blockPressWhileTypingOn:Array = [];
+ var UI_box:FlxUIBox;
function addEditorBox() {
- var tabs = [
- {name: 'Week', label: 'Week'},
- {name: 'Other', label: 'Other'},
- ];
- UI_box = new FlxUITabMenu(null, tabs, true);
- UI_box.resize(250, 375);
- UI_box.x = FlxG.width - UI_box.width;
- UI_box.y = FlxG.height - UI_box.height;
+ UI_box = new FlxUIBox(FlxG.width, FlxG.height, 250, 375, ['Other', 'Week']);
+ UI_box.x -= UI_box.width;
+ UI_box.y -= UI_box.height;
UI_box.scrollFactor.set();
- addWeekUI();
+ add(UI_box);
addOtherUI();
+ addWeekUI();
- UI_box.selected_tab_id = 'Week';
+ UI_box.selectedName = 'Week';
add(UI_box);
- var loadWeekButton:FlxButton = new FlxButton(0, 650, "Load Week", function() {
- loadWeek();
- });
+ var loadWeekButton:FlxUIButton = new FlxUIButton(0, 650, "Load Week", function() loadWeek());
loadWeekButton.screenCenter(X);
loadWeekButton.x -= 120;
add(loadWeekButton);
- var freeplayButton:FlxButton = new FlxButton(0, 650, "Freeplay", function() {
- MusicBeatState.switchState(new WeekEditorFreeplayState(weekFile));
-
- });
+ var freeplayButton:FlxUIButton = new FlxUIButton(0, 650, "Freeplay", function() MusicBeatState.switchState(new WeekEditorFreeplayState(weekFile)));
freeplayButton.screenCenter(X);
add(freeplayButton);
- var saveWeekButton:FlxButton = new FlxButton(0, 650, "Save Week", function() {
- saveWeek(weekFile);
- });
+ var saveWeekButton:FlxUIButton = new FlxUIButton(0, 650, "Save Week", function() saveWeek(weekFile));
saveWeekButton.screenCenter(X);
saveWeekButton.x += 120;
add(saveWeekButton);
@@ -181,37 +164,25 @@ class WeekEditorState extends MusicBeatState
public static var weekFileName:String = 'week1';
function addWeekUI() {
- var tab_group = new FlxUI(null, UI_box);
- tab_group.name = "Week";
-
+ var tab_group = UI_box.getTab('Week').menu;
+
songsInputText = new FlxUIInputText(10, 30, 200, '', 8);
- blockPressWhileTypingOn.push(songsInputText);
opponentInputText = new FlxUIInputText(10, songsInputText.y + 40, 70, '', 8);
- blockPressWhileTypingOn.push(opponentInputText);
boyfriendInputText = new FlxUIInputText(opponentInputText.x + 75, opponentInputText.y, 70, '', 8);
- blockPressWhileTypingOn.push(boyfriendInputText);
girlfriendInputText = new FlxUIInputText(boyfriendInputText.x + 75, opponentInputText.y, 70, '', 8);
- blockPressWhileTypingOn.push(girlfriendInputText);
backgroundInputText = new FlxUIInputText(10, opponentInputText.y + 40, 120, '', 8);
- blockPressWhileTypingOn.push(backgroundInputText);
-
-
displayNameInputText = new FlxUIInputText(10, backgroundInputText.y + 60, 200, '', 8);
- blockPressWhileTypingOn.push(backgroundInputText);
-
weekNameInputText = new FlxUIInputText(10, displayNameInputText.y + 60, 150, '', 8);
- blockPressWhileTypingOn.push(weekNameInputText);
-
weekFileInputText = new FlxUIInputText(10, weekNameInputText.y + 40, 100, '', 8);
- blockPressWhileTypingOn.push(weekFileInputText);
reloadWeekThing();
- hideCheckbox = new FlxUICheckBox(10, weekFileInputText.y + 40, null, null, "Hide Week from Story Mode?", 100);
- hideCheckbox.callback = function()
+ hideCheckbox = new FlxUICheckBox(10, weekFileInputText.y + 40, "Hide Week from Story Mode?", 100);
+ hideCheckbox.onClick = function()
{
weekFile.hideStoryMode = hideCheckbox.checked;
+ unsavedProgress = true;
};
tab_group.add(new FlxText(songsInputText.x, songsInputText.y - 18, 0, 'Songs:'));
@@ -231,7 +202,6 @@ class WeekEditorState extends MusicBeatState
tab_group.add(weekNameInputText);
tab_group.add(weekFileInputText);
tab_group.add(hideCheckbox);
- UI_box.addGroup(tab_group);
}
var weekBeforeInputText:FlxUIInputText;
@@ -240,29 +210,27 @@ class WeekEditorState extends MusicBeatState
var hiddenUntilUnlockCheckbox:FlxUICheckBox;
function addOtherUI() {
- var tab_group = new FlxUI(null, UI_box);
- tab_group.name = "Other";
+ var tab_group = UI_box.getTab('Other').menu;
- lockedCheckbox = new FlxUICheckBox(10, 30, null, null, "Week starts Locked", 100);
- lockedCheckbox.callback = function()
+ lockedCheckbox = new FlxUICheckBox(10, 30, "Week starts Locked", 100);
+ lockedCheckbox.onClick = function()
{
weekFile.startUnlocked = !lockedCheckbox.checked;
lock.visible = lockedCheckbox.checked;
hiddenUntilUnlockCheckbox.alpha = 0.4 + 0.6 * (lockedCheckbox.checked ? 1 : 0);
+ unsavedProgress = true;
};
- hiddenUntilUnlockCheckbox = new FlxUICheckBox(10, lockedCheckbox.y + 25, null, null, "Hidden until Unlocked", 110);
- hiddenUntilUnlockCheckbox.callback = function()
+ hiddenUntilUnlockCheckbox = new FlxUICheckBox(10, lockedCheckbox.y + 25, "Hidden until Unlocked", 110);
+ hiddenUntilUnlockCheckbox.onClick = function()
{
weekFile.hiddenUntilUnlocked = hiddenUntilUnlockCheckbox.checked;
+ unsavedProgress = true;
};
hiddenUntilUnlockCheckbox.alpha = 0.4;
weekBeforeInputText = new FlxUIInputText(10, hiddenUntilUnlockCheckbox.y + 55, 100, '', 8);
- blockPressWhileTypingOn.push(weekBeforeInputText);
-
difficultiesInputText = new FlxUIInputText(10, weekBeforeInputText.y + 60, 200, '', 8);
- blockPressWhileTypingOn.push(difficultiesInputText);
tab_group.add(new FlxText(weekBeforeInputText.x, weekBeforeInputText.y - 28, 0, 'Week File name of the Week you have\nto finish for Unlocking:'));
tab_group.add(new FlxText(difficultiesInputText.x, difficultiesInputText.y - 20, 0, 'Difficulties:'));
@@ -271,7 +239,6 @@ class WeekEditorState extends MusicBeatState
tab_group.add(difficultiesInputText);
tab_group.add(hiddenUntilUnlockCheckbox);
tab_group.add(lockedCheckbox);
- UI_box.addGroup(tab_group);
}
//Used on onCreate and when you load a week
@@ -373,30 +340,39 @@ class WeekEditorState extends MusicBeatState
}
recalculateStuffPosition();
- #if desktop
+ #if DISCORD_ALLOWED
// Updating Discord Rich Presence
DiscordClient.changePresence("Week Editor", "Editting: " + weekFileName);
+ WindowUtil.setTitle('Week Editer: - $weekFileName');
#end
}
- override function getEvent(id:String, sender:Dynamic, data:Dynamic, ?params:Array) {
+ public function UIEvent(id:String, sender:Dynamic) {
+ if(id == FlxUICheckBox.CLICK_EVENT)
+ unsavedProgress = true;
+
if(id == FlxUIInputText.CHANGE_EVENT && (sender is FlxUIInputText)) {
if(sender == weekFileInputText) {
weekFileName = weekFileInputText.text.trim();
+ unsavedProgress = true;
reloadWeekThing();
} else if(sender == opponentInputText || sender == boyfriendInputText || sender == girlfriendInputText) {
weekFile.weekCharacters[0] = opponentInputText.text.trim();
weekFile.weekCharacters[1] = boyfriendInputText.text.trim();
weekFile.weekCharacters[2] = girlfriendInputText.text.trim();
+ unsavedProgress = true;
updateText();
} else if(sender == backgroundInputText) {
weekFile.weekBackground = backgroundInputText.text.trim();
+ unsavedProgress = true;
reloadBG();
} else if(sender == displayNameInputText) {
weekFile.storyName = displayNameInputText.text.trim();
+ unsavedProgress = true;
updateText();
} else if(sender == weekNameInputText) {
weekFile.weekName = weekNameInputText.text.trim();
+ unsavedProgress = true;
} else if(sender == songsInputText) {
var splittedText:Array = songsInputText.text.trim().split(',');
for (i in 0...splittedText.length) {
@@ -409,20 +385,23 @@ class WeekEditorState extends MusicBeatState
for (i in 0...splittedText.length) {
if(i >= weekFile.songs.length) { //Add new song
- weekFile.songs.push([splittedText[i], 'dad', [146, 113, 253]]);
+ weekFile.songs.push([splittedText[i], 'face', [146, 113, 253]]);
} else { //Edit song
weekFile.songs[i][0] = splittedText[i];
if(weekFile.songs[i][1] == null || weekFile.songs[i][1]) {
- weekFile.songs[i][1] = 'dad';
+ weekFile.songs[i][1] = 'face';
weekFile.songs[i][2] = [146, 113, 253];
}
}
}
updateText();
+ unsavedProgress = true;
} else if(sender == weekBeforeInputText) {
weekFile.weekBefore = weekBeforeInputText.text.trim();
+ unsavedProgress = true;
} else if(sender == difficultiesInputText) {
weekFile.difficulties = difficultiesInputText.text.trim();
+ unsavedProgress = true;
}
}
}
@@ -436,28 +415,20 @@ class WeekEditorState extends MusicBeatState
reloadAllShit();
}
- var blockInput:Bool = false;
- for (inputText in blockPressWhileTypingOn) {
- if(inputText.hasFocus) {
- FlxG.sound.muteKeys = [];
- FlxG.sound.volumeDownKeys = [];
- FlxG.sound.volumeUpKeys = [];
- blockInput = true;
-
- if(FlxG.keys.justPressed.ENTER) inputText.hasFocus = false;
- break;
- }
- }
-
- if(!blockInput) {
- FlxG.sound.muteKeys = funkin.game.Init.Volume.muteKeys;
- FlxG.sound.volumeDownKeys = funkin.game.Init.Volume.volumeDownKeys;
- FlxG.sound.volumeUpKeys = funkin.game.Init.Volume.volumeUpKeys;
- if(FlxG.keys.justPressed.ESCAPE) {
- MusicBeatState.switchState(new funkin.game.editors.MasterEditorMenu());
- FlxG.sound.playMusic(Paths.music('freakyMenu'));
+ if(FlxUIInputText.focusOn == null)
+ {
+ ClientPrefs.toggleVolumeKeys(true);
+ if(FlxG.keys.justPressed.ESCAPE)
+ {
+ if(!unsavedProgress)
+ {
+ MusicBeatState.switchState(new MasterEditorMenu());
+ FlxG.sound.playMusic(Paths.music('freakyMenu'));
+ }
+ else openSubState(new ExitConfirmationPrompt(function() unsavedProgress = false));
}
}
+ else ClientPrefs.toggleVolumeKeys(false);
super.update(elapsed);
@@ -474,7 +445,7 @@ class WeekEditorState extends MusicBeatState
public static function loadWeek() {
var jsonFilter:FileFilter = new FileFilter('JSON', 'json');
_file = new FileReference();
- _file.addEventListener(Event.SELECT, onLoadComplete);
+ _file.addEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.addEventListener(Event.CANCEL, onLoadCancel);
_file.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file.browse([jsonFilter]);
@@ -484,7 +455,7 @@ class WeekEditorState extends MusicBeatState
public static var loadError:Bool = false;
private static function onLoadComplete(_):Void
{
- _file.removeEventListener(Event.SELECT, onLoadComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.removeEventListener(Event.CANCEL, onLoadCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
@@ -505,6 +476,7 @@ class WeekEditorState extends MusicBeatState
weekFileName = cutName;
_file = null;
+ unsavedProgress = false;
return;
}
}
@@ -522,7 +494,7 @@ class WeekEditorState extends MusicBeatState
*/
private static function onLoadCancel(_):Void
{
- _file.removeEventListener(Event.SELECT, onLoadComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.removeEventListener(Event.CANCEL, onLoadCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file = null;
@@ -534,7 +506,7 @@ class WeekEditorState extends MusicBeatState
*/
private static function onLoadError(_):Void
{
- _file.removeEventListener(Event.SELECT, onLoadComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onLoadComplete);
_file.removeEventListener(Event.CANCEL, onLoadCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_file = null;
@@ -542,11 +514,11 @@ class WeekEditorState extends MusicBeatState
}
public static function saveWeek(weekFile:WeekFile) {
- var data:String = Json.stringify(weekFile, "\t");
+ var data:String = haxe.Json.stringify(weekFile, "\t");
if (data.length > 0)
{
_file = new FileReference();
- _file.addEventListener(Event.COMPLETE, onSaveComplete);
+ _file.addEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.addEventListener(Event.CANCEL, onSaveCancel);
_file.addEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file.save(data, weekFileName + ".json");
@@ -555,11 +527,12 @@ class WeekEditorState extends MusicBeatState
private static function onSaveComplete(_):Void
{
- _file.removeEventListener(Event.COMPLETE, onSaveComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
FlxG.log.notice("Successfully saved file.");
+ unsavedProgress = false;
}
/**
@@ -567,10 +540,11 @@ class WeekEditorState extends MusicBeatState
*/
private static function onSaveCancel(_):Void
{
- _file.removeEventListener(Event.COMPLETE, onSaveComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
+ trace("Cancelled file saving.");
}
/**
@@ -578,7 +552,7 @@ class WeekEditorState extends MusicBeatState
*/
private static function onSaveError(_):Void
{
- _file.removeEventListener(Event.COMPLETE, onSaveComplete);
+ _file.removeEventListener(#if desktop Event.SELECT #else Event.COMPLETE #end, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
@@ -586,7 +560,7 @@ class WeekEditorState extends MusicBeatState
}
}
-class WeekEditorFreeplayState extends MusicBeatState
+class WeekEditorFreeplayState extends MusicBeatState implements FlxUIEventHandler.FlxUIEvent
{
var weekFile:WeekFile = null;
public function new(weekFile:WeekFile = null)
@@ -597,27 +571,27 @@ class WeekEditorFreeplayState extends MusicBeatState
}
var bg:FlxSprite;
- private var grpSongs:FlxTypedGroup;
+ private var grpSongs:FlxTypedGroup;
private var iconArray:Array = [];
var curSelected = 0;
override function create() {
bg = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
- bg.antialiasing = ClientPrefs.data.globalAntialiasing;
-
+ bg.antialiasing = ClientPrefs.data.antialiasing;
bg.color = FlxColor.WHITE;
add(bg);
- grpSongs = new FlxTypedGroup();
+ grpSongs = new FlxTypedGroup();
add(grpSongs);
for (i in 0...weekFile.songs.length)
{
- var songText:funkin.game.objects.Alphabet = new funkin.game.objects.Alphabet(90, 320, weekFile.songs[i][0], true);
+ var songText:Alphabet = new Alphabet(90, 320, weekFile.songs[i][0], true);
songText.isMenuItem = true;
songText.targetY = i;
grpSongs.add(songText);
+ songText.scaleX = Math.min(1, 980 / songText.width);
songText.snapToPosition();
var icon:HealthIcon = new HealthIcon(weekFile.songs[i][1]);
@@ -637,19 +611,15 @@ class WeekEditorFreeplayState extends MusicBeatState
super.create();
}
- var UI_box:FlxUITabMenu;
- var blockPressWhileTypingOn:Array = [];
+ var UI_box:FlxUIBox;
function addEditorBox() {
var tabs = [
{name: 'Freeplay', label: 'Freeplay'},
];
- UI_box = new FlxUITabMenu(null, tabs, true);
- UI_box.resize(250, 200);
- UI_box.x = FlxG.width - UI_box.width - 100;
- UI_box.y = FlxG.height - UI_box.height - 60;
+ UI_box = new FlxUIBox(FlxG.width, FlxG.height, 250, 200, ['Freeplay']);
+ UI_box.x -= UI_box.width + 100;
+ UI_box.y -= UI_box.height + 60;
UI_box.scrollFactor.set();
-
- UI_box.selected_tab_id = 'Week';
addFreeplayUI();
add(UI_box);
@@ -657,21 +627,21 @@ class WeekEditorFreeplayState extends MusicBeatState
blackBlack.alpha = 0.6;
add(blackBlack);
- var loadWeekButton:FlxButton = new FlxButton(0, 685, "Load Week", function() {
+ var loadWeekButton:FlxUIButton = new FlxUIButton(0, 685, "Load Week", function() {
WeekEditorState.loadWeek();
});
loadWeekButton.screenCenter(X);
loadWeekButton.x -= 120;
add(loadWeekButton);
- var storyModeButton:FlxButton = new FlxButton(0, 685, "Story Mode", function() {
+ var storyModeButton:FlxUIButton = new FlxUIButton(0, 685, "Story Mode", function() {
MusicBeatState.switchState(new WeekEditorState(weekFile));
});
storyModeButton.screenCenter(X);
add(storyModeButton);
- var saveWeekButton:FlxButton = new FlxButton(0, 685, "Save Week", function() {
+ var saveWeekButton:FlxUIButton = new FlxUIButton(0, 685, "Save Week", function() {
WeekEditorState.saveWeek(weekFile);
});
saveWeekButton.screenCenter(X);
@@ -679,14 +649,20 @@ class WeekEditorFreeplayState extends MusicBeatState
add(saveWeekButton);
}
- override function getEvent(id:String, sender:Dynamic, data:Dynamic, ?params:Array) {
- if(id == FlxUIInputText.CHANGE_EVENT && (sender is FlxUIInputText)) {
+ public function UIEvent(id:String, sender:Dynamic)
+ {
+ if(id == FlxUICheckBox.CLICK_EVENT)
+ WeekEditorState.unsavedProgress = true;
+
+ if(id == FlxUIInputText.CHANGE_EVENT && (sender is FlxUIInputText))
+ {
weekFile.songs[curSelected][1] = iconInputText.text;
iconArray[curSelected].changeIcon(iconInputText.text);
- } else if(id == FlxUINumericStepper.CHANGE_EVENT && (sender is FlxUINumericStepper)) {
- if(sender == bgColorStepperR || sender == bgColorStepperG || sender == bgColorStepperB) {
+ }
+ else if(id == FlxUINumericStepper.CHANGE_EVENT && (sender is FlxUINumericStepper))
+ {
+ if(sender == bgColorStepperR || sender == bgColorStepperG || sender == bgColorStepperB)
updateBG();
- }
}
}
@@ -695,30 +671,33 @@ class WeekEditorFreeplayState extends MusicBeatState
var bgColorStepperB:FlxUINumericStepper;
var iconInputText:FlxUIInputText;
function addFreeplayUI() {
- var tab_group = new FlxUI(null, UI_box);
- tab_group.name = "Freeplay";
+ var tab_group = UI_box.getTab('Freeplay').menu;
bgColorStepperR = new FlxUINumericStepper(10, 40, 20, 255, 0, 255, 0);
bgColorStepperG = new FlxUINumericStepper(80, 40, 20, 255, 0, 255, 0);
bgColorStepperB = new FlxUINumericStepper(150, 40, 20, 255, 0, 255, 0);
- var copyColor:FlxButton = new FlxButton(10, bgColorStepperR.y + 25, "Copy Color", function() {
- Clipboard.text = bg.color.red + ',' + bg.color.green + ',' + bg.color.blue;
- });
- var pasteColor:FlxButton = new FlxButton(140, copyColor.y, "Paste Color", function() {
- if(Clipboard.text != null) {
+ var copyColor:FlxUIButton = new FlxUIButton(10, bgColorStepperR.y + 25, "Copy Color", function() Clipboard.text = bg.color.red + ',' + bg.color.green + ',' + bg.color.blue);
+
+ var pasteColor:FlxUIButton = new FlxUIButton(140, copyColor.y, "Paste Color", function()
+ {
+ if(Clipboard.text != null)
+ {
var leColor:Array = [];
var splitted:Array = Clipboard.text.trim().split(',');
- for (i in 0...splitted.length) {
+ for (i in 0...splitted.length)
+ {
var toPush:Int = Std.parseInt(splitted[i]);
- if(!Math.isNaN(toPush)) {
+ if(!Math.isNaN(toPush))
+ {
if(toPush > 255) toPush = 255;
else if(toPush < 0) toPush *= -1;
leColor.push(toPush);
}
}
- if(leColor.length > 2) {
+ if(leColor.length > 2)
+ {
bgColorStepperR.value = leColor[0];
bgColorStepperG.value = leColor[1];
bgColorStepperB.value = leColor[2];
@@ -729,11 +708,12 @@ class WeekEditorFreeplayState extends MusicBeatState
iconInputText = new FlxUIInputText(10, bgColorStepperR.y + 70, 100, '', 8);
- var hideFreeplayCheckbox:FlxUICheckBox = new FlxUICheckBox(10, iconInputText.y + 30, null, null, "Hide Week from Freeplay?", 100);
+ var hideFreeplayCheckbox:FlxUICheckBox = new FlxUICheckBox(10, iconInputText.y + 30, "Hide Week from Freeplay?", 100);
hideFreeplayCheckbox.checked = weekFile.hideFreeplay;
- hideFreeplayCheckbox.callback = function()
+ hideFreeplayCheckbox.onClick = function()
{
weekFile.hideFreeplay = hideFreeplayCheckbox.checked;
+ WeekEditorState.unsavedProgress = true;
};
tab_group.add(new FlxText(10, bgColorStepperR.y - 18, 0, 'Selected background Color R/G/B:'));
@@ -745,7 +725,6 @@ class WeekEditorFreeplayState extends MusicBeatState
tab_group.add(pasteColor);
tab_group.add(iconInputText);
tab_group.add(hideFreeplayCheckbox);
- UI_box.addGroup(tab_group);
}
function updateBG() {
@@ -758,66 +737,51 @@ class WeekEditorFreeplayState extends MusicBeatState
function changeSelection(change:Int = 0) {
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
- curSelected += change;
-
- if (curSelected < 0)
- curSelected = weekFile.songs.length - 1;
- if (curSelected >= weekFile.songs.length)
- curSelected = 0;
-
- var bullShit:Int = 0;
- for (i in 0...iconArray.length)
+ curSelected = FlxMath.wrap(curSelected + change, 0, weekFile.songs.length - 1);
+ for (num => item in grpSongs.members)
{
- iconArray[i].alpha = 0.6;
- }
-
- iconArray[curSelected].alpha = 1;
-
- for (item in grpSongs.members)
- {
- item.targetY = bullShit - curSelected;
- bullShit++;
-
+ var icon:HealthIcon = iconArray[num];
+ item.targetY = num - curSelected;
item.alpha = 0.6;
- // item.setGraphicSize(Std.int(item.width * 0.8));
-
+ icon.alpha = 0.6;
if (item.targetY == 0)
{
item.alpha = 1;
- // item.setGraphicSize(Std.int(item.width));
+ icon.alpha = 1;
}
}
- trace(weekFile.songs[curSelected]);
+ //trace(weekFile.songs[curSelected]);
iconInputText.text = weekFile.songs[curSelected][1];
- bgColorStepperR.value = Math.round(weekFile.songs[curSelected][2][0]);
- bgColorStepperG.value = Math.round(weekFile.songs[curSelected][2][1]);
- bgColorStepperB.value = Math.round(weekFile.songs[curSelected][2][2]);
+
+ var colors = weekFile.songs[curSelected][2];
+ bgColorStepperR.value = Math.round(colors[0]);
+ bgColorStepperG.value = Math.round(colors[1]);
+ bgColorStepperB.value = Math.round(colors[2]);
updateBG();
}
override function update(elapsed:Float) {
if(WeekEditorState.loadedWeek != null) {
super.update(elapsed);
- FlxTransitionableState.skipNextTransIn = FlxTransitionableState.skipNextTransOut = true;
+ FlxTransitionableState.skipNextTransIn = true;
+ FlxTransitionableState.skipNextTransOut = true;
MusicBeatState.switchState(new WeekEditorFreeplayState(WeekEditorState.loadedWeek));
WeekEditorState.loadedWeek = null;
return;
}
- if(iconInputText.hasFocus) {
- FlxG.sound.muteKeys = [];
- FlxG.sound.volumeDownKeys = [];
- FlxG.sound.volumeUpKeys = [];
- if(FlxG.keys.justPressed.ENTER) {
- iconInputText.hasFocus = false;
- }
- } else {
- FlxG.sound.muteKeys = funkin.game.Init.Volume.muteKeys;
- FlxG.sound.volumeDownKeys = funkin.game.Init.Volume.volumeDownKeys;
- FlxG.sound.volumeUpKeys = funkin.game.Init.Volume.volumeUpKeys;
+ if(FlxUIInputText.focusOn != null)
+ ClientPrefs.toggleVolumeKeys(false);
+ else
+ {
+ ClientPrefs.toggleVolumeKeys(true);
if(FlxG.keys.justPressed.ESCAPE) {
- MusicBeatState.switchState(new funkin.game.editors.MasterEditorMenu());
- FlxG.sound.playMusic(Paths.music('freakyMenu'));
+ if(!WeekEditorState.unsavedProgress)
+ {
+ MusicBeatState.switchState(new MasterEditorMenu());
+ FlxG.sound.playMusic(Paths.music('freakyMenu'));
+ }
+ else openSubState(new ExitConfirmationPrompt());
}
if(controls.UI_UP_P) changeSelection(-1);
diff --git a/source/funkin/game/objects/FlxUIDropDownMenuCustom.hx b/source/funkin/game/objects/FlxUIDropDownMenuCustom.hx
deleted file mode 100644
index 8c48d42d..00000000
--- a/source/funkin/game/objects/FlxUIDropDownMenuCustom.hx
+++ /dev/null
@@ -1,630 +0,0 @@
-package funkin.game.objects;
-
-import flash.geom.Rectangle;
-import flixel.addons.ui.interfaces.IFlxUIClickable;
-import flixel.addons.ui.interfaces.IFlxUIWidget;
-import flixel.addons.ui.interfaces.IHasParams;
-import flixel.FlxG;
-import flixel.FlxSprite;
-import flixel.math.FlxMath;
-import flixel.ui.FlxButton;
-import flixel.util.FlxColor;
-import flixel.util.FlxDestroyUtil;
-import flixel.util.FlxStringUtil;
-import flixel.addons.ui.FlxUIGroup;
-import flixel.addons.ui.FlxUIText;
-import flixel.addons.ui.FlxUIButton;
-import flixel.addons.ui.FlxUISpriteButton;
-import flixel.addons.ui.FlxUI9SliceSprite;
-import flixel.addons.ui.FlxUIAssets;
-import flixel.addons.ui.StrNameLabel;
-import flixel.addons.ui.FlxUI;
-
-
-/*
-
-THIS IS AN EDIT OF FlxUIDropDownMenu I'VE MADE BECAUSE I'M TIRED OF IT NOT SUPPORTING SCROLLING UP/DOWN
-BAH!
-
-The differences are the following:
-* Support to scrolling up/down with mouse wheel or arrow keys
-* THe default drop direction is "Down" instead of "Automatic"
-
-*/
-
-
-
-/**
- * @author larsiusprime
- */
-class FlxUIDropDownMenuCustom extends FlxUIGroup implements IFlxUIWidget implements IFlxUIClickable implements IHasParams
-{
- public var skipButtonUpdate(default, set):Bool;
-
- private function set_skipButtonUpdate(b:Bool):Bool
- {
- skipButtonUpdate = b;
- header.button.skipButtonUpdate = b;
- return b;
- }
-
- public var selectedId(get, set):String;
- public var selectedLabel(get, set):String;
-
- private var _selectedId:String;
- private var _selectedLabel:String;
-
- private var currentScroll:Int = 0; //Handles the scrolling
- public var canScroll:Bool = true;
-
- private function get_selectedId():String
- {
- return _selectedId;
- }
-
- private function set_selectedId(str:String):String
- {
- if (_selectedId == str)
- return str;
-
- var i:Int = 0;
- for (btn in list)
- {
- if (btn != null && btn.name == str)
- {
- var item:FlxUIButton = list[i];
- _selectedId = str;
- if (item.label != null)
- {
- _selectedLabel = item.label.text;
- header.text.text = item.label.text;
- }
- else
- {
- _selectedLabel = "";
- header.text.text = "";
- }
- return str;
- }
- i++;
- }
- return str;
- }
-
- private function get_selectedLabel():String
- {
- return _selectedLabel;
- }
-
- private function set_selectedLabel(str:String):String
- {
- if (_selectedLabel == str)
- return str;
-
- var i:Int = 0;
- for (btn in list)
- {
- if (btn.label.text == str)
- {
- var item:FlxUIButton = list[i];
- _selectedId = item.name;
- _selectedLabel = str;
- header.text.text = str;
- return str;
- }
- i++;
- }
- return str;
- }
-
- /**
- * The header of this dropdown menu.
- */
- public var header:FlxUIDropDownHeader;
-
- /**
- * The list of items that is shown when the toggle button is clicked.
- */
- public var list:Array = [];
-
- /**
- * The background for the list.
- */
- public var dropPanel:FlxUI9SliceSprite;
-
- public var params(default, set):Array;
-
- private function set_params(p:Array):Array
- {
- return params = p;
- }
-
- public var dropDirection(default, set):FlxUIDropDownMenuDropDirection = Down;
-
- private function set_dropDirection(dropDirection):FlxUIDropDownMenuDropDirection
- {
- this.dropDirection = dropDirection;
- updateButtonPositions();
- return dropDirection;
- }
-
- public static inline var CLICK_EVENT:String = "click_dropdown";
-
- public var callback:String->Void;
-
- // private var _ui_control_callback:Bool->FlxUIDropDownMenuCustom->Void;
-
- /**
- * This creates a new dropdown menu.
- *
- * @param X x position of the dropdown menu
- * @param Y y position of the dropdown menu
- * @param DataList The data to be displayed
- * @param Callback Optional Callback
- * @param Header The header of this dropdown menu
- * @param DropPanel Optional 9-slice-background for actual drop down menu
- * @param ButtonList Optional list of buttons to be used for the corresponding entry in DataList
- * @param UIControlCallback Used internally by FlxUI
- */
- public function new(X:Float = 0, Y:Float = 0, DataList:Array, ?Callback:String->Void, ?Header:FlxUIDropDownHeader,
- ?DropPanel:FlxUI9SliceSprite, ?ButtonList:Array, ?UIControlCallback:Bool->FlxUIDropDownMenuCustom->Void)
- {
- super(X, Y);
- callback = Callback;
- header = Header;
- dropPanel = DropPanel;
-
- if (header == null)
- header = new FlxUIDropDownHeader();
-
- if (dropPanel == null)
- {
- var rect = new Rectangle(0, 0, header.background.width, header.background.height);
- dropPanel = new FlxUI9SliceSprite(0, 0, FlxUIAssets.IMG_BOX, rect, [1, 1, 14, 14]);
- }
-
- if (DataList != null)
- {
- for (i in 0...DataList.length)
- {
- var data = DataList[i];
- list.push(makeListButton(i, data.label, data.name));
- }
- selectSomething(DataList[0].name, DataList[0].label);
- }
- else if (ButtonList != null)
- {
- for (btn in ButtonList)
- {
- list.push(btn);
- btn.resize(header.background.width, header.background.height);
- btn.x = 1;
- }
- }
- updateButtonPositions();
-
- dropPanel.resize(header.background.width, getPanelHeight());
- dropPanel.visible = false;
- add(dropPanel);
-
- for (btn in list)
- {
- add(btn);
- btn.visible = false;
- }
-
- // _ui_control_callback = UIControlCallback;
- header.button.onUp.callback = onDropdown;
- add(header);
- }
-
- private function updateButtonPositions():Void
- {
- var buttonHeight = header.background.height;
- dropPanel.y = header.background.y;
- if (dropsUp())
- dropPanel.y -= getPanelHeight();
- else
- dropPanel.y += buttonHeight;
-
- var offset = dropPanel.y;
- for (i in 0...currentScroll) { //Hides buttons that goes before the current scroll
- var button:FlxUIButton = list[i];
- if(button != null) {
- button.y = -99999;
- }
- }
- for (i in currentScroll...list.length)
- {
- var button:FlxUIButton = list[i];
- if(button != null) {
- button.y = offset;
- offset += buttonHeight;
- }
- }
- }
-
- override function set_visible(Value:Bool):Bool
- {
- var vDropPanel = dropPanel.visible;
- var vButtons = [];
- for (i in 0...list.length)
- {
- if (list[i] != null)
- {
- vButtons.push(list[i].visible);
- }
- else
- {
- vButtons.push(false);
- }
- }
- super.set_visible(Value);
- dropPanel.visible = vDropPanel;
- for (i in 0...list.length)
- {
- if (list[i] != null)
- {
- list[i].visible = vButtons[i];
- }
- }
- return Value;
- }
-
- private function dropsUp():Bool
- {
- return dropDirection == Up || (dropDirection == Automatic && exceedsHeight());
- }
-
- private function exceedsHeight():Bool
- {
- return y + getPanelHeight() + header.background.height > FlxG.height;
- }
-
- private function getPanelHeight():Float
- {
- return list.length * header.background.height;
- }
-
- /**
- * Change the contents with a new data list
- * Replaces the old content with the new content
- */
- public function setData(DataList:Array):Void
- {
- var i:Int = 0;
-
- if (DataList != null)
- {
- for (data in DataList)
- {
- var recycled:Bool = false;
- if (list != null)
- {
- if (i <= list.length - 1)
- { // If buttons exist, try to re-use them
- var btn:FlxUIButton = list[i];
- if (btn != null)
- {
- btn.label.text = data.label; // Set the label
- list[i].name = data.name; // Replace the name
- recycled = true; // we successfully recycled it
- }
- }
- }
- else
- {
- list = [];
- }
- if (!recycled)
- { // If we couldn't recycle a button, make a fresh one
- var t:FlxUIButton = makeListButton(i, data.label, data.name);
- list.push(t);
- add(t);
- t.visible = false;
- }
- i++;
- }
-
- // Remove excess buttons:
- if (list.length > DataList.length)
- { // we have more entries in the original set
- for (j in DataList.length...list.length)
- { // start counting from end of list
- var b:FlxUIButton = list.pop(); // remove last button on list
- b.visible = false;
- b.active = false;
- remove(b, true); // remove from widget
- b.destroy(); // destroy it
- b = null;
- }
- }
-
- selectSomething(DataList[0].name, DataList[0].label);
- }
-
- dropPanel.resize(header.background.width, getPanelHeight());
- updateButtonPositions();
- }
-
- private function selectSomething(name:String, label:String):Void
- {
- header.text.text = label;
- selectedId = name;
- selectedLabel = label;
- }
-
- private function makeListButton(i:Int, Label:String, Name:String):FlxUIButton
- {
- var t:FlxUIButton = new FlxUIButton(0, 0, Label);
- t.broadcastToFlxUI = false;
- t.onUp.callback = onClickItem.bind(i);
-
- t.name = Name;
-
- t.loadGraphicSlice9([FlxUIAssets.IMG_INVIS, FlxUIAssets.IMG_HILIGHT, FlxUIAssets.IMG_HILIGHT], Std.int(header.background.width),
- Std.int(header.background.height), [[1, 1, 3, 3], [1, 1, 3, 3], [1, 1, 3, 3]], FlxUI9SliceSprite.TILE_NONE);
- t.labelOffsets[FlxButton.PRESSED].y -= 1; // turn off the 1-pixel depress on click
-
- t.up_color = FlxColor.BLACK;
- t.over_color = FlxColor.WHITE;
- t.down_color = FlxColor.WHITE;
-
- t.resize(header.background.width - 2, header.background.height - 1);
-
- t.label.alignment = "left";
- t.autoCenterLabel();
- t.x = 1;
-
- for (offset in t.labelOffsets)
- {
- offset.x += 2;
- }
-
- return t;
- }
-
- /*public function setUIControlCallback(UIControlCallback:Bool->FlxUIDropDownMenuCustom->Void):Void {
- _ui_control_callback = UIControlCallback;
- }*/
- public function changeLabelByIndex(i:Int, NewLabel:String):Void
- {
- var btn:FlxUIButton = getBtnByIndex(i);
- if (btn != null && btn.label != null)
- {
- btn.label.text = NewLabel;
- }
- }
-
- public function changeLabelById(name:String, NewLabel:String):Void
- {
- var btn:FlxUIButton = getBtnById(name);
- if (btn != null && btn.label != null)
- {
- btn.label.text = NewLabel;
- }
- }
-
- public function getBtnByIndex(i:Int):FlxUIButton
- {
- if (i >= 0 && i < list.length)
- {
- return list[i];
- }
- return null;
- }
-
- public function getBtnById(name:String):FlxUIButton
- {
- for (btn in list)
- {
- if (btn.name == name)
- {
- return btn;
- }
- }
- return null;
- }
-
- public override function update(elapsed:Float):Void
- {
- super.update(elapsed);
-
- #if FLX_MOUSE
- if (dropPanel.visible)
- {
- if(list.length > 1 && canScroll) {
- if(FlxG.mouse.wheel > 0 || FlxG.keys.justPressed.UP) {
- // Go up
- --currentScroll;
- if(currentScroll < 0) currentScroll = 0;
- updateButtonPositions();
- }
- else if (FlxG.mouse.wheel < 0 || FlxG.keys.justPressed.DOWN) {
- // Go down
- currentScroll++;
- if(currentScroll >= list.length) currentScroll = list.length-1;
- updateButtonPositions();
- }
- }
-
- if (FlxG.mouse.justPressed && !mouseOverlapping())
- {
- showList(false);
- }
- }
- #end
- }
-
- function mouseOverlapping()
- {
- var mousePoint = FlxG.mouse.getScreenPosition(camera);
- var objPoint = this.getScreenPosition(null, camera);
- if(mousePoint.x >= objPoint.x && mousePoint.y >= objPoint.y &&
- mousePoint.x < objPoint.x + this.width && mousePoint.y < objPoint.y + this.height)
- {
- return true;
- }
- return false;
- }
-
- override public function destroy():Void
- {
- super.destroy();
-
- dropPanel = FlxDestroyUtil.destroy(dropPanel);
-
- list = FlxDestroyUtil.destroyArray(list);
- // _ui_control_callback = null;
- callback = null;
- }
-
- private function showList(b:Bool):Void
- {
- for (button in list)
- {
- button.visible = b;
- button.active = b;
- }
-
- dropPanel.visible = b;
- if(currentScroll != 0) {
- currentScroll = 0;
- updateButtonPositions();
- }
-
- FlxUI.forceFocus(b, this); // avoid overlaps
- }
-
- private function onDropdown():Void
- {
- (dropPanel.visible) ? showList(false) : showList(true);
- }
-
- private function onClickItem(i:Int):Void
- {
- var item:FlxUIButton = list[i];
- selectSomething(item.name, item.label.text);
- showList(false);
-
- if (callback != null)
- {
- callback(item.name);
- }
-
- if (broadcastToFlxUI)
- {
- FlxUI.event(CLICK_EVENT, this, item.name, params);
- }
- }
-
- /**
- * Helper function to easily create a data list for a dropdown menu from an array of strings.
- *
- * @param StringArray The strings to use as data - used for both label and string ID.
- * @param UseIndexID Whether to use the integer index of the current string as ID.
- * @return The StrIDLabel array ready to be used in FlxUIDropDownMenuCustom's constructor
- */
- public static function makeStrIdLabelArray(StringArray:Array, UseIndexID:Bool = false):Array
- {
- var strIdArray:Array = [];
- for (i in 0...StringArray.length)
- {
- var ID:String = StringArray[i];
- if (UseIndexID)
- {
- ID = Std.string(i);
- }
- strIdArray[i] = new StrNameLabel(ID, StringArray[i]);
- }
- return strIdArray;
- }
-}
-
-/**
- * Header for a FlxUIDropDownMenuCustom
- */
-class FlxUIDropDownHeader extends FlxUIGroup
-{
- /**
- * The background of the header.
- */
- public var background:FlxSprite;
-
- /**
- * The text that displays the currently selected item.
- */
- public var text:FlxUIText;
-
- /**
- * The button that toggles the visibility of the dropdown panel.
- */
- public var button:FlxUISpriteButton;
-
- /**
- * Creates a new dropdown header to be used in a FlxUIDropDownMenuCustom.
- *
- * @param Width Width of the dropdown - only relevant when no back sprite was specified
- * @param Back Optional sprite to be placed in the background
- * @param Text Optional text that displays the current value
- * @param Button Optional button that toggles the dropdown list
- */
- public function new(Width:Int = 120, ?Background:FlxSprite, ?Text:FlxUIText, ?Button:FlxUISpriteButton)
- {
- super();
-
- background = Background;
- text = Text;
- button = Button;
-
- // Background
- if (background == null)
- {
- background = new FlxUI9SliceSprite(0, 0, FlxUIAssets.IMG_BOX, new Rectangle(0, 0, Width, 20), [1, 1, 14, 14]);
- }
-
- // Button
- if (button == null)
- {
- button = new FlxUISpriteButton(0, 0, new FlxSprite(0, 0, FlxUIAssets.IMG_DROPDOWN));
- button.loadGraphicSlice9([FlxUIAssets.IMG_BUTTON_THIN], 80, 20, [FlxStringUtil.toIntArray(FlxUIAssets.SLICE9_BUTTON)],
- FlxUI9SliceSprite.TILE_NONE, -1, false, FlxUIAssets.IMG_BUTTON_SIZE, FlxUIAssets.IMG_BUTTON_SIZE);
- }
- button.resize(background.height, background.height);
- button.x = background.x + background.width - button.width;
-
- // Reposition and resize the button hitbox so the whole header is clickable
- button.width = Width;
- button.offset.x -= (Width - button.frameWidth);
- button.x = offset.x;
- button.label.offset.x += button.offset.x;
-
- // Text
- if (text == null)
- {
- text = new FlxUIText(0, 0, Std.int(background.width));
- }
- text.setPosition(2, 4);
- text.color = FlxColor.BLACK;
-
- add(background);
- add(button);
- add(text);
- }
-
- override public function destroy():Void
- {
- super.destroy();
-
- background = FlxDestroyUtil.destroy(background);
- text = FlxDestroyUtil.destroy(text);
- button = FlxDestroyUtil.destroy(button);
- }
-}
-
-enum FlxUIDropDownMenuDropDirection
-{
- Automatic;
- Down;
- Up;
-}
diff --git a/source/funkin/game/objects/characters/MenuCharacter.hx b/source/funkin/game/objects/characters/MenuCharacter.hx
index 34462dbf..76d010b2 100644
--- a/source/funkin/game/objects/characters/MenuCharacter.hx
+++ b/source/funkin/game/objects/characters/MenuCharacter.hx
@@ -17,6 +17,7 @@ typedef MenuCharacterFile = {
var idle_anim:String;
var confirm_anim:String;
var flipX:Bool;
+ var antialiasing:Null;
}
class MenuCharacter extends FlxSprite
@@ -37,12 +38,14 @@ class MenuCharacter extends FlxSprite
if(character == this.character) return;
this.character = character;
- antialiasing = funkin.backend.utils.ClientPrefs.data.globalAntialiasing;
visible = true;
var dontPlayAnim:Bool = false;
scale.set(1, 1);
updateHitbox();
+
+ color = FlxColor.WHITE;
+ alpha = 1;
hasConfirmAnimation = false;
switch(character) {
@@ -51,28 +54,33 @@ class MenuCharacter extends FlxSprite
dontPlayAnim = true;
default:
var characterPath:String = 'images/menucharacters/' + character + '.json';
- var rawJson = null;
+ var path:String = Paths.getPath(characterPath, TEXT);
#if MODS_ALLOWED
- var path:String = Paths.modFolders(characterPath);
- if (!FileSystem.exists(path)) {
- path = Paths.getSharedPath(characterPath);
+ if (!FileSystem.exists(path))
+ #else
+ if (!Assets.exists(path))
+ #end
+ {
+ path = Paths.getSharedPath('characters/' + DEFAULT_CHARACTER + '.json'); //If a character couldn't be found, change him to BF just to prevent a crash
+ color = FlxColor.BLACK;
+ alpha = 0.6;
}
- if(!FileSystem.exists(path)) {
- path = Paths.getSharedPath('images/menucharacters/' + DEFAULT_CHARACTER + '.json');
+ var charFile:MenuCharacterFile = null;
+ try
+ {
+ #if MODS_ALLOWED
+ charFile = Json.parse(File.getContent(path));
+ #else
+ charFile = Json.parse(Assets.getText(path));
+ #end
}
- rawJson = File.getContent(path);
-
- #else
- var path:String = Paths.getSharedPath(characterPath);
- if(!Assets.exists(path)) {
- path = Paths.getSharedPath('images/menucharacters/' + DEFAULT_CHARACTER + '.json');
+ catch(e:Dynamic)
+ {
+ trace('Error loading menu character file of "$character": $e');
}
- rawJson = Assets.getText(path);
- #end
-
- var charFile:MenuCharacterFile = cast Json.parse(rawJson);
+
frames = Paths.getSparrowAtlas('menucharacters/' + charFile.image);
animation.addByPrefix('idle', charFile.idle_anim, 24);
@@ -83,15 +91,17 @@ class MenuCharacter extends FlxSprite
if (animation.getByName('confirm') != null) //check for invalid animation
hasConfirmAnimation = true;
}
-
flipX = (charFile.flipX == true);
- if(charFile.scale != 1) {
+ if(charFile.scale != 1)
+ {
scale.set(charFile.scale, charFile.scale);
updateHitbox();
}
offset.set(charFile.position[0], charFile.position[1]);
animation.play('idle');
+
+ antialiasing = (charFile.antialiasing != false && ClientPrefs.data.antialiasing);
}
}
}
diff --git a/source/funkin/game/objects/shaders/RainShader.hx b/source/funkin/game/objects/shaders/RainShader.hx
index d63f2e5b..60022194 100644
--- a/source/funkin/game/objects/shaders/RainShader.hx
+++ b/source/funkin/game/objects/shaders/RainShader.hx
@@ -1,9 +1,9 @@
package funkin.game.objects.shaders;
-
import flixel.system.FlxAssets.FlxShader;
import openfl.display.BitmapData;
import openfl.display.ShaderParameter;
import openfl.display.ShaderParameterType;
+import openfl.utils.Assets;
typedef Light =
{
diff --git a/source/funkin/game/options/BaseOptionsMenu.hx b/source/funkin/game/options/BaseOptionsMenu.hx
index a3a6f7ce..97a41a2d 100644
--- a/source/funkin/game/options/BaseOptionsMenu.hx
+++ b/source/funkin/game/options/BaseOptionsMenu.hx
@@ -179,6 +179,7 @@ class BaseOptionsMenu extends MusicBeatSubstate
if(controls.ACCEPT)
{
FlxG.sound.play(Paths.sound('scrollMenu'));
+ ClientPrefs.toggleVolumeKeys(false);
curOption.setValue((curOption.getValue() == true) ? false : true);
curOption.change();
reloadCheckboxes();
diff --git a/source/funkin/game/options/ControlsSubState.hx b/source/funkin/game/options/ControlsSubState.hx
index 75c989c4..415b8910 100644
--- a/source/funkin/game/options/ControlsSubState.hx
+++ b/source/funkin/game/options/ControlsSubState.hx
@@ -130,7 +130,7 @@ class ControlsSubState extends BaseMenu {
}
if (controls.BACK) {
- funkin.backend.utils.ClientPrefs.reloadControls();
+ ClientPrefs.reloadVolumeKeys();
close();
FlxG.sound.play(Paths.sound('cancelMenu'));
}
diff --git a/source/funkin/game/options/NoteOffsetState.hx b/source/funkin/game/options/NoteOffsetState.hx
index ce8d54bc..521b8d3c 100644
--- a/source/funkin/game/options/NoteOffsetState.hx
+++ b/source/funkin/game/options/NoteOffsetState.hx
@@ -64,7 +64,7 @@ class NoteOffsetState extends MusicBeatState
FlxG.cameras.add(camHUD, false);
FlxG.cameras.add(camOther, false);
- FadeTransition.nextCamera = camOther;
+
FlxG.camera.scroll.set(120, 130);
persistentUpdate = true;
@@ -341,7 +341,7 @@ class NoteOffsetState extends MusicBeatState
if(beatTween != null) beatTween.cancel();
persistentUpdate = false;
- FadeTransition.nextCamera = camOther;
+
MusicBeatState.switchState(new funkin.game.states.OptionsState());
FlxG.sound.playMusic(Paths.music('freakyMenu'), 1, true);
FlxG.mouse.visible = false;
diff --git a/source/funkin/game/states/MainMenuState.hx b/source/funkin/game/states/MainMenuState.hx
index ca2b2794..0d4e15b9 100644
--- a/source/funkin/game/states/MainMenuState.hx
+++ b/source/funkin/game/states/MainMenuState.hx
@@ -133,10 +133,6 @@ class MainMenuState extends MusicBeatState
camFollow = new FlxObject(0, 0, 1, 1);
add(camFollow);
- // Transistions
- transIn = FlxTransitionableState.defaultTransIn;
- transOut = FlxTransitionableState.defaultTransOut;
-
// Background
var bgColor:FlxColor = EngineData.coreGame.menuColor;
var yScroll:Float = Math.max(0.25 - (0.05 * (menuButtons.length - 4)), 0.1);
diff --git a/source/funkin/game/states/PlayState.hx b/source/funkin/game/states/PlayState.hx
index b94e1ba3..37ca3a65 100644
--- a/source/funkin/game/states/PlayState.hx
+++ b/source/funkin/game/states/PlayState.hx
@@ -374,7 +374,6 @@ class PlayState extends MusicBeatState
// Init Stuff
grpNoteSplashes = new FlxTypedGroup();
- FadeTransition.nextCamera = camOther;
persistentUpdate = persistentDraw = true;
if(isPixelStage) introSoundsSuffix = '-pixel';
if (SONG == null) SONG = Song.loadFromJson('tutorial');
@@ -407,10 +406,13 @@ class PlayState extends MusicBeatState
GameOverSubstate.resetVariables();
songName = Paths.formatToSongPath(SONG.song);
- curStage = SONG.stage;
- SONG.stage = curStage;
+ if(SONG.stage == null || SONG.stage.length < 1)
+ SONG.stage = StageData.vanillaSongStage(Paths.formatToSongPath(Song.loadedSongName));
+ curStage = SONG.stage;
+
var stageData:StageFile = StageData.getStageFile(curStage);
+ defaultCamZoom = stageData.defaultZoom;
// if u wanna hardcode stage json files
stageUI = "normal";
@@ -796,7 +798,6 @@ class PlayState extends MusicBeatState
}
Paths.clearUnusedMemory();
- FadeTransition.nextCamera = camOther;
if(eventNotes.length < 1) checkEventNote();
}
@@ -1175,16 +1176,17 @@ class PlayState extends MusicBeatState
public function startCountdown()
{
if(startedCountdown) {
- callOnScripts('onStartCountdown', []);
+ callOnScripts('onStartCountdown');
return false;
}
-
+
seenCutscene = true;
inCutscene = false;
- var ret:Dynamic = callOnScripts('onStartCountdown', [], false);
+ var ret:Dynamic = callOnScripts('onStartCountdown', null, true);
if(ret != LuaUtils.Function_Stop) {
if (skipCountdown || startOnTime > 0) skipArrowStartTween = true;
+ canPause = true;
generateStaticArrows(0);
generateStaticArrows(1);
for (i in 0...playerStrums.length) {
@@ -1198,14 +1200,11 @@ class PlayState extends MusicBeatState
}
startedCountdown = true;
- Conductor.songPosition = -Conductor.crochet * 5;
+ Conductor.songPosition = -Conductor.crochet * 5 + Conductor.offset;
setOnScripts('startedCountdown', true);
- callOnScripts('onCountdownStarted', []);
+ callOnScripts('onCountdownStarted');
var swagCounter:Int = 0;
-
- if(startOnTime < 0) startOnTime = 0;
-
if (startOnTime > 0) {
clearNotesBefore(startOnTime);
setSongTime(startOnTime - 350);
@@ -1216,38 +1215,24 @@ class PlayState extends MusicBeatState
setSongTime(0);
return true;
}
-
moveCameraSection();
startTimer = new FlxTimer().start(Conductor.crochet / 1000 / playbackRate, function(tmr:FlxTimer)
{
- if (gf != null && tmr.loopsLeft % Math.round(gfSpeed * gf.danceEveryNumBeats) == 0 && gf.animation.curAnim != null && !gf.animation.curAnim.name.startsWith("sing") && !gf.stunned)
- {
- gf.dance();
- }
- if (tmr.loopsLeft % boyfriend.danceEveryNumBeats == 0 && boyfriend.animation.curAnim != null && !boyfriend.animation.curAnim.name.startsWith('sing') && !boyfriend.stunned)
- {
- boyfriend.dance();
- }
- if (tmr.loopsLeft % dad.danceEveryNumBeats == 0 && dad.animation.curAnim != null && !dad.animation.curAnim.name.startsWith('sing') && !dad.stunned)
- {
- dad.dance();
- }
+ characterBopper(tmr.loopsLeft);
var introAssets:Map> = new Map>();
- introAssets.set('default', ['UI/default/countdown/ready', 'UI/default/countdown/set', 'UI/default/countdown/go']);
- introAssets.set('pixel', ['UI/pixel/countdown/ready', 'UI/pixel/countdown/set', 'UI/pixel/countdown/date']);
+ var introImagesArray:Array = switch(stageUI) {
+ case "pixel": ['${stageUI}UI/ready-pixel', '${stageUI}UI/set-pixel', '${stageUI}UI/date-pixel'];
+ case "normal": ["ready", "set" ,"go"];
+ default: ['${stageUI}UI/ready', '${stageUI}UI/set', '${stageUI}UI/go'];
+ }
+ introAssets.set(stageUI, introImagesArray);
-
- var introAlts:Array = introAssets.get('default');
- var antialias:Bool = ClientPrefs.data.globalAntialiasing;
- var tick:BaseStage.Countdown = THREE;
+ var introAlts:Array = introAssets.get(stageUI);
+ var antialias:Bool = (ClientPrefs.data.antialiasing && !isPixelStage);
+ var tick:Countdown = THREE;
- if(isPixelStage) {
- introAlts = introAssets.get('pixel');
- antialias = false;
- }
-
switch (swagCounter)
{
case 0:
@@ -1269,27 +1254,29 @@ class PlayState extends MusicBeatState
tick = START;
}
- notes.forEachAlive(function(note:Note) {
- if(ClientPrefs.data.opponentStrums || note.mustPress)
- {
- note.copyAlpha = false;
- note.alpha = note.multAlpha;
- if(ClientPrefs.data.middleScroll && !note.mustPress) {
- note.alpha *= 0.35;
+ if(!skipArrowStartTween)
+ {
+ notes.forEachAlive(function(note:Note) {
+ if(ClientPrefs.data.opponentStrums || note.mustPress)
+ {
+ note.copyAlpha = false;
+ note.alpha = note.multAlpha;
+ if(ClientPrefs.data.middleScroll && !note.mustPress)
+ note.alpha *= 0.35;
}
- }
- });
+ });
+ }
+
stagesFunc(function(stage:BaseStage) stage.countdownTick(tick, swagCounter));
- callOnScripts('onCountdownTick', [swagCounter]);
+ callOnLuas('onCountdownTick', [swagCounter]);
+ callOnHScript('onCountdownTick', [tick, swagCounter]);
swagCounter += 1;
- // generateSong('fresh');
}, 5);
}
return true;
}
-
inline private function createCountdownSprite(image:String, antialias:Bool):FlxSprite
{
var spr:FlxSprite = new FlxSprite().loadGraphic(Paths.image(image));
@@ -1728,6 +1715,8 @@ class PlayState extends MusicBeatState
public var skipArrowStartTween:Bool = false; //for lua
private function generateStaticArrows(player:Int):Void
{
+ var strumLineX:Float = ClientPrefs.data.middleScroll ? STRUM_X_MIDDLESCROLL : STRUM_X;
+ var strumLineY:Float = ClientPrefs.data.downScroll ? (FlxG.height - 150) : 50;
for (i in 0...4)
{
// FlxG.log.add(i);
@@ -1738,7 +1727,7 @@ class PlayState extends MusicBeatState
else if(ClientPrefs.data.middleScroll) targetAlpha = 0.35;
}
- var babyArrow:StrumNote = new StrumNote(ClientPrefs.data.middleScroll ? STRUM_X_MIDDLESCROLL : STRUM_X, strumLine.y, i, player);
+ var babyArrow:StrumNote = new StrumNote(strumLineX, strumLineY, i, player);
babyArrow.downScroll = ClientPrefs.data.downScroll;
if (!isStoryMode && !skipArrowStartTween)
{
@@ -1746,15 +1735,10 @@ class PlayState extends MusicBeatState
babyArrow.alpha = 0;
FlxTween.tween(babyArrow, {/*y: babyArrow.y + 10,*/ alpha: targetAlpha}, 1, {ease: FlxEase.circOut, startDelay: 0.5 + (0.2 * i)});
}
- else
- {
- babyArrow.alpha = targetAlpha;
- }
+ else babyArrow.alpha = targetAlpha;
if (player == 1)
- {
playerStrums.add(babyArrow);
- }
else
{
if(ClientPrefs.data.middleScroll)
@@ -1784,7 +1768,7 @@ class PlayState extends MusicBeatState
opponentVocals.pause();
}
FlxTimer.globalManager.forEach(function(tmr:FlxTimer) if(!tmr.finished) tmr.active = false);
- //FlxTween.globalManager.forEach(function(twn:FlxTween) if(!twn.finished) twn.active = false);
+ FlxTween.globalManager.forEach(function(twn:FlxTween) if(!twn.finished) twn.active = false);
}
super.openSubState(SubState);
@@ -1818,7 +1802,7 @@ class PlayState extends MusicBeatState
#end
#if desktop
- WindowUtil.setTitle(detailsText + '- ${SONG.song} (${storyDifficultyText})');
+ WindowUtil.setTitle(detailsText + ' - ${SONG.song} (${storyDifficultyText})');
#end
}
@@ -2648,9 +2632,7 @@ class PlayState extends MusicBeatState
FlxG.sound.playMusic(Paths.music('freakyMenu'));
cancelMusicFadeTween();
- if(FlxTransitionableState.skipNextTransIn) {
- FadeTransition.nextCamera = null;
- }
+
canResync = false;
MusicBeatState.switchState(new StoryMenuState());
@@ -2691,9 +2673,7 @@ class PlayState extends MusicBeatState
trace('WENT BACK TO FREEPLAY??');
Mods.loadTopMod();
cancelMusicFadeTween();
- if(FlxTransitionableState.skipNextTransIn) {
- FadeTransition.nextCamera = null;
- }
+
canResync = false;
MusicBeatState.switchState(new FreeplayState());
FlxG.sound.playMusic(Paths.music('freakyMenu'));
diff --git a/source/funkin/game/states/substates/PauseSubState.hx b/source/funkin/game/states/substates/PauseSubState.hx
index 2fd01b9b..6c7a375f 100644
--- a/source/funkin/game/states/substates/PauseSubState.hx
+++ b/source/funkin/game/states/substates/PauseSubState.hx
@@ -30,9 +30,8 @@ class PauseSubState extends MusicBeatSubstate
var grpMenuShit:FlxTypedGroup;
var menuItems:Array = [];
- var menuItemsOG:Array = ['Resume', 'Restart Song', 'Change Difficulty', 'Exit', 'Exit to menu'];
+ var menuItemsOG:Array = ['Resume', 'Restart Song', 'Change Difficulty', 'Exit to menu'];
var difficultyChoices = [];
- var exitChoices = ['Yes', 'No'];
var curSelected:Int = 0;
var pauseMusic:FlxSound;
@@ -40,13 +39,14 @@ class PauseSubState extends MusicBeatSubstate
var skipTimeText:FlxText;
var skipTimeTracker:Alphabet;
var curTime:Float = Math.max(0, Conductor.songPosition);
- //var botplayText:FlxText;
- public static var songName:String = '';
+ var missingTextBG:FlxSprite;
+ var missingText:FlxText;
- public function new()
+ public static var songName:String = null;
+
+ override function create()
{
- super();
if(Difficulty.list.length < 2) menuItemsOG.remove('Change Difficulty'); //No need to change difficulty if there is only one!
if(PlayState.chartingMode)
@@ -66,18 +66,18 @@ class PauseSubState extends MusicBeatSubstate
menuItems = menuItemsOG;
for (i in 0...Difficulty.list.length) {
- var diff:String = '' + Difficulty.list[i];
+ var diff:String = Difficulty.getString(i);
difficultyChoices.push(diff);
}
difficultyChoices.push('BACK');
-
pauseMusic = new FlxSound();
- if(songName != null) {
- pauseMusic.loadEmbedded(Paths.music(songName), true, true);
- } else if (songName != 'None') {
- pauseMusic.loadEmbedded(Paths.music(Paths.formatToSongPath(funkin.backend.utils.ClientPrefs.data.pauseMusic)), true, true);
+ try
+ {
+ var pauseSong:String = getPauseSong();
+ if(pauseSong != null) pauseMusic.loadEmbedded(Paths.music(pauseSong), true, true);
}
+ catch(e:Dynamic) {}
pauseMusic.volume = 0;
pauseMusic.play(false, FlxG.random.int(0, Std.int(pauseMusic.length / 2)));
@@ -90,8 +90,7 @@ class PauseSubState extends MusicBeatSubstate
bg.scrollFactor.set();
add(bg);
- var levelInfo:FlxText = new FlxText(20, 15, 0, "", 32);
- levelInfo.text += PlayState.SONG.song.formatText();
+ var levelInfo:FlxText = new FlxText(20, 15, 0, PlayState.SONG.song, 32);
levelInfo.scrollFactor.set();
levelInfo.setFormat(Paths.font("vcr.ttf"), 32);
levelInfo.updateHitbox();
@@ -103,14 +102,13 @@ class PauseSubState extends MusicBeatSubstate
levelDifficulty.updateHitbox();
add(levelDifficulty);
- var blueballedTxt:FlxText = new FlxText(20, 15 + 64, 0, "", 32);
- blueballedTxt.text = "Blueballed: " + PlayState.deathCounter;
+ var blueballedTxt:FlxText = new FlxText(20, 15 + 64, 0, "Blueballed: "+PlayState.deathCounter, 32);
blueballedTxt.scrollFactor.set();
blueballedTxt.setFormat(Paths.font('vcr.ttf'), 32);
blueballedTxt.updateHitbox();
add(blueballedTxt);
- practiceText = new FlxText(20, 15 + 101, 0, "PRACTICE MODE", 32);
+ practiceText = new FlxText(20, 15 + 101, 0, "Practice Mode", 32);
practiceText.scrollFactor.set();
practiceText.setFormat(Paths.font('vcr.ttf'), 32);
practiceText.x = FlxG.width - (practiceText.width + 20);
@@ -118,7 +116,7 @@ class PauseSubState extends MusicBeatSubstate
practiceText.visible = PlayState.instance.practiceMode;
add(practiceText);
- var chartingText:FlxText = new FlxText(20, 15 + 101, 0, "CHARTING MODE", 32);
+ var chartingText:FlxText = new FlxText(20, 15 + 101, 0, "Charting Mode", 32);
chartingText.scrollFactor.set();
chartingText.setFormat(Paths.font('vcr.ttf'), 32);
chartingText.x = FlxG.width - (chartingText.width + 20);
@@ -143,9 +141,32 @@ class PauseSubState extends MusicBeatSubstate
grpMenuShit = new FlxTypedGroup();
add(grpMenuShit);
- regenMenu();
+ missingTextBG = new FlxSprite().makeGraphic(1, 1, FlxColor.BLACK);
+ missingTextBG.scale.set(FlxG.width, FlxG.height);
+ missingTextBG.updateHitbox();
+ missingTextBG.alpha = 0.6;
+ missingTextBG.visible = false;
+ add(missingTextBG);
- cameras = [PlayState.instance.camPause];
+ missingText = new FlxText(50, 0, FlxG.width - 100, '', 24);
+ missingText.setFormat(Paths.font("vcr.ttf"), 24, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
+ missingText.scrollFactor.set();
+ missingText.visible = false;
+ add(missingText);
+
+ regenMenu();
+ cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
+
+ super.create();
+ }
+
+ function getPauseSong()
+ {
+ var formattedSongName:String = (songName != null ? Paths.formatToSongPath(songName) : '');
+ var formattedPauseMusic:String = Paths.formatToSongPath(ClientPrefs.data.pauseMusic);
+ if(formattedSongName == 'none' || (formattedSongName != 'none' && formattedPauseMusic == 'none')) return null;
+
+ return (formattedSongName != '') ? formattedSongName : formattedPauseMusic;
}
var holdTime:Float = 0;
@@ -157,17 +178,19 @@ class PauseSubState extends MusicBeatSubstate
pauseMusic.volume += 0.01 * elapsed;
super.update(elapsed);
- updateSkipTextStuff();
- var upP = controls.UI_UP_P;
- var downP = controls.UI_DOWN_P;
- var accepted = controls.ACCEPT;
+ if(controls.BACK)
+ {
+ close();
+ return;
+ }
- if (upP)
+ updateSkipTextStuff();
+ if (controls.UI_UP_P)
{
changeSelection(-1);
}
- if (downP)
+ if (controls.UI_DOWN_P)
{
changeSelection(1);
}
@@ -203,95 +226,105 @@ class PauseSubState extends MusicBeatSubstate
}
}
- if (accepted && (cantUnpause <= 0 || !funkin.backend.utils.ClientPrefs.data.controllerMode))
+ if (controls.ACCEPT && (cantUnpause <= 0))
{
if (menuItems == difficultyChoices)
{
- if(menuItems.length - 1 != curSelected && difficultyChoices.contains(daSelected)) {
- var name:String = PlayState.SONG.song;
- var poop = Highscore.formatSong(name, curSelected);
- PlayState.SONG = Song.loadFromJson(poop, name);
- PlayState.storyDifficulty = curSelected;
- MusicBeatState.resetState();
- FlxG.sound.music.volume = 0;
- PlayState.changedDifficulty = true;
- PlayState.chartingMode = false;
+ var songLowercase:String = Paths.formatToSongPath(PlayState.SONG.song);
+ var poop:String = Highscore.formatSong(songLowercase, curSelected);
+ try
+ {
+ if(menuItems.length - 1 != curSelected && difficultyChoices.contains(daSelected))
+ {
+ Song.loadFromJson(poop, songLowercase);
+ PlayState.storyDifficulty = curSelected;
+ MusicBeatState.resetState();
+ FlxG.sound.music.volume = 0;
+ PlayState.changedDifficulty = true;
+ PlayState.chartingMode = false;
+ return;
+ }
+ }
+ catch(e:haxe.Exception)
+ {
+ trace('ERROR! ${e.message}');
+
+ var errorStr:String = e.message;
+ if(errorStr.startsWith('[lime.utils.Assets] ERROR:')) errorStr = 'Missing file: ' + errorStr.substring(errorStr.indexOf(songLowercase), errorStr.length-1); //Missing chart
+ else errorStr += '\n\n' + e.stack;
+
+ missingText.text = 'ERROR WHILE LOADING CHART:\n$errorStr';
+ missingText.screenCenter(Y);
+ missingText.visible = true;
+ missingTextBG.visible = true;
+ FlxG.sound.play(Paths.sound('cancelMenu'));
+
+ super.update(elapsed);
return;
}
+
menuItems = menuItemsOG;
regenMenu();
}
- if(menuItems == exitChoices)
- switch(daSelected){
- case 'Yes':
- Main.exitOn(0, true);
- case 'No':
- menuItems = menuItemsOG;
- regenMenu();
- }
- else
- switch (daSelected)
- {
- case "Resume":
- close();
- case 'Change Difficulty':
- menuItems = difficultyChoices;
- deleteSkipTimeText();
- regenMenu();
- case 'Exit':
- menuItems = exitChoices;
- deleteSkipTimeText();
- regenMenu();
- case 'Toggle Practice Mode':
- PlayState.instance.practiceMode = !PlayState.instance.practiceMode;
- PlayState.changedDifficulty = true;
- practiceText.visible = PlayState.instance.practiceMode;
- case "Restart Song":
- restartSong();
- case "Leave Charting Mode":
- restartSong();
- PlayState.chartingMode = false;
- case 'Skip Time':
- if(curTime < Conductor.songPosition)
- {
- PlayState.startOnTime = curTime;
- restartSong(true);
- }
- else
+ switch (daSelected)
+ {
+ case "Resume":
+ close();
+ case 'Change Difficulty':
+ menuItems = difficultyChoices;
+ deleteSkipTimeText();
+ regenMenu();
+ case 'Toggle Practice Mode':
+ PlayState.instance.practiceMode = !PlayState.instance.practiceMode;
+ PlayState.changedDifficulty = true;
+ practiceText.visible = PlayState.instance.practiceMode;
+ case "Restart Song":
+ restartSong();
+ case "Leave Charting Mode":
+ restartSong();
+ PlayState.chartingMode = false;
+ case 'Skip Time':
+ if(curTime < Conductor.songPosition)
+ {
+ PlayState.startOnTime = curTime;
+ restartSong(true);
+ }
+ else
+ {
+ if (curTime != Conductor.songPosition)
{
- if (curTime != Conductor.songPosition)
- {
- PlayState.instance.clearNotesBefore(curTime);
- PlayState.instance.setSongTime(curTime);
- }
- close();
+ PlayState.instance.clearNotesBefore(curTime);
+ PlayState.instance.setSongTime(curTime);
}
- case "End Song":
close();
- PlayState.instance.finishSong(true);
- case 'Toggle Botplay':
- PlayState.instance.cpuControlled = !PlayState.instance.cpuControlled;
- PlayState.changedDifficulty = true;
- PlayState.instance.botplayTxt.visible = PlayState.instance.cpuControlled && !funkin.backend.utils.ClientPrefs.data.hideFullHUD;
- PlayState.instance.botplayTxt.alpha = 1;
- PlayState.instance.botplaySine = 0;
- case "Exit to menu":
- PlayState.deathCounter = 0;
- PlayState.seenCutscene = false;
-
- Mods.loadTopMod();
- if(PlayState.isStoryMode) {
- MusicBeatState.switchState(new funkin.game.states.StoryMenuState());
- } else {
- MusicBeatState.switchState(new funkin.game.states.FreeplayState());
- }
- PlayState.cancelMusicFadeTween();
- FlxG.sound.playMusic(Paths.music('freakyMenu'));
- PlayState.changedDifficulty = false;
- PlayState.chartingMode = false;
- }
+ }
+ case 'End Song':
+ close();
+ PlayState.instance.notes.clear();
+ PlayState.instance.unspawnNotes = [];
+ PlayState.instance.finishSong(true);
+ case 'Toggle Botplay':
+ PlayState.instance.cpuControlled = !PlayState.instance.cpuControlled;
+ PlayState.changedDifficulty = true;
+ PlayState.instance.botplayTxt.visible = PlayState.instance.cpuControlled;
+ PlayState.instance.botplayTxt.alpha = 1;
+ PlayState.instance.botplaySine = 0;
+ case "Exit to menu":
+ PlayState.deathCounter = 0;
+ PlayState.seenCutscene = false;
+ Mods.loadTopMod();
+ if(PlayState.isStoryMode)
+ MusicBeatState.switchState(new StoryMenuState());
+ else
+ MusicBeatState.switchState(new FreeplayState());
+
+ FlxG.sound.playMusic(Paths.music('freakyMenu'));
+ PlayState.changedDifficulty = false;
+ PlayState.chartingMode = false;
+ FlxG.camera.followLerp = 0;
+ }
}
}
@@ -315,48 +348,28 @@ class PauseSubState extends MusicBeatSubstate
if(noTrans)
{
+ FlxTransitionableState.skipNextTransIn = true;
FlxTransitionableState.skipNextTransOut = true;
- FlxG.resetState();
- }
- else
- {
- MusicBeatState.resetState();
}
+ MusicBeatState.resetState();
}
override function destroy()
{
pauseMusic.destroy();
-
super.destroy();
}
function changeSelection(change:Int = 0):Void
{
- curSelected += change;
-
- FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
-
- if (curSelected < 0)
- curSelected = menuItems.length - 1;
- if (curSelected >= menuItems.length)
- curSelected = 0;
-
- var bullShit:Int = 0;
-
- for (item in grpMenuShit.members)
+ curSelected = FlxMath.wrap(curSelected + change, 0, menuItems.length - 1);
+ for (num => item in grpMenuShit.members)
{
- item.targetY = bullShit - curSelected;
- bullShit++;
-
+ item.targetY = num - curSelected;
item.alpha = 0.6;
- // item.setGraphicSize(Std.int(item.width * 0.8));
-
if (item.targetY == 0)
{
item.alpha = 1;
- // item.setGraphicSize(Std.int(item.width));
-
if(item == skipTimeTracker)
{
curTime = Math.max(0, Conductor.songPosition);
@@ -364,23 +377,27 @@ class PauseSubState extends MusicBeatSubstate
}
}
}
+ missingText.visible = false;
+ missingTextBG.visible = false;
+ FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
}
function regenMenu():Void {
- for (i in 0...grpMenuShit.members.length) {
- var obj = grpMenuShit.members[0];
+ for (i in 0...grpMenuShit.members.length)
+ {
+ var obj:Alphabet = grpMenuShit.members[0];
obj.kill();
grpMenuShit.remove(obj, true);
obj.destroy();
}
- for (i in 0...menuItems.length) {
- var item = new Alphabet(90, 320, menuItems[i], true);
+ for (num => str in menuItems) {
+ var item = new Alphabet(90, 320, str, true);
item.isMenuItem = true;
- item.targetY = i;
+ item.targetY = num;
grpMenuShit.add(item);
- if(menuItems[i] == 'Skip Time')
+ if(str == 'Skip Time')
{
skipTimeText = new FlxText(0, 0, 0, '', 64);
skipTimeText.setFormat(Paths.font("vcr.ttf"), 64, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
@@ -407,7 +424,5 @@ class PauseSubState extends MusicBeatSubstate
}
function updateSkipTimeText()
- {
skipTimeText.text = FlxStringUtil.formatTime(Math.max(0, Math.floor(curTime / 1000)), false) + ' / ' + FlxStringUtil.formatTime(Math.max(0, Math.floor(FlxG.sound.music.length / 1000)), false);
- }
}
diff --git a/source/funkin/game/transitions/FadeTransition.hx b/source/funkin/game/transitions/FadeTransition.hx
index 8c2408e5..6ce12d25 100644
--- a/source/funkin/game/transitions/FadeTransition.hx
+++ b/source/funkin/game/transitions/FadeTransition.hx
@@ -3,7 +3,6 @@ package funkin.game.transitions;
import funkin.backend.CoolUtil;
import funkin.backend.Conductor.BPMChangeEvent;
import flixel.FlxG;
-import flixel.addons.ui.FlxUIState;
import flixel.math.FlxRect;
import flixel.util.FlxTimer;
import flixel.addons.transition.FlxTransitionableState;
@@ -18,75 +17,78 @@ import funkin.backend.system.MusicBeatSubstate;
class FadeTransition extends MusicBeatSubstate {
public static var finishCallback:Void->Void;
- private var leTween:FlxTween = null;
- public static var nextCamera:FlxCamera;
+
var isTransIn:Bool = false;
var transBlack:FlxSprite;
var transGradient:FlxSprite;
- public function new(duration:Float, isTransIn:Bool) {
- super();
+ var duration:Float;
+ public function new(duration:Float, isTransIn:Bool)
+ {
+ this.duration = duration;
this.isTransIn = isTransIn;
- var zoom:Float = CoolUtil.boundTo(FlxG.camera.zoom, 0.05, 1);
- var width:Int = Std.int(FlxG.width / zoom);
- var height:Int = Std.int(FlxG.height / zoom);
- transGradient = FlxGradient.createGradientFlxSprite(width, height, (isTransIn ? [0x0, FlxColor.BLACK] : [FlxColor.BLACK, 0x0]));
+ super();
+ }
+
+ override function create()
+ {
+ cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
+ var width:Int = Std.int(FlxG.width / Math.max(camera.zoom, 0.001));
+ var height:Int = Std.int(FlxG.height / Math.max(camera.zoom, 0.001));
+ transGradient = FlxGradient.createGradientFlxSprite(1, height, (isTransIn ? [0x0, FlxColor.BLACK] : [FlxColor.BLACK, 0x0]));
+ transGradient.scale.x = width;
+ transGradient.updateHitbox();
transGradient.scrollFactor.set();
+ transGradient.screenCenter(X);
add(transGradient);
- transBlack = new FlxSprite().makeGraphic(width, height + 400, FlxColor.BLACK);
+ transBlack = new FlxSprite().makeGraphic(1, 1, FlxColor.BLACK);
+ transBlack.scale.set(width, height + 400);
+ transBlack.updateHitbox();
transBlack.scrollFactor.set();
+ transBlack.screenCenter(X);
add(transBlack);
- transGradient.x -= (width - FlxG.width) / 2;
- transBlack.x = transGradient.x;
-
- if(isTransIn) {
+ if (isTransIn)
transGradient.y = transBlack.y - transBlack.height;
- FlxTween.tween(transGradient, {y: transGradient.height + 50}, duration, {
- onComplete: function(twn:FlxTween) {
- close();
- },
- ease: FlxEase.linear});
- } else {
+ else
transGradient.y = -transGradient.height;
- transBlack.y = transGradient.y - transBlack.height + 50;
- leTween = FlxTween.tween(transGradient, {y: transGradient.height + 50}, duration, {
- onComplete: function(twn:FlxTween) {
- if(finishCallback != null) {
- finishCallback();
- }
- },
- ease: FlxEase.linear});
- }
- if(nextCamera != null) {
- transBlack.cameras = [nextCamera];
- transGradient.cameras = [nextCamera];
- }
- nextCamera = null;
+ super.create();
}
- override function update(elapsed:Float) {
- if(isTransIn) {
- transBlack.y = transGradient.y + transGradient.height;
- } else {
- transBlack.y = transGradient.y - transBlack.height;
- }
+ override function update(elapsed:Float)
+ {
super.update(elapsed);
- if(isTransIn) {
+
+ final height:Float = FlxG.height * Math.max(camera.zoom, 0.001);
+ final targetPos:Float = transGradient.height + 50 * Math.max(camera.zoom, 0.001);
+ if (duration > 0)
+ transGradient.y += (height + targetPos) * elapsed / duration;
+ else
+ transGradient.y = (targetPos) * elapsed;
+
+ if (isTransIn)
transBlack.y = transGradient.y + transGradient.height;
- } else {
+ else
transBlack.y = transGradient.y - transBlack.height;
+
+ if (transGradient.y >= targetPos)
+ {
+ close();
}
}
- override function destroy() {
- if(leTween != null) {
+ // Don't delete this
+ override function close():Void
+ {
+ super.close();
+
+ if (finishCallback != null)
+ {
finishCallback();
- leTween.cancel();
+ finishCallback = null;
}
- super.destroy();
}
}
\ No newline at end of file
diff --git a/source/funkin/import.hx b/source/funkin/import.hx
index abc3a6e3..2dab9ceb 100644
--- a/source/funkin/import.hx
+++ b/source/funkin/import.hx
@@ -15,6 +15,7 @@ import funkin.game.editors.content.*;
import funkin.game.states.substates.*;
import funkin.game.objects.shaders.*;
import funkin.game.objects.shaders.RGBPalette;
+import funkin.backend.Prompt;
// backend
import funkin.backend.macro.*;