Skip to content

Commit

Permalink
fix(Menu): fix on Steam beta
Browse files Browse the repository at this point in the history
  • Loading branch information
AAGaming00 committed Nov 5, 2022
1 parent e44187f commit 82768e0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/deck-components/Menu.tsx
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down Expand Up @@ -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];
}
}
Expand All @@ -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];
}
}
Expand Down

0 comments on commit 82768e0

Please sign in to comment.