Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
hammouda101010 committed Oct 12, 2024
1 parent 4e22dbf commit 5aeac1a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions extensions/Hammouda101010/turbomodz.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@
});
};

const addAssetToMod = (url, modName, key, validatorFn, errorMessage) => {
const addAssetToMod = (context, url, modName, key, validatorFn, errorMessage) => {
if (validatorFn(url)) {
this.addModItem(modName, key, url);
context.addModItem(modName, key, url); // Use the passed context
} else {
console.error(errorMessage);
}
};


const isSprite = (url) => {
try {
Expand Down Expand Up @@ -611,6 +612,7 @@

addSpritetoMod(args) {
addAssetToMod(
this,
args.URL,
args.MOD,
"sprites",
Expand All @@ -620,6 +622,7 @@
}
addImagetoMod(args) {
addAssetToMod(
this,
args.URL,
args.MOD,
"costumes",
Expand Down

0 comments on commit 5aeac1a

Please sign in to comment.