2022-10-24 20:33:40 -04:00
|
|
|
export * from './patcher';
|
|
|
|
|
export * from './react';
|
2022-09-04 13:29:36 -04:00
|
|
|
|
|
|
|
|
export function joinClassNames(...classes: string[]): string {
|
2022-10-24 20:33:40 -04:00
|
|
|
return classes.join(' ');
|
2022-09-04 13:29:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function sleep(ms: number) {
|
2022-10-24 20:33:40 -04:00
|
|
|
return new Promise((res) => setTimeout(res, ms));
|
2022-10-23 20:22:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2022-10-24 20:45:01 -04:00
|
|
|
* Finds the SP window, since it is a render target as of 10-19-2022's beta
|
2022-10-23 20:22:00 -04:00
|
|
|
*/
|
|
|
|
|
export function findSP(): Window {
|
2022-10-24 20:33:40 -04:00
|
|
|
// old (SP as host)
|
|
|
|
|
if (document.title == 'SP') return window;
|
|
|
|
|
// new (SP as popup)
|
|
|
|
|
return FocusNavController.m_ActiveContext.m_rgGamepadNavigationTrees.find((x: any) => x.m_ID == 'root_1_').Root
|
|
|
|
|
.Element.ownerDocument.defaultView;
|
|
|
|
|
}
|