mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
feat(religions editor): sync religion center circle style with culture one
This commit is contained in:
parent
47ef8d938b
commit
13e247ed9c
2 changed files with 10 additions and 13 deletions
3
main.js
3
main.js
|
|
@ -684,7 +684,6 @@ async function generate(options) {
|
||||||
const timeStart = performance.now();
|
const timeStart = performance.now();
|
||||||
const {seed: precreatedSeed, graph: precreatedGraph} = options || {};
|
const {seed: precreatedSeed, graph: precreatedGraph} = options || {};
|
||||||
|
|
||||||
pack = {};
|
|
||||||
invokeActiveZooming();
|
invokeActiveZooming();
|
||||||
setSeed(precreatedSeed);
|
setSeed(precreatedSeed);
|
||||||
INFO && console.group("Generated Map " + seed);
|
INFO && console.group("Generated Map " + seed);
|
||||||
|
|
@ -695,7 +694,7 @@ async function generate(options) {
|
||||||
if (shouldRegenerateGrid(grid, precreatedSeed)) grid = precreatedGraph || generateGrid();
|
if (shouldRegenerateGrid(grid, precreatedSeed)) grid = precreatedGraph || generateGrid();
|
||||||
else delete grid.cells.h;
|
else delete grid.cells.h;
|
||||||
grid.cells.h = await HeightmapGenerator.generate(grid);
|
grid.cells.h = await HeightmapGenerator.generate(grid);
|
||||||
pack = {};
|
pack = {}; // reset pack
|
||||||
|
|
||||||
markFeatures();
|
markFeatures();
|
||||||
markupGridOcean();
|
markupGridOcean();
|
||||||
|
|
|
||||||
|
|
@ -286,7 +286,7 @@ function getExpansionColumns(r) {
|
||||||
culture
|
culture
|
||||||
</span>
|
</span>
|
||||||
<span class="icon-resize-full placeholder hide"></span>
|
<span class="icon-resize-full placeholder hide"></span>
|
||||||
<input class="religionExpan placeholder hide" type="number" />`
|
<input class="religionExpan placeholder hide" type="number" />`;
|
||||||
else
|
else
|
||||||
return `<select data-tip="Potential religion extent" class="religionExtent hide" style="width: 5em">
|
return `<select data-tip="Potential religion extent" class="religionExtent hide" style="width: 5em">
|
||||||
${getExtentOptions(r.expansion)}
|
${getExtentOptions(r.expansion)}
|
||||||
|
|
@ -300,7 +300,7 @@ function getExpansionColumns(r) {
|
||||||
max="99"
|
max="99"
|
||||||
step=".1"
|
step=".1"
|
||||||
value=${r.expansionism}
|
value=${r.expansionism}
|
||||||
/>`
|
/>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getExtentOptions(type) {
|
function getExtentOptions(type) {
|
||||||
|
|
@ -318,20 +318,19 @@ const religionHighlightOn = debounce(event => {
|
||||||
if (!layerIsOn("toggleReligions")) return;
|
if (!layerIsOn("toggleReligions")) return;
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
||||||
const animate = d3.transition().duration(1500).ease(d3.easeSinIn);
|
const animate = d3.transition().duration(2000).ease(d3.easeSinIn);
|
||||||
relig
|
relig
|
||||||
.select("#religion" + religionId)
|
.select("#religion" + religionId)
|
||||||
.raise()
|
.raise()
|
||||||
.transition(animate)
|
.transition(animate)
|
||||||
.attr("stroke-width", 2.5)
|
.attr("stroke-width", 2.5)
|
||||||
.attr("stroke", "#c13119");
|
.attr("stroke", "#d0240f");
|
||||||
debug
|
debug
|
||||||
.select("#religionsCenter" + religionId)
|
.select("#religionsCenter" + religionId)
|
||||||
.raise()
|
.raise()
|
||||||
.transition(animate)
|
.transition(animate)
|
||||||
.attr("r", 8)
|
.attr("r", 3)
|
||||||
.attr("stroke-width", 2)
|
.attr("stroke", "#d0240f");
|
||||||
.attr("stroke", "#c13119");
|
|
||||||
}, 200);
|
}, 200);
|
||||||
|
|
||||||
function religionHighlightOff(event) {
|
function religionHighlightOff(event) {
|
||||||
|
|
@ -347,8 +346,7 @@ function religionHighlightOff(event) {
|
||||||
debug
|
debug
|
||||||
.select("#religionsCenter" + religionId)
|
.select("#religionsCenter" + religionId)
|
||||||
.transition()
|
.transition()
|
||||||
.attr("r", 4)
|
.attr("r", 2)
|
||||||
.attr("stroke-width", 1.2)
|
|
||||||
.attr("stroke", null);
|
.attr("stroke", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -531,7 +529,7 @@ function drawReligionCenters() {
|
||||||
const religionCenters = debug
|
const religionCenters = debug
|
||||||
.append("g")
|
.append("g")
|
||||||
.attr("id", "religionCenters")
|
.attr("id", "religionCenters")
|
||||||
.attr("stroke-width", 1.2)
|
.attr("stroke-width", 0.8)
|
||||||
.attr("stroke", "#444444")
|
.attr("stroke", "#444444")
|
||||||
.style("cursor", "move");
|
.style("cursor", "move");
|
||||||
|
|
||||||
|
|
@ -543,7 +541,7 @@ function drawReligionCenters() {
|
||||||
.append("circle")
|
.append("circle")
|
||||||
.attr("id", d => "religionsCenter" + d.i)
|
.attr("id", d => "religionsCenter" + d.i)
|
||||||
.attr("data-id", d => d.i)
|
.attr("data-id", d => d.i)
|
||||||
.attr("r", 4)
|
.attr("r", 2)
|
||||||
.attr("fill", d => d.color)
|
.attr("fill", d => d.color)
|
||||||
.attr("cx", d => pack.cells.p[d.center][0])
|
.attr("cx", d => pack.cells.p[d.center][0])
|
||||||
.attr("cy", d => pack.cells.p[d.center][1])
|
.attr("cy", d => pack.cells.p[d.center][1])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue