wip options api

This commit is contained in:
ang-xd committed 2024-06-23 17:06:40 -04:00
1 parent 2affea8c96
commit e2e811254a
30 files changed
+544 -632

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ using UnityEngine;
namespace MiraAPI.Example
{
[RegisterCustomRole(ExamplePlugin.Id)]
[RegisterCustomRole]
public class CustomRole : CrewmateRole, ICustomRole
{
public string RoleName => "Test Role";
+4 -4
View File
@@ -9,11 +9,11 @@ namespace MiraAPI.Example
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;
[ModdedToggleOption("Use Thing")] public bool useThing { get; set; } = false;
[ModdedToggleOption("Use another thing")] public bool useAnotherThing { get; set; } = true;
[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;
[ModdedStringOption("Sus choices", ["hello", "hello 2", "hello 3"])] public int susChoices { get; set; } = 2;
[ModdedEnumOption("Enum test", typeof(TestEnum))] public TestEnum enumTest { get; set; } = TestEnum.Bye;
}
public enum TestEnum
+2 -10
View File
@@ -1,7 +1,7 @@
using BepInEx;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using MiraAPI.Utilities.Assets;
using MiraAPI.PluginLoading;
using Reactor;
using Reactor.Networking;
using Reactor.Networking.Attributes;
@@ -12,19 +12,11 @@ namespace MiraAPI.Example;
[BepInProcess("Among Us.exe")]
[BepInDependency(ReactorPlugin.Id)]
[ReactorModFlags(ModFlags.RequireOnAllClients)]
public partial class ExamplePlugin : BasePlugin, IMiraConfig
public partial class ExamplePlugin : BasePlugin, IMiraPlugin
{
public Harmony Harmony { get; } = new(Id);
public static ExamplePlugin Instance { get; private set; }
public ModdedOptionTabSettings TabSettings => new ModdedOptionTabSettings()
{
Title = "MiraAPI Example Mod",
TabIcon = MiraAssets.Empty
};
public override void Load()
{
Instance = this;
Harmony.PatchAll();
}
}
+2 -1
View File
@@ -4,6 +4,7 @@ namespace MiraAPI.Example
{
public class SomeRandomNonGroupClass
{
[ModdedStringOption("Yeah, idk", ["Idk 1", "idk 2", "idk 3", "idk 4"])] public static int yeaIdk { get; set; } = 2;
[ModdedStringOption("Yeah, idk", ["Idk 1", "idk 2", "idk 3", "idk 4"])] public static int yeaIdk { get; set; } = 3;
[ModdedNumberOption("Aw man", min: 45, max: 95)] public float sussyLevel { get; set; } = 63;
}
}