v. 0.59.10b

This commit is contained in:
Azgaar 2018-09-04 21:45:39 +03:00
parent 5bfe920eed
commit f8ce6a0ea8
3 changed files with 21 additions and 16 deletions

View file

@ -47,7 +47,7 @@ button, select, a {
} }
#cults { #cults {
stroke-width: 2; stroke-width: 4;
mask: url(#shape); mask: url(#shape);
mask-mode: alpha; mask-mode: alpha;
pointer-events: none; pointer-events: none;
@ -75,6 +75,7 @@ button, select, a {
#regions { #regions {
stroke-width: 0; stroke-width: 0;
stroke: none;
fill-rule: evenodd; fill-rule: evenodd;
stroke-linejoin: round; stroke-linejoin: round;
mask: url(#shape); mask: url(#shape);

View file

@ -32,8 +32,8 @@
<script src="libs/quantize.min.js" defer></script> <script src="libs/quantize.min.js" defer></script>
<script src="libs/d3-hexbin.v0.2.min.js" defer></script> <script src="libs/d3-hexbin.v0.2.min.js" defer></script>
<script src="libs/jquery.ui.touch-punch.min.js" defer></script> <script src="libs/jquery.ui.touch-punch.min.js" defer></script>
<link rel="stylesheet" type="text/css" href="index.css?version=0.59.09b"/> <link rel="stylesheet" type="text/css" href="index.css?version=0.59.10b"/>
<link rel="stylesheet" type="text/css" href="icons.css?version=0.59.09b"/> <link rel="stylesheet" type="text/css" href="icons.css?version=0.59.10b"/>
<link rel="stylesheet" type="text/css" href="libs/jquery-ui.css"/> <link rel="stylesheet" type="text/css" href="libs/jquery-ui.css"/>
</head> </head>
<body> <body>
@ -1143,5 +1143,5 @@
<input type="file" accept=".txt" id="namesbaseToLoad"> <input type="file" accept=".txt" id="namesbaseToLoad">
</div> </div>
<script src="script.js?version=0.59.09b"></script> <script src="script.js?version=0.59.10b"></script>
</body> </body>

View file

@ -380,11 +380,11 @@ function fantasyMap() {
{name:"Toledi", color:"#ffd92f", base:4}, {name:"Toledi", color:"#ffd92f", base:4},
{name:"Slovian", color:"#e5c494", base:5}, {name:"Slovian", color:"#e5c494", base:5},
{name:"Norse", color:"#dca3e4", base:6}, {name:"Norse", color:"#dca3e4", base:6},
{name:"Elladian", color:"#96d6be", base:7}, {name:"Elladian", color:"#66c4a0", base:7},
{name:"Latian", color:"#ff7174", base:8}, {name:"Latian", color:"#ff7174", base:8},
{name:"Somi", color:"#aedff7", base:9}, {name:"Soomi", color:"#85c8fa", base:9},
{name:"Koryo", color:"#578880", base:10}, {name:"Koryo", color:"#578880", base:10},
{name:"Hantzu", color:"#fdface", base:11}, {name:"Hantzu", color:"#becb8d", base:11},
{name:"Yamoto", color:"#ffd9da", base:12} {name:"Yamoto", color:"#ffd9da", base:12}
]; ];
} }
@ -854,12 +854,12 @@ function fantasyMap() {
console.time('defineHeightmap'); console.time('defineHeightmap');
if (lockTemplateInput.getAttribute("data-locked") == 0) { if (lockTemplateInput.getAttribute("data-locked") == 0) {
const rnd = Math.random(); const rnd = Math.random();
if (rnd > 0.9) {templateInput.value = "Volcano";} if (rnd > 0.95) {templateInput.value = "Volcano";}
else if (rnd > 0.7) {templateInput.value = "High Island";} else if (rnd > 0.75) {templateInput.value = "High Island";}
else if (rnd > 0.5) {templateInput.value = "Low Island";} else if (rnd > 0.55) {templateInput.value = "Low Island";}
else if (rnd > 0.35) {templateInput.value = "Continents";} else if (rnd > 0.35) {templateInput.value = "Continents";}
else if (rnd > 0.05) {templateInput.value = "Archipelago";} else if (rnd > 0.15) {templateInput.value = "Archipelago";}
else if (rnd > 0.03) {templateInput.value = "Mainland";} else if (rnd > 0.10) {templateInput.value = "Mainland";}
else if (rnd > 0.01) {templateInput.value = "Peninsulas";} else if (rnd > 0.01) {templateInput.value = "Peninsulas";}
else {templateInput.value = "Atoll";} else {templateInput.value = "Atoll";}
} }
@ -4424,10 +4424,14 @@ function fantasyMap() {
array[array.length] = edgesOrdered.map(function(e) {return [+e.scX, +e.scY];}); array[array.length] = edgesOrdered.map(function(e) {return [+e.scX, +e.scY];});
} }
var color = states[region].color; var color = states[region].color;
regions.append("path").attr("d", round(path, 1)).attr("fill", color).attr("stroke", "none").attr("class", "region"+region); regions.append("path").attr("d", round(path, 1)).attr("fill", color).attr("class", "region"+region);
array.sort(function(a, b){return b.length - a.length;}); array.sort(function(a, b){return b.length - a.length;});
const capitalCell = manors[states[region].capital].cell; let capital = states[region].capital;
array.push(polygons[capitalCell]); // add capital cell as a hole // add capital cell as a hole
if (!isNaN(capital)) {
const capitalCell = manors[capital].cell;
array.push(polygons[capitalCell]);
}
var name = states[region].name; var name = states[region].name;
var c = polylabel(array, 1.0); // pole of inaccessibility var c = polylabel(array, 1.0); // pole of inaccessibility
labels.select("#countries").append("text").attr("id", "regionLabel"+region).attr("x", rn(c[0])).attr("y", rn(c[1])).text(name).on("click", editLabel); labels.select("#countries").append("text").attr("id", "regionLabel"+region).attr("x", rn(c[0])).attr("y", rn(c[1])).text(name).on("click", editLabel);
@ -4461,7 +4465,7 @@ function fantasyMap() {
path += lineGen(edgesOrdered); path += lineGen(edgesOrdered);
} }
var color = states[region].color; var color = states[region].color;
regions.append("path").attr("d", round(path, 1)).attr("fill", "none").attr("stroke", color).attr("stroke-width", 3).attr("class", "region"+region); regions.append("path").attr("d", round(path, 1)).attr("fill", "none").attr("stroke", color).attr("stroke-width", 5).attr("class", "region"+region);
} }
function drawBorders(edges, type) { function drawBorders(edges, type) {