The + menu holds fourteen types now, so scrolling one into view belongs to the scaffold (#91)
game-maker / suite (push) Successful in 10m31s
game-maker / suite (push) Successful in 10m31s
`Variables` pushed `Font` under the menu's mask edge: `locate` still finds the entry, a click there lands on nothing, `__gm.fontPicker()` is null and reading `.captions` throws. Only step 31 carried the scroll workaround, so step 30 fell. The helper moves to `lib/scaffold.mjs` as `pickAssetType()` and both steps use it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
98fa9907fd
commit
80dd82349d
3 files changed
+26
-23
No files matched your search
@@ -129,3 +129,24 @@ export async function openTab(t, tab) {
|
||||
await t.clickText(TAB_LABELS[tab]);
|
||||
await t.sleep(400);
|
||||
}
|
||||
|
||||
/**
|
||||
* Picks an asset type from the already-open `+` menu. The menu has one entry per type and scrolls
|
||||
* past 320 px, so the last of them sit under the mask: `locate` still finds them, but a click there
|
||||
* lands on nothing. The fourteenth type (`Variables`, #91) pushed `Font` under that edge and took
|
||||
* step 30 down with it, because only step 31 had scrolled first.
|
||||
*/
|
||||
export async function pickAssetType(t, label) {
|
||||
const box = await t.json('__gm.overlayRect()');
|
||||
let p = await t.locate(label, true);
|
||||
let scrolled = false;
|
||||
if (box && (!p || p.y > box.y + box.h - 4)) {
|
||||
await t.wheel(box.x + box.w / 2, box.y + box.h / 2, 300);
|
||||
await t.sleep(250);
|
||||
p = await t.locate(label, true);
|
||||
scrolled = true;
|
||||
}
|
||||
await t.click(p.x, p.y);
|
||||
await t.sleep(250);
|
||||
return { box, p, scrolled };
|
||||
}
|
||||
Reference in new issue
Block a user