Wildfrost

Wildfrost

49 arvostelua
Config Manager
   
Palkinto
Lisää suosikkeihin
Lisätty suosikkeihin
Poista suosikeista
Tools
Tunnisteet: Mod
Tiedostokoko
Julkaistu
Päivitetty
1.080 MB
8.3.2024 klo 21.37
5.6. klo 8.50
44 muutosilmoitusta ( näytä )

Tilaa ladataksesi
Config Manager

1 kokoelmassa, tekijä Hopeless
Configurables
30 luomusta
Kuvaus
Adds a Journal button to modify configs for all currently ACTIVE mods, and allows modders to customise their appearance and behaviour


NOTE: If the configs don't automatically update ingame, first try resubscribing to Config Manager and delete your mod's config.cfg. If all else fails, report to me @Hopeful on Discord


Customisation for your mod
Without this mod as a dependency
Without requiring this mod as a dependency, you can still do minimal customisation:
  • Set the description through the comment parameter in your ConfigItem. Make sure new lines use "\n//".
  • Set predefined options by using bool or an enum type as the value of your ConfigItem
You can use sprites using <sprite name="your sprite"> (or <sprite=..> or even <spr=..> for short) in the desc, but keywords and card popups don't work yet. By default this works with the base game stuff, but you can add your own by adding a sprite asset with my VFX & SFX Tools

With this mod as a dependency
In general, each mod has its own ConfigSection in the Journal which contains a ConfigItem for each config. If there are no (visible) configs, then this section won't show up.

Attributes: The main meat
For modders adding this to your mod, you can add any of these new attributes when you define each config item:
  • ConfigManagerTitle : The title to display for this item
  • ConfigManagerDesc : The description to display when hovered. Use this if you want rich text tags like <align> or <voffset>
  • ConfigInput : Adds a button to manually input the config. When used with Options, will only choose between the predefined options, or the range if used with Slider.
  • ConfigOptions : Adds left/right buttons to swap between predefined options. When used with an enum, it will automatically replace _ with spaces
  • ConfigSlider : Adds a slider with a predefined range. Can use with float or int. This shows the current value under the title
  • HideInConfigManager : By default, this item won't show up in the Journal unless any ShowIfConfig is defined

Making manual changes to the config or appearance
Manually make changes to the config (similar to toggling charms with my Unlock Selector mod).
  • ConfigManager.SaveConfig() : This method is missing from the api for some reason so I added it here
  • ConfigManager.ConfigItem : For each config in your mod:
    • configItem.UpdateDesc() : Change the hover popup, possibly overriding the text preprocessing. Same as doing "desc = str"
    • configItem.UpdateTitle() : Change the title displayed. Same as doing "title = str"

Conditional visibility attributes
You can use any number of these to specify when a config should/shouldn't be visible. Optionally set priority parameters if using HideIf and ShowIf together
  • HideIfConfig : This item won't show up in the Journal if the specified config item (by field name) takes some value
  • ShowIfConfig : Use to override HideIf or HideInConfigManager if needed

Events
The main thing here is OnConfigChanged, which is useful for when you need to reload your mod after disabling/enabling any DataFile objects for example (see Miya's blood mod in progress)
  • ConfigManager.OnModLoaded : Event after any mod loads
  • ConfigManager.OnModUnloaded : Event after any mod unloads
  • configSection.OnConfigChanged : Event after a config's value is saved for each mod
I didn't realise the ModLoaded/Unloaded were already part of the api so wtv
1 kommenttia
Hopeless  [tekijä] 20.4. klo 15.28 
This mod's GUID is hope.wildfrost.configs