🚚 Rename burn effect

This commit is contained in:
Simon Schneegans
2022-05-28 21:05:52 +02:00
parent d114c68422
commit d6e46d951c
6 changed files with 61 additions and 55 deletions
+1 -1
View File
@@ -52,11 +52,11 @@ class Extension {
this._ALL_EFFECTS = [
new Me.imports.src.Apparition.Apparition(),
new Me.imports.src.BrokenGlass.BrokenGlass(),
new Me.imports.src.Burn.Burn(),
new Me.imports.src.EnergizeA.EnergizeA(),
new Me.imports.src.EnergizeB.EnergizeB(),
new Me.imports.src.Fire.Fire(),
new Me.imports.src.Hexagon.Hexagon(),
new Me.imports.src.Incinerate.Incinerate(),
new Me.imports.src.Matrix.Matrix(),
new Me.imports.src.SnapOfDisintegration.SnapOfDisintegration(),
new Me.imports.src.TRexAttack.TRexAttack(),
+1 -1
View File
@@ -48,11 +48,11 @@ var PreferencesDialog = class PreferencesDialog {
this._ALL_EFFECTS = [
new Me.imports.src.Apparition.Apparition(),
new Me.imports.src.BrokenGlass.BrokenGlass(),
new Me.imports.src.Burn.Burn(),
new Me.imports.src.EnergizeA.EnergizeA(),
new Me.imports.src.EnergizeB.EnergizeB(),
new Me.imports.src.Fire.Fire(),
new Me.imports.src.Hexagon.Hexagon(),
new Me.imports.src.Incinerate.Incinerate(),
new Me.imports.src.Matrix.Matrix(),
new Me.imports.src.SnapOfDisintegration.SnapOfDisintegration(),
new Me.imports.src.TRexAttack.TRexAttack(),
@@ -1,11 +1,17 @@
// Inject some common shader snippets. It is only possible to include glsl files from the
// "common" directory. Also, the files in the "common" directory are not allowed to
// include any further files.
#include "common/uniforms.glsl"
#include "common/noise.glsl"
#include "common/easing.glsl"
#include "common/compositing.glsl"
#include "common/edgeMask.glsl"
//////////////////////////////////////////////////////////////////////////////////////////
// ) ( //
// ( /( ( ( ) ( ( ( ( )\ ) ( ( //
// )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( //
// ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ //
// | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) //
// | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< //
// |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ //
// |__/ //
// Copyright (c) 2021 Simon Schneegans //
// Released under the GPLv3 or later. See LICENSE file for details. //
//////////////////////////////////////////////////////////////////////////////////////////
// The content from common.glsl is automatically prepended to each shader effect.
uniform vec2 uSeed;
uniform vec3 uColor;
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="burn-my-windows">
<object class="GtkBox" id="burn-prefs">
<object class="GtkBox" id="incinerate-prefs">
<property name="orientation">vertical</property>
<child>
@@ -37,7 +37,7 @@
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="burn-animation-time">
<object class="GtkAdjustment" id="incinerate-animation-time">
<property name="upper">10000</property>
<property name="lower">100</property>
<property name="step-increment">1</property>
@@ -47,7 +47,7 @@
</object>
</child>
<child>
<object class="GtkButton" id="reset-burn-animation-time">
<object class="GtkButton" id="reset-incinerate-animation-time">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
@@ -83,7 +83,7 @@
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="burn-scale">
<object class="GtkAdjustment" id="incinerate-scale">
<property name="upper">10</property>
<property name="lower">0.1</property>
<property name="step-increment">0.01</property>
@@ -93,7 +93,7 @@
</object>
</child>
<child>
<object class="GtkButton" id="reset-burn-scale">
<object class="GtkButton" id="reset-incinerate-scale">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
@@ -129,7 +129,7 @@
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="burn-width">
<object class="GtkAdjustment" id="incinerate-width">
<property name="upper">10</property>
<property name="lower">0.1</property>
<property name="step-increment">0.01</property>
@@ -139,7 +139,7 @@
</object>
</child>
<child>
<object class="GtkButton" id="reset-burn-width">
<object class="GtkButton" id="reset-incinerate-width">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
@@ -175,7 +175,7 @@
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="burn-turbulence">
<object class="GtkAdjustment" id="incinerate-turbulence">
<property name="upper">1</property>
<property name="lower">0</property>
<property name="step-increment">0.01</property>
@@ -185,7 +185,7 @@
</object>
</child>
<child>
<object class="GtkButton" id="reset-burn-turbulence">
<object class="GtkButton" id="reset-incinerate-turbulence">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
@@ -213,13 +213,13 @@
</object>
</child>
<child>
<object class="GtkColorButton" id="burn-color">
<object class="GtkColorButton" id="incinerate-color">
<property name="use_alpha">0</property>
<property name="show_editor">1</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-burn-color">
<object class="GtkButton" id="reset-incinerate-color">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
@@ -332,48 +332,48 @@
</key>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Burn Options -->
<!-- Incinerate Options -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<key name="burn-close-effect" type="b">
<key name="incinerate-close-effect" type="b">
<default>false</default>
<summary>Burn Close Effect</summary>
<description>Use the Burn effect for window closing.</description>
<summary>Incinerate Close Effect</summary>
<description>Use the Incinerate effect for window closing.</description>
</key>
<key name="burn-open-effect" type="b">
<key name="incinerate-open-effect" type="b">
<default>false</default>
<summary>Burn Open Effect</summary>
<description>Use the Burn effect for window opening.</description>
<summary>Incinerate Open Effect</summary>
<description>Use the Incinerate effect for window opening.</description>
</key>
<key name="burn-animation-time" type="i">
<key name="incinerate-animation-time" type="i">
<default>2000</default>
<summary>Burn Animation Time</summary>
<description>The time the Burn effect takes.</description>
<summary>Incinerate Animation Time</summary>
<description>The time the Incinerate effect takes.</description>
</key>
<key name="burn-scale" type="d">
<key name="incinerate-scale" type="d">
<default>1.0</default>
<summary>Burn Scale</summary>
<summary>Incinerate Scale</summary>
<description>The scale of the effect.</description>
</key>
<key name="burn-width" type="d">
<key name="incinerate-width" type="d">
<default>1.0</default>
<summary>Burn Width</summary>
<summary>Incinerate Width</summary>
<description>The width of the effect.</description>
</key>
<key name="burn-turbulence" type="d">
<key name="incinerate-turbulence" type="d">
<default>0.15</default>
<summary>Burn Turbulence</summary>
<summary>Incinerate Turbulence</summary>
<description>The turbulence of the effect.</description>
</key>
<key name="burn-color" type="s">
<key name="incinerate-color" type="s">
<default>"rgb(255, 200, 50)"</default>
<summary>Burn Color</summary>
<summary>Incinerate Color</summary>
<description>The color of the effect.</description>
</key>
+16 -16
View File
@@ -29,7 +29,7 @@ const ShaderFactory = Me.imports.src.ShaderFactory.ShaderFactory;
// The effect class can be used to get some metadata (like the effect's name or supported
// GNOME Shell versions), to initialize the respective page of the settings dialog, as
// well as to create the actual shader for the effect.
var Burn = class {
var Incinerate = class {
// The constructor creates a ShaderFactory which will be used by extension.js to create
// shader instances for this effect. The shaders will be automagically created using the
@@ -51,7 +51,7 @@ var Burn = class {
// Write all uniform values at the start of each animation.
shader.connect('begin-animation', (shader, settings) => {
const c = Clutter.Color.from_string(settings.get_string('burn-color'))[1];
const c = Clutter.Color.from_string(settings.get_string('incinerate-color'))[1];
// If we are currently performing integration test, the animation uses a fixed
// seed.
@@ -60,9 +60,9 @@ var Burn = class {
// clang-format off
shader.set_uniform_float(shader._uSeed, 2, [testMode ? 0 : Math.random(), testMode ? 0 : Math.random()]);
shader.set_uniform_float(shader._uColor, 3, [c.red / 255, c.green / 255, c.blue / 255]);
shader.set_uniform_float(shader._uWidth, 1, [settings.get_double('burn-width')]);
shader.set_uniform_float(shader._uScale, 1, [settings.get_double('burn-scale')]);
shader.set_uniform_float(shader._uTurbulence, 1, [settings.get_double('burn-turbulence')]);
shader.set_uniform_float(shader._uWidth, 1, [settings.get_double('incinerate-width')]);
shader.set_uniform_float(shader._uScale, 1, [settings.get_double('incinerate-scale')]);
shader.set_uniform_float(shader._uTurbulence, 1, [settings.get_double('incinerate-turbulence')]);
// clang-format on
});
});
@@ -70,9 +70,9 @@ var Burn = class {
// ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension.
// This effect is only available on GNOME Shell 40+.
getMinShellVersion() {
return [3, 36];
return [40, 0];
}
// This will be called in various places where a unique identifier for this effect is
@@ -80,13 +80,13 @@ var Burn = class {
// effect is enabled currently (e.g. '*-close-effect'), and its animation time
// (e.g. '*-animation-time').
getNick() {
return 'burn';
return 'incinerate';
}
// This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect.
getLabel() {
return _('Burn');
return _('Incinerate');
}
// -------------------------------------------------------------------- API for prefs.js
@@ -96,17 +96,17 @@ var Burn = class {
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/Burn.ui`);
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/Incinerate.ui`);
// Bind all properties.
dialog.bindAdjustment('burn-animation-time');
dialog.bindAdjustment('burn-width');
dialog.bindAdjustment('burn-scale');
dialog.bindAdjustment('burn-turbulence');
dialog.bindColorButton('burn-color');
dialog.bindAdjustment('incinerate-animation-time');
dialog.bindAdjustment('incinerate-width');
dialog.bindAdjustment('incinerate-scale');
dialog.bindAdjustment('incinerate-turbulence');
dialog.bindColorButton('incinerate-color');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('burn-prefs');
return dialog.getBuilder().get_object('incinerate-prefs');
}
// ---------------------------------------------------------------- API for extension.js