Let the example-game smokes read texts in the game again
Since 89aa92d (#169) a text in the game is drawn as a picture of its
glyphs on a sprite mesh, not as a Pixi `Text`. The test hook
`__gm.locate` only looked for `Text` nodes, so every game text was
invisible to it. The smokes have been red in CI since then (tasks 385
to 395): 5 checks in jumprun, 1 in tetris. The e2e part stayed green,
because it reads editor labels only.
- `textPicture.ts` remembers, per mesh, the text a `TextPicture`
shows, and hands it out through `pictureText(node)`.
- `textProbe.eachText` reads both kinds and passes the text as a
string instead of the Pixi node. `locate`, `locateAll` and
`overlayTexts` use that string.
Tests:
- ./check.sh: 195 files, 2815 tests, CHECK EXIT 0
- smoke-jumprun: ALL PASSED, 24 checks
- smoke-tetris: ALL PASSED, 19 checks
- full e2e run (local): ALL PASSED, 1580 checks, the sum is unchanged
although `locate` now also sees texts in the scene
- counter-check: CI task 395 with the old code, same checks, 6 red
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cab1c0177f
commit
dded62b9f9
3 files changed
+26
-8
No files matched your search
@@ -64,8 +64,8 @@ export function uiHooks({ app, state, editor }: HookContext) {
|
||||
*/
|
||||
const overlayTexts = (): string[] => {
|
||||
const out: string[] = [];
|
||||
eachText(ui().overlay, (node) => {
|
||||
if (node.text) out.push(node.text);
|
||||
eachText(ui().overlay, (text) => {
|
||||
if (text) out.push(text);
|
||||
});
|
||||
return out;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user