forked from EverestAPI/ExampleMod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Oui.cs
46 lines (32 loc) · 1.53 KB
/
Oui.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
42
43
44
45
46
// https://github.com/EverestAPI/Resources/wiki/TextMenu-Reference
using Celeste.Mod.UI;
using System.Collections.Generic;
namespace Celeste.Mod.Example {
public class ExampleOui : OuiGenericMenu, OuiModOptions.ISubmenu {
public override string MenuName => "Example Menu";
protected override void addOptionsToMenu(TextMenu menu) {
menu.Add(new TextMenu.Header("Example Header"));
menu.Add(new TextMenu.Button("This Does Nothing"));
menu.Add(new TextMenu.OnOff("Toggle", false));
menu.Add(new TextMenu.Slider("Range", i => new string[] { "One", "Two", "Three" }[i], 0, 2));
menu.Add(new TextMenu.SubHeader("That's the end of the vanilla items"));
menu.Add(new TextMenuExt.IntSlider("This one handles big values", 0, 2000));
// Adding submenus can be quite verbose, so they get their own functions
addSubMenu(menu);
addOptionSubMenu(menu);
menu.Add(new TextMenuExt.HeaderImage("menu/everest"));
}
private void addSubMenu(TextMenu menu) {
menu.Add(new TextMenuExt.SubMenu("Click Me!", enterOnSelect: false));
}
private void addOptionSubMenu(TextMenu menu) {
menu.Add(new TextMenuExt.OptionSubMenu("Toggle Me!").Add(
"Empty", null)
.Add("Filled", new List<TextMenu.Item> {
new TextMenu.Button("Btn"),
new TextMenu.OnOff("OnOff", false)
})
);
}
}
}