mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 10:01:23 +01:00
burgs placement change + resource style
This commit is contained in:
parent
dc6528665a
commit
b7545d2805
6 changed files with 687 additions and 479 deletions
|
|
@ -1655,6 +1655,7 @@ function toggleResources(event) {
|
|||
function drawResources() {
|
||||
console.time('drawResources');
|
||||
const someArePinned = pack.resources.some((resource) => resource.pinned);
|
||||
const drawCircle = +goods.attr('data-circle');
|
||||
|
||||
let resourcesHTML = '';
|
||||
for (const i of pack.cells.i) {
|
||||
|
|
@ -1664,11 +1665,17 @@ function drawResources() {
|
|||
const [x, y] = pack.cells.p[i];
|
||||
const stroke = Resources.getStroke(resource.color);
|
||||
|
||||
if (!drawCircle) {
|
||||
resourcesHTML += `<use href="#${resource.icon}" x="${x - 3}" y="${y - 3}" width="6" height="6"/>`;
|
||||
continue;
|
||||
}
|
||||
|
||||
resourcesHTML += `<g>
|
||||
<circle data-i="${resource.i}" cx=${x} cy=${y} r="3" fill="${resource.color}" stroke="${stroke}" />
|
||||
<use href="#${resource.icon}" x="${x - 3}" y="${y - 3}" width="6" height="6"/>
|
||||
</g>`;
|
||||
}
|
||||
|
||||
goods.html(resourcesHTML);
|
||||
console.timeEnd('drawResources');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue