add back examples

This commit is contained in:
D1GQ committed 2026-03-18 14:45:26 -05:00
1 parent 51548b8327
commit 07627d79ff
2 files changed
+104

No files matched your search

@@ -0,0 +1,65 @@
using BepInEx.Configuration;
using BepInEx.Unity.IL2CPP;
namespace BetterAmongUs.Examples;
/// <summary>
/// Example event handler class demonstrating how to respond to BetterAmongUs events.
/// This class must be instantiated and assigned to the BAUEvents field in the plugin.
/// </summary>
/// <remarks>
/// Each method in this class corresponds to a different lifecycle event in BetterAmongUs.
/// Methods are optional - only implement the ones your plugin needs.
/// </remarks>
internal class ModdedSupportBAUEventExample
{
/// <summary>
/// Called when BetterAmongUs is loading. Can be used to prevent BAU from loading.
/// </summary>
/// <param name="bauPlugin">The BetterAmongUs plugin instance.</param>
/// <returns>
/// Return true to allow BAU to continue loading, or false to prevent BAU from loading.
/// This can be useful if your plugin has compatibility issues with specific BAU versions.
/// </returns>
public bool OnBAULoad(BasePlugin bauPlugin)
{
return true;
}
/// <summary>
/// Called when BetterAmongUs game options have been loaded.
/// Allows plugins to read or modify BAU game options.
/// </summary>
/// <param name="options">
/// Array of game options objects from BetterAmongUs.
/// The exact type of these objects depends on BAU's internal implementation.
/// Common option types to check for:
/// <see cref="Modules.OptionItems.OptionItem"/>,
/// <see cref="Modules.OptionItems.OptionItem{T}"/>,
/// <see cref="Modules.OptionItems.OptionCheckboxItem"/>,
/// <see cref="Modules.OptionItems.OptionFloatItem"/>,
/// <see cref="Modules.OptionItems.OptionIntItem"/>,
/// <see cref="Modules.OptionItems.OptionPercentItem"/>,
/// <see cref="Modules.OptionItems.OptionPlayerItem"/>,
/// <see cref="Modules.OptionItems.OptionStringItem"/>,
/// </param>
public void OnBAUOptionsLoaded(object[] options)
{
}
/// <summary>
/// Called when BetterAmongUs configuration entries have been loaded.
/// Allows plugins to read or modify BAU's BepInEx configuration entries.
/// </summary>
/// <param name="configs">
/// Array of BepInEx configuration entries from BetterAmongUs.
/// These can be cast to ConfigEntry&lt;T&gt; to access their values.
/// </param>
/// <remarks>
/// This is useful for plugins that need to interact with BAU's configuration,
/// such as reading default values or adding validation to certain settings.
/// </remarks>
public void OnBAUConfigEntriesLoaded(ConfigEntryBase[] configs)
{
}
}
@@ -0,0 +1,39 @@
using BepInEx.Unity.IL2CPP;
namespace BetterAmongUs.Examples;
/// <summary>
/// Example plugin demonstrating how to integrate with BetterAmongUs modded support system.
/// Shows the structure required for a plugin to declare BAU events and flags.
/// </summary>
/// <remarks>
/// This example shows a minimal plugin that implements both event handlers and flags.
/// In a real implementation, you would add your plugin's actual logic in the Load() method.
/// </remarks>
internal class ModdedSupportPluginExample : BasePlugin
{
/// <summary>
/// Event handler instance for BetterAmongUs events.
/// This field must be named exactly "BAUEvents" to be detected by the reflection system.
/// </summary>
public static ModdedSupportBAUEventExample BAUEvents = new();
/// <summary>
/// Array of flags to control BetterAmongUs behavior.
/// This field must be named exactly "BAUFlags" to be detected by the reflection system.
/// </summary>
/// <remarks>
/// Flags can disable specific BAU features or modify its behavior.
/// See <see cref="Modules.Support.BAUModdedSupportFlags"/> for available flag constants.
/// </remarks>
public static string[] BAUFlags = [];
/// <summary>
/// Main plugin load method.
/// In a real implementation, this is where your plugin initialization would occur.
/// </summary>
public override void Load()
{
// Plugin initialization logic would go here
}
}