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