GithubHelp home page GithubHelp logo

bepinex / bepinex.configurationmanager Goto Github PK

View Code? Open in Web Editor NEW
227.0 227.0 54.0 20.93 MB

Plugin configuration manager for BepInEx

Home Page: https://www.patreon.com/ManlyMarco

License: GNU Lesser General Public License v3.0

C# 98.62% PowerShell 1.38%
bepinex bepinex-plugins plugin unity3d

bepinex.configurationmanager's Introduction

BepInEx

Github All Releases GitHub release BepInEx Discord

Bepis Injector Extensible


BepInEx is a plugin / modding framework for Unity Mono, IL2CPP and .NET framework games (XNA, FNA, MonoGame, etc.)

(Currently only Unity Mono has stable releases)

Platform compatibility chart

Windows OSX Linux ARM
Unity Mono ✔️ ✔️ ✔️ N/A
Unity IL2CPP ✔️
.NET / XNA ✔️ Mono Mono N/A

A more comprehensive comparison list of features and compatibility is available at https://bepis.io/unity.html

Resources

Latest releases

Bleeding Edge builds

How to install (latest releases)

How to install (Bleeding Edge, BepInEx 6)

User and developer guides

Discord server

Available plugin loaders

Name Link to project
BSIPA BepInEx.BSIPA.Loader
IPA IPALoaderX
MelonLoader BepInEx.MelonLoader.Loader
MonoMod BepInEx.MonoMod.Loader
MuseDashModLoader BepInEx.MDML.Loader
Partiality BepInEx-Partiality-Wrapper
Sybaris BepInEx.SybarisLoader.Patcher
UnityInjector BepInEx.UnityInjector.Loader
Unity Mod Manager Yan.UMMLoader
uMod BepInEx.uMod.Loader

Used libraries

IL2CPP libraries

License

The BepInEx project is licensed under the LGPL-2.1 license.

bepinex.configurationmanager's People

Contributors

benediktwerner avatar bwoebi avatar ghorsington avatar keelhauled avatar manlymarco avatar mantas-2155x avatar mrageo avatar takahiro0327 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bepinex.configurationmanager's Issues

Closing ConfigurationManager

I love this configuration manager, the only thing I could ask for is if it were possible to close the manager out by either pressing escape key or pressing F1 again, instead of having to click outside of the menu. Thank you.

Preloaders Not being included

Cannot Reference BasePatcher, no BepInEx.Preloader found. I created the project with dotnet new bep6plugin_il2cpp -n MyTestPatcher, but cant use Preload Patchers.

Changing the default Keybinding.

Where can we change the keybind to? I tried looking at the BepInEx.cfg file that I have for Valheim but it does not seem to have an option there and is conflicting with a keybind for other mods.

Crashing on Startup

I've been trying to get the Configuration Manager to work for Rhythm Doctor, however the mod seems to crash on startup.
The logs show this message:

[Info : BepInEx] Loading [Configuration Manager 16.3]
[Error : BepInEx] Error loading [Configuration Manager 16.3]:

with nothing related to the mod after the colon. Using BepInEx 5.4.15 x86.

Valheim doesn't start with BepInEx

I have issue with start valheim. BepInEx start cmd but crushes on [preloader]. Sometimes get error „Valheim - Unity 2020.3.33f“. Tell me how to fix it? Thank you in advance

Reinstalling mods, reinstalling the game and BepInEx does not help

F1 Button not working

when I press the f1 button it does not open the config manager, I followed the instructions to put the config manager dll into the plugins file but it does not work

.NET Framework v3.5 is not compatible with NETStandard 2.1

When opening the most recent version's .zip's SLN in VSCode, nothing works until ConfigurationManager.csproj's TargetFrameworkVersion is changed from v3.5 to v4.8. I'm not sure why this fixes it for me as the .NET Standard compatibility chart says no framework versions will be supported by 2.1. Hopefully someone more familiar with .NET/C# knows why this is, but for now this fixed it for me.

More specifically, it seems all the UnityEngine things broke, with the message that <package id =" netstandard" Version="2.1.0.0" Culture="neutral" PublicKeyToken="cc7b13ffcd2ddd51"/> was missing.

