mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-24 04:51:24 +01:00
Town Promotion to largetown
This commit is contained in:
parent
2cec7e930b
commit
eb4900446d
5 changed files with 39 additions and 19 deletions
|
|
@ -39,7 +39,7 @@ const generateSubmap = debounce(async function () {
|
|||
|
||||
depressRivers: checked("submapDepressRivers"),
|
||||
addLakesInDepressions: checked("submapAddLakeInDepression"),
|
||||
promoteTown: checked("submapPromoteTown"),
|
||||
promoteTowns: checked("submapPromoteTowns"),
|
||||
smoothHeightMap: scale > 2,
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ const generateSubmap = debounce(async function () {
|
|||
customization = 0;
|
||||
|
||||
undraw();
|
||||
resetZoom(1000);
|
||||
resetZoom(0);
|
||||
let oldstate = {
|
||||
grid: _.cloneDeep(grid),
|
||||
pack: _.cloneDeep(pack),
|
||||
|
|
@ -77,7 +77,15 @@ const generateSubmap = debounce(async function () {
|
|||
};
|
||||
|
||||
try {
|
||||
const oldScale = scale;
|
||||
await Submap.resample(oldstate, projection, options);
|
||||
if (options.promoteTowns) {
|
||||
const groupName = 'largetowns';
|
||||
moveAllBurgsToGroup('towns', groupName);
|
||||
changeRadius(oldScale * 0.8, groupName);
|
||||
changeFontSize(svg.select(`#labels #${groupName}`), oldScale*2);
|
||||
invoceActiveZooming();
|
||||
}
|
||||
} catch (error) {
|
||||
generateSubmapErrorHandler(error, oldstate, projection, options);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue