Skip to content
Beta: this is a preview of the new SplitScreen.Me. Data may be reset before launch.

Stardew Valley · handler “StardewValley”

Version 9

Release notes

do not apply coop cursor mod to kb instance.

Released
Size
2.4 KB
Downloads
2,009
Check
Verified
SHA-256
7a67608d34ce2436a33a17200eb4bf8b20f873ef982a568827e585ddaa7c54f2
Download v9 (.nc)All versions

Files 1

PathSize
handler.js8.8 KB

handler.js

Plain text
Hub.Handler.Version = 9; // Released at https://hub.splitscreen.me/ on Wed Jun 22 2022 05:42:49 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "LT3wMdrR7gPrKgfzb";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";

Game.ExecutableContext = ["Content"];
Game.DirSymlinkExclusions = ["Mods\\Coop Cursor"];
Game.FileSymlinkExclusions = ["steam_appid.txt", "Stardew Valley.exe", "StardewModdingAPI.exe", "xinput1_4.dll"];
Game.FileSymlinkCopyInstead = ["Coop Cursor.dll", "Coop Cursor.pdb"];
Game.NeedsSteamEmulation = false;
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = true;
Game.ExecutableName = "Stardew Valley.exe";
Game.SteamID = "413150";
Game.CreateSteamAppIdByExe = true;
Game.GUID = "Stardew Valley";
Game.GameName = "Stardew Valley";
Game.MaxPlayers = 4;
Game.MaxPlayersOneMonitor = 4;
Game.LauncherTitle = "conhost";
Game.HideTaskbar = false;
Game.SetTopMostAtEnd = true;
Game.Hook.ForceFocus = false;
Game.Hook.ForceFocusWindowName = "Stardew Valley";
Game.HasDynamicWindowTitle = true;
Game.RefreshWindowAfterStart = false;
Game.ResetWindows = true;
Game.SetWindowHook = false;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = false;
Game.Hook.XInputReroute = false;
Game.Hook.CustomDllEnabled = false;
Game.UserProfileConfigPath = "AppData\\Roaming\\StardewValley";
Game.UserProfileSavePath = "AppData\\Roaming\\StardewValley\\Saves";
Game.Description =
  "IMPORTANT: Intended for Multiple monitors only, one player per instance, the game already has 4 player native split-screen. To start a co-op game select co-op, host a new farm and select the number of starting cabins you want (this equals the number of players), the other instances then select join LAN game, leave the field blank, press ok and join. If you have SMAPI installed for mods in your main files the handler will automatically launch the SMAPI exe even if you added the game to Nucleus by selecting the vanilla exe so do not rename any exes, installing the Co-op cursor mod by DeLiXx is recommended to fix the known issue of all instances sharing the same cursor.";
Game.ForceProcessPick = false;
Game.PauseBetweenProcessGrab = 7;
Game.PauseBetweenStarts = 30;

//USS deprecated options:

Game.HookSetCursorPos = false;
Game.HookGetCursorPos = false;
Game.HookGetKeyState = false;
Game.HookGetAsyncKeyState = false;
Game.HookGetKeyboardState = false;
Game.HookFilterRawInput = false;
Game.HookFilterMouseMessages = false;
Game.HookUseLegacyInput = false;
Game.HookDontUpdateLegacyInMouseMsg = false;
Game.HookMouseVisibility = false;
Game.InjectHookXinput = false;

Game.SendNormalMouseInput = false;
Game.SendNormalKeyboardInput = false;
Game.SendScrollWheel = false;
Game.ForwardRawKeyboardInput = false;
Game.ForwardRawMouseInput = false;
Game.HookReRegisterRawInput = false;
Game.HookReRegisterRawInputMouse = false;
Game.HookReRegisterRawInputKeyboard = false;
Game.DrawFakeMouseCursor = false;

//ProtoInput:

Game.SupportsMultipleKeyboardsAndMice = false;
Game.SupportsKeyboard = true;

Game.ProtoInput.InjectStartup = false;
Game.ProtoInput.InjectRuntime_RemoteLoadMethod = false;
Game.ProtoInput.InjectRuntime_EasyHookMethod = true;
Game.ProtoInput.InjectRuntime_EasyHookStealthMethod = false;

Game.LockInputAtStart = false;
Game.LockInputSuspendsExplorer = false;
Game.ProtoInput.FreezeExternalInputWhenInputNotLocked = false;
Game.LockInputToggleKey = 0x23;

Game.ProtoInput.RenameHandlesHook = false;
Game.ProtoInput.RenameHandles = [];
Game.ProtoInput.RenameNamedPipes = [];

Game.ProtoInput.RegisterRawInputHook = false;
Game.ProtoInput.GetRawInputDataHook = false;
Game.ProtoInput.MessageFilterHook = false;
Game.ProtoInput.GetCursorPosHook = false;
Game.ProtoInput.SetCursorPosHook = false;
Game.ProtoInput.GetKeyStateHook = false;
Game.ProtoInput.GetAsyncKeyStateHook = false;
Game.ProtoInput.GetKeyboardStateHook = false;
Game.ProtoInput.CursorVisibilityHook = false;
Game.ProtoInput.ClipCursorHook = false;
Game.ProtoInput.FocusHooks = true;
Game.ProtoInput.DrawFakeCursor = false;
Game.ProtoInput.AutoHideTaskbar = false;
Game.ProtoInput.SetWindowPosHook = false;
Game.ProtoInput.SetWindowStyleHook = false;

