Particle muting + improved molang performance

This commit is contained in:
JannisX11 2020-10-07 19:38:31 +02:00
parent 808c28e6ba
commit b988681abb
2 changed files with 7 additions and 5 deletions

View File

@ -954,7 +954,6 @@ class EffectAnimator extends GeneralAnimator {
}
displayFrame() {
if (!this.muted.sound) {
// Sounds
this.sound.forEach(kf => {
var diff = kf.time - Timeline.time;
if (diff >= 0 && diff < (1/60) * (Timeline.playback_speed/100)) {
@ -974,7 +973,9 @@ class EffectAnimator extends GeneralAnimator {
}
}
})
// Particles
}
if (!this.muted.particle) {
this.particle.forEach(kf => {
var diff = Timeline.time - kf.time;
if (diff >= 0) {

View File

@ -23,8 +23,10 @@
// Util
function trimInput(string) {
string = string.toLowerCase();
string = string.replace(/;\s+/g, ';').replace(/;\s*$/, '').trim();
string = string.toLowerCase().trim();
if (string.includes(';')) {
string = string.replace(/;\s+/g, ';').replace(/;\s*$/, '');
}
return string;
}
@ -44,7 +46,6 @@
// Tree Types
function Expression(string) {
this.original_input = string;
this.lines = string.split(';').map(line => {
return iterateString(line);
});