feat: assistant - minify js, add option UI

This commit is contained in:
Azgaar 2024-09-01 16:32:06 +02:00
parent 6a0ee5827e
commit cb34491a17
4 changed files with 31 additions and 41 deletions

View file

@ -251,6 +251,7 @@ document.addEventListener("DOMContentLoaded", async () => {
}
restoreDefaultEvents(); // apply default viewbox events
initiateAutosave();
setTipMessage();
});
function hideLoading() {
@ -316,6 +317,7 @@ async function generateMapOnLoad() {
applyPreset(); // apply saved layers preset
fitMapToScreen();
focusOn(); // based on searchParams focus on point, cell or burg from MFCG
loadAssistant();
}
// focus on coordinates, cell or burg provided in searchParams
@ -365,6 +367,11 @@ function focusOn() {
}
}
function loadAssistant() {
const showAssistant = byId("azgaarAssistant").value === "show";
if (showAssistant) import("./libs/openwidget.min.js");
}
// find burg for MFCG and focus on it
function findBurgForMFCG(params) {
const cells = pack.cells,