Added a lock function to burgs (#612)

* Added a lock function to burgs that will prevent them from being regenerated

* Updated tooltips and fixed culture change from renaming locked burgs and group remove from deleting locked burgs
This commit is contained in:
Legogizmo 2021-03-29 16:05:49 -05:00 committed by GitHub
parent c9b34866f9
commit f855de6fb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 85 additions and 16 deletions

View file

@ -221,6 +221,20 @@ function togglePort(burg) {
.attr("width", size).attr("height", size);
}
function toggleBurgLock(burg) {
const b = pack.burgs[burg];
b.lock = b.lock ? 0 : 1;
}
function showBurgLockTip(burg) {
const b = pack.burgs[burg];
if (b.lock) {
tip("Click to Unlock burg and allow it to be change by regeneration tools");
} else {
tip("Click to Lock burg and prevent changes by regeneration tools");
}
}
// draw legend box
function drawLegend(name, data) {
legend.selectAll("*").remove(); // fully redraw every time