-
Notifications
You must be signed in to change notification settings - Fork 9
[ConfigurableField]
Nebby edited this page Oct 24, 2021
·
1 revision
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
- The modules and content relationship
- Module Bases
- Content Bases
- [Loaders]
- Item Behavior Crashcourse
- ContentPack Autopopulating
- [PickupsModule]
- [ItemBase]
- [EquipmentBase]
- [EliteModule]
- [EliteEquipmentBase]
- [MSEliteDef]
- [BuffBase]
- [BuffsModule]
- [ProjectileBase]
- [ProjectilesModule]
- [ArtifactBase]
- [ArtifactsModule]
- [CharacterBase]
- [MonsterBase]
- [SurvivorBase]
- [CharacterModule]
- [StageBase]
- [StagesModule]
- [ItemDisplayModule]
- [MSIDRS]
- [SIDRS]
- [KADPH]
- Populating the Dictionary as a non MSU depentant mod