added a way to know which content packages are enabled

This commit is contained in:
Evil Factory
2021-09-02 18:39:00 -03:00
parent 8b54f93f66
commit 1fbd7ee7f8
2 changed files with 10 additions and 2 deletions
@@ -8,6 +8,7 @@ using System.Threading.Tasks;
using Barotrauma.Items.Components;
using System.IO;
using System.Net;
using System.Linq;
namespace Barotrauma
{
@@ -338,7 +339,12 @@ namespace Barotrauma
{
return new Signal(value, stepsTaken, sender, source, power, strength);
}
public static ContentPackage[] GetEnabledContentPackages()
{
return GameMain.Config.AllEnabledPackages.ToArray();
}
}
@@ -201,6 +201,7 @@ namespace Barotrauma
UserData.RegisterType<FireSource>();
UserData.RegisterType<Fabricator>();
UserData.RegisterType<Pair<JobPrefab, int>>();
UserData.RegisterType<ContentPackage>();
lua = new Script(CoreModules.Preset_SoftSandbox);
@@ -210,7 +211,7 @@ namespace Barotrauma
hook = new LuaHook(this);
game = new LuaGame(this);
lua.Globals["dofile"] = (Func<string, Table, string, DynValue>)DoFile;
lua.Globals["loadfile"] = (Func<string, Table, string, DynValue>)LoadFile;
lua.Globals["require"] = (Func<string, Table, DynValue>)Require;
@@ -250,6 +251,7 @@ namespace Barotrauma
lua.Globals["Hull"] = UserData.CreateStatic<Hull>();
lua.Globals["InvSlotType"] = UserData.CreateStatic<InvSlotType>();
lua.Globals["Gap"] = UserData.CreateStatic<Gap>();
lua.Globals["ContentPackage"] = UserData.CreateStatic<ContentPackage>();
List<string> modulePaths = new List<string>();