Fix MIST gallery scene controls, video positioning and audio overlap
CI / frontend (push) Failing after 20s
CI / backend (push) Failing after 36s

This commit is contained in:
mrleo1nid committed 2026-10-27 16:14:13 +03:00
1 parent 19924e1c5a
commit 4dc660f786
10 files changed
+197 -12

No files matched your search

+17 -5
View File
@@ -1400,6 +1400,19 @@ export class ScreenManager {
const sensitive = props.sensitive ? truthy(this.ev(props.sensitive)) && this.actionSensitive(action) : this.actionSensitive(action);
const selected = props.selected ? truthy(this.ev(props.selected)) : this.actionSelected(action);
let hover = false;
// Keep every state in the same grid cell. Replacing the idle image with an
// unloaded hover image collapses the hit area and causes enter/leave loops.
const pictures = new Map<any, HTMLElement>();
if (images) for (const file of Object.values(images)) {
if (!file || pictures.has(file)) continue;
const picture = this.displayable(file);
if (!picture) continue;
picture.classList.add("pg-simg");
picture.style.gridArea = "1 / 1";
picture.style.pointerEvents = "none";
pictures.set(file, picture);
el.append(picture);
}
const paint = () => {
const state = !sensitive ? (selected ? "selected_insensitive" : "insensitive")
: selected ? (hover ? "selected_hover" : "selected_idle") : hover ? "hover" : "idle";
@@ -1409,10 +1422,7 @@ export class ScreenManager {
}
el.dataset.state = state;
if (images) {
const file = images[state];
const picture = file ? this.displayable(file) : null;
el.replaceChildren(...(picture ? [picture] : []));
picture?.classList.add("pg-simg");
for (const [file, picture] of pictures) picture.style.opacity = file === images[state] ? "1" : "0";
} else {
this.look(el, props, state);
if (label) this.textLook(label, { ...props, ...Object.fromEntries(Object.entries(textProps).map(([k, v]) => [k, v])) }, state);
@@ -1741,7 +1751,9 @@ export class ScreenManager {
/** Run what a widget's `action` evaluated to. */
run(action: any, screen: Instance | null) {
if (this.suspended) return;
// Absent hover actions must not rebuild the button under the pointer:
// its replacement would receive mouseenter again and replay hover_sound.
if (this.suspended || action === null || action === undefined || action === false) return;
// actions act on the game, not on the screen's own variable scope
const { py } = this.host;
const savedFn = py.fn;