Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Commit e8ebd82

Browse files
committed
Add "nomods" configuration
1 parent b89db33 commit e8ebd82

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

NeosModLoader/Configuration.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ internal static Configuration get()
3939
{
4040
_configuration.Debug = true;
4141
}
42+
else if ("nomods".Equals(key) && "true".Equals(value))
43+
{
44+
_configuration.NoMods = true;
45+
}
4246
}
4347
}
4448
}
@@ -71,5 +75,6 @@ private static string GetAssemblyDirectory()
7175

7276
public bool Unsafe { get; private set; } = false;
7377
public bool Debug { get; private set; } = false;
78+
public bool NoMods { get; private set; } = false;
7479
}
7580
}

NeosModLoader/ModLoader.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ namespace NeosModLoader
1010
{
1111
internal class ModLoader
1212
{
13-
public static readonly string VERSION = "1.2.0";
13+
public static readonly string VERSION = "1.2.1";
1414
private static readonly Type NEOS_MOD_TYPE = typeof(NeosMod);
1515
internal static Dictionary<Assembly, NeosMod> LoadedMods { get; } = new Dictionary<Assembly, NeosMod>();
1616

1717
internal static void LoadMods()
1818
{
19+
if (Configuration.get().NoMods)
20+
{
21+
Logger.DebugInternal("mods will not be loaded due to configuration file");
22+
return;
23+
}
24+
1925
string modDirectory = Directory.GetParent(Process.GetCurrentProcess().MainModule.FileName).FullName + "\\nml_mods";
2026
Logger.DebugInternal($"loading mods from {modDirectory}");
2127

NeosModLoader/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("1.2.0.0")]
35-
[assembly: AssemblyFileVersion("1.2.0.0")]
34+
[assembly: AssemblyVersion("1.2.1.0")]
35+
[assembly: AssemblyFileVersion("1.2.1.0")]

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,16 @@ It showcases the following:
109109
- A valid Visual Studio project setup
110110
- Using LibHarmony to patch a Neos method
111111
- Using Unity to alter all existing GameObjects of a certain type
112+
113+
### Configuration
114+
NeosModLoader aims to have a reasonable default configuration, but certain things can be changed via a config file.
115+
The `NeosModLoader.config` file should be placed in the same directory as `NeosModLoader.dll`, and contains keys and values in the following format:
116+
```
117+
debug=true
118+
nomods=false
119+
```
120+
121+
| Configuration | Default | Description |
122+
| --- | --- | --- |
123+
| `debug` | `false` | if `true`, NeosMod.Debug() logs will appear in your log file. Otherwise, they are hidden. |
124+
| `nomods` | `false` | if `true`, mods will not be loaded. |

0 commit comments

Comments
 (0)