-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathUMFAPI.cs
More file actions
153 lines (133 loc) · 3.97 KB
/
Copy pathUMFAPI.cs
File metadata and controls
153 lines (133 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
using GadgetCore.API;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.CompilerServices;
using UModFramework.API;
namespace GadgetCore
{
internal class UMFAPI : IUMFAPI
{
[MethodImpl(MethodImplOptions.NoInlining)]
public string GetConfigsPath()
{
return UMFData.ConfigsPath;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public string GetModInfosPath()
{
return UMFData.ModInfosPath;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public string GetLibrariesPath()
{
return UMFData.LibrariesPath;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public List<string> GetModLibraries()
{
try
{
return GetModLibraries_Internal();
}
catch (MissingMethodException)
{
return new List<string>();
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
private List<string> GetModLibraries_Internal()
{
return UMFData.ModLibraries;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public List<string> GetModNames()
{
return UMFData.ModNames;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public List<string> GetModNamesEnabled()
{
return UMFData.ModNamesEnabled;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public List<string> GetModNamesMissingDependencies()
{
try
{
return GetModNamesMissingDependencies_Internal();
}
catch (MissingMethodException)
{
return new List<string>();
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
private List<string> GetModNamesMissingDependencies_Internal()
{
return UMFData.ModNamesMissingDependencies;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public List<Assembly> GetMods()
{
return UMFData.Mods;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public string GetModsPath()
{
return UMFData.ModsPath;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public string GetUMFPath()
{
return UMFData.UMFPath;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public Version GetVersion()
{
return UMFData.Version;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public string GetDisabledModsFile()
{
return UMFData.DisabledModsFile;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public bool IsLibrary(string modName)
{
try
{
return IsLibrary_Internal(modName);
}
catch (MissingMethodException)
{
return false;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
private bool IsLibrary_Internal(string modName)
{
return UMFData.IsLibrary(modName);
}
[MethodImpl(MethodImplOptions.NoInlining)]
public void SendCommand(string command, bool openConsole = false)
{
UMFGUI.SendCommand(command, openConsole);
}
[MethodImpl(MethodImplOptions.NoInlining)]
public string GetModDescription(string modName, bool caseInsensitive = false)
{
return UMFMod.GetModDescription(modName, caseInsensitive);
}
[MethodImpl(MethodImplOptions.NoInlining)]
public Version GetModVersion(string modName)
{
return UMFMod.GetModVersion(modName);
}
[MethodImpl(MethodImplOptions.NoInlining)]
public Assembly GetModAssembly(string modName)
{
return UMFMod.GetMod(modName);
}
}
}