mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 02:21:24 +01:00
feat: assistant - minify js, add option UI
This commit is contained in:
parent
6a0ee5827e
commit
cb34491a17
4 changed files with 31 additions and 41 deletions
7
main.js
7
main.js
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue