Amrv.ConfigurableCompany 3.7.0

dotnet add package Amrv.ConfigurableCompany --version 3.7.0                
NuGet\Install-Package Amrv.ConfigurableCompany -Version 3.7.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Amrv.ConfigurableCompany" Version="3.7.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Amrv.ConfigurableCompany --version 3.7.0                
#r "nuget: Amrv.ConfigurableCompany, 3.7.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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.

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.

A image of the in-game menu with some configurations from Lethal Company Variables

As the image shows, configuration are split into pages (Seen at the top left of the image) and then into categories.

Buttons

A image of the in-game menu showing the 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

A image of the in-game menu showing how the tooltip is displayed

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 82 10/25/2024
3.6.0 104 9/20/2024
3.5.0 121 8/8/2024
3.4.0 139 4/26/2024
3.3.2 120 4/19/2024
3.3.0 109 4/8/2024
3.2.0 106 4/5/2024
3.1.0 129 3/8/2024
3.0.1 123 3/2/2024
3.0.0 124 3/1/2024
2.6.0 131 2/15/2024
2.5.4 130 2/6/2024
2.5.3 118 1/30/2024
2.5.2 116 1/22/2024
2.5.1 113 1/20/2024
2.5.0 117 1/19/2024
2.4.1 123 1/14/2024
2.4.0 123 1/11/2024
2.3.4 127 1/10/2024
2.3.2 125 1/9/2024
2.3.1 140 1/8/2024
2.3.0 141 1/8/2024
2.2.0 139 1/7/2024
2.1.0 126 1/7/2024

See CHANGELOG.md