Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatModifiers

An interactive API to allow for Twitch Chat to interact with your game

License: GPLv3


Installation

  1. Download the latest release for your game version
  2. Locate your Beat Saber install folder
  3. Extract the zip file to the install folder

Integration

Simple integration of ChatModifiers

internal class ExampleModifier
{
    internal static ChatModifiers.API.CustomModifier Example = new ChatModifiers.API.CustomModifier(
      "Example Modifier", // Name
      "Does blah blah blah", // Description
      "ExamplePlugin.Images.Icon.png", // Assembly path to the icon, will be used in the gameplay setup menu and the settings menu,
      "example", // Command keyword, ChatModifiers will know to execute this modifiers function when the keyword is used
      ExampleFunction, // Action linking the ExampleFunction below
      new ChatModifiers.API.ArgumentInfo[] { // Arguments listed in this array will be positioned the same within the object[] args in the example function.
        new ChatModifiers.API.ArgumentInfo("example", typeof(int)) // This ArgumentInfo will activate when any integer is typed after "!example". Any Type should work with this.
      }, 

      Areas.Game, // The area that the command will execute in. Areas are as such: None = 0, Menu = 1, Game = 2, Both = 3
      new System.Collections.Generic.Dictionary<string, object> { { "TestKey", "TestValue" } } // The config, where the key is the name of the setting, and the value is the default value of the setting
    )

    private static void ExampleFunction(ChatModifiers.API.MessageInfo messageInfo, object[] args)
    {

    }
}

internal class Plugin
{
  // Base code for Plugin.cs

  [OnEnable]
  public void OnEnable() => ChatModifiers.API.RegistrationManager.RegisterModifier(ExampleModifier.Example);
}

Additional Notes

To change your CustomModifier settings (You will need to cast it to whatever Type you are using, this may require extra work)

customModifier will just be your instance of CustomModifier

    [UIValue("TestSettingValue")]
    public string TestSettingValue
    {
        get
        {
            if (customModifier != null)
            {
                return customModifier.ModifierSettings.AdditionalSettings["KeyTest"].ToString();
            }
            return null;
        }
        set
        {
            if (customModifier != null)
            {
                customModifier.ModifierSettings.AdditionalSettings["KeyTest"] = (object)value;
                customModifier.SaveSettings();
            }
        }
    }

There is an extra optional field for ViewController in order to show your settings within a list of other CustomModifiers, simply define the ViewController and it will appear within the settings menu for ChatModifiers, FlowCoordinators will be handled for you.

Image 1 Image 2
Image 3 Image 4

About

Beat Saber plugin that allows for chat to interact with the game. Features an API for additional modifiers to be added

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages