This repository was archived by the owner on Feb 28, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +27
-3
lines changed Expand file tree Collapse file tree 4 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ internal static Configuration get()
39
39
{
40
40
_configuration . Debug = true ;
41
41
}
42
+ else if ( "nomods" . Equals ( key ) && "true" . Equals ( value ) )
43
+ {
44
+ _configuration . NoMods = true ;
45
+ }
42
46
}
43
47
}
44
48
}
@@ -71,5 +75,6 @@ private static string GetAssemblyDirectory()
71
75
72
76
public bool Unsafe { get ; private set ; } = false ;
73
77
public bool Debug { get ; private set ; } = false ;
78
+ public bool NoMods { get ; private set ; } = false ;
74
79
}
75
80
}
Original file line number Diff line number Diff line change @@ -10,12 +10,18 @@ namespace NeosModLoader
10
10
{
11
11
internal class ModLoader
12
12
{
13
- public static readonly string VERSION = "1.2.0 " ;
13
+ public static readonly string VERSION = "1.2.1 " ;
14
14
private static readonly Type NEOS_MOD_TYPE = typeof ( NeosMod ) ;
15
15
internal static Dictionary < Assembly , NeosMod > LoadedMods { get ; } = new Dictionary < Assembly , NeosMod > ( ) ;
16
16
17
17
internal static void LoadMods ( )
18
18
{
19
+ if ( Configuration . get ( ) . NoMods )
20
+ {
21
+ Logger . DebugInternal ( "mods will not be loaded due to configuration file" ) ;
22
+ return ;
23
+ }
24
+
19
25
string modDirectory = Directory . GetParent ( Process . GetCurrentProcess ( ) . MainModule . FileName ) . FullName + "\\ nml_mods" ;
20
26
Logger . DebugInternal ( $ "loading mods from { modDirectory } ") ;
21
27
Original file line number Diff line number Diff line change 31
31
// You can specify all the values or you can default the Build and Revision Numbers
32
32
// by using the '*' as shown below:
33
33
// [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" ) ]
Original file line number Diff line number Diff line change @@ -109,3 +109,16 @@ It showcases the following:
109
109
- A valid Visual Studio project setup
110
110
- Using LibHarmony to patch a Neos method
111
111
- 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. |
You can’t perform that action at this time.
0 commit comments