Doesn't Support Games Using Unity Input System package

The way that the ConfigurationManager detects key input only works with the UnityEngine.Input class but some games use the Unity Input System package instead which gives this error in the Player.log file:

(Filename: D:/SVN/BepInEx.ConfigurationManager/ConfigurationManager/ConfigurationManager.cs Line: 597)

InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.
  at (wrapper managed-to-native) UnityEngine.Input.GetKeyDownInt(UnityEngine.KeyCode)
  at UnityEngine.Input.GetKeyDown (UnityEngine.KeyCode key) [0x00001] in <dc91b8bd68954aeba15a42ea03c6382c>:0 
  at BepInEx.Configuration.KeyboardShortcut.IsDown () [0x0000c] in <23c82cada6174aeea1f2659206cab34d>:0 
  at ConfigurationManager.ConfigurationManager.Update () [0x0001d] in D:\SVN\BepInEx.ConfigurationManager\ConfigurationManager\ConfigurationManager.cs:597 

An example of a game that uses this system is the Farewell North demo: https://store.steampowered.com/app/1432850/Farewell_North/

Integer or Float values not showing up in the mod settings.

Describe the bug

When binding an integer value to the configuration, it does generate configurable entries for it on the configuration file BepInEx/config/org.bepinex.plugins.Test.cfg, but the ConfigurationManager menu does not display this options.
The default and configured values are accessible through code just fine, so this is an issue with this mod.

To Reproduce

namespace Test

open BepInEx
open BepInEx.Configuration
open UnityEngine;

[<BepInPlugin("org.bepinex.plugins.Test", "Test", "0.0.1")>]
type Test() =
    inherit BaseUnityPlugin()

    let KeyDef = ConfigDefinition("Confing Thing", "Keybind")
    let NumberDef = ConfigDefinition("Config Thing", "Number")

    // This shows
    member this.Keybind =
        this.Config.Bind(KeyDef, KeyboardShortcut(KeyCode.F9))

    // This doesn't show
    member this.Number =
        this.Config.Bind(NumberDef, 1)

    member this.Awake() =
        this.Logger.LogInfo("Hello, World!")
        // Proof that the value is readable
        this.Logger.LogInfo("Value -> %d", this.Number.Value)

And then in-game, open the mod settings, and see how the Number value is missing, but the Keybind value appears just fine.

Expected behavior

The Number setting appears as a configurable type-able box, as it should.

Screenshots and logs

No errors nor warnings appear.

Desktop

  • Game: Poly Bridge 2
  • BepInEx 5.4.1.0
  • Arch Linux as the main OS, Running the game though proton 5.13-4

Crashing on Startup [Timberborn]

I was hoping to use this mod in Timberborn, but it's crashing on startup with:

[Error : Unity Log] InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.
Stack trace:
UnityEngine.Input.GetKeyDown (UnityEngine.KeyCode key) (at :0)
BepInEx.Configuration.KeyboardShortcut.IsDown () (at <73d37a760d5a4444be8d7989b489dc1a>:0)
ConfigurationManager.ConfigurationManager.Update () (at D:/SVN/BepInEx.ConfigurationManager/ConfigurationManager/ConfigurationManager.cs:644)

Any ideas on how to fix it?

[Question / Not a bug]

Just one simple question, please.
I prefer create the Config file at my own mod folder inside Plugins folder's, instead BepinEx default Config folder.
And I use this command to set my ConfigFile:
public static ConfigFile configFile = new ConfigFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), MyPluginInfo.PLUGIN_NAME, "Config.cfg"), true);

How could I make ConfiguratorManager compatible, please?
And is there a way I can change F1 key and embeed PluginConfigurator in my dll mod file, please?

Thanks!!!

Cannot open with F1

Hey, I'm trying to use this in Timberborn game with BepInExPack_Timberborn (that is based on 5.4.19) so I have to use version 17.0 of CM, as 17.1 require 5.4.20.

I'm just trying to use this with BepInEx.GraphicsSettings to be able to disable MSAA at ultra preset, so I can interact with the Depth Pass in ReShade.
Nothing in the command prompt window, except that those 2 plugins are loaded.
I also tried to uninstall ReShade to check if there was some sort of conflict, but no changes.

