Merge branch 'master' of https://github.com/Azgaar/Fantasy-Map-Generator into alternative-grids

This commit is contained in:
Azgaar 2024-07-27 14:50:40 +02:00
commit 06c4f78c35
3 changed files with 16 additions and 17 deletions

View file

@ -8133,13 +8133,8 @@
<script src="modules/ui/stylePresets.js?v=1.96.00"></script>
<script src="modules/ui/general.js?v=1.98.01"></script>
<<<<<<< HEAD
<script src="modules/ui/options.js?v=1.98.03"></script>
<script src="main.js?v=1.99.00"></script>
=======
<script src="modules/ui/options.js?v=1.98.04"></script>
<script src="main.js?v=1.98.01"></script>
>>>>>>> a5a638c4394268b425a8181dfbf29d2778c25933
<script src="main.js?v=1.98.05"></script>
<script defer src="modules/relief-icons.js"></script>
<script defer src="modules/ui/style.js?v=1.96.00"></script>
@ -8183,7 +8178,7 @@
<script defer src="modules/io/save.js?v=1.99.00"></script>
<script defer src="modules/io/load.js?v=1.98.01"></script>
<script defer src="modules/io/cloud.js?v=1.96.00"></script>
<script defer src="modules/io/export.js?v=1.98.01"></script>
<script defer src="modules/io/export.js?v=1.98.05"></script>
<!-- Web Components -->
<script defer src="components/fill-box.js"></script>

View file

@ -87,7 +87,7 @@ async function exportToPngTiles() {
imgSchema.src = urlSchema;
await loadImage(imgSchema);
status.innerHTML = "Drawing schema...";
status.innerHTML = "Rendering schema...";
ctx.drawImage(imgSchema, 0, 0, canvas.width, canvas.height);
const blob = await canvasToBlob(canvas, "image/png");
ctx.clearRect(0, 0, canvas.width, canvas.height);
@ -95,9 +95,9 @@ async function exportToPngTiles() {
// download tiles
const url = await getMapURL("tiles", {fullMap: true});
const tilesX = +byId("tileColsInput").value;
const tilesY = +byId("tileRowsInput").value;
const scale = +byId("tileScaleInput").value;
const tilesX = +byId("tileColsOutput").value || 2;
const tilesY = +byId("tileRowsOutput").value || 2;
const scale = +byId("tileScaleOutput").value || 1;
const tolesTotal = tilesX * tilesY;
const tileW = (graphWidth / tilesX) | 0;
@ -113,11 +113,17 @@ async function exportToPngTiles() {
await loadImage(img);
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
function getRowLabel(row) {
const first = row >= alphabet.length ? alphabet[Math.floor(row / alphabet.length) - 1] : "";
const last = alphabet[row % alphabet.length];
return first + last;
}
for (let y = 0, row = 0, id = 1; y + tileH <= graphHeight; y += tileH, row++) {
const rowName = alphabet[row % alphabet.length];
const rowName = getRowLabel(row);
for (let x = 0, cell = 1; x + tileW <= graphWidth; x += tileW, cell++, id++) {
status.innerHTML = `Drawing tile ${rowName}${cell} (${id} of ${tolesTotal})...`;
status.innerHTML = `Rendering tile ${rowName}${cell} (${id} of ${tolesTotal})...`;
ctx.drawImage(img, x, y, tileW, tileH, 0, 0, width, height);
const blob = await canvasToBlob(canvas, "image/png");
ctx.clearRect(0, 0, canvas.width, canvas.height);

View file

@ -1,7 +1,7 @@
"use strict";
// version and caching control
const version = "1.99.00"; // generator version, update each time
const version = "1.98.05"; // generator version, update each time
{
document.title += " v" + version;
@ -28,6 +28,7 @@ const version = "1.99.00"; // generator version, update each time
<ul>
<strong>Latest changes:</strong>
<li>Alternative grids (advanced option)</li>
<li>Configurable longitude</li>
<li>Preview villages map</li>
<li>Ability to render ocean heightmap</li>
@ -39,9 +40,6 @@ const version = "1.99.00"; // generator version, update each time
<li>Auto-load of the last saved map is now optional (see <i>Onload behavior</i> in Options)</li>
<li>New label placement algorithm for states</li>
<li>North and South Poles temperature can be set independently</li>
<li>More than 70 new heraldic charges</li>
<li>Multi-color heraldic charges support</li>
<li>New 3D scene options and improvements</li>
</ul>
<p>Join our <a href="${discord}" target="_blank">Discord server</a> and <a href="${reddit}" target="_blank">Reddit community</a> to ask questions, share maps, discuss the Generator and Worlbuilding, report bugs and propose new features.</p>