Merge pull request #576 from Azgaar/dev

Dev
This commit is contained in:
Azgaar 2021-02-20 21:31:17 +03:00 committed by GitHub
commit 1457323acd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -2667,7 +2667,7 @@
<div id="namesbaseBottom"> <div id="namesbaseBottom">
<button id="namesbaseUpdateExamples" data-tip="Re-generate examples based on provided data" class="icon-arrows-cw"></button> <button id="namesbaseUpdateExamples" data-tip="Re-generate examples based on provided data" class="icon-arrows-cw"></button>
<button id="namesbaseAnalize" data-tip="Analize namesbase to get a validity and quality overview" class="icon-flask"></button> <button id="namesbaseAnalize" data-tip="Analyze namesbase to get a validity and quality overview" class="icon-flask"></button>
<button id="namesbaseAdd" data-tip="Add new namesbase" class="icon-plus"></button> <button id="namesbaseAdd" data-tip="Add new namesbase" class="icon-plus"></button>
<button id="namesbaseDefault" data-tip="Restore default namesbase" class="icon-cancel"></button> <button id="namesbaseDefault" data-tip="Restore default namesbase" class="icon-cancel"></button>
<button id="namesbaseDownload" data-tip="Download namesbase to PC" class="icon-download"></button> <button id="namesbaseDownload" data-tip="Download namesbase to PC" class="icon-download"></button>

View file

@ -303,13 +303,12 @@ function getPopulationTip(i) {
} }
function highlightEmblemElement(type, el) { function highlightEmblemElement(type, el) {
if (emblems.selectAll("line, circle").size()) return;
const i = el.i, cells = pack.cells; const i = el.i, cells = pack.cells;
const animation = d3.transition().duration(1000).ease(d3.easeSinIn); const animation = d3.transition().duration(1000).ease(d3.easeSinIn);
if (type === "burg") { if (type === "burg") {
const {x, y} = el; const {x, y} = el;
emblems.append("circle").attr("cx", x).attr("cy", y).attr("r", 0) debug.append("circle").attr("cx", x).attr("cy", y).attr("r", 0)
.attr("fill", "none").attr("stroke", "#d0240f").attr("stroke-width", 1).attr("opacity", 1) .attr("fill", "none").attr("stroke", "#d0240f").attr("stroke-width", 1).attr("opacity", 1)
.transition(animation).attr("r", 20).attr("opacity", .1).attr("stroke-width", 0).remove(); .transition(animation).attr("r", 20).attr("opacity", .1).attr("stroke-width", 0).remove();
return; return;
@ -320,7 +319,7 @@ function highlightEmblemElement(type, el) {
const borderCells = cells.i.filter(id => obj[id] === i && cells.c[id].some(n => obj[n] !== i)); const borderCells = cells.i.filter(id => obj[id] === i && cells.c[id].some(n => obj[n] !== i));
const data = Array.from(borderCells).filter((c, i) => !(i%2)).map(i => cells.p[i]).map(i => [i[0], i[1], Math.hypot(i[0]-x, i[1]-y)]); const data = Array.from(borderCells).filter((c, i) => !(i%2)).map(i => cells.p[i]).map(i => [i[0], i[1], Math.hypot(i[0]-x, i[1]-y)]);
emblems.selectAll("line").data(data).enter().append("line") debug.selectAll("line").data(data).enter().append("line")
.attr("x1", x).attr("y1", y).attr("x2", d => d[0]).attr("y2", d => d[1]) .attr("x1", x).attr("y1", y).attr("x2", d => d[0]).attr("y2", d => d[1])
.attr("stroke", "#d0240f").attr("stroke-width", .5).attr("opacity", .2) .attr("stroke", "#d0240f").attr("stroke-width", .5).attr("opacity", .2)
.attr("stroke-dashoffset", d => d[2]).attr("stroke-dasharray", d => d[2]) .attr("stroke-dashoffset", d => d[2]).attr("stroke-dasharray", d => d[2])
@ -480,6 +479,7 @@ document.addEventListener("keyup", event => {
else if (shift && key === 78) editNamesbase(); // Shift + "N" to edit Namesbase else if (shift && key === 78) editNamesbase(); // Shift + "N" to edit Namesbase
else if (shift && key === 90) editZones(); // Shift + "Z" to edit Zones else if (shift && key === 90) editZones(); // Shift + "Z" to edit Zones
else if (shift && key === 82) editReligions(); // Shift + "R" to edit Religions else if (shift && key === 82) editReligions(); // Shift + "R" to edit Religions
else if (shift && key === 89) openEmblemEditor(); // Shift + "Y" to edit Emblems
else if (shift && key === 81) editUnits(); // Shift + "Q" to edit Units else if (shift && key === 81) editUnits(); // Shift + "Q" to edit Units
else if (shift && key === 79) editNotes(); // Shift + "O" to edit Notes else if (shift && key === 79) editNotes(); // Shift + "O" to edit Notes
else if (shift && key === 84) overviewBurgs(); // Shift + "T" to open Burgs overview else if (shift && key === 84) overviewBurgs(); // Shift + "T" to open Burgs overview