Amrv.ConfigurableCompany
3.7.0
dotnet add package Amrv.ConfigurableCompany --version 3.7.0
NuGet\Install-Package Amrv.ConfigurableCompany -Version 3.7.0
<PackageReference Include="Amrv.ConfigurableCompany" Version="3.7.0" />
paket add Amrv.ConfigurableCompany --version 3.7.0
#r "nuget: Amrv.ConfigurableCompany, 3.7.0"
// Install Amrv.ConfigurableCompany as a Cake Addin #addin nuget:?package=Amrv.ConfigurableCompany&version=3.7.0 // Install Amrv.ConfigurableCompany as a Cake Tool #tool nuget:?package=Amrv.ConfigurableCompany&version=3.7.0
Configurable Company
Configurable Company provides an enhanced experience for both players and developers adding an in-game menu where you can change you gameplay settings.
Player information | Developer guide |
---|
Player information
PRO TIP
This plugin does not add content on it's own, it's an API.
If you want content alongside it install Lethal Company Variables.
Menu
Using the in-game menu allows you to set a specific setting for your current file, you can have your first save with x10
enemy spawning and your second one with x0
enemy spawning.
As the image shows, configuration are split into pages (Seen at the top left of the image) and then into categories.
Buttons
- Save configurations: Saves the settings you changed.
- Reset to default values: Resets every configuration to the initial value.
- Restore saved values: Reverts back your modifications to the last saved configuration.
- Copy to clipboard: Allows you to share your current configurations by copying them to your clipboard.
- Paste from clipboard: Tries to read your clipboard for configurations and sets them.
INFO
You don't need to share configurations with your friends, they are automatically synchronized.
Tooltip
The tooltip shows the configuration name, a description on what it does and some tags with extra information. These tags can be:
- Experimental: If a configuration maybe produce issues while playing this tag will be shown.
- Default: Shows the initial value from the configuration.
- Synchronize with client: If that configuration needs to be synchronized with other players to work (This means they need the mod, otherwise they don't).
- Green tag: A green text represents what values does the configuration accept.
Developer guide
INFO
If you want an easy-to-read guide I recommend you looking Lethal comapny modding wiki for configurable company. However you can also check the thunderstore wiki or the mod's github page.
This API will allow you as a developer to add configurations to the game easily. These configurations will be displayed in an in-game menu where the user will be able to change them.
Configurations will change automatically so I suggest you listen to changes with events if you need the value automatically updated.
How to create configurations
public static CConfig FloatConfiguration = new CConfigBuilder()
{
Category = MyPluginCategories.Normal,
ID = "my-mod-id_configuration_float-configuration",
Name = "Does something",
Tooltip = "This is my cool description of the configuration",
Value = 69.420f
};
And you can get the value easily too:
int intValue = FloatConfiguration<int>Get();
float floatValue = FloatConfiguration<float>Get();
float floatValueWithDefault = FloatConfiguration<float>Get(10f);
You can even use BepInEx configurations:
CConfig myConfig = ConfigAPI.ConfigFromBepInEx(config);
Listening to events
The API includes a lot of events you can access and listen to. If you want to see the full list, navigate to the wiki section about events.
Here is an example on how you could listen to configuration changes:
First we need to register the listener (you might want to do this when your plugin starts)
CEvents.ConfigEvents.ChangeConfig.AddListener(MyListenerMethod);
Now we need the method to execute
public static void MyListenerMethod(CEventChangeConfig myEvent) {
CConfig changedConfig = myEvent.Config;
ChangeReason reason = myEvent.Reason;
bool succeeded = myEvent.Success;
bool converted = myEvent.Converted;
object oldValue = myEvent.OldValue;
object requestedValue = myEvent.RequestedValue;
object newValue = myEvent.NewValue;
// Here you can do whatever you need with the information
if (myEvent.Success) {
// Configuration changed correctly
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- BepInEx.Core (>= 5.4.21)
- BepInEx.PluginInfoProps (>= 1.1.0)
- UnityEngine.Modules (>= 2022.3.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.7.0 | 91 | 10/25/2024 |
3.6.0 | 110 | 9/20/2024 |
3.5.0 | 129 | 8/8/2024 |
3.4.0 | 143 | 4/26/2024 |
3.3.2 | 124 | 4/19/2024 |
3.3.0 | 113 | 4/8/2024 |
3.2.0 | 110 | 4/5/2024 |
3.1.0 | 133 | 3/8/2024 |
3.0.1 | 127 | 3/2/2024 |
3.0.0 | 128 | 3/1/2024 |
2.6.0 | 135 | 2/15/2024 |
2.5.4 | 134 | 2/6/2024 |
2.5.3 | 122 | 1/30/2024 |
2.5.2 | 120 | 1/22/2024 |
2.5.1 | 117 | 1/20/2024 |
2.5.0 | 121 | 1/19/2024 |
2.4.1 | 127 | 1/14/2024 |
2.4.0 | 127 | 1/11/2024 |
2.3.4 | 131 | 1/10/2024 |
2.3.2 | 129 | 1/9/2024 |
2.3.1 | 144 | 1/8/2024 |
2.3.0 | 145 | 1/8/2024 |
2.2.0 | 143 | 1/7/2024 |
2.1.0 | 130 | 1/7/2024 |
See CHANGELOG.md