Game.ProtoInput.RawInputFilter = false;
Game.ProtoInput.MouseMoveFilter = false;
Game.ProtoInput.MouseActivateFilter = false;
Game.ProtoInput.WindowActivateFilter = false;
Game.ProtoInput.WindowActvateAppFilter = false;
Game.ProtoInput.MouseWheelFilter = false;
Game.ProtoInput.MouseButtonFilter = false;
Game.ProtoInput.KeyboardButtonFilter = false;

Game.ProtoInput.SendMouseWheelMessages = false;
Game.ProtoInput.SendMouseButtonMessages = false;
Game.ProtoInput.SendMouseMovementMessages = false;
Game.ProtoInput.SendKeyboardButtonMessages = false;
Game.ProtoInput.XinputHook = true;
Game.ProtoInput.UseOpenXinput = true;
Game.ProtoInput.UseDinputRedirection = false;
Game.ProtoInput.DinputDeviceHook = false;
Game.ProtoInput.DinputHookAlsoHooksGetDeviceState = false;
Game.ProtoInput.MultipleProtoControllers = true;

Game.ProtoInput.EnableFocusMessageLoop = true;
Game.ProtoInput.FocusLoopIntervalMilliseconds = 5000;
Game.ProtoInput.FocusLoop_WM_ACTIVATE = true;
Game.ProtoInput.FocusLoop_WM_ACTIVATEAPP = true;
Game.ProtoInput.FocusLoop_WM_NCACTIVATE = true;
//Game.ProtoInput.FocusLoop_WM_SETFOCUS = true;
//Game.ProtoInput.FocusLoop_WM_MOUSEACTIVATE = true;
Game.ProtoInput.BlockedMessages = [0x0008]; // Blocks WM_KILLFOCUS

Game.Play = function() {
  var path = Context.NucleusUserRoot + "\\AppData\\Roaming\\StardewValley\\startup_preferences";
  Context.ChangeXmlNodeInnerTextValue(path, "//skipWindowPreparation", "true");
  Context.ChangeXmlNodeInnerTextValue(path, "//windowMode", "1");
  Context.ChangeXmlNodeInnerTextValue(path, "//windowedBorderlessFullscreen", "false");
  Context.ChangeXmlNodeInnerTextValue(path, "//fullscreen", "false");
  Context.ChangeXmlNodeInnerTextValue(path, "//gamepadControls", "true");
  Context.ChangeXmlNodeInnerTextValue(path, "//hardwareCursor", "false");
  Context.ChangeXmlNodeInnerTextValue(path, "//fullscreenResolutionX", Context.Width);
  Context.ChangeXmlNodeInnerTextValue(path, "//fullscreenResolutionY", Context.Height);
  Context.ChangeXmlNodeInnerTextValue(path, "//preferredResolutionX", Context.Width);
  Context.ChangeXmlNodeInnerTextValue(path, "//preferredResolutionY", Context.Height);
  Context.ChangeXmlNodeInnerTextValue(path, "//pauseWhenOutOfFocus", "false");

  if (Player.Owner.IsFullscreen()) {
    var path = Context.NucleusUserRoot + "\\AppData\\Roaming\\StardewValley\\startup_preferences";
    Context.ChangeXmlNodeInnerTextValue(path, "//skipWindowPreparation", "false");
    Context.ChangeXmlNodeInnerTextValue(path, "//windowMode", "1");
    Context.ChangeXmlNodeInnerTextValue(path, "//windowedBorderlessFullscreen", "true");
    Context.ChangeXmlNodeInnerTextValue(path, "//fullscreen", "false");
  }

  if (Context.IsKeyboardPlayer) {
    var path = Context.NucleusUserRoot + "\\AppData\\Roaming\\StardewValley\\startup_preferences";
    Context.ChangeXmlNodeInnerTextValue(path, "//gamepadControls", "false");
    Context.ChangeXmlNodeInnerTextValue(path, "//hardwareCursor", "false");
  }

  if (System.IO.File.Exists(Context.OrigRootFolder + "\\StardewModdingAPI.exe")) {
    Game.PauseBetweenProcessGrab = 18;

    System.IO.File.Copy(System.IO.Path.Combine(Context.RootInstallFolder, "StardewModdingAPI.exe"), System.IO.Path.Combine(Context.RootFolder, "Stardew Valley.exe"), true);

    if (Context.IsKeyboardPlayer) {
      System.IO.File.Delete(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Mods\\Coop Cursor\\Coop Cursor.dll");
    }
  } else {
    System.IO.File.Copy(System.IO.Path.Combine(Context.RootInstallFolder, "Stardew Valley.exe"), System.IO.Path.Combine(Context.RootFolder, "Stardew Valley.exe"), true);
  }

  var numPlayers = 0;

  for (var i = 0; i < PlayerList.Count; i++) {
    var player = PlayerList[i];

    if (player.IsXInput && player.ScreenIndex !== -1) {
      numPlayers++;
    }
    player.ProtoController1 = Context.GamepadId;
    player.ProtoController2 = Context.GamepadId;
    player.ProtoController3 = Context.GamepadId;
    player.ProtoController4 = Context.GamepadId;
    player.ProtoController5 = Context.GamepadId;
    player.ProtoController6 = Context.GamepadId;
    player.ProtoController7 = Context.GamepadId;
    player.ProtoController8 = Context.GamepadId;
    player.ProtoController9 = Context.GamepadId;
    player.ProtoController10 = Context.GamepadId;
    player.ProtoController11 = Context.GamepadId;
    player.ProtoController12 = Context.GamepadId;
    player.ProtoController13 = Context.GamepadId;
    player.ProtoController14 = Context.GamepadId;
    player.ProtoController15 = Context.GamepadId;
    player.ProtoController16 = Context.GamepadId;
  }
};