From fc971e49022bb683bd697cab4fe4da91586f5db2 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sat, 19 Mar 2022 20:03:16 +0300 Subject: [PATCH 1/5] rivers: if points data is wrong, ignore points --- modules/ui/layers.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/ui/layers.js b/modules/ui/layers.js index 653cc9e4..009828c4 100644 --- a/modules/ui/layers.js +++ b/modules/ui/layers.js @@ -1481,6 +1481,12 @@ function drawRivers() { const riverPaths = pack.rivers.map(({cells, points, i, widthFactor, sourceWidth}) => { if (!cells || cells.length < 2) return; + + if (points && points.length !== cells.length) { + console.error(`River ${i} has ${cells.length} cells, but only ${points.length} points defined. Resetting points data`); + points = undefined; + } + const meanderedPoints = addMeandering(cells, points); const path = getRiverPath(meanderedPoints, widthFactor, sourceWidth); return ``; From 8473b9ed01aa51564b21dc46d1278c01402e6994 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sat, 19 Mar 2022 20:04:06 +0300 Subject: [PATCH 2/5] update supporters --- modules/ui/options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui/options.js b/modules/ui/options.js index eef2cd09..ad90d7fe 100644 --- a/modules/ui/options.js +++ b/modules/ui/options.js @@ -105,7 +105,7 @@ function showSupporters() { Jonathan Williams,ojacid .,Brian Wilson,A Patreon of the Ahts,Shubham Jakhotiya,www15o,Jan Bundesmann,Angelique Badger,Joshua Xiong,Moist mongol, Frank Fewkes,jason baldrick,Game Master Pro,Andrew Kircher,Preston Mitchell,Chris Kohut,Emarandzeb,Trentin Bergeron,Damon Gallaty,Pleaseworkforonce, Jordan,William Markus,Sidr Dim,Alexander Whittaker,The Next Level,Patrick Valverde,Markus Peham,Daniel Cooper,the Beagles of Neorbus,Marley Moule, - Maximilian Schielke,Johnathan Xavier Hutchinson,Ele,Rita`; + Maximilian Schielke,Johnathan Xavier Hutchinson,Ele,Rita,Randy Ross,John Wick,RedSpaz,cameron cannon,Ian Grau-Fay,Kyle Barrett,Charlotte Wiland`; const array = supporters .replace(/(?:\r\n|\r|\n)/g, "") From 79b7df1c95f9c8666bacbbb879cd8e9165f682e3 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Tue, 22 Mar 2022 00:14:15 +0300 Subject: [PATCH 3/5] not allow to select text on svg --- index.css | 1 + 1 file changed, 1 insertion(+) diff --git a/index.css b/index.css index ed81773f..c8d5efb0 100644 --- a/index.css +++ b/index.css @@ -50,6 +50,7 @@ iframe { mask-mode: alpha; mask-clip: no-clip; fill-rule: evenodd; + user-select: none; } #canvas { From 4b10b60c693acb1abeae628f8982359dc597fb5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20M=C3=A9sz=C3=A1ros=2C=20Ph=2ED?= Date: Wed, 30 Mar 2022 20:14:51 +0200 Subject: [PATCH 4/5] fix concurency issue at load (#762) --- main.js | 43 +++++++++++++++++++++++-------------------- modules/ui/editors.js | 9 ++++----- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/main.js b/main.js index d4dc39e9..61dc267b 100644 --- a/main.js +++ b/main.js @@ -172,29 +172,32 @@ 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); oceanLayers.append("rect").attr("id", "oceanBase").attr("x", 0).attr("y", 0).attr("width", graphWidth).attr("height", graphHeight); -if (!location.hostname) { - const wiki = "https://github.com/Azgaar/Fantasy-Map-Generator/wiki/Run-FMG-locally"; - alertMessage.innerHTML = `Fantasy Map Generator cannot run serverless. - Follow the instructions on how you can easily run a local web-server`; +document.addEventListener("DOMContentLoaded", () => { + if (!location.hostname) { + const wiki = "https://github.com/Azgaar/Fantasy-Map-Generator/wiki/Run-FMG-locally"; + alertMessage.innerHTML = `Fantasy Map Generator cannot run serverless. + Follow the instructions on how you can easily run a local web-server`; - $("#alert").dialog({ - resizable: false, - title: "Loading error", - width: "28em", - position: {my: "center center-4em", at: "center", of: "svg"}, - buttons: { - OK: function () { - $(this).dialog("close"); + $("#alert").dialog({ + resizable: false, + title: "Loading error", + width: "28em", + position: {my: "center center-4em", at: "center", of: "svg"}, + buttons: { + OK: function () { + $(this).dialog("close"); + } } - } - }); + }); - d3.select("#loading-text").transition().duration(1000).style("opacity", 0); - d3.select("#init-rose").transition().duration(4000).style("opacity", 0); -} else { - hideLoading(); - checkLoadParameters(); -} + d3.select("#loading-text").transition().duration(1000).style("opacity", 0); + d3.select("#init-rose").transition().duration(4000).style("opacity", 0); + } else { + hideLoading(); + checkLoadParameters(); + } + restoreDefaultEvents(); // apply default viewbox events +}); function hideLoading() { d3.select("#loading").transition().duration(4000).style("opacity", 0); diff --git a/modules/ui/editors.js b/modules/ui/editors.js index be97102c..e13f8eff 100644 --- a/modules/ui/editors.js +++ b/modules/ui/editors.js @@ -2,7 +2,6 @@ "use strict"; modules.editors = true; -restoreDefaultEvents(); // apply default viewbox events on load // restore default viewbox events function restoreDefaultEvents() { @@ -478,14 +477,14 @@ function createPicker() { .attr("height", 20) .on("mousemove", () => tip("Color value in different color spaces. Edit to change")); const html = ` -