diff --git a/index.css b/index.css
index 27f9c86c..457cc5f2 100644
--- a/index.css
+++ b/index.css
@@ -1854,6 +1854,11 @@ svg.button {
margin: 10px 0;
}
+.pseudoLink {
+ cursor: pointer;
+ text-decoration: underline;
+}
+
#info-line {
font-size: .9em;
color: gray;
@@ -1971,7 +1976,7 @@ svg.button {
.dontAsk {
display: inline-block;
- margin: 10px 0 0 7px;
+ margin: .9em 0 0 .6em;
}
#errorBox {
@@ -1985,7 +1990,7 @@ svg.button {
#debug {
font-size: 1px;
- opacity: 0.8;
+ opacity: .8;
}
@media print {
diff --git a/modules/religions-generator.js b/modules/religions-generator.js
index 3bcc595e..b0b52432 100644
--- a/modules/religions-generator.js
+++ b/modules/religions-generator.js
@@ -35,7 +35,7 @@
Heresy:{"Heresy":1}
};
- const methods = {"Random + type":3, "Random + ism":1, "Supreme + ism":5, "Faith of + Supreme":3, "Place + ism":1, "Culture + ism":2, "Place + ian + type":6, "Culture + type":4};
+ const methods = {"Random + type":3, "Random + ism":1, "Supreme + ism":5, "Faith of + Supreme":5, "Place + ism":1, "Culture + ism":2, "Place + ian + type":6, "Culture + type":4};
const types = {
"Shamanism":{"Beliefs":3, "Shamanism":2, "Spirits":1},
@@ -327,7 +327,7 @@
if (m === "Random + type") return [random() + " " + type(), "global"];
if (m === "Random + ism") return [trimVowels(random()) + "ism", "global"];
if (m === "Supreme + ism" && deity) return [trimVowels(supreme()) + "ism", "global"];
- if (m === "Faith of + Supreme" && deity) return ["Faith of " + supreme(), "global"];
+ if (m === "Faith of + Supreme" && deity) return [ra(['Faith', 'Way', 'Word']) + " of " + supreme(), "global"];
if (m === "Place + ism") return [place() + "ism", "state"];
if (m === "Culture + ism") return [trimVowels(culture()) + "ism", "culture"];
if (m === "Place + ian + type") return [place("adj") + " " + type(), "state"];
diff --git a/modules/save-and-load.js b/modules/save-and-load.js
index f06fe5cd..29d65c67 100644
--- a/modules/save-and-load.js
+++ b/modules/save-and-load.js
@@ -155,7 +155,6 @@ function GFontToDataURI(url) {
// prepare map data for saving
function getMapData() {
- if (customization) return false;
console.time("createMapDataBlob");
return new Promise(resolve => {
@@ -218,7 +217,7 @@ function getMapData() {
// Download .map file
async function saveMap() {
if (customization) {tip("Map cannot be saved when edit mode is active, please exit the mode and retry", false, "error"); return;}
- closeDialogs();
+ closeDialogs("#alert");
const blob = await getMapData();
const URL = window.URL.createObjectURL(blob);
@@ -327,6 +326,92 @@ function getRiverPoints(node) {
return points;
}
+async function quickSave() {
+ if (customization) {tip("Map cannot be saved when edit mode is active, please exit the mode and retry", false, "error"); return;}
+ const blob = await getMapData();
+ if (blob) ldb.set("lastMap", blob); // auto-save map
+ tip("Map is saved to browser memory", true, "success", 2000);
+}
+
+function quickLoad() {
+ ldb.get("lastMap", blob => {
+ if (blob) {
+ loadMapPrompt(blob);
+ } else {
+ tip("No map stored. Save map to storage first", true, "error", 2000);
+ console.error("No map stored");
+ }
+ });
+}
+
+function loadMapPrompt(blob) {
+ const workingTime = (Date.now() - last(mapHistory).created) / 60000; // minutes
+ if (workingTime < 5) {loadLastSavedMap(); return;}
+
+ alertMessage.innerHTML = `Are you sure you want to load saved map?
+ All unsaved changes made to the current map will be lost`;
+ $("#alert").dialog({resizable: false, title: "Load saved map",
+ buttons: {
+ Cancel: function() {$(this).dialog("close");},
+ Load: function() {loadLastSavedMap(); $(this).dialog("close");}
+ }
+ });
+
+ function loadLastSavedMap() {
+ console.warn("Load last saved map");
+ try {
+ uploadFile(blob);
+ }
+ catch(error) {
+ console.error(error);
+ tip("Cannot load last saved map", true, "error", 2000);
+ }
+ }
+}
+
+const saveReminder = function() {
+ if (localStorage.getItem("noReminder")) return;
+ const message = ["Please don't forget to save your work as a .map file",
+ "Please remember to save work as a .map file",
+ "Saving in .map format will ensure your data won't be lost in case of issues",
+ "Safety is number one priority. Please save the map",
+ "Don't forget to save your map on a regular basis!",
+ "Just a gentle reminder for you to save the map",
+ "Please forget to save your progress (saving as .map is the best option)",
+ "Don't want to be reminded about need to save? Press CTRL+Q"];
+
+ saveReminder.reminder = setInterval(() => {
+ if (customization) return;
+ tip(ra(message), true, "warn", 2500);
+ }, 1e6);
+ saveReminder.status = 1;
+}
+
+saveReminder();
+
+function toggleSaveReminder() {
+ if (saveReminder.status) {
+ tip("Save reminder is turned off. Press CTRL+Q again to re-initiate", true, "warn", 2000);
+ clearInterval(saveReminder.reminder);
+ localStorage.setItem("noReminder", true);
+ saveReminder.status = 0;
+ } else {
+ tip("Save reminder is turned on. Press CTRL+Q to turn off", true, "warn", 2000);
+ localStorage.removeItem("noReminder");
+ saveReminder();
+ }
+}
+
+function getFileName(dataType) {
+ const name = mapName.value;
+ const type = dataType ? dataType + " " : "";
+ const date = new Date();
+ const datFormatter = new Intl.DateTimeFormat("en", {month: "short", day: "numeric"});
+ const timeFormatter = new Intl.DateTimeFormat("ru", {hour: "numeric", minute: "numeric"});
+ const day = datFormatter.format(date).replace(" ", "");
+ const time = timeFormatter.format(date).replace(":", "-");
+ return name + " " + type + day + " " + time;
+}
function saveGeoJSON_Cells() {
let data = "{ \"type\": \"FeatureCollection\", \"features\": [\n";
@@ -408,6 +493,11 @@ function uploadFile(file, callback) {
function parseLoadedData(data) {
try {
+ // exit customization
+ closeDialogs();
+ customization = 0;
+ if (customizationMenu.offsetParent) styleTab.click();
+
const reliefIcons = document.getElementById("defs-relief").innerHTML; // save relief icons
const hatching = document.getElementById("hatching").cloneNode(true); // save hatching
@@ -732,91 +822,4 @@ function parseLoadedData(data) {
});
}
-}
-
-async function quickSave() {
- const blob = await getMapData();
- if (blob) ldb.set("lastMap", blob); // auto-save map
- tip("Map is saved to browser memory", true, "success", 2000);
-}
-
-function quickLoad() {
- ldb.get("lastMap", blob => {
- if (blob) {
- loadMapPrompt(blob);
- } else {
- tip("No map stored. Save map to storage first", true, "error", 2000);
- console.error("No map stored");
- }
- });
-}
-
-function loadMapPrompt(blob) {
- const workingTime = (Date.now() - last(mapHistory).created) / 60000; // minutes
- if (workingTime < 10) {loadLastSavedMap(); return;}
-
- alertMessage.innerHTML = `Are you sure you want to load saved map?
- All unsaved changes made to the current map will be lost`;
- $("#alert").dialog({resizable: false, title: "Load saved map",
- buttons: {
- Cancel: function() {$(this).dialog("close");},
- Load: function() {loadLastSavedMap(); $(this).dialog("close");}
- }
- });
-
- function loadLastSavedMap() {
- console.warn("Load last saved map");
- closeDialogs();
- try {
- uploadFile(blob);
- }
- catch(error) {
- console.error(error);
- tip("Cannot load last saved map", true, "error", 2000);
- }
- }
-}
-
-const saveReminder = function() {
- if (localStorage.getItem("noReminder")) return;
- const message = ["Please don't forget to save your work as a .map file",
- "Please remember to save work as a .map file",
- "Saving in .map format will ensure your data won't be lost in case of issues",
- "Safety is number one priority. Please save the map",
- "Don't forget to save your map on a regular basis!",
- "Just a gentle reminder for you to save the map",
- "Please forget to save your progress (saving as .map is the best option)",
- "Don't want to be reminded about need to save? Press CTRL+Q"];
-
- saveReminder.reminder = setInterval(() => {
- if (customization) return;
- tip(ra(message), true, "warn", 2500);
- }, 1e6);
- saveReminder.status = 1;
-}
-
-saveReminder();
-
-function toggleSaveReminder() {
- if (saveReminder.status) {
- tip("Save reminder is turned off. Press CTRL+Q again to re-initiate", true, "warn", 2000);
- clearInterval(saveReminder.reminder);
- localStorage.setItem("noReminder", true);
- saveReminder.status = 0;
- } else {
- tip("Save reminder is turned on. Press CTRL+Q to turn off", true, "warn", 2000);
- localStorage.removeItem("noReminder");
- saveReminder();
- }
-}
-
-function getFileName(dataType) {
- const name = mapName.value;
- const type = dataType ? dataType + " " : "";
- const date = new Date();
- const datFormatter = new Intl.DateTimeFormat("en", {month: "short", day: "numeric"});
- const timeFormatter = new Intl.DateTimeFormat("ru", {hour: "numeric", minute: "numeric"});
- const day = datFormatter.format(date).replace(" ", "");
- const time = timeFormatter.format(date).replace(":", "-");
- return name + " " + type + day + " " + time;
}
\ No newline at end of file
diff --git a/modules/ui/heightmap-editor.js b/modules/ui/heightmap-editor.js
index bb1b6cd0..67116613 100644
--- a/modules/ui/heightmap-editor.js
+++ b/modules/ui/heightmap-editor.js
@@ -13,11 +13,10 @@ function editHeightmap() {
Check out wiki for guidance.
-Please save the map before edditing the heightmap!
`; +Please save the map before edditing the heightmap!
`; $("#alert").dialog({resizable: false, title: "Edit Heightmap", width: "28em", buttons: { - Save: function() {saveMap();}, Erase: function() {enterHeightmapEditMode("erase");}, Keep: function() {enterHeightmapEditMode("keep");}, Risk: function() {enterHeightmapEditMode("risk");}, diff --git a/modules/ui/options.js b/modules/ui/options.js index afa297d1..569a58a5 100644 --- a/modules/ui/options.js +++ b/modules/ui/options.js @@ -1012,7 +1012,7 @@ document.getElementById("sticked").addEventListener("click", function(event) { function regeneratePrompt() { const workingTime = (Date.now() - last(mapHistory).created) / 60000; // minutes - if (workingTime < 10) {regenerateMap(); return;} + if (workingTime < 5) {regenerateMap(); return;} alertMessage.innerHTML = `Are you sure you want to generate a new map?