Skip to content

Commit

Permalink
Nautical mile option in Units-Editor (#1059)
Browse files Browse the repository at this point in the history
* Nautical mile option in Units-Editor

In Distance --> Distance Unit.

* adding nautical league

The distance 5.556 km = 1 league, is put on the nautical league and used the English land league 4.828 to differentiate both units.

* Update versioning.js

changed 1.97.02 to 1.97.03

* fix in versioning and index.html

* writing ver 1.97.03

in hopes of fixing the version conflict

* increasing ver 1.97.05 to fix

---------

Co-authored-by: Azgaar <[email protected]>
  • Loading branch information
Avengium and Azgaar authored Mar 26, 2024
1 parent af927ed commit 73e9d22
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5149,6 +5149,8 @@
<option value="km">Kilometer (km)</option>
<option value="lg">League (lg)</option>
<option value="vr">Versta (vr)</option>
<option value="nmi">Nautical mile (nmi)</option>
<option value="nlg">Nautical league (nlg)</option>
<option value="custom_name">Custom name</option>
</select>
</div>
Expand Down Expand Up @@ -8057,7 +8059,7 @@
<script defer src="modules/ui/style.js?v=1.96.00"></script>
<script defer src="modules/ui/editors.js?v=1.97.00"></script>
<script defer src="modules/ui/tools.js?v=1.96.03"></script>
<script defer src="modules/ui/world-configurator.js?v=1.91.05"></script>
<script defer src="modules/ui/world-configurator.js?v=1.98.00"></script>
<script defer src="modules/ui/heightmap-editor.js?v=1.96.00"></script>
<script defer src="modules/ui/provinces-editor.js?v=1.96.00"></script>
<script defer src="modules/ui/biomes-editor.js?v=1.91.05"></script>
Expand Down
8 changes: 5 additions & 3 deletions modules/ui/world-configurator.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,11 @@ function editWorld() {

function toKilometer(v) {
if (unit === "km") return v;
else if (unit === "mi") return v * 1.60934;
else if (unit === "lg") return v * 5.556;
else if (unit === "vr") return v * 1.0668;
if (unit === "mi") return v * 1.60934;
if (unit === "lg") return v * 4.828;
if (unit === "vr") return v * 1.0668;
if (unit === "nmi") return v * 1.852;
if (unit === "nlg") return v * 5.556;
return 0; // 0 if distanceUnitInput is a custom unit
}

Expand Down
2 changes: 1 addition & 1 deletion versioning.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

// version and caching control
const version = "1.97.04"; // generator version, update each time
const version = "1.97.05"; // generator version, update each time

{
document.title += " v" + version;
Expand Down

0 comments on commit 73e9d22

Please sign in to comment.