Skip to content

Commit

Permalink
add modernshellstamps plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
onlypuppy7 committed Nov 22, 2024
1 parent b018c4a commit a8e28da
Show file tree
Hide file tree
Showing 615 changed files with 19,462 additions and 9,077 deletions.
2 changes: 1 addition & 1 deletion plugins_default/legacyshellcore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class Plugin {
});
};

stampImageDirs(data) {
async stampImageDirs(data) {
var stampImageDirs = data.stampImageDirs;

stampImageDirs.push(
Expand Down
2 changes: 2 additions & 0 deletions plugins_default/legacyshellcore/items/Stamps.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ if (fs.existsSync(stampsDir)) {

var base = path.basename(file, ext);

if (!base.includes('=')) return;

var info = base.split('=')[0].split('_');
var name = base.split('=')[1];

Expand Down
5 changes: 5 additions & 0 deletions plugins_default/modernshellstamps/dependencies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//

export const dependencies = {
// "is-thirteen": "^2.0.0",
};
41 changes: 41 additions & 0 deletions plugins_default/modernshellstamps/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//basic
import fs from 'node:fs';
import path from 'node:path';
//plugin: samplecommand
//

export const PluginMeta = {
identifier: "modernshellstamps",
name: 'Modern Shell Stamps',
author: 'onlypuppy7',
version: '1.0.0',
descriptionShort: 'Adds stamps from current shell!', //displayed when loading
descriptionLong: 'Adds stamps from current shell!',
legacyShellVersion: 334, //legacy shell version, can be found in /versionEnum.txt, or just on the homescreen
};

export var pluginInstance = null;

export class Plugin {
constructor(plugins, thisDir) {
this.plugins = plugins;
this.thisDir = thisDir;

pluginInstance = this;

this.plugins.on('client:stampImageDirs', this.stampImageDirs.bind(this));
this.plugins.on('services:initTables', this.initTables.bind(this));
};

async stampImageDirs(data) {
var stampImageDirs = data.stampImageDirs;

stampImageDirs.push(
path.join(this.thisDir, 'stamps')
);
};

async initTables(data) { //async operation requires awaits to ensure proper order
await data.ss.recs.insertItems(path.join(this.thisDir, 'items'));
};
};
Loading

0 comments on commit a8e28da

Please sign in to comment.