F1 does nothing

[Message:   BepInEx] BepInEx 5.4.19.0 - Timberborn (05.02.2023 18:28:41)
[Info   :   BepInEx] Running under Unity v2022.1.24.7380445
[Info   :   BepInEx] CLR runtime version: 4.0.30319.42000
[Info   :   BepInEx] Supports SRE: True
[Info   :   BepInEx] System platform: Bits64, Windows
[Message:   BepInEx] Preloader started
[Info   :   BepInEx] Loaded 1 patcher method from [BepInEx.Preloader 5.4.19.0]
[Info   :   BepInEx] 1 patcher plugin loaded
[Info   :   BepInEx] Patching [UnityEngine.CoreModule] with [BepInEx.Chainloader]
[Message:   BepInEx] Preloader finished
[Message:   BepInEx] Chainloader ready
[Message:   BepInEx] Chainloader started
[Info   :   BepInEx] 2 plugins to load
[Info   :   BepInEx] Loading [Configuration Manager 17.0]
[Info   :   BepInEx] Loading [Graphics Settings 1.2.1]
[Message:   BepInEx] Chainloader startup complete
[Info   : Unity Log] Starting game version 0.3.5.1-fb48f47-gw
[Info   : Unity Log] System info:
System: Windows 11  (10.0.22000) 64bit
CPU: AMD Ryzen 7 3700X 8-Core Processor
GPU: NVIDIA GeForce GTX 1060 6GB
GPU memory: 6043MB
RAM: 16307MB
Drives:
  C:\ 93.16GB free from 464.48GB
  D:\ 8.46GB free from 71.85GB
  E:\ 50.55GB free from 931.50GB
  G:\ 166.75GB free from 859.66GB

[Info   : Unity Log] Modded: true, BepInEx
[Info   : Unity Log] Loading saved game Castorama - 2023-02-06 19h51m, Day 3-14.autosave at 2023-02-06 22:38:26Z
[Info   : Unity Log] Load time: 26535 ms

TypeLoadException without stack trace

[Error  : Unity Log] TypeLoadException: Could not resolve type with token 01000070 (from typeref, class/assembly BepInEx.UnityInput, BepInEx, Version=5.4.20.0, Culture=neutral, PublicKeyToken=null)
Stack trace:

I am running the JTV package & a few others so I am having trouble tracking down which mod is conflicting with ConfigManager.

Is it possible that ConfigurationManager.Logger.LogError(ex); isn't printing the stack trace when the exception is caught?

Entries are being orphaned

BepInEx 5.4.21 x64

I'm making a plugin that lets the user assign a label to an object and saving their input using BepInEx's config manager:

input = GUILayout.TextField(input);
if (GUILayout.Button("Submit"))
{
    Plugin.ConfigInstance.TryGetEntry(
        $"World.{guid}",
        storageIndex.ToString(),
        out ConfigEntry<string> entry
    );
    if (entry != null)
    {
        entry.Value = input;
    }
    else
    {
        Plugin.ConfigInstance.Bind($"World.{guid}", storageIndex.ToString(), input);
    }
    this.enabled = false;
}

I have SaveOnConfigSet set to true and tried a couple of test submissions which saved to the config file successfully:

[World.51cec5e8-76b4-4926-a00c-f3f936d14233]
# Setting type: String
# Default value: 1234
18890 = 1234

# Setting type: String
# Default value: test2
18887 = test2

When the player later hovers their crosshair over this object I hook the method that gets the "Interact" HUD text and add their label to it:

Plugin.ConfigInstance.TryGetEntry(
    $"World.{guid}",
    boxIndex.ToString(),
    out ConfigEntry<string> entryMaybe
);
if (entryMaybe != null && !entryMaybe.Value.IsNullOrEmpty())
{
    __result += $"\n{entryMaybe.Value}";
}

