-
Notifications
You must be signed in to change notification settings - Fork 1
/
EmptyMenu.cs
41 lines (39 loc) · 1.17 KB
/
EmptyMenu.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Modding;
using Modding.Menu;
using Modding.Menu.Config;
using System.Reflection;
using UnityEngine;
namespace EmptyMenu
{
public class EmptyMenu: Mod, ICustomMenuMod
{
public override string GetVersion() => Assembly.GetExecutingAssembly().GetName().Version.ToString();
public bool ToggleButtonInsideMenu { get; } = false;
internal MenuScreen screen;
public MenuScreen GetMenuScreen(MenuScreen modListMenu, ModToggleDelegates? toggleDelegates)
{
this.screen = new MenuBuilder("emptyMenu")
.CreateControlPane(RectTransformData.FromSizeAndPos(
new RelVector2(),
new AnchoredPosition(new Vector2(),new Vector2(),
new Vector2(0f, -100f) /*Offset*/
)
))
.SetDefaultNavGraph(new GridNavGraph(1))
.AddControls(
new SingleContentLayout(new AnchoredPosition()),
c => c.AddMenuButton(
"BackButton",
new MenuButtonConfig {
Label = "Back",
CancelAction = self => UIManager.instance.UIGoToDynamicMenu(modListMenu),
SubmitAction = self => UIManager.instance.UIGoToDynamicMenu(modListMenu),
Proceed = true
}
)
)
.Build();
return this.screen;
}
}
}