The autotile asset is renamed to tile and gains a plain None (1 × 1) kind, which is now the default; older projects load their autotiles as floor tiles (#131)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a65132bb5a
commit
732f6518ae
35 files changed
+786
-617
No files matched your search
+15
-15
@@ -1,10 +1,10 @@
|
||||
import { colourDistance } from '../lib/harness.mjs';
|
||||
import { LANES, openTab, pickAssetType } from './lib/scaffold.mjs';
|
||||
import { quadColour } from './39-autotile.mjs';
|
||||
import { quadColour } from './39-tile.mjs';
|
||||
|
||||
/**
|
||||
* Tilemaps (#128): a placed grid painted with the autotiles of step 39, which is where the sheet
|
||||
* and the `at-grass` autotile come from – this step needs it and is run after it.
|
||||
* Tilemaps (#128): a placed grid painted with the tiles of step 39, which is where the sheet
|
||||
* and the `at-grass` tile come from – this step needs it and is run after it.
|
||||
*
|
||||
* The point of the checks below is that a painted cell really shows the quarters its neighbours
|
||||
* call for: they read pixels off the scene view, because everything between the model and the
|
||||
@@ -101,28 +101,28 @@ export async function tilemap(t) {
|
||||
await select({ kind: 'object', holderId: 'scene1', objectIds: [MAP_OBJECT], objectId: MAP_OBJECT });
|
||||
await settle();
|
||||
|
||||
// 40b. The inspector paints: a tool, the autotiles of the project, the layers.
|
||||
// 40b. The inspector paints: a tool, the tiles of the project, the layers.
|
||||
const section = await json(
|
||||
'(() => ({ tools: __gm.tilemap.toolAt("brush") !== null, grass: __gm.tilemap.autotileAt("at-grass") !== null,' +
|
||||
'(() => ({ tools: __gm.tilemap.toolAt("brush") !== null, grass: __gm.tilemap.tileButtonAt("at-grass") !== null,' +
|
||||
' layers: (__gm.tilemap.layerRowAt(0) || {}).id }))()',
|
||||
);
|
||||
check(
|
||||
'a selected tilemap offers tools, autotiles and layers in the inspector',
|
||||
'a selected tilemap offers tools, tiles and layers in the inspector',
|
||||
section.tools && section.grass && Boolean(section.layers),
|
||||
JSON.stringify(section),
|
||||
);
|
||||
// Clicked through the hook rather than by its text: the autotile's own row in the asset panel
|
||||
// reads "Grass" as well, and a click there would only select the autotile.
|
||||
// Clicked through the hook rather than by its text: the tile's own row in the asset panel
|
||||
// reads "Grass" as well, and a click there would only select the tile.
|
||||
check(
|
||||
'the autotile can be picked in the section',
|
||||
await clickInInspector(t, '__gm.tilemap.autotileAt("at-grass")'),
|
||||
'the tile can be picked in the section',
|
||||
await clickInInspector(t, '__gm.tilemap.tileButtonAt("at-grass")'),
|
||||
JSON.stringify(await json('__gm.inspectorRect()')),
|
||||
);
|
||||
await settle();
|
||||
const paint = await json('__gm.tilemap.paint()');
|
||||
check(
|
||||
'picking an autotile reaches for the brush by itself',
|
||||
paint.autotileId === 'at-grass' && paint.tool === 'brush',
|
||||
'picking a tile reaches for the brush by itself',
|
||||
paint.tileId === 'at-grass' && paint.tool === 'brush',
|
||||
JSON.stringify(paint),
|
||||
);
|
||||
|
||||
@@ -197,10 +197,10 @@ export async function tilemap(t) {
|
||||
);
|
||||
await settle();
|
||||
|
||||
// 40f. One mesh per autotile, not one per cell – the whole point of drawing it as a mesh.
|
||||
// 40f. One mesh per tile, not one per cell – the whole point of drawing it as a mesh.
|
||||
const drawn = await json(`__gm.tilemap.info(${JSON.stringify(MAP_OBJECT)})`);
|
||||
check(
|
||||
'nine cells of one autotile are one draw call',
|
||||
'nine cells of one tile are one draw call',
|
||||
drawn.tiles === 9 && drawn.drawCalls === 1 && drawn.layers === 1,
|
||||
JSON.stringify(drawn),
|
||||
);
|
||||
@@ -229,7 +229,7 @@ export async function tilemap(t) {
|
||||
layers.length === 2 && layers[1].cells === 0,
|
||||
JSON.stringify(layers),
|
||||
);
|
||||
await clickInInspector(t, '__gm.tilemap.autotileAt("at-grass")');
|
||||
await clickInInspector(t, '__gm.tilemap.tileButtonAt("at-grass")');
|
||||
await settle();
|
||||
const above = await json(`__gm.tilemap.cellAt(${JSON.stringify(MAP_OBJECT)}, 4, 0)`);
|
||||
await click(above.x, above.y);
|
||||
|
||||
Reference in new issue
Block a user