mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-20 02:51:23 +01:00
feat: submap - allow custom number of cells
This commit is contained in:
parent
f587805da9
commit
0bd331f564
3 changed files with 35 additions and 29 deletions
|
|
@ -332,16 +332,12 @@ const cellsDensityMap = {
|
|||
|
||||
function changeCellsDensity(value) {
|
||||
pointsInput.value = value;
|
||||
const cells = cellsDensityMap[value] || 1000;
|
||||
const cells = cellsDensityMap[value] || pointsInput.dataset.cells;
|
||||
pointsInput.dataset.cells = cells;
|
||||
pointsOutputFormatted.value = getCellsDensityValue(cells);
|
||||
pointsOutputFormatted.value = cells / 1000 + "K";
|
||||
pointsOutputFormatted.style.color = getCellsDensityColor(cells);
|
||||
}
|
||||
|
||||
function getCellsDensityValue(cells) {
|
||||
return cells / 1000 + "K";
|
||||
}
|
||||
|
||||
function getCellsDensityColor(cells) {
|
||||
return cells > 50000 ? "#b12117" : cells !== 10000 ? "#dfdf12" : "#053305";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue