working rebase
This commit is contained in:
@@ -7,14 +7,14 @@ namespace Barotrauma
|
||||
{
|
||||
public static void Check()
|
||||
{
|
||||
if (!File.Exists(LuaSetup.VERSION_FILE)) { return; }
|
||||
if (!File.Exists(LuaCsSetup.VERSION_FILE)) { return; }
|
||||
|
||||
ContentPackage luaCsPackage = LuaSetup.GetPackage();
|
||||
ContentPackage luaCsPackage = LuaCsSetup.GetPackage();
|
||||
string luaCsPath = Path.GetDirectoryName(luaCsPackage.Path);
|
||||
|
||||
if (luaCsPackage == null) { return; }
|
||||
|
||||
string clientVersion = File.ReadAllText(LuaSetup.VERSION_FILE);
|
||||
string clientVersion = File.ReadAllText(LuaCsSetup.VERSION_FILE);
|
||||
string workshopVersion = luaCsPackage.ModVersion;
|
||||
|
||||
if (clientVersion == workshopVersion) { return; }
|
||||
@@ -39,7 +39,7 @@ namespace Barotrauma
|
||||
File.Copy(Path.Combine(luaCsPath, "Binary", file), file, true);
|
||||
}
|
||||
|
||||
File.WriteAllText(LuaSetup.VERSION_FILE, workshopVersion);
|
||||
File.WriteAllText(LuaCsSetup.VERSION_FILE, workshopVersion);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -442,7 +442,7 @@ namespace Barotrauma
|
||||
}
|
||||
};
|
||||
|
||||
string version = File.Exists(LuaSetup.VERSION_FILE) ? File.ReadAllText(LuaSetup.VERSION_FILE) : "Github";
|
||||
string version = File.Exists(LuaCsSetup.VERSION_FILE) ? File.ReadAllText(LuaCsSetup.VERSION_FILE) : "Github";
|
||||
|
||||
new GUITextBlock(new RectTransform(new Point(300, 30), Frame.RectTransform, Anchor.TopLeft) { AbsoluteOffset = new Point(10, 10) }, $"Using LuaCsForBarotrauma revision {AssemblyInfo.GitRevision} version {version}", Color.Red)
|
||||
{
|
||||
@@ -525,7 +525,7 @@ namespace Barotrauma
|
||||
#region Selection
|
||||
public override void Select()
|
||||
{
|
||||
GameMain.Lua.Stop();
|
||||
GameMain.LuaCs.Stop();
|
||||
|
||||
if (WorkshopItemsToUpdate.Any())
|
||||
{
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Barotrauma
|
||||
.Where(p => p != null).ToArray());
|
||||
}
|
||||
GameMain.NetLobbyScreen.Select();
|
||||
GameMain.Lua.Initialize();
|
||||
GameMain.LuaCs.Initialize();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ namespace Barotrauma
|
||||
ContentPackageManager.EnabledPackages.SetRegular(regularPackages);
|
||||
|
||||
GameMain.NetLobbyScreen.Select();
|
||||
GameMain.Lua.Initialize();
|
||||
GameMain.LuaCs.Initialize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1049,7 +1049,7 @@ namespace Barotrauma
|
||||
GameMain.SubEditorScreen.Select();
|
||||
};
|
||||
|
||||
GameMain.Lua.Initialize();
|
||||
GameMain.LuaCs.Initialize();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1319,7 +1319,7 @@ namespace Barotrauma
|
||||
|
||||
public void Select(bool enableAutoSave = true)
|
||||
{
|
||||
GameMain.Lua.Stop();
|
||||
GameMain.LuaCs.Stop();
|
||||
|
||||
base.Select();
|
||||
|
||||
|
||||
@@ -1253,7 +1253,7 @@ namespace Barotrauma
|
||||
|
||||
commands.Add(new Command("install_cl_lua", "Installs client-Side Lua into your client.", (string[] args) =>
|
||||
{
|
||||
ContentPackage luaPackage = LuaCsSetup.GetLuaPackage();
|
||||
ContentPackage luaPackage = LuaCsSetup.GetPackage();
|
||||
|
||||
if (luaPackage == null)
|
||||
{
|
||||
@@ -1283,11 +1283,11 @@ namespace Barotrauma
|
||||
File.Copy(Path.Combine(path, "Binary", file), file, true);
|
||||
}
|
||||
|
||||
File.WriteAllText(LuaSetup.VERSION_FILE, luaPackage.ModVersion);
|
||||
File.WriteAllText(LuaCsSetup.VERSION_FILE, luaPackage.ModVersion);
|
||||
}
|
||||
catch (UnauthorizedAccessException e)
|
||||
{
|
||||
GameMain.Lua.PrintError("You seem to already have Client Side Lua installed, if you are trying to reinstall, make sure uninstall it first (mainmenu button located top left).");
|
||||
GameMain.LuaCs.PrintError("You seem to already have Client Side Lua installed, if you are trying to reinstall, make sure uninstall it first (mainmenu button located top left).");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1832,7 +1832,7 @@ namespace Barotrauma.Networking
|
||||
IsDownloading = FileSender.ActiveTransfers.Any(t => t.Connection == client.Connection)
|
||||
};
|
||||
|
||||
GameMain.Lua.hook.Call("writeClientList.modifyTempClientData", c, client, tempClientData, outmsg);
|
||||
GameMain.LuaCs.Hook.Call("writeClientList.modifyTempClientData", c, client, tempClientData, outmsg);
|
||||
|
||||
outmsg.Write(tempClientData);
|
||||
outmsg.WritePadBits();
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
#if SERVER
|
||||
private void PrintError(object message) => PrintErrorBase("[SV LUA ERROR] ", message, "nil");
|
||||
public void PrintError(object message) => PrintErrorBase("[SV LUA ERROR] ", message, "nil");
|
||||
public static void PrintCsError(object message) => PrintErrorBase("[SV CS ERROR] ", message, "Null");
|
||||
public static void PrintBothError(object message) => PrintErrorBase("[SV ERROR] ", message, "Null");
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user