mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
fix concurency issue at load (#762)
This commit is contained in:
parent
79b7df1c95
commit
4b10b60c69
2 changed files with 27 additions and 25 deletions
9
main.js
9
main.js
|
|
@ -172,7 +172,8 @@ landmass.append("rect").attr("x", 0).attr("y", 0).attr("width", graphWidth).attr
|
||||||
oceanPattern.append("rect").attr("fill", "url(#oceanic)").attr("x", 0).attr("y", 0).attr("width", graphWidth).attr("height", graphHeight);
|
oceanPattern.append("rect").attr("fill", "url(#oceanic)").attr("x", 0).attr("y", 0).attr("width", graphWidth).attr("height", graphHeight);
|
||||||
oceanLayers.append("rect").attr("id", "oceanBase").attr("x", 0).attr("y", 0).attr("width", graphWidth).attr("height", graphHeight);
|
oceanLayers.append("rect").attr("id", "oceanBase").attr("x", 0).attr("y", 0).attr("width", graphWidth).attr("height", graphHeight);
|
||||||
|
|
||||||
if (!location.hostname) {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
if (!location.hostname) {
|
||||||
const wiki = "https://github.com/Azgaar/Fantasy-Map-Generator/wiki/Run-FMG-locally";
|
const wiki = "https://github.com/Azgaar/Fantasy-Map-Generator/wiki/Run-FMG-locally";
|
||||||
alertMessage.innerHTML = `Fantasy Map Generator cannot run serverless.
|
alertMessage.innerHTML = `Fantasy Map Generator cannot run serverless.
|
||||||
Follow the <a href="${wiki}" target="_blank">instructions</a> on how you can easily run a local web-server`;
|
Follow the <a href="${wiki}" target="_blank">instructions</a> on how you can easily run a local web-server`;
|
||||||
|
|
@ -191,10 +192,12 @@ if (!location.hostname) {
|
||||||
|
|
||||||
d3.select("#loading-text").transition().duration(1000).style("opacity", 0);
|
d3.select("#loading-text").transition().duration(1000).style("opacity", 0);
|
||||||
d3.select("#init-rose").transition().duration(4000).style("opacity", 0);
|
d3.select("#init-rose").transition().duration(4000).style("opacity", 0);
|
||||||
} else {
|
} else {
|
||||||
hideLoading();
|
hideLoading();
|
||||||
checkLoadParameters();
|
checkLoadParameters();
|
||||||
}
|
}
|
||||||
|
restoreDefaultEvents(); // apply default viewbox events
|
||||||
|
});
|
||||||
|
|
||||||
function hideLoading() {
|
function hideLoading() {
|
||||||
d3.select("#loading").transition().duration(4000).style("opacity", 0);
|
d3.select("#loading").transition().duration(4000).style("opacity", 0);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
modules.editors = true;
|
modules.editors = true;
|
||||||
restoreDefaultEvents(); // apply default viewbox events on load
|
|
||||||
|
|
||||||
// restore default viewbox events
|
// restore default viewbox events
|
||||||
function restoreDefaultEvents() {
|
function restoreDefaultEvents() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue