diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 0ac2ceb7..00000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.gitignore b/.gitignore deleted file mode 100644 index eb71b40a..00000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.DS_Store -wikidata diff --git a/LICENSE b/LICENSE index c755d218..ef47c28c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2019 Max Ganiev (Azgaar) +Copyright 2018-2019 Max Ganiev (Azgaar), azgaar.fmg@yandex.by Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 32e889e8..d5fe4479 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Refer to the [project wiki](https://github.com/Azgaar/Fantasy-Map-Generator/wiki [](https://cdn.discordapp.com/attachments/515359096925454350/593891237984206848/The_Wichin_Island_-_diplomacy.png) -Join our [Reddit community](https://www.reddit.com/r/FantasyMapGenerator) and [Discord server](https://discordapp.com/invite/X7E84HU) to share the created maps, discuss the Generator, suggest ideas and get a most recent updates. You may also contact me directly via [email](mailto:maxganiev@yandex.com). For bug reports please use the project [issues page](https://github.com/Azgaar/Fantasy-Map-Generator/issues) or Discord "Bugs" channel. If you are facing performance issues, please read [the tips](https://github.com/Azgaar/Fantasy-Map-Generator/wiki/Tips#performance-tips). +Join our [Reddit community](https://www.reddit.com/r/FantasyMapGenerator) and [Discord server](https://discordapp.com/invite/X7E84HU) to share the created maps, discuss the Generator, suggest ideas and get a most recent updates. You may also contact me directly via [email](mailto:azgaar.fmg@yandex.by). For bug reports please use the project [issues page](https://github.com/Azgaar/Fantasy-Map-Generator/issues) or Discord "Bugs" channel. If you are facing performance issues, please read [the tips](https://github.com/Azgaar/Fantasy-Map-Generator/wiki/Tips#performance-tips). You can support the project [on Patreon](https://www.patreon.com/azgaar). diff --git a/index.css b/index.css index 07f0fd38..ef7d7712 100644 --- a/index.css +++ b/index.css @@ -1931,7 +1931,7 @@ svg.button { #errorBox { font-size: .9em; - font-family: monospace; + font-family: Consolas, monospace; color: #920303; background-color: #dabdbd91; padding: 2px; diff --git a/index.html b/index.html index 02ae3577..e54a2cd2 100644 --- a/index.html +++ b/index.html @@ -1812,7 +1812,7 @@
Fantasy Map Generator is a free open source tool which procedurally generates fantasy maps. You may use auto-generated maps as they are, edit them or even create a new map from scratch. Check out the quick start tutorial and project wiki for guidance.
Join our Discord server and Reddit community to ask questions, get help and share created maps. You may support the project on Patreon.
-The project is under active development. For older versions see the changelog. To track the development progress see the devboard. Please report bugs here. You can also contact me directly via email.
+The project is under active development. For older versions see the changelog. To track the development progress see the devboard. Please report bugs here. You can also contact me directly via email.
A special thanks to all supporters!
${errorParsed}
`; +${parseError(error)}
`; $("#alert").dialog({ - resizable: false, title: "Generation error", maxWidth:500, buttons: { + resizable: false, title: "Generation error", width:320, buttons: { "Clear data": function() {localStorage.clear(); localStorage.setItem("version", version);}, - Regenerate: function() {regenerateMap(); $(this).dialog("close");} + Regenerate: function() {regenerateMap(); $(this).dialog("close");}, + Ignore: function() {$(this).dialog("close");} }, position: {my: "center", at: "center", of: "svg"} }); } diff --git a/maps/template_continent.txt b/maps/template_continent.txt deleted file mode 100644 index b0a610cc..00000000 --- a/maps/template_continent.txt +++ /dev/null @@ -1,11 +0,0 @@ -Hill 6-12 10-20 10-90 10-90 -Hill 2-5 20-30 25-75 20-80 -Smooth 1 0 0 0 -Range 0-2 30-60 25-75 25-75 -Smooth 2 0 0 0 -Range 1-2 40-50 40-60 40-60 -Multiply 1.2 land 0 0 -Pit 1-3 10-30 30-70 20-80 -Trough 0-2 20-30 15-85 20-80 -Hill 2-4 10-25 15-85 20-80 -Smooth 3 0 0 0 diff --git a/maps/template_squarish.txt b/maps/template_squarish.txt deleted file mode 100644 index 75da0a6e..00000000 --- a/maps/template_squarish.txt +++ /dev/null @@ -1,14 +0,0 @@ -Hill 2-3 10-25 20-30 20-30 -Hill 1-2 10-25 20-30 70-80 -Hill 2-3 10-25 70-80 20-30 -Hill 1-2 10-25 70-80 70-80 -Hill 6-12 10-20 30-70 30-70 -Smooth 1 0 0 0 -Hill 4-6 10-30 30-70 30-70 -Range 1-2 40-50 20-80 20-40 -Trough 1-2 10-30 15-85 40-80 -Pit 2-4 10-20 15-85 20-80 -Pit 1-2 20-30 25-75 60-80 -Smooth 3 0 0 0 -Range 0-2 40-50 15-85 20-80 -Trough 0-2 40-50 15-85 20-80 diff --git a/maps/template_vertical.txt b/maps/template_vertical.txt deleted file mode 100644 index f86c7056..00000000 --- a/maps/template_vertical.txt +++ /dev/null @@ -1,13 +0,0 @@ -Hill 1 90-100 45-55 25-30 -Hill 1 60-80 45-55 70-75 -Hill 1 60-80 30-50 40-50 -Hill 1 40-50 50-70 40-60 -Multiply 0.6 20-100 0 0 -Smooth 1 0 0 0 -Range 0-2 40-50 30-60 30-60 -Trough 1-3 20-40 25-75 20-80 -Smooth 2 0 0 0 -Pit 3-5 10-30 15-85 20-80 -Hill 3-5 10-30 20-80 20-80 -Range 1-2 20-50 30-70 20-65 -Trough 1-2 20-50 15-85 20-80 diff --git a/modules/burgs-and-states.js b/modules/burgs-and-states.js index de770ad4..ab7a8da6 100644 --- a/modules/burgs-and-states.js +++ b/modules/burgs-and-states.js @@ -436,6 +436,8 @@ void function drawLabels() { const g = labels.select("#states"), t = defs.select("#textPaths"); + const displayed = layerIsOn("toggleLabels"); + if (!displayed) toggleLabels(); if (!list) { g.selectAll("text").remove(); @@ -520,6 +522,7 @@ }); example.remove(); + if (!displayed) toggleLabels(); }() console.timeEnd("drawStateLabels"); @@ -583,6 +586,7 @@ const generateDiplomacy = function() { console.time("generateDiplomacy"); const cells = pack.cells, states = pack.states; + const chronicle = states[0].diplomacy = []; const valid = states.filter(s => s.i && !states.removed); if (valid.length < 2) return; @@ -592,7 +596,6 @@ const navals = {"Neutral":1, "Suspicion":2, "Rival":1, "Unknown":1}; // relations of naval powers valid.forEach(s => s.diplomacy = new Array(states.length).fill("x")); // clear all relationships - const chronicle = states[0].diplomacy = []; const areaMean = d3.mean(valid.map(s => s.area)); // avarage state area // generic relations diff --git a/modules/save-and-load.js b/modules/save-and-load.js index 54784123..373da683 100644 --- a/modules/save-and-load.js +++ b/modules/save-and-load.js @@ -695,6 +695,7 @@ function parseLoadedData(data) { // v 1.0 initially has Sympathy status then relaced with Friendly for (const s of pack.states) { + if (!s.diplomacy) continue; s.diplomacy = s.diplomacy.map(r => r === "Sympathy" ? "Friendly" : r); } } @@ -713,13 +714,9 @@ function parseLoadedData(data) { console.error(error); clearMainTip(); - const regex =/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; - const errorNoURL = error.stack.replace(regex, url => '' + last(url.split("/")) + ''); - const errorParsed = errorNoURL.replace(/ at /ig, "${errorParsed}
`; +${parseError(error)}
`; $("#alert").dialog({ resizable: false, title: "Loading error", maxWidth:500, buttons: { "Select file": function() {$(this).dialog("close"); mapToLoad.click();}, diff --git a/modules/ui/diplomacy-editor.js b/modules/ui/diplomacy-editor.js index 4a3e217b..2869dd49 100644 --- a/modules/ui/diplomacy-editor.js +++ b/modules/ui/diplomacy-editor.js @@ -2,7 +2,7 @@ function editDiplomacy() { if (customization) return; if (pack.states.filter(s => s.i && !s.removed).length < 2) { - tip("There should be at least 2 states to edit the diplomacy", false, "Error"); + tip("There should be at least 2 states to edit the diplomacy", false, "error"); return; } diff --git a/modules/ui/layers.js b/modules/ui/layers.js index 0c2c0744..939881cf 100644 --- a/modules/ui/layers.js +++ b/modules/ui/layers.js @@ -1011,11 +1011,11 @@ function toggleMarkers() { function toggleLabels() { if (!layerIsOn("toggleLabels")) { turnButtonOn("toggleLabels"); - $('#labels').fadeIn(); + labels.attr("display", null) invokeActiveZooming(); } else { turnButtonOff("toggleLabels"); - $('#labels').fadeOut(); + labels.attr("display", "none"); } } diff --git a/modules/utils.js b/modules/utils.js index a2a911c7..c884af31 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -522,6 +522,16 @@ function sleep(delay) { while (new Date().getTime() < start + delay); } +// parse error to get the readable string in Chrome and Firefox +function parseError(error) { + const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; + const errorString = isFirefox ? error.toString() + " " + error.stack : error.stack; + const regex =/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; + const errorNoURL = errorString.replace(regex, url => '' + last(url.split("/")) + ''); + const errorParsed = errorNoURL.replace(/at /ig, "