🔧 Implicitely load effect preferences

This commit is contained in:
Simon Schneegans
2023-01-25 05:50:46 +01:00
parent b2f5a930d0
commit 6bdb1b07ff
79 changed files with 141 additions and 299 deletions
+3 -11
View File
@@ -83,22 +83,14 @@ var Apparition = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/Apparition.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('apparition-randomness');
dialog.bindAdjustment('apparition-animation-time');
dialog.bindAdjustment('apparition-twirl-intensity');
dialog.bindAdjustment('apparition-shake-intensity');
dialog.bindAdjustment('apparition-suction-intensity');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('apparition-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+5 -12
View File
@@ -128,7 +128,8 @@ var BrokenGlass = class {
// This will be called in various places where a unique identifier for this effect is
// required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time').
// (e.g. '*-animation-time'). Also, the shader file and the settings UI files should be
// named likes this.
getNick() {
return 'broken-glass';
}
@@ -141,22 +142,14 @@ var BrokenGlass = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/BrokenGlass.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('broken-glass-animation-time');
dialog.bindAdjustment('broken-glass-scale');
dialog.bindAdjustment('broken-glass-gravity');
dialog.bindAdjustment('broken-glass-blow-force');
dialog.bindSwitch('broken-glass-use-pointer');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('broken-glass-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -90,21 +90,13 @@ var Doom = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/Doom.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('doom-animation-time');
dialog.bindAdjustment('doom-horizontal-scale');
dialog.bindAdjustment('doom-vertical-scale');
dialog.bindAdjustment('doom-pixel-size');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('doom-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -82,20 +82,12 @@ var EnergizeA = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/EnergizeA.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('energize-a-animation-time');
dialog.bindAdjustment('energize-a-scale');
dialog.bindColorButton('energize-a-color');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('energize-a-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -83,20 +83,12 @@ var EnergizeB = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/EnergizeB.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('energize-b-animation-time');
dialog.bindAdjustment('energize-b-scale');
dialog.bindColorButton('energize-b-color');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('energize-b-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -9
View File
@@ -102,12 +102,9 @@ var Fire = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/Fire.ui`);
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
// Bind all properties.
dialog.bindAdjustment('fire-animation-time');
@@ -131,9 +128,6 @@ var Fire = class {
// Initialize the fire-preset dropdown.
this._createFirePresets(dialog);
// Finally, return the new settings page.
return dialog.getBuilder().get_object('fire-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -80,22 +80,14 @@ var Glide = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/Glide.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('glide-animation-time');
dialog.bindAdjustment('glide-scale');
dialog.bindAdjustment('glide-squish');
dialog.bindAdjustment('glide-tilt');
dialog.bindAdjustment('glide-shift');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('glide-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -91,22 +91,14 @@ var Glitch = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/Glitch.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('glitch-animation-time');
dialog.bindAdjustment('glitch-scale');
dialog.bindAdjustment('glitch-speed');
dialog.bindAdjustment('glitch-strength');
dialog.bindColorButton('glitch-color');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('glitch-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -100,23 +100,15 @@ var Hexagon = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/Hexagon.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('hexagon-animation-time');
dialog.bindAdjustment('hexagon-scale');
dialog.bindAdjustment('hexagon-line-width');
dialog.bindColorButton('hexagon-line-color');
dialog.bindColorButton('hexagon-glow-color');
dialog.bindSwitch('hexagon-additive-blending');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('hexagon-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -133,22 +133,14 @@ var Incinerate = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/Incinerate.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('incinerate-animation-time');
dialog.bindAdjustment('incinerate-scale');
dialog.bindAdjustment('incinerate-turbulence');
dialog.bindSwitch('incinerate-use-pointer');
dialog.bindColorButton('incinerate-color');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('incinerate-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -116,23 +116,15 @@ var Matrix = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/Matrix.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('matrix-animation-time');
dialog.bindAdjustment('matrix-scale');
dialog.bindAdjustment('matrix-randomness');
dialog.bindAdjustment('matrix-overshoot');
dialog.bindColorButton('matrix-trail-color');
dialog.bindColorButton('matrix-tip-color');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('matrix-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -76,20 +76,12 @@ var PixelWheel = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/PixelWheel.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('pixel-wheel-animation-time');
dialog.bindAdjustment('pixel-wheel-pixel-size');
dialog.bindAdjustment('pixel-wheel-spoke-count');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('pixel-wheel-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -102,19 +102,11 @@ var PixelWipe = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/PixelWipe.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('pixel-wipe-animation-time');
dialog.bindAdjustment('pixel-wipe-pixel-size');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('pixel-wipe-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -76,20 +76,12 @@ var Pixelate = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/Pixelate.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('pixelate-animation-time');
dialog.bindAdjustment('pixelate-noise');
dialog.bindAdjustment('pixelate-pixel-size');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('pixelate-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -93,22 +93,14 @@ var Portal = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/Portal.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('portal-animation-time');
dialog.bindAdjustment('portal-rotation-speed');
dialog.bindAdjustment('portal-whirling');
dialog.bindAdjustment('portal-details');
dialog.bindColorButton('portal-color');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('portal-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -12
View File
@@ -120,21 +120,12 @@ var SnapOfDisintegration = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(
`/ui/${utils.getUIDir()}/SnapOfDisintegration.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('snap-animation-time');
dialog.bindAdjustment('snap-scale');
dialog.bindColorButton('snap-color');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('snap-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -118,22 +118,14 @@ var TRexAttack = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/TRexAttack.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('trex-animation-time');
dialog.bindColorButton('claw-scratch-color');
dialog.bindAdjustment('claw-scratch-scale');
dialog.bindAdjustment('claw-scratch-count');
dialog.bindAdjustment('claw-scratch-warp');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('trex-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -80,19 +80,11 @@ var TVEffect = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/TVEffect.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('tv-animation-time');
dialog.bindColorButton('tv-effect-color');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('tv-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -92,22 +92,14 @@ var TVGlitch = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/TVGlitch.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('tv-glitch-animation-time');
dialog.bindAdjustment('tv-glitch-scale');
dialog.bindAdjustment('tv-glitch-speed');
dialog.bindAdjustment('tv-glitch-strength');
dialog.bindColorButton('tv-glitch-color');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('tv-glitch-prefs');
}
// ---------------------------------------------------------------- API for extension.js
+3 -11
View File
@@ -88,20 +88,12 @@ var Wisps = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/Wisps.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('wisps-animation-time');
dialog.bindAdjustment('wisps-scale');
dialog.bindColorButton('wisps-color');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('wisps-prefs');
}
// ---------------------------------------------------------------- API for extension.js