Merge pull request #70 from oiltanker/master

Cs mod store folder method for storing configs, etc.
This commit is contained in:
Evil Factory
2022-04-27 16:04:23 -03:00
committed by GitHub
3 changed files with 13 additions and 2 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;

View File

@@ -12,7 +12,7 @@ namespace Barotrauma
{
public delegate void LuaCsAction(params object[] args);
public delegate object LuaCsFunc(params object[] args);
public delegate object LuaCsPatch(object self, object args);
public delegate object LuaCsPatch(object self, Dictionary<string, object> args);
public class LuaCsHook
{