Preact: Support |popup||wide|

Fixes #2567
This commit is contained in:
Guangcong Luo
2026-05-24 01:21:41 -07:00
parent 600833335c
commit 6f42ca2153

View File

@@ -169,7 +169,7 @@ export class MainMenuRoom extends PSRoom {
this.parseFormats(args);
return;
} case 'popup': {
const [, message] = args;
let [, message] = args;
for (const roomid in PS.rooms) {
const room = PS.rooms[roomid] as ChatRoom | MainMenuRoom;
if (room.teamSent) {
@@ -178,7 +178,12 @@ export class MainMenuRoom extends PSRoom {
}
if (room.type === 'team') (room as any).cancelUpload();
}
PS.alert(message.replace(/\|\|/g, '\n'));
let width: number | undefined;
if (message.startsWith('|wide|')) {
message = message.slice(6);
width = 960;
}
PS.alert(message.replace(/\|\|/g, '\n'), { width });
return;
}
}