Skip to content

Commit

Permalink
Removed furnace exception.
Browse files Browse the repository at this point in the history
Added a video into the README.
  • Loading branch information
Feu-Secret committed Jun 6, 2021
1 parent eded7db commit c048411
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 43 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ In short :

###### In French

- [#jdr Foundry VTT Token Magic FX](https://www.youtube.com/watch?v=heBV1vYPQaQ) by *Ceizyl*
- [#jdr #foundryvtt jeu de Rôle : Guide du débutant](https://www.youtube.com/watch?v=B0Gwvp-Ns6c&t=1s) by *Ceizyl*

If you are a streamer and want your video about TMFX to be added to these lists, contact me on Discord or Github.
Expand Down
43 changes: 0 additions & 43 deletions tokenmagic/module/tokenmagic.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,6 @@ export function isVideoDisabled() {
return game.settings.get("tokenmagic", "disableVideo");
}

export var isFurnaceDrawingsActive = () => {
// module exeption for the Furnace by KaKaRoTo
if (isActiveModule("furnace")
&& game.settings.get("furnace", "enableDrawingTools")) {
return true;
}
return false;
};

export function isTheOne() {
const theOne = game.users.find((user) => user.isGM && user.active);
return theOne && game.user === theOne;
Expand Down Expand Up @@ -1411,39 +1402,6 @@ function initSocketListener() {
});
};

function initFurnaceDrawingsException() {
if (isFurnaceDrawingsActive()) {
const wrappedDCR = async function (wrapped, ...args) {
// Clear animations and filters if needed
let tmfxUpdate = false;
if (this.object.data.hasOwnProperty("flags")
&& this.object.data.flags.hasOwnProperty("tokenmagic")
&& this.object.data.flags.tokenmagic.hasOwnProperty("filters")) {
tmfxUpdate = true;
Anime.removeAnimation(this.object.id);
Magic._clearImgFiltersByPlaceable(this.object);
}

// Furnace function apply (updating data and full redraw : destruction/reconstruction)
await wrapped(...args);

// Reapply the filters if needed
if (tmfxUpdate) {
Magic._singleLoadFilters(this.object);
}
};

if (game.modules.get("lib-wrapper")?.active) {
libWrapper.register("tokenmagic", "FurnaceDrawingConfig.prototype.refresh", wrappedDCR, "WRAPPER");
} else {
const cachedDCR = FurnaceDrawingConfig.prototype.refresh;
FurnaceDrawingConfig.prototype.refresh = function () {
return wrappedDCR.call(this, cachedDCR.bind(this), ...arguments);
};
}
}
}

async function requestLoadFilters(placeable, startTimeout = 0) {
var reqTimer;
placeable.loadingRequest = true;
Expand Down Expand Up @@ -1578,7 +1536,6 @@ Hooks.on("ready", () => {
log("Hook -> ready");
tmfxDataMigration();
initSocketListener();
initFurnaceDrawingsException();
window.TokenMagic = Magic;

if (!game.modules.get("lib-wrapper")?.active && game.user.isGM)
Expand Down

0 comments on commit c048411

Please sign in to comment.