public override void Load() { Monitor.Log("Loading..."); Events = new Events(); //Disables FPS throttling when window is unfocused Terraria.Main.instance.InactiveSleepTime = new TimeSpan(0); //Make sure it doesnt start in borderless fullscreen Terraria.Main.screenBorderless = false; SplitScreen.Events.QuitGame += (o, e) => Terraria.Main.screenBorderless = false; toggleBorders = new ToggleBorders(); SplitScreen.Events.SecondaryLoad += delegate { //Multiple keyboard/mice keyboardManager = new MultipleKeyboardManager(); miceManager = new MultipleMiceManager(); miceManager.RegisterMice(); uiController = new UIController(keyboardManager, miceManager); Events.PreUpdate += OnPreUpdate; }; SplitScreen.Events.JoinedServer += delegate { uiController.ActivateUI(); keyboardManager.Initialize(); }; try { HarmonyInstance harmony = HarmonyInstance.Create("me.ilyaki.terrariaSplitScreen"); //Run AFTER subscribing to Events harmony.PatchAll(Assembly.GetExecutingAssembly()); }catch (Exception) { Monitor.Log("Could not patch with Harmony. This is probably because of a mod reload instead of a fresh restart"); } }