mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-19 17:40:08 +02:00
fix(Menu): fix on Steam beta
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { FC, ReactNode } from 'react';
|
||||
|
||||
import { fakeRenderComponent } from '../utils';
|
||||
import { findModuleChild } from '../webpack';
|
||||
|
||||
export const showContextMenu: (children: ReactNode, parent?: EventTarget) => void = findModuleChild((m) => {
|
||||
@@ -38,7 +39,11 @@ export const MenuGroup: FC<MenuGroupProps> = findModuleChild((m) => {
|
||||
if (typeof m !== 'object') return undefined;
|
||||
|
||||
for (let prop in m) {
|
||||
if (m[prop]?.prototype?.RenderSubMenu && m[prop]?.prototype?.ShowSubMenu) {
|
||||
if (
|
||||
(m[prop]?.toString()?.includes('bInGamepadUI:') &&
|
||||
fakeRenderComponent(() => m[prop]())?.type?.prototype?.RenderSubMenu) ||
|
||||
(m[prop]?.prototype?.RenderSubMenu && m[prop]?.prototype?.ShowSubMenu)
|
||||
) {
|
||||
return m[prop];
|
||||
}
|
||||
}
|
||||
@@ -54,7 +59,10 @@ export const MenuItem: FC<MenuItemProps> = findModuleChild((m) => {
|
||||
if (typeof m !== 'object') return undefined;
|
||||
|
||||
for (let prop in m) {
|
||||
if (m[prop]?.prototype?.OnOKButton && m[prop]?.prototype?.OnMouseEnter) {
|
||||
if (
|
||||
m[prop]?.render?.toString()?.includes('bPlayAudio:') ||
|
||||
(m[prop]?.prototype?.OnOKButton && m[prop]?.prototype?.OnMouseEnter)
|
||||
) {
|
||||
return m[prop];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user