mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
v1.5.24 - smarter generation
This commit is contained in:
parent
e4e40fab49
commit
2f3f5d05fb
4 changed files with 17 additions and 24 deletions
|
|
@ -968,18 +968,16 @@
|
|||
}
|
||||
|
||||
async function fetchCharge(charge, id) {
|
||||
const fetched = fetch("https://azgaar.github.io/Armoria/charges/" + charge + ".svg")
|
||||
.then(res => {
|
||||
const fetched = fetch("https://azgaar.github.io/Armoria/charges/" + charge + ".svg").then(res => {
|
||||
if (res.ok) return res.text();
|
||||
else throw new Error("Cannot fetch charge");
|
||||
})
|
||||
.then(text => {
|
||||
}).then(text => {
|
||||
const html = document.createElement("html");
|
||||
html.innerHTML = text;
|
||||
const g = html.querySelector("g");
|
||||
g.setAttribute("id", charge + "_" + id);
|
||||
return g.outerHTML;
|
||||
});
|
||||
}).catch(err => console.error(err));
|
||||
return fetched;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue