mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
Zone filter (#728)
* Adding zone type dropdown to index.html * added zone type filter to zones-editor.js * zoneTypes dialog add and delete types, dialog * filtering types * correct filter button and prompt The filter button now works on click with an added zonesEditorAddLines(); on function toggleFilterTable(). If the table is empty, a message appears on a line giving advice. * Amount of types and fixes Fixed some spacing in zoneTypes dialog, and made a count for the amount of zones per type. * Minor changes for zone types * dialog for types on a button New button for the zone Types dialog. * typo in index.html * update on click add type Co-authored-by: Evolvedexperiment <evolvedexperiment@gmail.com> Co-authored-by: Azgaar <maxganiev@yandex.ru>
This commit is contained in:
parent
ca2716a5c4
commit
8e7ccbd50d
3 changed files with 165 additions and 3 deletions
9
main.js
9
main.js
|
|
@ -122,6 +122,7 @@ let customization = 0;
|
|||
|
||||
let biomesData = applyDefaultBiomesSystem();
|
||||
let nameBases = Names.getNameBases(); // cultures-related data
|
||||
const zoneTypes = ["Invasion", "Rebels", "Proselytism", "Crusade", "Disease", "Disaster"];
|
||||
|
||||
let color = d3.scaleSequential(d3.interpolateSpectral); // default color scheme
|
||||
const lineGen = d3.line().curve(d3.curveBasis); // d3 line generator with default curve interpolation
|
||||
|
|
@ -1871,6 +1872,14 @@ function addZones(number = 1) {
|
|||
TIME && console.timeEnd("addZones");
|
||||
}
|
||||
|
||||
// Update zone types
|
||||
function updateZoneType(zoneId, newType) {
|
||||
const zone = document.getElementById(zoneId);
|
||||
if (zone) {
|
||||
zone.dataset.type = newType;
|
||||
}
|
||||
}
|
||||
|
||||
// show map stats on generation complete
|
||||
function showStatistics() {
|
||||
const template = templateInput.options[templateInput.selectedIndex].text;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue