Cs mod store folder method for storing configs, etc.

This commit is contained in:
Oiltanker
2022-04-26 16:19:56 +03:00
parent 60ddfb831b
commit ed92a12db6
2 changed files with 12 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
namespace Barotrauma
@@ -9,6 +10,16 @@ namespace Barotrauma
private static List<ACsMod> mods = new List<ACsMod>();
public static List<ACsMod> LoadedMods { get => mods; }
private const string MOD_STORE = "LocalMods/.modstore";
public static string GetSoreFolder<T>() where T : ACsMod
{
if (!Directory.Exists(MOD_STORE)) Directory.CreateDirectory(MOD_STORE);
var modFolder = $"{MOD_STORE}/{typeof(T)}";
if (!Directory.Exists(modFolder)) Directory.CreateDirectory(modFolder);
return modFolder;
}
public bool IsDisposed { get; private set; }
public ACsMod()

View File

@@ -14,7 +14,7 @@ namespace Barotrauma
{
class CsScriptLoader : CsScriptBase
{
public LuaCsSetup setup;
private LuaCsSetup setup;
private List<MetadataReference> defaultReferences;
private Dictionary<string, List<string>> sources;