Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions Backend/scripting/runtimes/js/client_architect.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ test("your own models are in Props' Yours folder; a prop takes one of your mater
});
editor.open();
editor.useMode('props');
editor.pressFolder(7);
editor.pressFolder(8);
// The textures drawn by code come first (New stone blocks ...), then your models.
const names = editor.items().map((item) => item.name);
assert.equal(names.at(-1), 'stall');
Expand Down Expand Up @@ -2699,7 +2699,7 @@ test("Yours' New ... tiles make a material of that kind under the next free name
});
editor.random = () => 0.25;
editor.useMode('props');
editor.pressFolder(7);
editor.pressFolder(8);
const index = editor.items().findIndex((item) => item.name === 'New plaster');
editor.pressTile(index);
const paths = calls
Expand Down Expand Up @@ -5345,6 +5345,32 @@ test('the catalogue offers the prefabs people use, and says which models are onl
);
});

test("the catalogue offers the level designers' paving, road and bank pieces", () => {
const { Catalogue } = require('../../../../Client/resources/architect/catalogue.cjs');
const catalogue = new Catalogue({
prefabNames: () => [],
vegetationKinds: () => [],
propMeshes: () => [
'objects/intermediates/walltool/stone_pavement_normal.cgf',
'objects/intermediates/walltool/curb_garden_straight_a.cgf',
'objects/intermediates/cestool/road_country_big_corner60l_a.cgf',
'objects/intermediates/poses/bag_pick.cgf',
'objects/intermediates/dimension_references/dimref_anvil.cgf',
],
});
assert.deepEqual(
catalogue
.entries('ground_pieces')
.map((entry) => entry.name)
.sort(),
[
'objects/intermediates/cestool/road_country_big_corner60l_a.cgf',
'objects/intermediates/walltool/curb_garden_straight_a.cgf',
'objects/intermediates/walltool/stone_pavement_normal.cgf',
],
);
});

test('an export builds the prefabs people use as smart objects and whole ladders climbable', () => {
const vm = require('node:vm');
const { serverScript } = require('../../../../Client/resources/architect/server_export.cjs');
Expand Down
10 changes: 10 additions & 0 deletions Client/resources/architect/catalogue.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ const CATEGORIES_LIST = [
source: 'prop',
match: (path) => path.startsWith('objects/manmade/structures/'),
},
// The level designers' kit pieces: paving and curbs (walltool), road, bank and creek pieces,
// stairs and building elements. Their poses and size references are no props to place.
{
key: 'ground_pieces',
label: 'Paving, roads, banks',
source: 'prop',
match: (path) =>
path.startsWith('objects/intermediates/') &&
!['/poses/', '/dimension_references/'].some((part) => path.includes(part)),
},
// The author's own models (Documents\KCDS\World Architect\assets, <top>/kcds/<name>/...).
{
key: 'yours',
Expand Down
12 changes: 11 additions & 1 deletion Client/resources/architect/editor.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,17 @@ const MODES = Object.freeze([
key: 'props',
label: 'Props',
icon: 'box',
folders: ['furniture', 'decorations', 'fixtures', 'goods', 'work', 'rocks', 'parts', 'yours'],
folders: [
'furniture',
'decorations',
'fixtures',
'goods',
'work',
'rocks',
'parts',
'ground_pieces',
'yours',
],
},
{
key: 'effects',
Expand Down