forgot shapeshifter's menu is a minigame itself

This commit is contained in:
Az committed 2026-09-12 01:27:16 -04:00
1 parent 34a4fcf69f
commit f62513a3b4
1 file changed
+2 -23
+2 -23
View File
@@ -12,22 +12,6 @@ using Object = UnityEngine.Object;
namespace MiraAPI.Hud; namespace MiraAPI.Hud;
/// <summary>
/// Component registered in Il2Cpp domain to handle Unity events for custom menus.
/// </summary>
[RegisterInIl2Cpp]
public class CustomPhoneMenuComponent(IntPtr cppPtr) : Minigame(cppPtr)
{
[SuppressMessage("Style", "IDE0051:Remove unused private members", Justification = "Unity convention.")]
private void OnDisable()
{
if (ControllerManager.Instance)
{
ControllerManager.Instance.CloseOverlayMenu(name);
}
}
}
/// <summary> /// <summary>
/// Defines an entry in a <see cref="CustomPhoneMenu"/> with a Panel. /// Defines an entry in a <see cref="CustomPhoneMenu"/> with a Panel.
/// </summary> /// </summary>
@@ -110,7 +94,7 @@ public abstract class CustomPhoneMenu : ICustomMenu
/// <summary> /// <summary>
/// Gets the wrapped component that the menu modifies. /// Gets the wrapped component that the menu modifies.
/// </summary> /// </summary>
public CustomPhoneMenuComponent Component { get; internal set; } = null!; public ShapeshifterMinigame Component { get; internal set; } = null!;
/// <inheritdoc/> /// <inheritdoc/>
public List<IMenuEntry> MenuEntries { get; protected set; } = []; public List<IMenuEntry> MenuEntries { get; protected set; } = [];
@@ -171,10 +155,9 @@ public abstract class CustomPhoneMenu : ICustomMenu
var ogMenu = shapeShifterRole.TryCast<ShapeshifterRole>()!.ShapeshifterMenu; var ogMenu = shapeShifterRole.TryCast<ShapeshifterRole>()!.ShapeshifterMenu;
var newMenu = Object.Instantiate(ogMenu); var newMenu = Object.Instantiate(ogMenu);
var component = newMenu.gameObject.AddComponent<CustomPhoneMenuComponent>();
var customMenu = new TMenu var customMenu = new TMenu
{ {
Component = component, Component = newMenu,
panelPrefab = newMenu.PanelPrefab, panelPrefab = newMenu.PanelPrefab,
xStart = newMenu.XStart, xStart = newMenu.XStart,
yStart = newMenu.YStart, yStart = newMenu.YStart,
@@ -188,10 +171,6 @@ public abstract class CustomPhoneMenu : ICustomMenu
back.OnClick.RemoveAllListeners(); back.OnClick.RemoveAllListeners();
back.OnClick.AddListener((UnityAction)customMenu.Close); back.OnClick.AddListener((UnityAction)customMenu.Close);
component.CloseSound = newMenu.CloseSound;
component.logger = newMenu.logger;
component.OpenSound = newMenu.OpenSound;
newMenu.DestroyImmediate(); newMenu.DestroyImmediate();
customMenu.transform.SetParent(Camera.main!.transform, false); customMenu.transform.SetParent(Camera.main!.transform, false);