Merge branch 'main' into feature/transporter
This commit is contained in:
@@ -71,7 +71,7 @@ Just remember to replace `simple-fade` with your custom name!
|
|||||||
|
|
||||||
### 2. Creating the Effect Class
|
### 2. Creating the Effect Class
|
||||||
|
|
||||||
You will have to create a new file called `src/SimpleFadeEffect.js` and paste the following code to it.
|
You will have to create a new file called `src/SimpleFade.js` and paste the following code to it.
|
||||||
Please study this code carefully, all of it is explained with inline comments.
|
Please study this code carefully, all of it is explained with inline comments.
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
@@ -110,7 +110,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 SimpleFadeEffect = class SimpleFadeEffect {
|
var SimpleFade = class SimpleFade {
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------- metadata
|
// ---------------------------------------------------------------------------- metadata
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ Like this:
|
|||||||
```javascript
|
```javascript
|
||||||
const ALL_EFFECTS = [
|
const ALL_EFFECTS = [
|
||||||
...
|
...
|
||||||
Me.imports.src.SimpleFadeEffect.SimpleFadeEffect,
|
Me.imports.src.SimpleFade.SimpleFade,
|
||||||
...
|
...
|
||||||
];
|
];
|
||||||
```
|
```
|
||||||
@@ -555,8 +555,8 @@ static initPreferences(dialog) {
|
|||||||
// 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(SimpleFadeEffect.getNick() + '-prefs'),
|
dialog.getBuilder().get_object(SimpleFade.getNick() + '-prefs'),
|
||||||
SimpleFadeEffect.getNick(), SimpleFadeEffect.getLabel());
|
SimpleFade.getNick(), SimpleFade.getLabel());
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+4
-5
@@ -22,17 +22,16 @@ const WINDOW_REPOSITIONING_DELAY = imports.ui.workspace.WINDOW_REPOSITIONING_DEL
|
|||||||
const ExtensionUtils = imports.misc.extensionUtils;
|
const ExtensionUtils = imports.misc.extensionUtils;
|
||||||
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
||||||
const utils = Me.imports.src.utils;
|
const utils = Me.imports.src.utils;
|
||||||
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.EnergizeAEffect.EnergizeAEffect,
|
||||||
Me.imports.src.EnergizeBEffect.EnergizeBEffect,
|
Me.imports.src.EnergizeBEffect.EnergizeBEffect,
|
||||||
Me.imports.src.FireEffect.FireEffect,
|
Me.imports.src.Fire.Fire,
|
||||||
Me.imports.src.MatrixEffect.MatrixEffect,
|
Me.imports.src.Matrix.Matrix,
|
||||||
Me.imports.src.TRexEffect.TRexEffect,
|
Me.imports.src.TRexAttack.TRexAttack,
|
||||||
Me.imports.src.TVEffect.TVEffect,
|
Me.imports.src.TVEffect.TVEffect,
|
||||||
Me.imports.src.WispsEffect.WispsEffect,
|
Me.imports.src.Wisps.Wisps,
|
||||||
];
|
];
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ const utils = Me.imports.src.utils;
|
|||||||
const ALL_EFFECTS = [
|
const ALL_EFFECTS = [
|
||||||
Me.imports.src.EnergizeAEffect.EnergizeAEffect,
|
Me.imports.src.EnergizeAEffect.EnergizeAEffect,
|
||||||
Me.imports.src.EnergizeBEffect.EnergizeBEffect,
|
Me.imports.src.EnergizeBEffect.EnergizeBEffect,
|
||||||
Me.imports.src.FireEffect.FireEffect,
|
Me.imports.src.Fire.Fire,
|
||||||
Me.imports.src.MatrixEffect.MatrixEffect,
|
Me.imports.src.Matrix.Matrix,
|
||||||
Me.imports.src.TRexEffect.TRexEffect,
|
Me.imports.src.TRexAttack.TRexAttack,
|
||||||
Me.imports.src.TVEffect.TVEffect,
|
Me.imports.src.TVEffect.TVEffect,
|
||||||
Me.imports.src.WispsEffect.WispsEffect,
|
Me.imports.src.Wisps.Wisps,
|
||||||
];
|
];
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -33,7 +33,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 FireEffect = class FireEffect {
|
var Fire = class Fire {
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------- metadata
|
// ---------------------------------------------------------------------------- metadata
|
||||||
|
|
||||||
@@ -86,13 +86,12 @@ var FireEffect = class FireEffect {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Initialize the fire-preset dropdown.
|
// Initialize the fire-preset dropdown.
|
||||||
FireEffect._createFirePresets(dialog);
|
Fire._createFirePresets(dialog);
|
||||||
|
|
||||||
// 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('fire-prefs'), FireEffect.getNick(),
|
dialog.getBuilder().get_object('fire-prefs'), Fire.getNick(), Fire.getLabel());
|
||||||
FireEffect.getLabel());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------- API for extension.js
|
// ---------------------------------------------------------------- API for extension.js
|
||||||
@@ -33,7 +33,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 MatrixEffect = class MatrixEffect {
|
var Matrix = class Matrix {
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------- metadata
|
// ---------------------------------------------------------------------------- metadata
|
||||||
|
|
||||||
@@ -75,8 +75,8 @@ var MatrixEffect = class MatrixEffect {
|
|||||||
// 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('matrix-prefs'), MatrixEffect.getNick(),
|
dialog.getBuilder().get_object('matrix-prefs'), Matrix.getNick(),
|
||||||
MatrixEffect.getLabel());
|
Matrix.getLabel());
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------- API for extension.js
|
// ---------------------------------------------------------------- API for extension.js
|
||||||
@@ -31,7 +31,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 TRexEffect = class TRexEffect {
|
var TRexAttack = class TRexAttack {
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------- metadata
|
// ---------------------------------------------------------------------------- metadata
|
||||||
|
|
||||||
@@ -73,8 +73,8 @@ var TRexEffect = class TRexEffect {
|
|||||||
// 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('trex-prefs'), TRexEffect.getNick(),
|
dialog.getBuilder().get_object('trex-prefs'), TRexAttack.getNick(),
|
||||||
TRexEffect.getLabel());
|
TRexAttack.getLabel());
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------- API for extension.js
|
// ---------------------------------------------------------------- API for extension.js
|
||||||
@@ -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 WispsEffect = class WispsEffect {
|
var Wisps = class Wisps {
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------- metadata
|
// ---------------------------------------------------------------------------- metadata
|
||||||
|
|
||||||
@@ -69,8 +69,7 @@ var WispsEffect = class WispsEffect {
|
|||||||
// 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('wisps-prefs'), WispsEffect.getNick(),
|
dialog.getBuilder().get_object('wisps-prefs'), Wisps.getNick(), Wisps.getLabel());
|
||||||
WispsEffect.getLabel());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------- API for extension.js
|
// ---------------------------------------------------------------- API for extension.js
|
||||||
Reference in New Issue
Block a user