markers overview

This commit is contained in:
Azgaar 2021-09-27 01:07:36 +03:00 committed by Peter
parent 26e5413090
commit 6d6dc22a75
5 changed files with 3 additions and 53 deletions

View file

@ -82,7 +82,6 @@ function overviewBurgs() {
const province = prov ? pack.provinces[prov].name : '';
const culture = pack.cultures[b.culture].name;
<<<<<<< HEAD
lines += /* html */ `<div
class="states"
data-id=${b.i}
@ -100,31 +99,13 @@ function overviewBurgs() {
<select data-tip="Dominant culture. Click to change burg culture (to change cell culture use Cultures Editor)" class="stateCulture">
${getCultureOptions(b.culture)}
</select>
=======
lines += `<div class="states" data-id=${b.i} data-name="${
b.name
}" data-state="${state}" data-province="${province}" data-culture="${culture}" data-population=${population} data-type="${type}">
<span data-tip="Click to zoom into view" class="icon-dot-circled pointer"></span>
<input data-tip="Burg name. Click and type to change" class="burgName" value="${b.name}" autocorrect="off" spellcheck="false">
<input data-tip="Burg province" class="burgState" value="${province}" disabled>
<input data-tip="Burg state" class="burgState" value="${state}" disabled>
<select data-tip="Dominant culture. Click to change burg culture (to change cell cultrure use Cultures Editor)" class="stateCulture">${getCultureOptions(
b.culture
)}</select>
>>>>>>> 01fbfca0 (markers - generate tool + lock tooltip)
<span data-tip="Burg population" class="icon-male"></span>
<input data-tip="Burg population. Type to change" class="burgPopulation" value=${si(population)} />
<div class="burgType">
<<<<<<< HEAD
<span
data-tip="${b.capital ? " This burg is a state capital" : "Click to assign a capital status"}"
class="icon-star-empty${b.capital ? "" : " inactive pointer"}"
></span>
=======
<span data-tip="${b.capital ? " This burg is a state capital" : "Click to assign a capital status"}" class="icon-star-empty${
b.capital ? "" : " inactive pointer"
}"></span>
>>>>>>> 01fbfca0 (markers - generate tool + lock tooltip)
<span data-tip="Click to toggle port status" class="icon-anchor pointer${b.port ? "" : " inactive"}" style="font-size:.9em"></span>
</div>
<span data-tip="Edit burg" class="icon-pencil"></span>
@ -226,7 +207,6 @@ function overviewBurgs() {
function toggleBurgLockStatus() {
const burgId = +this.parentNode.dataset.id;
<<<<<<< HEAD
const burg = pack.burgs[burgId];
burg.lock = !burg.lock;
@ -241,8 +221,6 @@ function overviewBurgs() {
}
}
=======
>>>>>>> 01fbfca0 (markers - generate tool + lock tooltip)
function openBurgEditor() {
const burg = +this.parentNode.dataset.id;
editBurg(burg);
@ -435,7 +413,6 @@ function overviewBurgs() {
if (this.value === "provinces") return d.province;
};
<<<<<<< HEAD
const mapping = {
states: getStatesData,
cultures: getCulturesData,
@ -444,16 +421,6 @@ function overviewBurgs() {
};
const base = mapping[this.value]();
=======
const base =
this.value === "states"
? getStatesData()
: this.value === "cultures"
? getCulturesData()
: this.value === "parent"
? getParentData()
: getProvincesData();
>>>>>>> 01fbfca0 (markers - generate tool + lock tooltip)
burgs.forEach(b => (b.id = b.i + base.length - 1));
const data = base.concat(burgs);
@ -485,17 +452,10 @@ function overviewBurgs() {
}
function downloadBurgsData() {
<<<<<<< HEAD
let data = `Id,Burg,Province,Province Full Name,State,State Full Name,Culture,Religion,Population,Latitude,Longitude,Elevation (${heightUnit.value}),Capital,Port,Citadel,Walls,Plaza,Temple,Shanty Town`; // headers
if (options.showMFCGMap) data += `,City Generator Link`;
data += "\n";
=======
let data =
"Id,Burg,Province,Province Full Name,State,State Full Name,Culture,Religion,Population,Longitude,Latitude,Elevation (" +
heightUnit.value +
"),Capital,Port,Citadel,Walls,Plaza,Temple,Shanty Town\n"; // headers
>>>>>>> 01fbfca0 (markers - generate tool + lock tooltip)
const valid = pack.burgs.filter(b => b.i && !b.removed); // all valid burgs
valid.forEach((b) => {

View file

@ -295,7 +295,6 @@ function getBurgSeed(burg) {
return burg.MFCG || Number(`${seed}${String(burg.i).padStart(4, 0)}`);
}
<<<<<<< HEAD
function getMFCGlink(burg) {
if (burg.link) return burg.link;
@ -357,8 +356,6 @@ function getMFCGlink(burg) {
return url.toString();
}
=======
>>>>>>> 01fbfca0 (markers - generate tool + lock tooltip)
// draw legend box
function drawLegend(name, data) {
legend.selectAll('*').remove(); // fully redraw every time
@ -472,7 +469,7 @@ function clearLegend() {
}
// draw color (fill) picker
function createPicker(hatching) {
function createPicker() {
const COLORS_IN_ROW = 14;
const pos = () => tip("Drag to change the picker position");
const cl = () => tip("Click to close the picker");

View file

@ -74,13 +74,8 @@ function showElementLockTip(event) {
}
}
<<<<<<< HEAD
const onMouseMove = debounce(handleMouseMove, 100);
function handleMouseMove() {
=======
const moved = debounce(mouseMove, 100);
function mouseMove() {
>>>>>>> 01fbfca0 (markers - generate tool + lock tooltip)
const point = d3.mouse(this);
const i = findCell(point[0], point[1]); // pack cell id
if (i === undefined) return;
@ -126,15 +121,11 @@ function showMapTooltip(point, e, i, g) {
if (group === "emblems" && e.target.tagName === "use") {
const parent = e.target.parentNode;
const [g, type] =
<<<<<<< HEAD
parent.id === "burgEmblems"
? [pack.burgs, "burg"]
: parent.id === "provinceEmblems"
? [pack.provinces, "province"]
: [pack.states, "state"];
=======
parent.id === "burgEmblems" ? [pack.burgs, "burg"] : parent.id === "provinceEmblems" ? [pack.provinces, "province"] : [pack.states, "state"];
>>>>>>> 01fbfca0 (markers - generate tool + lock tooltip)
const i = +e.target.dataset.i;
if (event.shiftKey) highlightEmblemElement(type, g[i]);

View file

@ -1461,3 +1461,4 @@ function editHeightmap(options) {
};
}
}
}

View file

@ -338,3 +338,4 @@ function editRoute(onClick) {
unselect();
}
}
}