Skip to content

Commit 8de4a15

Browse files
committed
Rename System.Drawing shims
1 parent 35a82a3 commit 8de4a15

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

OTAPI.Scripts/Shims/System.Drawing/Redirect.Server.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
1717
along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919
using ModFramework;
20+
using System.Linq;
2021

2122
/// <summary>
2223
/// @doc Shims and relinks System.Drawing.Graphics
@@ -31,5 +32,19 @@ public static void RedirectAssembly(ModFwModder modder)
3132
{
3233
modder.RelinkAssembly("System.Drawing.Graphics");
3334
}
35+
36+
/// <summary>
37+
/// Renames the System.Graphics shim due to conflicts with plugins that use the newer NuGet package.
38+
/// </summary>
39+
/// <remarks>These shims are not intended for use</remarks>
40+
/// <see cref="https://github.com/elevatorguy/map/issues/4"/>
41+
/// <param name="modder"></param>
42+
[Modification(ModType.PostPatch, "Renaming System.Drawing")]
43+
public static void Rename(ModFwModder modder)
44+
{
45+
var type = modder.Module.Types.Where(x => x.Namespace == "System.Drawing");
46+
foreach (var mod in type)
47+
mod.Namespace += ".Shims";
48+
}
3449
}
3550
}

0 commit comments

Comments
 (0)