mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
40 lines
1.6 KiB
C#
40 lines
1.6 KiB
C#
using MiraAPI.GameOptions;
|
|
using MiraAPI.GameOptions.OptionTypes;
|
|
using Reactor.Utilities;
|
|
|
|
namespace MiraAPI.Example.Options;
|
|
|
|
public class ExampleOptions2 : AbstractOptionGroup
|
|
{
|
|
public override string GroupName => "options.exampleOptions2";
|
|
public override uint GroupPriority => 0; // This group will be displayed first. The default value is uint.MaxValue.
|
|
public override MenuCategory ParentMenu => MenuCategory.CustomTwo;
|
|
public override bool ShowInMatchInfoGuide => true;
|
|
|
|
public ModdedPlayerOption PlayerOption2 { get; } = new("options.exampleOptions2.youMustChoseAPlayer", false);
|
|
public ModdedPlayerOption PlayerOption { get; } = new("options.exampleOptions2.ehWhatever");
|
|
public ModdedToggleOption ToggleOpt1 { get; } = new("options.exampleOptions2.toggleOption1", false);
|
|
|
|
public ModdedOptionList<ModdedNumberOption> PlayerNums { get; } = new(5, i =>
|
|
new($"PlayerNum{i}", 2, 0, 5, 1, Utilities.MiraNumberSuffixes.None));
|
|
|
|
public ModdedToggleOption ToggleOpt2 { get; } = new("options.exampleOptions2.toggleOption2", false)
|
|
{
|
|
Visible = () => OptionGroupSingleton<ExampleOptions2>.Instance.ToggleOpt1, // implicit cast from ModdedToggleOption to bool
|
|
};
|
|
|
|
public ModdedEnumOption<TestingData> EnumOpt { get; } = new("options.exampleOptions2.enumOpt", 0)
|
|
{
|
|
ChangedEvent = x => Logger<ExamplePlugin>.Info($"changed Enum Opt to {x}"),
|
|
Getter = currentValue => currentValue,
|
|
Setter = (newValue, oldValue) => newValue,
|
|
};
|
|
}
|
|
|
|
public enum TestingData : ulong
|
|
{
|
|
Happy,
|
|
Sad,
|
|
Neutral,
|
|
}
|