🚚 Rename transporter effects

This commit is contained in:
Simon Schneegans
2022-01-16 05:37:40 +01:00
parent b873772419
commit 5244ac65f3
5 changed files with 33 additions and 35 deletions
+2 -2
View File
@@ -26,11 +26,11 @@ const FireEffect = Me.imports.src.FireEffect.FireEffect;
// New effects must be registered here and in prefs.js. // New effects must be registered here and in prefs.js.
const ALL_EFFECTS = [ const ALL_EFFECTS = [
Me.imports.src.EnergizeAEffect.EnergizeAEffect,
Me.imports.src.EnergizeBEffect.EnergizeBEffect,
Me.imports.src.FireEffect.FireEffect, Me.imports.src.FireEffect.FireEffect,
Me.imports.src.MatrixEffect.MatrixEffect, Me.imports.src.MatrixEffect.MatrixEffect,
Me.imports.src.TRexEffect.TRexEffect, Me.imports.src.TRexEffect.TRexEffect,
Me.imports.src.TOSTransporterEffect.TOSTransporterEffect,
Me.imports.src.TNGTransporterEffect.TNGTransporterEffect,
Me.imports.src.TVEffect.TVEffect, Me.imports.src.TVEffect.TVEffect,
Me.imports.src.WispsEffect.WispsEffect, Me.imports.src.WispsEffect.WispsEffect,
]; ];
+2 -2
View File
@@ -21,11 +21,11 @@ const utils = Me.imports.src.utils;
// New effects must be registered here and in extension.js. // New effects must be registered here and in extension.js.
const ALL_EFFECTS = [ const ALL_EFFECTS = [
Me.imports.src.EnergizeAEffect.EnergizeAEffect,
Me.imports.src.EnergizeBEffect.EnergizeBEffect,
Me.imports.src.FireEffect.FireEffect, Me.imports.src.FireEffect.FireEffect,
Me.imports.src.MatrixEffect.MatrixEffect, Me.imports.src.MatrixEffect.MatrixEffect,
Me.imports.src.TRexEffect.TRexEffect, Me.imports.src.TRexEffect.TRexEffect,
Me.imports.src.TOSTransporterEffect.TOSTransporterEffect,
Me.imports.src.TNGTransporterEffect.TNGTransporterEffect,
Me.imports.src.TVEffect.TVEffect, Me.imports.src.TVEffect.TVEffect,
Me.imports.src.WispsEffect.WispsEffect, Me.imports.src.WispsEffect.WispsEffect,
]; ];
@@ -180,44 +180,44 @@
</key> </key>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- TOS Transporter Options --> <!-- Energize A Options -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<key name="tos-transporter-close-effect" type="b"> <key name="energize-a-close-effect" type="b">
<default>false</default> <default>false</default>
<summary>TOS Transporter Close Effect</summary> <summary>TOS Transporter Close Effect</summary>
<description>Use the TOS Transporter effect for window closing.</description> <description>Use the TOS Transporter effect for window closing.</description>
</key> </key>
<key name="tos-transporter-animation-time" type="i"> <key name="energize-a-animation-time" type="i">
<default>2500</default> <default>2500</default>
<summary>TOS Transporter Animation Time</summary> <summary>TOS Transporter Animation Time</summary>
<description>The time the TOS Transporter effect takes.</description> <description>The time the TOS Transporter effect takes.</description>
</key> </key>
<key name="tos-transporter-color" type="s"> <key name="energize-a-color" type="s">
<default>"rgb(255, 200, 50)"</default> <default>"rgb(255, 200, 50)"</default>
<summary>TOS Transporter Color</summary> <summary>TOS Transporter Color</summary>
<description>The color of the effect.</description> <description>The color of the effect.</description>
</key> </key>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- TNG Transporter Options --> <!-- Energize B Options -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<key name="tng-transporter-close-effect" type="b"> <key name="energize-b-close-effect" type="b">
<default>false</default> <default>false</default>
<summary>TNG Transporter Close Effect</summary> <summary>TNG Transporter Close Effect</summary>
<description>Use the TNG Transporter effect for window closing.</description> <description>Use the TNG Transporter effect for window closing.</description>
</key> </key>
<key name="tng-transporter-animation-time" type="i"> <key name="energize-b-animation-time" type="i">
<default>2000</default> <default>2000</default>
<summary>TNG Transporter Animation Time</summary> <summary>TNG Transporter Animation Time</summary>
<description>The time the TNG Transporter effect takes.</description> <description>The time the TNG Transporter effect takes.</description>
</key> </key>
<key name="tng-transporter-color" type="s"> <key name="energize-b-color" type="s">
<default>"rgb(150, 150, 255)"</default> <default>"rgb(150, 150, 255)"</default>
<summary>TNG Transporter Color</summary> <summary>TNG Transporter Color</summary>
<description>The color of the effect.</description> <description>The color of the effect.</description>
@@ -28,7 +28,7 @@ let Shader = null;
// The effect class is completely static. It can be used to get some metadata (like the // The effect class is completely static. It can be used to get some metadata (like the
// effect's name or supported GNOME Shell versions), to initialize the respective page of // 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. // the settings dialog, as well as to create the actual shader for the effect.
var TOSTransporterEffect = class TOSTransporterEffect { var EnergizeAEffect = class EnergizeAEffect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
@@ -41,13 +41,13 @@ var TOSTransporterEffect = class TOSTransporterEffect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. the '*-close-effect'). // effect is enabled currently (e.g. the '*-close-effect').
static getNick() { static getNick() {
return 'tos-transporter'; return 'energize-a';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // 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. // drop-down menus where the user can choose the effect.
static getLabel() { static getLabel() {
return 'TOS Transporter Effect'; return 'Energize A';
} }
// -------------------------------------------------------------------- API for prefs.js // -------------------------------------------------------------------- API for prefs.js
@@ -67,8 +67,8 @@ var TOSTransporterEffect = class TOSTransporterEffect {
// Finally, append the settings page to the main stack. // Finally, append the settings page to the main stack.
// const stack = dialog.getBuilder().get_object('main-stack'); // const stack = dialog.getBuilder().get_object('main-stack');
// stack.add_titled( // stack.add_titled(
// dialog.getBuilder().get_object('tv-prefs'), TOSTransporterEffect.getNick(), // dialog.getBuilder().get_object('tv-prefs'), EnergizeAEffect.getNick(),
// TOSTransporterEffect.getLabel()); // EnergizeAEffect.getLabel());
} }
// ---------------------------------------------------------------- API for extension.js // ---------------------------------------------------------------- API for extension.js
@@ -82,7 +82,7 @@ var TOSTransporterEffect = class TOSTransporterEffect {
// the actor - usually windows are faded to transparency and scaled down slightly by // the actor - usually windows are faded to transparency and scaled down slightly by
// GNOME Shell. Here, we modify this behavior as well as the transition duration. // GNOME Shell. Here, we modify this behavior as well as the transition duration.
static tweakTransitions(actor, settings) { static tweakTransitions(actor, settings) {
const animationTime = settings.get_int('tos-transporter-animation-time'); const animationTime = settings.get_int('energize-a-animation-time');
const tweakTransition = (property, value) => { const tweakTransition = (property, value) => {
const transition = actor.get_transition(property); const transition = actor.get_transition(property);
@@ -115,8 +115,7 @@ if (utils.isInShellProcess()) {
_init(settings) { _init(settings) {
super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER}); super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER});
const color = const color = Clutter.Color.from_string(settings.get_string('energize-a-color'))[1];
Clutter.Color.from_string(settings.get_string('tos-transporter-color'))[1];
this.set_shader_source(` this.set_shader_source(`
@@ -133,7 +132,7 @@ if (utils.isInShellProcess()) {
float getSparks(vec2 texCoords, float gridSize, vec2 seed) { float getSparks(vec2 texCoords, float gridSize, vec2 seed) {
// Shift coordinates by a random offset and make sure the have a 1:1 aspect ratio. // Shift coordinates by a random offset and make sure the have a 1:1 aspect ratio.
vec2 coords = (texCoords + hash2D(seed)) * vec2(uSizeX, uSizeY); vec2 coords = (texCoords + hash22(seed)) * vec2(uSizeX, uSizeY);
// Apply global scale. // Apply global scale.
coords /= gridSize; coords /= gridSize;
@@ -145,10 +144,10 @@ if (utils.isInShellProcess()) {
vec2 cellID = coords-cellUV + vec2(362.456); vec2 cellID = coords-cellUV + vec2(362.456);
// Add random rotation, scale and offset to each grid cell. // Add random rotation, scale and offset to each grid cell.
float speed = mix(10.0, 15.0, hash(cellID*seed*134.451)) / gridSize * SPARK_SPEED; float speed = mix(10.0, 15.0, hash12(cellID*seed*134.451)) / gridSize * SPARK_SPEED;
float rotation = mix( 0.0, 6.283, hash(cellID*seed*54.4129)); float rotation = mix( 0.0, 6.283, hash12(cellID*seed*54.4129));
float radius = mix( 0.5, 1.0, hash(cellID*seed*19.1249)) * SPARK_RADIUS; float radius = mix( 0.5, 1.0, hash12(cellID*seed*19.1249)) * SPARK_RADIUS;
float roundness = mix(-1.0, 1.0, hash(cellID*seed*7.51949)); float roundness = mix(-1.0, 1.0, hash12(cellID*seed*7.51949));
vec2 offset = vec2(sin(speed * (uTime+10)) * roundness, cos(speed * (uTime+10))); vec2 offset = vec2(sin(speed * (uTime+10)) * roundness, cos(speed * (uTime+10)));
offset *= (0.5 - radius / gridSize); offset *= (0.5 - radius / gridSize);
@@ -165,7 +164,7 @@ if (utils.isInShellProcess()) {
// return 0.03 / pow(dist, 2.0); // return 0.03 / pow(dist, 2.0);
} }
return 0; return 0.0;
} }
void main() { void main() {
@@ -182,7 +181,7 @@ if (utils.isInShellProcess()) {
sparks += getSparks((cogl_tex_coord_in[0].st-0.5) / mix(2.0, 1.0, uProgress), SPARK_SPACING, SEED * (i+1)); sparks += getSparks((cogl_tex_coord_in[0].st-0.5) / mix(2.0, 1.0, uProgress), SPARK_SPACING, SEED * (i+1));
} }
float noise = noise3D(vec3(uv, uTime*5.0), 5); float noise = simplex3DFractal(vec3(uv, uTime*5.0));
sparks = sparks*(noise*0.8 + 0.2) + noise*0.15; sparks = sparks*(noise*0.8 + 0.2) + noise*0.15;
float edgeFadeWidth = 0.5; float edgeFadeWidth = 0.5;
@@ -30,7 +30,7 @@ let Shader = null;
// The effect class is completely static. It can be used to get some metadata (like the // The effect class is completely static. It can be used to get some metadata (like the
// effect's name or supported GNOME Shell versions), to initialize the respective page of // 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. // the settings dialog, as well as to create the actual shader for the effect.
var TNGTransporterEffect = class TNGTransporterEffect { var EnergizeBEffect = class EnergizeBEffect {
// ---------------------------------------------------------------------------- metadata // ---------------------------------------------------------------------------- metadata
@@ -43,13 +43,13 @@ var TNGTransporterEffect = class TNGTransporterEffect {
// required. It should match the prefix of the settings keys which store whether the // required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. the '*-close-effect'). // effect is enabled currently (e.g. the '*-close-effect').
static getNick() { static getNick() {
return 'tng-transporter'; return 'energize-b';
} }
// This will be shown in the sidebar of the preferences dialog as well as in the // 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. // drop-down menus where the user can choose the effect.
static getLabel() { static getLabel() {
return 'TNG Transporter Effect'; return 'Energize B';
} }
// -------------------------------------------------------------------- API for prefs.js // -------------------------------------------------------------------- API for prefs.js
@@ -69,8 +69,8 @@ var TNGTransporterEffect = class TNGTransporterEffect {
// Finally, append the settings page to the main stack. // Finally, append the settings page to the main stack.
// const stack = dialog.getBuilder().get_object('main-stack'); // const stack = dialog.getBuilder().get_object('main-stack');
// stack.add_titled( // stack.add_titled(
// dialog.getBuilder().get_object('tv-prefs'), TNGTransporterEffect.getNick(), // dialog.getBuilder().get_object('tv-prefs'), EnergizeBEffect.getNick(),
// TNGTransporterEffect.getLabel()); // EnergizeBEffect.getLabel());
} }
// ---------------------------------------------------------------- API for extension.js // ---------------------------------------------------------------- API for extension.js
@@ -84,7 +84,7 @@ var TNGTransporterEffect = class TNGTransporterEffect {
// the actor - usually windows are faded to transparency and scaled down slightly by // the actor - usually windows are faded to transparency and scaled down slightly by
// GNOME Shell. Here, we modify this behavior as well as the transition duration. // GNOME Shell. Here, we modify this behavior as well as the transition duration.
static tweakTransitions(actor, settings) { static tweakTransitions(actor, settings) {
const animationTime = settings.get_int('tng-transporter-animation-time'); const animationTime = settings.get_int('energize-b-animation-time');
const tweakTransition = (property, value) => { const tweakTransition = (property, value) => {
const transition = actor.get_transition(property); const transition = actor.get_transition(property);
@@ -117,8 +117,7 @@ if (utils.isInShellProcess()) {
_init(settings) { _init(settings) {
super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER}); super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER});
const color = const color = Clutter.Color.from_string(settings.get_string('energize-b-color'))[1];
Clutter.Color.from_string(settings.get_string('tng-transporter-color'))[1];
this.set_shader_source(` this.set_shader_source(`