mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 12:01:23 +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
3e353e98cc
commit
61d4d52589
2 changed files with 86 additions and 0 deletions
9
main.js
9
main.js
|
|
@ -158,6 +158,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
|
||||
|
|
@ -2056,6 +2057,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 heightmap = byId("templateInput").value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue