using System; using System.Collections.Generic; using System.IO; using Barotrauma.LuaCs; namespace Barotrauma { [Obsolete("Make your class implement IAssemblyPlugin instead.")] public abstract class ACsMod : IAssemblyPlugin { private static List mods = new List(); [Obsolete("$This does nothing. Stop using it!")] public static List LoadedMods { get => mods; } private const string MOD_STORE = "LocalMods/.modstore"; [Obsolete("$This does nothing. Stop using it!")] public static string GetStoreFolder() 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; } = false; /// /// Called as soon as plugin loading begins, use this for internal setup only. /// public virtual void Initialize() { } /// /// Called once all plugins have completed Initialization. Put cross-mod code here. /// public virtual void OnLoadCompleted() { } /// /// [NotImplemented] Called before vanilla content is loaded. Use to patch Barotrauma classes before they're /// instantiated. /// public void PreInitPatching() { } public virtual void Dispose() { try { Stop(); } catch (Exception e) { GameMain.LuaCs.Logger.HandleException(e); } IsDisposed = true; } public abstract void Stop(); } }