You are viewing a potentially older version of this package. View all versions.
Hydraxous-Configgy-1.0.3 icon

Configgy

Library mod for configuring other mods!

Date uploaded 9 months ago
Version 1.0.3
Download link Hydraxous-Configgy-1.0.3.zip
Downloads 34604
Dependency string Hydraxous-Configgy-1.0.3

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

Configgy

A library mod for configuring plugin data at runtime.

Disclaimer

This mod does more or less nothing on its own. I haven't got around to making proper documentation for it yet.

Example usage

public class MyPlugin : BaseUnityPlugin
{
	private ConfigBuilder config;
    
    private void Awake()
    {
	     config = new ConfigBuilder("MyName.MyPlugin", "My Plugin");
	     config.BuildAll(); //Generates config menu from any Configgable attribute tagged  static fields in your plugin.
    }
}

public class MyBehaviour : MonoBehaviour
{
    //All of these will be automatically initialized when config.Build is called.
    
	[Configgable]
    private static float myFloat = 4f;
    
    //A path and display name are optional.
    [Configgable]
    private static ConfigToggle myToggle = new ConfigToggle(true);
	
	//Defines a path in the menu and a display name.
	[Configgable("MySliders", "Slider That Controls Things")]
	private static FloatSlider slider = new FloatSlider(1f, 0f, 1f);
	
	[Configgable("MyStrings", "Important String")]
	private static ConfigInputField<string> stringField = new ConfigInputField<string>("default String!");
	
	private void Update()
	{
		//Prints current value of the slider.
		Debug.Log(slider.Value);
	}
}

CHANGELOG

Changelog 1.0.4
  • Fixed values not saving due to saver objects being deleted.
  • Fixed ConfiggyPersistent not serializing values
  • Add support for bepin enums
  • Better bepin support thanks to The0x539