🔧 Add transiation tweaking

This commit is contained in:
Simon Schneegans
2022-01-09 21:18:01 +01:00
parent 9cd43a9c56
commit f04295b32b
6 changed files with 99 additions and 37 deletions
+18
View File
@@ -215,6 +215,24 @@ var FireEffect = class FireEffect {
return new FireShader(settings);
}
// If there's a transition in progress, we re-target these transitions so that the
// window is neither scaled nor faded.
static tweakTransitions(actor, settings) {
const animationTime = settings.get_int('fire-animation-time');
const tweakTransition = (property, value) => {
const transition = actor.get_transition(property);
if (transition) {
transition.set_to(value);
transition.set_duration(animationTime);
}
};
tweakTransition('opacity', 255);
tweakTransition('scale-x', 1);
tweakTransition('scale-y', 1);
}
// ----------------------------------------------------------------------- private stuff
// This populates the preset dropdown menu for the fire options.
+18
View File
@@ -190,4 +190,22 @@ var MatrixEffect = class MatrixEffect {
static createShader(settings) {
return new MatrixShader(settings);
}
// If there's a transition in progress, we re-target these transitions so that the
// window is neither scaled nor faded.
static tweakTransitions(actor, settings) {
const animationTime = settings.get_int('matrix-animation-time');
const tweakTransition = (property, value) => {
const transition = actor.get_transition(property);
if (transition) {
transition.set_to(value);
transition.set_duration(animationTime);
}
};
tweakTransition('opacity', 255);
tweakTransition('scale-x', 1);
tweakTransition('scale-y', 1);
}
}
+20
View File
@@ -201,4 +201,24 @@ var TRexEffect = class TRexEffect {
static createShader(settings) {
return new TRexShader(settings);
}
// If there's a transition in progress, we re-target these transitions so that the
// window is neither scaled nor faded.
static tweakTransitions(actor, settings) {
const animationTime = settings.get_int('trex-animation-time');
const tweakTransition = (property, value) => {
const transition = actor.get_transition(property);
if (transition) {
transition.set_to(value);
transition.set_duration(animationTime);
}
};
const warp = 0.5 * settings.get_double('claw-scratch-warp');
tweakTransition('opacity', 255);
tweakTransition('scale-x', 1.0 + warp);
tweakTransition('scale-y', 1.0 + warp);
}
}
+18
View File
@@ -130,4 +130,22 @@ var TVEffect = class TVEffect {
static createShader(settings) {
return new TVEffectShader(settings);
}
// If there's a transition in progress, we re-target these transitions so that the
// window is neither scaled nor faded.
static tweakTransitions(actor, settings) {
const animationTime = settings.get_int('tv-animation-time');
const tweakTransition = (property, value) => {
const transition = actor.get_transition(property);
if (transition) {
transition.set_to(value);
transition.set_duration(animationTime);
}
};
tweakTransition('opacity', 255);
tweakTransition('scale-x', 1);
tweakTransition('scale-y', 0.5);
}
}