All of this works fine during a single play session. However when I restart the game the Entries property inside the ConfigFile is empty, and both entries have been moved to OrphanedEntries. How can I prevent this from happening? I read that entries are only orphaned if Bind isn't called on them, but I use that method to create them and they're saved, should they not be loaded back into Entries the next time I start the game? Since all the values are set at runtime I can't Bind everything inside my plugin Awake method, so I'm not sure how to keep them 'active' so to speak. Any help would be greatly appreciated!

Configurations doesn't save on servers with -crossplay startup parameters

Hello!

I don't know is that possible, but noticed that some days ago. When I run my servers with -crossplay switch, then Configuration Manager doesnt save locked files (admin locked). It's probably just because mod doesnt recognize the admin correctly (with -crossplay enabled, id of player is steam_76561197960287930 instead of only numbers at server without crossplay enabled).

Console

When installing your mod, the console disappears-pressing F5 does not give anything (the "-console " command is present when starting the game)

Bepinex does not see the ConfigurationManager

ConfigurationManager does not work, nothing happens when I press F1, also in the Bepinex console nothing about ConfigurationManager is written, I have tried everything, downloaded different versions of ConfigurationManager and Bepinex, no help, other plugins work (for example my plugin and UnityExplorer work)

I may not understand something, and I may be making a stupid mistake, but I'm new to this and I don't understand.
Bepinex I downloaded from here: BepInEx Bleeding Edge (BE) builds (The official Bepinex does not work)
ConfigurationManager I downloaded from here: Github
Game: Paint the town red (License) [Unity 2020.3.34f1, IL2cpp]

p.s. I couldn't find anything on the internet about this, so I gave up and wrote here

KK_CyuVR can not work since v17.0

When I update my ConfigurationManager in to v17, I found that CyuVR can not work and when I go back to v16.4 it can working.
I think CyuVR is a good plug for vr player, coud you do something to support it in the next version?

[Feature] Admin only settings

With more and more games using the internet, there is a real need for server side only settings.
For the configuration manager we'd only need an additional flag per entry (to determine if it is a server setting) and one global flag to determine if the serversettings are to be shown/editable in the configuration manager.

Synchronization would have to be done on the mod side anyway, so the impact/side effects of this change would be minimal.

Reload ConfigurationManagerAttributes on change

I have some settings which are only relevant when some other setting is set to a specific value.

How would I hide them? I can set Browsable = someNewValue in the SettingChanged handler of the ConfigEntries, but it will only take effect when BuildSettingList() is re-executed (e.g. on re-open, when toggling debugmode ...).
I can invoke it myself via reflection as well, but this still is not satisfying because of this

todo item not being implemented yet.

Would it be possible to have that todo item implemented and the settings rebuild ideally publicly accessible?

Alternatively an accessible callback to just rebuild a given mods settings would be also great (and probably the best solution).

F1 not working

I just installed this on a new system (Win 11) yesterday and the config manager doesn't appear when I press F1. I am not tech savvy so looking at logs is useless for me as I wouldn't know what an error in the logs look like nor where to find them.

This works perfectly on Win 7 but not on my Win 11 system.

BepInEx4 reference breaks Assembly.GetTypes() (System.Reflection)

Phew, it took me over an hour to get to the bottom of this confusing exception... I hope I got it right!

Because the types LegacySettingSearcher and SavedKeyboardShortcut (both in the Obsolete folder) still exist in the code, GetTypes() throws ReflectionTypeLoadException unless the user is consciously using BepIn4Patcher - which isn't shipped with ConfigurationManager (nor with BepInEx 5) and there's no information of such (very conditional, but actual) dependency.

And yes, there are game libraries which actually use GetTypes() in production code - I've stumbled upon this issue in whichever version of AwesomeTechnology's VegetationStudio the game Outward is using.

Obviously, the root of the issue is not the ConfigurationManager, but other libraries using GetTypes() AND using it outside of the try-catch block. Currently, Outward players have to harmony-patch GetTypes() so it ignores missing assemblies (which requires a separate plugin) and even though the patch is conveniently included in the most popular Outward modding tool (SideLoader), it's still somewhat of a dirty, too-far-down-the-road workaround.

Removing ConfigurationManager's obsolete code and the BepIn4Patcher reference won't fix the issue at its source, but it will be at least one step up.

