mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-08 13:44:30 +08:00
快捷键
This commit is contained in:
1 parent
05ed15c0a6
commit
e6148ae7fe
5 files changed
+240
-17
No files matched your search
@@ -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();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user