Skip to content

[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

MSU 101

Items & Equipments

  • [PickupsModule]
  • [ItemBase]
  • [EquipmentBase]

Elites

  • [EliteModule]
  • [EliteEquipmentBase]
  • [MSEliteDef]

Buffs

  • [BuffBase]
  • [BuffsModule]

Projectiles

  • [ProjectileBase]
  • [ProjectilesModule]

Artifacts

  • [ArtifactBase]
  • [ArtifactsModule]

Survivors & Enemies

  • [CharacterBase]
  • [MonsterBase]
  • [SurvivorBase]
  • [CharacterModule]

Stages

  • [StageBase]
  • [StagesModule]

Item Displays

Attributes

Clone this wiki locally