🔧 Work on effect profiles

This commit is contained in:
Simon Schneegans
2023-01-13 20:41:28 +01:00
parent 532aad1341
commit a4b9f70cc3
26 changed files with 231 additions and 445 deletions
+5 -5
View File
@@ -379,8 +379,7 @@ class Extension {
// If an effect is to be previewed, we have to affect dialogs es well. This is
// because the preview window is a dialog window...
const action = forOpening ? 'open' : 'close';
const previewNick = this._settings.get_string(action + '-preview-effect');
const previewNick = this._settings.get_string('preview-effect');
if (isDialogWindow && !shouldDestroyDialogs && previewNick == '') {
this._fixAnimationTimes(isDialogWindow, forOpening, null);
@@ -418,15 +417,16 @@ class Extension {
effect = this._ALL_EFFECTS.find(effect => effect.getNick() == previewNick);
// Only preview the effect once.
this._settings.set_string(action + '-preview-effect', '');
if (!forOpening) {
this._settings.set_string('preview-effect', '');
}
}
// Else we choose a random effect from all enabled effects.
else {
// Therefore, we first create a list of all currently enabled effects.
const enabled = this._ALL_EFFECTS.filter(effect => {
return this._settings.get_boolean(`${effect.getNick()}-${action}-effect`);
return this._settings.get_boolean(`${effect.getNick()}-enable-effect`);
});
// And then choose a random effect.