diff --git a/examples/moddedsupport/ModdedSupportBAUEventExample.cs b/examples/moddedsupport/ModdedSupportBAUEventExample.cs new file mode 100644 index 0000000..c562770 --- /dev/null +++ b/examples/moddedsupport/ModdedSupportBAUEventExample.cs @@ -0,0 +1,65 @@ +using BepInEx.Configuration; +using BepInEx.Unity.IL2CPP; + +namespace BetterAmongUs.Examples; + +/// +/// 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. +/// +/// +/// Each method in this class corresponds to a different lifecycle event in BetterAmongUs. +/// Methods are optional - only implement the ones your plugin needs. +/// +internal class ModdedSupportBAUEventExample +{ + /// + /// Called when BetterAmongUs is loading. Can be used to prevent BAU from loading. + /// + /// The BetterAmongUs plugin instance. + /// + /// 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. + /// + public bool OnBAULoad(BasePlugin bauPlugin) + { + return true; + } + + /// + /// Called when BetterAmongUs game options have been loaded. + /// Allows plugins to read or modify BAU game 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: + /// , + /// , + /// , + /// , + /// , + /// , + /// , + /// , + /// + public void OnBAUOptionsLoaded(object[] options) + { + } + + /// + /// Called when BetterAmongUs configuration entries have been loaded. + /// Allows plugins to read or modify BAU's BepInEx configuration entries. + /// + /// + /// Array of BepInEx configuration entries from BetterAmongUs. + /// These can be cast to ConfigEntry<T> to access their values. + /// + /// + /// This is useful for plugins that need to interact with BAU's configuration, + /// such as reading default values or adding validation to certain settings. + /// + public void OnBAUConfigEntriesLoaded(ConfigEntryBase[] configs) + { + } +} \ No newline at end of file diff --git a/examples/moddedsupport/ModdedSupportPluginExample.cs b/examples/moddedsupport/ModdedSupportPluginExample.cs new file mode 100644 index 0000000..1eb521b --- /dev/null +++ b/examples/moddedsupport/ModdedSupportPluginExample.cs @@ -0,0 +1,39 @@ +using BepInEx.Unity.IL2CPP; + +namespace BetterAmongUs.Examples; + +/// +/// Example plugin demonstrating how to integrate with BetterAmongUs modded support system. +/// Shows the structure required for a plugin to declare BAU events and flags. +/// +/// +/// 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. +/// +internal class ModdedSupportPluginExample : BasePlugin +{ + /// + /// Event handler instance for BetterAmongUs events. + /// This field must be named exactly "BAUEvents" to be detected by the reflection system. + /// + public static ModdedSupportBAUEventExample BAUEvents = new(); + + /// + /// Array of flags to control BetterAmongUs behavior. + /// This field must be named exactly "BAUFlags" to be detected by the reflection system. + /// + /// + /// Flags can disable specific BAU features or modify its behavior. + /// See for available flag constants. + /// + public static string[] BAUFlags = []; + + /// + /// Main plugin load method. + /// In a real implementation, this is where your plugin initialization would occur. + /// + public override void Load() + { + // Plugin initialization logic would go here + } +} \ No newline at end of file