Turn the own mouse pointer off again after signing out and in
CI was red ond4fc425with two checks, both from this week's work. - Signing out builds the editor anew on the same renderer. The second useCursorFiles then took the SVG pointers of the first for Pixi's own styles, so switching the option off kept them. The editor now undoes the pointers on dispose and Pixi's styles are back in place. - e2e 62d still looked for "Start recording". The menu reads "Start recording…" sinceba01d14, and 62 had not run then. Tests: - e2e 45, 46 and 62 on melektaus-atx: ALL PASSED, 51 checks - Without the dispose, 46i-ii is red after 45, as it was in CI - Gate, measured together with #419 on top: 305 files, 4714 tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c425eea004
commit
f171c77f91
3 files changed
+11
-5
No files matched your search
@@ -429,7 +429,8 @@ export class Editor implements PlayHost {
|
|||||||
showBadge: (on) => this.toolbar.showRecording(on),
|
showBadge: (on) => this.toolbar.showRecording(on),
|
||||||
badgeRoom: () => this.toolbar.recordingRoom(),
|
badgeRoom: () => this.toolbar.recordingRoom(),
|
||||||
});
|
});
|
||||||
useCursorFiles(app.renderer.events, app.canvas);
|
// Undone on dispose: the next session's editor shares the renderer and must find Pixi's own styles.
|
||||||
|
this.cleanups.push(useCursorFiles(app.renderer.events, app.canvas));
|
||||||
this.play = new PlaySession(state, this);
|
this.play = new PlaySession(state, this);
|
||||||
this.editorRun = new EditorRun(state, {
|
this.editorRun = new EditorRun(state, {
|
||||||
// The game view is the one place where no key means anything to the editor, so that is where
|
// The game view is the one place where no key means anything to the editor, so that is where
|
||||||
|
|||||||
@@ -10,15 +10,20 @@ import { generalSettings, onGeneralSettings } from './generalSettings';
|
|||||||
export function useCursorFiles(events: EventSystem, canvas: HTMLCanvasElement): () => void {
|
export function useCursorFiles(events: EventSystem, canvas: HTMLCanvasElement): () => void {
|
||||||
const own = { ...events.cursorStyles };
|
const own = { ...events.cursorStyles };
|
||||||
const files = Object.fromEntries(cursorKeywords().map((keyword) => [keyword, cursorCss(keyword)]));
|
const files = Object.fromEntries(cursorKeywords().map((keyword) => [keyword, cursorCss(keyword)]));
|
||||||
const apply = (): void => {
|
const show = (custom: boolean): void => {
|
||||||
const styles = events.cursorStyles;
|
const styles = events.cursorStyles;
|
||||||
for (const keyword of Object.keys(styles)) delete styles[keyword];
|
for (const keyword of Object.keys(styles)) delete styles[keyword];
|
||||||
Object.assign(styles, own, generalSettings().customCursor ? files : {});
|
Object.assign(styles, own, custom ? files : {});
|
||||||
// Pixi sets a style only when the pointer's mode changes: the one showing now changes here.
|
// Pixi sets a style only when the pointer's mode changes: the one showing now changes here.
|
||||||
const keyword = cursorKeyword(canvas.style.cursor);
|
const keyword = cursorKeyword(canvas.style.cursor);
|
||||||
const style = styles[keyword];
|
const style = styles[keyword];
|
||||||
canvas.style.cursor = typeof style === 'string' ? style : keyword;
|
canvas.style.cursor = typeof style === 'string' ? style : keyword;
|
||||||
};
|
};
|
||||||
|
const apply = (): void => show(generalSettings().customCursor);
|
||||||
apply();
|
apply();
|
||||||
return onGeneralSettings(apply);
|
const stopListening = onGeneralSettings(apply);
|
||||||
|
return () => {
|
||||||
|
stopListening();
|
||||||
|
show(false);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
@@ -128,7 +128,7 @@ export async function devicePixels(t) {
|
|||||||
fixed.shown.w === 960 &&
|
fixed.shown.w === 960 &&
|
||||||
fixed.shown.h === 540 &&
|
fixed.shown.h === 540 &&
|
||||||
Array.isArray(rows) &&
|
Array.isArray(rows) &&
|
||||||
rows.includes('Start recording'),
|
rows.includes('Start recording…'),
|
||||||
JSON.stringify({ fixed, menu, rows }),
|
JSON.stringify({ fixed, menu, rows }),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user