From 56a0d4b1e112f89831e14b55b4dc1eb11751fa65 Mon Sep 17 00:00:00 2001 From: Oiltanker Date: Fri, 15 Apr 2022 21:35:01 +0300 Subject: [PATCH] working rebase --- .../ClientSource/Lua/LuaCsUpdateChecker.cs | 8 ++++---- .../ClientSource/Screens/MainMenuScreen.cs | 4 ++-- .../ClientSource/Screens/ModDownloadScreen.cs | 4 ++-- .../ClientSource/Screens/SubEditorScreen.cs | 4 ++-- Barotrauma/BarotraumaServer/ServerSource/DebugConsole.cs | 6 +++--- .../ServerSource/Networking/GameServer.cs | 2 +- .../BarotraumaShared/SharedSource/LuaCs/LuaCsSetup.cs | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Barotrauma/BarotraumaClient/ClientSource/Lua/LuaCsUpdateChecker.cs b/Barotrauma/BarotraumaClient/ClientSource/Lua/LuaCsUpdateChecker.cs index 88caad34a..ba445d13f 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Lua/LuaCsUpdateChecker.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Lua/LuaCsUpdateChecker.cs @@ -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) { diff --git a/Barotrauma/BarotraumaClient/ClientSource/Screens/MainMenuScreen.cs b/Barotrauma/BarotraumaClient/ClientSource/Screens/MainMenuScreen.cs index 0502f00c0..9075ad8a4 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Screens/MainMenuScreen.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Screens/MainMenuScreen.cs @@ -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()) { diff --git a/Barotrauma/BarotraumaClient/ClientSource/Screens/ModDownloadScreen.cs b/Barotrauma/BarotraumaClient/ClientSource/Screens/ModDownloadScreen.cs index d0242a937..ab934a863 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Screens/ModDownloadScreen.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Screens/ModDownloadScreen.cs @@ -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(); } } } diff --git a/Barotrauma/BarotraumaClient/ClientSource/Screens/SubEditorScreen.cs b/Barotrauma/BarotraumaClient/ClientSource/Screens/SubEditorScreen.cs index 8808de8b9..ef0d4bd08 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Screens/SubEditorScreen.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Screens/SubEditorScreen.cs @@ -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(); diff --git a/Barotrauma/BarotraumaServer/ServerSource/DebugConsole.cs b/Barotrauma/BarotraumaServer/ServerSource/DebugConsole.cs index e9717c40e..b5b48d99c 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/DebugConsole.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/DebugConsole.cs @@ -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; } diff --git a/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs b/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs index bbc42cd10..b19f0c6fc 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs @@ -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(); diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsSetup.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsSetup.cs index dba7e7cc7..b921d003c 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsSetup.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsSetup.cs @@ -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