diff --git a/modules/markers-generator.js b/modules/markers-generator.js index 51286461..7b5df26c 100644 --- a/modules/markers-generator.js +++ b/modules/markers-generator.js @@ -26,6 +26,7 @@ window.Markers = (function () { addSacredPalmGroves(); addBrigands(); addPirates(); + addStatues(); TIME && console.timeEnd("addMarkers"); }; @@ -413,6 +414,43 @@ window.Markers = (function () { } } + function addStatues() { + const {cells} = pack; + let statues = Array.from(cells.i.filter(i => cells.h[i] >= 20 && cells.h[i] < 40)); + let quantity = getQuantity(statues, 80, 1200); + if (!quantity) return; + addMarker("statues", "🗿", 50, 50, 12); + + const types = ["Statue", "Obelisk", "Monument", "Column", "Monolith", "Pillar", "Megalith", "Stele", "Runestone"]; + const scripts = { + cypriot: "𐠁𐠂𐠃𐠄𐠅𐠈𐠊𐠋𐠌𐠍𐠎𐠏𐠐𐠑𐠒𐠓𐠔𐠕𐠖𐠗𐠘𐠙𐠚𐠛𐠜𐠝𐠞𐠟𐠠𐠡𐠢𐠣𐠤𐠥𐠦𐠧𐠨𐠩𐠪𐠫𐠬𐠭𐠮𐠯𐠰𐠱𐠲𐠳𐠴𐠵𐠷𐠸𐠼𐠿 ", + geez: "ሀለሐመሠረሰቀበተኀነአከወዐዘየደገጠጰጸፀፈፐ ", + coptic: "ⲲⲴⲶⲸⲺⲼⲾⳀⳁⳂⳃⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳤ⳥⳧⳩⳪ⳫⳬⳭⳲ⳹⳾ ", + tibetan: "ༀ༁༂༃༄༅༆༇༈༉༊་༌༐༑༒༓༔༕༖༗༘༙༚༛༜༠༡༢༣༤༥༦༧༨༩༪༫༬༭༮༯༰༱༲༳༴༵༶༷༸༹༺༻༼༽༾༿", + mongolian: "᠀᠐᠑᠒ᠠᠡᠦᠧᠨᠩᠪᠭᠮᠯᠰᠱᠲᠳᠵᠻᠼᠽᠾᠿᡀᡁᡆᡍᡎᡏᡐᡑᡒᡓᡔᡕᡖᡗᡙᡜᡝᡞᡟᡠᡡᡭᡮᡯᡰᡱᡲᡳᡴᢀᢁᢂᢋᢏᢐᢑᢒᢓᢛᢜᢞᢟᢠᢡᢢᢤᢥᢦ" + }; + + while (quantity) { + const [cell] = extractAnyElement(statues); + const id = appendMarker(cell, "statues"); + const culture = cells.culture[cell]; + + const type = ra(types); + const name = `${Names.getCulture(culture)} ${type}`; + const script = scripts[ra(Object.keys(scripts))]; + const inscription = Array(rand(40, 100)) + .fill(null) + .map(() => ra(script)) + .join(""); + const legend = `An ancient ${type.toLowerCase()}. It has an inscription, but no one can translate it: +
${inscription}
`; + notes.push({id, name, legend}); + quantity--; + } + } + + // pyramid" + function addMarker(id, icon, x, y, size) { const markers = svg.select("#defs-markers"); if (markers.select("#marker_" + id).size()) return; diff --git a/modules/ui/hotkeys.js b/modules/ui/hotkeys.js index 6f76fb4f..78d387ad 100644 --- a/modules/ui/hotkeys.js +++ b/modules/ui/hotkeys.js @@ -16,6 +16,7 @@ function handleKeyup(event) { const {tagName, contentEditable} = document.activeElement; if (["INPUT", "SELECT", "TEXTAREA"].includes(tagName)) return; // don't trigger if user inputs text if (tagName === "DIV" && contentEditable === "true") return; // don't trigger if user inputs a text + if (document.getSelection().toString()) return; // don't trigger if user selects text event.stopPropagation(); const {ctrlKey, metaKey, shiftKey, altKey} = event;