-
Notifications
You must be signed in to change notification settings - Fork 3
fix(map): transparent spaces in art overlays and register missing tiles #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
d7f33fb
4874216
3c30ebb
74a2183
d7e117b
235179c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,6 +59,10 @@ const TILES = { | |
| o: { id: 'rock', name: 'una piedra', solid: true }, | ||
| t: { id: 'tree', name: 'un arbol', solid: true }, | ||
| '~': { id: 'water', name: 'el agua', solid: true }, | ||
| ' ': { id: 'building', name: 'un edificio', solid: true }, | ||
| '=': { id: 'wall', name: 'una pared', solid: true }, | ||
| "'": { id: 'ornament', name: 'un adorno', solid: true }, | ||
| H: { id: 'ornament', name: 'un adorno', solid: true }, | ||
|
|
||
| C: { id: 'door.home', name: 'tu casa', solid: false, enter: { kind: 'home' } }, | ||
| I: { id: 'door.church', name: 'la iglesia', solid: false, enter: { kind: 'church' } }, | ||
|
|
@@ -750,7 +754,11 @@ function makeHighResolutionCityRows() { | |
| } | ||
| } | ||
| const write = (x, y, text) => { | ||
| for (let i = 0; i < String(text).length; i++) set(x + i, y, String(text)[i]) | ||
| for (let i = 0; i < String(text).length; i++) { | ||
| const ch = String(text)[i] | ||
| if (ch === ' ') continue | ||
| set(x + i, y, ch) | ||
| } | ||
| } | ||
|
gitar-bot[bot] marked this conversation as resolved.
|
||
| const centred = (x, y, w, text) => write(x + Math.floor((w - String(text).length) / 2), y, text) | ||
| const border = (x, y, w, h, horizontal = '-', vertical = '|') => { | ||
|
|
@@ -1094,7 +1102,14 @@ function makeHighResolutionCityRows() { | |
| ' /~~~~~~~~~~~~~~~~~~~~\\ ', | ||
| ' \\____________________/ ' | ||
| ] | ||
| for (let row = 0; row < art.length; row++) write(x, y + row, art[row]) | ||
| for (let row = 0; row < art.length; row++) { | ||
| const first = art[row].search(/\S/) | ||
| if (first === -1) continue | ||
| let last = art[row].length - 1 | ||
| while (last > first && art[row][last] === ' ') last-- | ||
| fill(x + first, y + row, last - first + 1, 1, ' ') | ||
| write(x, y + row, art[row]) | ||
| } | ||
| } | ||
|
|
||
| const market = (x, y, w) => { | ||
|
|
@@ -1155,7 +1170,13 @@ function makeHighResolutionCityRows() { | |
| write(lx, ly + 1, '|*') | ||
| } | ||
| for (let row = 0; row < PLAZA_FOUNTAIN.art.length; row++) { | ||
| write(PLAZA_FOUNTAIN.x, PLAZA_FOUNTAIN.y + row, PLAZA_FOUNTAIN.art[row]) | ||
| const artRow = PLAZA_FOUNTAIN.art[row] | ||
| const first = artRow.search(/\S/) | ||
| if (first === -1) continue | ||
| let last = artRow.length - 1 | ||
| while (last > first && artRow[last] === ' ') last-- | ||
| fill(PLAZA_FOUNTAIN.x + first, PLAZA_FOUNTAIN.y + row, last - first + 1, 1, ' ') | ||
| write(PLAZA_FOUNTAIN.x, PLAZA_FOUNTAIN.y + row, artRow) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -1515,7 +1536,13 @@ function makeRunaCapitalRows() { | |
| set(tx, ty - 1, '*') | ||
| } | ||
| for (let row = 0; row < PLAZA_FOUNTAIN.art.length; row++) { | ||
| write(PLAZA_FOUNTAIN.x, PLAZA_FOUNTAIN.y + row, PLAZA_FOUNTAIN.art[row]) | ||
| const artRow = PLAZA_FOUNTAIN.art[row] | ||
| const first = artRow.search(/\S/) | ||
| if (first === -1) continue | ||
| let last = artRow.length - 1 | ||
| while (last > first && artRow[last] === ' ') last-- | ||
| fill(PLAZA_FOUNTAIN.x + first, PLAZA_FOUNTAIN.y + row, last - first + 1, 1, ' ') | ||
| write(PLAZA_FOUNTAIN.x, PLAZA_FOUNTAIN.y + row, artRow) | ||
| } | ||
|
Comment on lines
1538
to
1546
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.