chore: label letter spacing - update version

This commit is contained in:
Azgaar 2024-09-01 13:46:42 +02:00
parent 6e64912e27
commit dbe6ef1854
2 changed files with 26 additions and 27 deletions

View file

@ -2689,15 +2689,19 @@
<button id="labelLetterSpacingShow" data-tip="Show the letter spacing section" class="icon-text-width"></button>
<div id="labelLetterSpacingSection" style="display: none">
<button id="labelLetterSpacingHide" data-tip="Hide the letter spacing section" class="icon-text-width"></button>
<input
id="labelLetterSpacingSize"
data-tip="Set the letter spacing size for the particular label"
type="range"
min="0"
max="80"
style="width: 8em"
/>
<button
id="labelLetterSpacingHide"
data-tip="Hide the letter spacing section"
class="icon-text-width"
></button>
<input
id="labelLetterSpacingSize"
data-tip="Set the letter spacing size for the particular label"
type="range"
min="0"
max="80"
style="width: 8em"
/>
</div>
<button id="labelAlign" data-tip="Turn text path into a straight line" class="icon-resize-horizontal"></button>
@ -8046,7 +8050,7 @@
<script src="main.js?v=1.100.00"></script>
<script defer src="modules/relief-icons.js?v=1.99.05"></script>
<script defer src="modules/ui/style.js?v=1.99.12"></script>
<script defer src="modules/ui/style.js?v=1.101.00"></script>
<script defer src="modules/ui/editors.js?v=1.99.05"></script>
<script defer src="modules/ui/tools.js?v=1.100.00"></script>
<script defer src="modules/ui/world-configurator.js?v=1.99.00"></script>
@ -8062,7 +8066,7 @@
<script defer src="modules/ui/ice-editor.js?v=1.99.00"></script>
<script defer src="modules/ui/lakes-editor.js?v=1.99.00"></script>
<script defer src="modules/ui/coastline-editor.js?v=1.99.00"></script>
<script defer src="modules/ui/labels-editor.js?v=1.99.00"></script>
<script defer src="modules/ui/labels-editor.js?v=1.101.00"></script>
<script defer src="modules/ui/rivers-editor.js?v=1.99.00"></script>
<script defer src="modules/ui/rivers-creator.js?v=1.99.00"></script>
<script defer src="modules/ui/relief-editor.js?v=1.99.00"></script>

View file

@ -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";
<ul>
<strong>Latest changes:</strong>
<li>Labels editor: ability to set letter spacing</li>
<li>Zones update</li>
<li>Notes Editor: on-demand AI text generation</li>
<li>New style preset: Dark Seas</li>
@ -43,12 +44,6 @@ const VERSION = "1.100.00";
<li>Ability to render ocean heightmap</li>
<li>Scale bar styling features</li>
<li>Vignette visual layer and vignette styling options</li>
<li>Ability to define custom heightmap color scheme</li>
<li>New style preset Night and new heightmap color schemes</li>
<li>Random encounter markers (integration with <a href="https://deorum.vercel.app/" target="_blank">Deorum</a>)</li>
<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>
</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>
@ -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)));