content package fixes
This commit is contained in:
@@ -1253,15 +1253,7 @@ namespace Barotrauma
|
||||
|
||||
commands.Add(new Command("install_cl_lua", "Installs client-Side Lua into your client.", (string[] args) =>
|
||||
{
|
||||
ContentPackage luaPackage = null;
|
||||
|
||||
foreach (ContentPackage package in ContentPackageManager.AllPackages)
|
||||
{
|
||||
if (package.NameMatches(new Identifier("LuaForBarotraumaUnstable")))
|
||||
{
|
||||
luaPackage = package;
|
||||
}
|
||||
}
|
||||
ContentPackage luaPackage = LuaSetup.GetLuaPackage();
|
||||
|
||||
if (luaPackage == null)
|
||||
{
|
||||
|
||||
@@ -85,7 +85,7 @@ defaultLib["TextManager"] = CreateStatic("Barotrauma.TextManager")
|
||||
defaultLib["NetEntityEvent"] = CreateStatic("Barotrauma.Networking.NetEntityEvent")
|
||||
defaultLib["Screen"] = CreateStatic("Barotrauma.Screen")
|
||||
defaultLib["AttackResult"] = CreateStatic("Barotrauma.AttackResult", true)
|
||||
defaultLib["TempClient"] = CreateStatic("Networking.TempClient", true)
|
||||
defaultLib["TempClient"] = CreateStatic("Barotrauma.Networking.TempClient", true)
|
||||
|
||||
defaultLib["AIObjective"] = CreateStatic("Barotrauma.AIObjective", true)
|
||||
defaultLib["AIObjectiveChargeBatteries"] = CreateStatic("Barotrauma.AIObjectiveChargeBatteries", true)
|
||||
|
||||
@@ -24,9 +24,19 @@ namespace Barotrauma
|
||||
|
||||
public LuaScriptLoader luaScriptLoader;
|
||||
|
||||
public void Update()
|
||||
public static ContentPackage GetLuaPackage()
|
||||
{
|
||||
hook?.Update();
|
||||
ContentPackage luaPackage = null;
|
||||
|
||||
foreach (ContentPackage package in ContentPackageManager.EnabledPackages.All)
|
||||
{
|
||||
if (package.NameMatches(new Identifier("LuaForBarotraumaUnstable")))
|
||||
{
|
||||
luaPackage = package;
|
||||
}
|
||||
}
|
||||
|
||||
return luaPackage;
|
||||
}
|
||||
|
||||
public void HandleLuaException(Exception ex, string extra = "")
|
||||
@@ -218,6 +228,11 @@ namespace Barotrauma
|
||||
luaScriptLoader.ModulePaths = str;
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
hook?.Update();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
harmony?.UnpatchAll();
|
||||
@@ -290,15 +305,7 @@ namespace Barotrauma
|
||||
|
||||
// LuaDocs.GenerateDocsAll();
|
||||
|
||||
ContentPackage luaPackage = null;
|
||||
|
||||
foreach (ContentPackage package in ContentPackageManager.AllPackages)
|
||||
{
|
||||
if (package.NameMatches(new Identifier("LuaForBarotraumaUnstable")))
|
||||
{
|
||||
luaPackage = package;
|
||||
}
|
||||
}
|
||||
ContentPackage luaPackage = GetLuaPackage();
|
||||
|
||||
if (File.Exists(LUA_PATH))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user