And if that's too risky for BepInEx4 backwards compatibility, there should at least be information that ConfigurationManager requires the BepIn4Patcher in some games (as the users won't know whether their game uses GetTypes() or not).

PS. I'm a huge fan of ConfigurationManager, thank you for your work <3

Text boxes don't scroll horizontally in Valheim

Instead the cursor just goes out of view. This is a problem for me as my users paste file paths in there and often these can't be verified as correct because only the first part of the path can be viewed, e.g.:
image

Custom ConfigFile cannot be shown

I create a new plugin base on BaseUnityPlugin and bind a new BepInEx.Configuration.ConfigFile which is under the floder "BepInEx\config\XXX". It seems like bind method works well, but F1 could not show any info about this plugin
if (hsUnitID.Length <= 0) ConfigBind(base.Config); else ConfigBind(new BepInEx.Configuration.ConfigFile(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "BepInEx/config", hsUnitID, PluginInfo.PLUGIN_GUID + ".cfg"), false, new BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)));

Allow easier keyboard reading in custom drawers

Currently as it stands reading from the keyboard (Input.GetKeyDown, etc..) appears to be, at best, very difficult from a custom drawer without requiring a reference to ConfigurationManager.dll.

The main root of this lies in the config manager OnGUI at

if (!SettingFieldDrawer.SettingKeyboardShortcut)
UnityInput.Current.ResetInputAxes();
which resets the keyboard inputs every frame. This is easy to work around in a global drawer by including ConfigurationManager.dll and simply setting SettingFieldDrawer._currentKeyboardShortcutToSet to your current SettingEntryBase.
private static SettingEntryBase _currentKeyboardShortcutToSet;
public static bool SettingKeyboardShortcut => _currentKeyboardShortcutToSet != null;
HOWEVER, in a drawer that is not global and does not include ConfigurationManager.dll, the signature is:

static void CustomDrawer(BepInEx.Configuration.ConfigEntryBase entry)

And of course since the type is different you can no longer simply set that variable.

If there is an easy workaround that I'm missing I'd gladly make use of it but I can't seem to find one.

Bepinex Configuration Manager no Plugins shown

Hi,
I haven't found a forum so I write here:
I use BepInEx 5.4.10.0 on Valheim classic.
I have 26 Plugins loaded, but if I press F1 no Plugin is shown. Plugins seem to work fine.
bepinex

Earlier it worked, but since I installed some Plugin, it's broken.
I'm not sure, but I think the latest plugin I tried to install was PreciseRotation.
Addons are installed via Vortex.
Configuration Manger v16.3 is installed.
If you need any information, please contact me.
Many thanks,
Urmel

Validate values on lost focus instead of immediately / Typing in floats is difficult and using - characters can throw up errors.

ConfigurationManager seems to really dislike it when you try to type in 0 after values higher than 0 in a decimal position. It also seems to really dislike typing in zeros before them in whole number places. Makes the configurations kinda wonky to use.

Also, trying to type a - sign anywhere but the start of the number throws up a good chunk of red in the console.

Hope this is fixed, configmanager is really handy for development...

Thunderstore Mod Manager?

Forgive me if this was mentioned somewhere, I haven't found it.

Is there any reason this isn't on the Thunderstore Mod Manager?

I just learned about this through the info page of DSP Drone Clearing and I love it. It's the first time I'm finding a mod that's not on Thunderstore so... discoverability maybe?

ConfigurationManager doesn't open after launching the game and pressing F1

I downloaded the latest release at the time of writing this, and placed ConfigurationManager (alongisde the provided XML - I don't know where to put it) in BepInEx/plugins, ran the game and pressed F1, per the How to Use section.
It doesn't open for me.
I do want to mention that I have the BepInEx console enabled, so it opens when I start the game - I don't know if that's relevant or not.

UI/Font Size

Hello,
would it be possible to add an option to increase UI/Font Size?
I'm using 4k monitors, and it is very hard to read :(

Thanks

can't see mouse cursor

I can't see my mouse cursor when I press F1 to bring up the configuration in game, it makes it very difficult to click on things. is windowed mode an issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.