Repository navigation
Settings
Fran Kelava edited this page Oct 15, 2026
·
12 revisions
Settings are configurable, persistent, strongly typed values a mod can refer to for configuration.
Settings derive from FhSetting<T>, where T is the type of value they contain.
Fahrenheit offers several basic derivations out of the box.
| Type name | Primitive type |
|---|---|
FhSettingToggle |
bool |
FhSettingNumber<T> |
Any INumber<T>
|
To use settings, create a class inheriting FhSettingProvider<T>, where T is the type of your module. See Modules.
You may arrange this class as you deem fit and control the visibility of both it and its individual settings.
For example:
public class Settings : FhSettingProvider<MyModule> {
public FhSettingToggle show_some_stuff = new("show_stuff", true);
internal protected override IEnumerable<FhSetting> get() {
return [ show_some_stuff ];
}
}
[FhLoad(FhGameId.FFX)]
public sealed class MyModule : FhModule
// ...There are three requirements for setting providers:
-
FhSettingProvidermust be derived by only one class for a given module. - An instance of that class must be created in the module's constructor. See Startup.
- In the
getmethod, it must return the settings it wishes to expose through the mod configuration UI, in display order.
At any point, the user may raise the mod configuration UI by pressing F7.
[This section will be added when PR #332 and the configuration visuals are available.]