快捷键

This commit is contained in:
AncTe committed 2023-08-08 16:44:43 +08:00
1 parent 05ed15c0a6
commit e6148ae7fe
5 files changed
+240 -17

No files matched your search

+16
View File
@@ -270,3 +270,19 @@ export function deleteWith<T>(arr: T[], ele: T): T[] {
arr.splice(index, 1);
return arr;
}
export async function triggerFullscreen(full: boolean) {
const { maxGameScale } = core.plugin.utils;
if (!!document.fullscreenElement && !full) {
await document.exitFullscreen();
requestAnimationFrame(() => {
maxGameScale(1);
});
}
if (full && !document.fullscreenElement) {
await document.body.requestFullscreen();
requestAnimationFrame(() => {
maxGameScale();
});
}
}