Windows build

This commit is contained in:
2026-11-22 19:49:50 -03:00
parent ed6f5fe0df
commit cbd662dc2a
12 changed files with 625 additions and 16 deletions
+3 -3
View File
@@ -69,7 +69,7 @@ function ask<T extends string | boolean>(question: (id: number) => ClientMessage
return new Promise((resolve) => asking.set(id, resolve as (answer: string | boolean) => void));
}
function native_platform(page: URL, stored: Record<string, string>): Platform {
function native_platform(page: URL, stored: Record<string, string>, credits: string | undefined): Platform {
const storage = new Map(Object.entries(stored));
return {
page,
@@ -104,7 +104,7 @@ function native_platform(page: URL, stored: Record<string, string>): Platform {
const title = `Join ${address.base.host}?`;
return ask((id) => ({ type: "ask", id, title, text, yes: "Join", no: "Cancel" }));
},
credits_screen: (on_back) => new TextCreditsScreen(on_back),
credits_screen: (on_back) => new TextCreditsScreen(on_back, credits),
read_clipboard: () => ask((id) => ({ type: "read_clipboard", id })),
write_clipboard(text) {
post({ type: "write_clipboard", text });
@@ -133,7 +133,7 @@ function native_platform(page: URL, stored: Record<string, string>): Platform {
}
async function start(message: Extract<WindowMessage, { type: "start" }>) {
set_platform(native_platform(new URL(message.page), message.storage));
set_platform(native_platform(new URL(message.page), message.storage, message.credits));
const { surface: handles, width, height } = message;
const surface = new Deno.UnsafeWindowSurface({
system: handles.system,