diff --git a/index.html b/index.html index 66273286..dc208c62 100644 --- a/index.html +++ b/index.html @@ -2689,15 +2689,19 @@ @@ -8046,7 +8050,7 @@ - + @@ -8062,7 +8066,7 @@ - + diff --git a/versioning.js b/versioning.js index c8acea04..9e0951ae 100644 --- a/versioning.js +++ b/versioning.js @@ -12,7 +12,7 @@ * * Example: 1.102.0 -> Major version 1, Minor version 102, Patch version 0 */ -const VERSION = "1.100.00"; +const VERSION = "1.101.00"; { document.title += " v" + VERSION; @@ -20,7 +20,7 @@ const VERSION = "1.100.00"; if (loadingScreenVersion) loadingScreenVersion.innerText = `v${VERSION}`; const storedVersion = localStorage.getItem("version"); - if (compareVersions(storedVersion, VERSION).isOlder) setTimeout(showUpdateWindow, 6000); + if (compareVersions(storedVersion, VERSION, {patch: false}).isOlder) setTimeout(showUpdateWindow, 6000); function showUpdateWindow() { const changelog = "https://github.com/Azgaar/Fantasy-Map-Generator/wiki/Changelog"; @@ -33,6 +33,7 @@ const VERSION = "1.100.00";

Join our Discord server and Reddit community to ask questions, share maps, discuss the Generator and Worlbuilding, report bugs and propose new features.

@@ -57,16 +52,12 @@ const VERSION = "1.100.00"; const buttons = { Ok: function () { $(this).dialog("close"); - if (storedVersion) { - clearCache(); - localStorage.clear(); - } localStorage.setItem("version", VERSION); } }; if (storedVersion) { - buttons.Reload = () => { + buttons.Cleanup = () => { clearCache(); localStorage.clear(); localStorage.setItem("version", VERSION); @@ -95,11 +86,15 @@ function isValidVersion(versionString) { return !isNaN(major) && !isNaN(minor) && !isNaN(patch); } -function compareVersions(version1, version2) { +function compareVersions(version1, version2, options = {major: true, minor: true, patch: true}) { if (!isValidVersion(version1) || !isValidVersion(version2)) return {isEqual: false, isNewer: false, isOlder: false}; - const [major1, minor1, patch1] = version1.split(".").map(Number); - const [major2, minor2, patch2] = version2.split(".").map(Number); + let [major1, minor1, patch1] = version1.split(".").map(Number); + let [major2, minor2, patch2] = version2.split(".").map(Number); + + if (!options.major) major1 = major2 = 0; + if (!options.minor) minor1 = minor2 = 0; + if (!options.patch) patch1 = patch2 = 0; const isEqual = major1 === major2 && minor1 === minor2 && patch1 === patch2; const isNewer = major1 > major2 || (major1 === major2 && (minor1 > minor2 || (minor1 === minor2 && patch1 > patch2)));