Enum options

This commit is contained in:
ang-xd committed 2024-05-18 01:30:57 -04:00
1 parent 947a202c55
commit 0d746869de
7 files changed
+103 -7

No files matched your search

+11
View File
@@ -1,14 +1,25 @@
using MiraAPI.GameOptions;
using MiraAPI.GameOptions.Attributes;
using UnityEngine;
namespace MiraAPI.Example
{
public class ExampleOptions : IModdedOptionGroup
{
public string GroupName => "General Group";
public Color GroupColor => Color.red;
[ModdedToggleOption("Use Thing")] public bool useThing { get; set; } = true;
[ModdedToggleOption("Use another thing")] public bool useAnotherThing { get; set; } = false;
[ModdedNumberOption("Sussy level", min: 0, max: 10)] public float sussyLevel { get; set; } = 4f;
[ModdedStringOption("Sus choices", ["hello", "hello 2", "hello 3"])] public int susChoices { get; set; } = 0;
[ModdedEnumOption("Enum test", typeof(TestEnum))] public TestEnum enumTest { get; set; } = TestEnum.Hello;
}
public enum TestEnum
{
Hello,
Hi,
Bye
}
}
+1 -1
View File
@@ -18,7 +18,7 @@ public partial class ExamplePlugin : BasePlugin, IMiraConfig
public static ExamplePlugin Instance { get; private set; }
public ModdedOptionTabSettings TabSettings => new ModdedOptionTabSettings()
{
Title = "Example Mod",
Title = "MiraAPI Example Mod",
TabIcon = MiraAssets.Empty
};