Disable background caching in preparation for routinglib

This commit is contained in:
Manuel Vögele
2022-09-28 07:46:34 +02:00
parent 5e82049686
commit ed10144cc6
+1 -20
View File
@@ -14,11 +14,7 @@ import {disableSnap, registerKeybindings} from "./keybindings.js";
import {libWrapper} from "./libwrapper_shim.js"; import {libWrapper} from "./libwrapper_shim.js";
import {performMigrations} from "./migration.js"; import {performMigrations} from "./migration.js";
import {removeLastHistoryEntryIfAt, resetMovementHistory} from "./movement_tracking.js"; import {removeLastHistoryEntryIfAt, resetMovementHistory} from "./movement_tracking.js";
import { import {wipePathfindingCache, initializePathfinding} from "./pathfinding.js";
wipePathfindingCache,
initializePathfinding,
startBackgroundCaching,
} from "./pathfinding.js";
import {extendRuler} from "./ruler.js"; import {extendRuler} from "./ruler.js";
import {registerSettings, RightClickAction, settingsKey} from "./settings.js"; import {registerSettings, RightClickAction, settingsKey} from "./settings.js";
import {recalculate} from "./socket.js"; import {recalculate} from "./socket.js";
@@ -39,21 +35,6 @@ initGridlessPathfinding().then(() => {
Hooks.on("createWall", wipePathfindingCache); Hooks.on("createWall", wipePathfindingCache);
Hooks.on("updateWall", wipePathfindingCache); Hooks.on("updateWall", wipePathfindingCache);
Hooks.on("deleteWall", wipePathfindingCache); Hooks.on("deleteWall", wipePathfindingCache);
// Whenever the current user selects a token, start caching
Hooks.on("controlToken", (token, controlled) => {
if (controlled) {
startBackgroundCaching(token);
}
});
// Whenever a token the current user controls updates, start caching
Hooks.on("updateToken", document => {
const token = document.object;
if (token._controlled) {
startBackgroundCaching(token);
}
});
}); });
Hooks.once("init", () => { Hooks.once("init", () => {