Drop the collider and delete-node buttons from the inspector
Adding a collider now lives only in the Scene objects context menu, deleting a node on the Delete key and the node context menu. The e2e checks that pinned the inspector button now drive the hierarchy menu instead, including that its entry is disabled on template content and on a placed container without raising a notice. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0dcb3b4432
commit
5f8a308d62
7 files changed
+48
-36
No files matched your search
@@ -296,12 +296,33 @@ export async function containers(t) {
|
||||
|
||||
// 16i. Structure is the template's business: resolved content cannot be removed, re-parented,
|
||||
// given a collider or turned into a container of its own.
|
||||
await selectObject(redA);
|
||||
check('the inspector offers no collider for resolved content', !(await has('+ Add collider')));
|
||||
await selectObject(instanceA.id);
|
||||
// The hierarchy menu is the only way to a collider, and a disabled entry must not even reach
|
||||
// the command: the command refuses too, but with a notice.
|
||||
const colliderFromMenu = async (id) => {
|
||||
await selectObject(id);
|
||||
const row = await json(`__gm.hierarchyRow(${JSON.stringify(id)})`);
|
||||
const before = (await objects()).length;
|
||||
const noticeNow = await notice();
|
||||
await click(row.x, row.y, 'right');
|
||||
await sleep(150);
|
||||
await clickText('Add collider');
|
||||
await sleep(200);
|
||||
await press('Escape');
|
||||
await sleep(100);
|
||||
return { added: (await objects()).length - before, notice: await noticeNow() };
|
||||
};
|
||||
const refused = JSON.stringify({ added: 0, notice: '' });
|
||||
const fromContent = await colliderFromMenu(redA);
|
||||
check(
|
||||
'nor for the placed container itself, which the command refuses as the hierarchy menu does',
|
||||
!(await has('+ Add collider')),
|
||||
'the menu offers no collider for resolved content',
|
||||
JSON.stringify(fromContent) === refused,
|
||||
JSON.stringify(fromContent),
|
||||
);
|
||||
const fromInstance = await colliderFromMenu(instanceA.id);
|
||||
check(
|
||||
'nor for the placed container itself',
|
||||
JSON.stringify(fromInstance) === refused,
|
||||
JSON.stringify(fromInstance),
|
||||
);
|
||||
const plainId = await json(`(() => {
|
||||
const p = __gm.state.project;
|
||||
@@ -311,11 +332,15 @@ export async function containers(t) {
|
||||
return sprite ? sprite.id : null;
|
||||
})()`);
|
||||
await selectObject(plainId);
|
||||
check('the inspector has no collider button of its own', !(await has('+ Add collider')));
|
||||
const fromPlain = await colliderFromMenu(plainId);
|
||||
check(
|
||||
'while a plain sprite still gets it',
|
||||
Boolean(plainId) && (await has('+ Add collider')),
|
||||
JSON.stringify({ plainId }),
|
||||
'while a plain sprite still gets one from the menu',
|
||||
fromPlain.added === 1,
|
||||
JSON.stringify(fromPlain),
|
||||
);
|
||||
await undo();
|
||||
await sleep(200);
|
||||
await selectObject(redA);
|
||||
let noticeAfter = await notice();
|
||||
await press('Delete');
|
||||
|
||||
Reference in new issue
Block a user