[ConfigurableField] - TeamMoonstorm/MoonstormSharedUtils GitHub Wiki

The [ConfigurableField] is an Attribute which's main purpose is to facilitate the creation of Configuration Entries on your mod's config file.

The ConfigurableField attribute is only valid on Fields, alongside this, it has 3 properties that can either be filled, or left null.

public string ConfigSection { get; set; } //String to use on the config's section, if left null, it'll use the Class that declares the field's name.
public string ConfigName { get; set; } //String to use on the config's name, if left null, it'll use the Field's name
public string ConfigDesc { get; set; } //String to use on the config's description, if left null, it'll use a generic string ("Configure this value")

To have your fields properly configured, all you need to do is call the "AddMod(ConfigFile configFile)" method that's inside the "ConfigurableFieldManager".

ConfigurableFieldManager.AddMod(Config);

The manager will afterwards automatically create config options for the fields that have the attribute

[ConfigurableField(ConfigName = "Extra Regen Per Vial", ConfigDesc = "Extra Regeneration added per vial.")]
public static float vialRegen = 0.8f;

If youre curious on how the configurable field manager works, you can look at its class here