mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 12:01:23 +01:00
slightly optimize onZoom
This commit is contained in:
parent
a06e55d618
commit
929d85a335
5 changed files with 4 additions and 22 deletions
|
|
@ -792,19 +792,6 @@ window.BurgsAndStates = (function () {
|
||||||
.sort((a, b) => a.start - b.start);
|
.sort((a, b) => a.start - b.start);
|
||||||
};
|
};
|
||||||
|
|
||||||
const wars = {War: 6, Conflict: 2, Campaign: 4, Invasion: 2, Rebellion: 2, Conquest: 2, Intervention: 1, Expedition: 1, Crusade: 1};
|
|
||||||
const generateCampaign = state => {
|
|
||||||
const neighbors = state.neighbors.length ? state.neighbors : [0];
|
|
||||||
return neighbors
|
|
||||||
.map(i => {
|
|
||||||
const name = i && P(0.8) ? pack.states[i].name : Names.getCultureShort(state.culture);
|
|
||||||
const start = gauss(options.year - 100, 150, 1, options.year - 6);
|
|
||||||
const end = start + gauss(4, 5, 1, options.year - start - 1);
|
|
||||||
return {name: getAdjective(name) + " " + rw(wars), start, end};
|
|
||||||
})
|
|
||||||
.sort((a, b) => a.start - b.start);
|
|
||||||
};
|
|
||||||
|
|
||||||
// generate historical conflicts of each state
|
// generate historical conflicts of each state
|
||||||
const generateCampaigns = function () {
|
const generateCampaigns = function () {
|
||||||
pack.states.forEach(s => {
|
pack.states.forEach(s => {
|
||||||
|
|
|
||||||
|
|
@ -383,7 +383,7 @@ function editBurg(id) {
|
||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeName() {
|
function changeName() {
|
||||||
|
|
|
||||||
|
|
@ -203,10 +203,7 @@ function editCoastline(node = d3.event.target) {
|
||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
groupEl.remove();
|
});
|
||||||
document.getElementById('coastlineGroup').selectedOptions[0].remove();
|
|
||||||
document.getElementById('coastlineGroup').value = 'sea_island';
|
|
||||||
};
|
|
||||||
confirmationDialog({title: 'Remove coastline group', message, confirm: 'Remove', onConfirm});
|
confirmationDialog({title: 'Remove coastline group', message, confirm: 'Remove', onConfirm});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -401,3 +401,4 @@ function editLabel() {
|
||||||
unselect();
|
unselect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
@ -235,10 +235,7 @@ function editLake() {
|
||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
groupEl.remove();
|
});
|
||||||
document.getElementById('lakeGroup').selectedOptions[0].remove();
|
|
||||||
document.getElementById('lakeGroup').value = 'freshwater';
|
|
||||||
};
|
|
||||||
confirmationDialog({title: 'Remove lake group', message, confirm: 'Remove', onConfirm});
|
confirmationDialog({title: 'Remove lake group', message, confirm: 'Remove', onConfirm});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue