Fix LuaCs initializing too late for singleplayer campaigns and rework the C# prompt to only show when enabling mods/joining server
This commit is contained in:
+22
@@ -2,6 +2,7 @@
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.LuaCs.Events;
|
||||
using Barotrauma.Networking;
|
||||
using Barotrauma.Steam;
|
||||
using HarmonyLib;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
@@ -95,6 +96,27 @@ internal class HarmonyEventPatchesService : ISystem
|
||||
_eventService.PublishEvent<IEventScreenSelected>(x => x.OnScreenSelected(__instance));
|
||||
}
|
||||
|
||||
#if CLIENT
|
||||
[HarmonyPatch(typeof(MainMenuScreen), "StartGame"), HarmonyPostfix]
|
||||
public static void MainMenuScreen_StartGame_Pre(Screen __instance)
|
||||
{
|
||||
LuaCsSetup.Instance.SetRunState(RunState.Running);
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(MainMenuScreen), "LoadGame"), HarmonyPostfix]
|
||||
public static void MainMenuScreen_LoadGame_Pre(Screen __instance)
|
||||
{
|
||||
LuaCsSetup.Instance.SetRunState(RunState.Running);
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(MutableWorkshopMenu), nameof(MutableWorkshopMenu.Apply)), HarmonyPostfix]
|
||||
public static void MutableWorkshopMenu_Apply_Post(Screen __instance)
|
||||
{
|
||||
LuaCsSetup.Instance.PromptCSharpMods(selection => { }, joiningServer: false);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
[HarmonyPatch(typeof(ContentPackageManager.PackageSource), nameof(ContentPackageManager.PackageSource.Refresh)), HarmonyPostfix]
|
||||
public static void PackageSource_Refresh_Post()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user