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

Borderlands: The Pre-Sequel · handler “Borderlands The Pre-Sequel”

Version 7

Release notes

regular windowed UI option.

Released
Size
2.4 KB
Downloads
1,175
Check
Verified
SHA-256
63269934594aafef20ea4a8921faf35c71b6e8cfa9b10f2c16ec593f8a0ac142
Download v7 (.nc)All versions

Files 1

PathSize
handler.js8.6 KB

handler.js

Plain text
Hub.Handler.Version = 7; // Released at https://hub.splitscreen.me/ on Sun Nov 29 2020 22:28:43 GMT+0000 (UTC).
Hub.Handler.Id = "3gM5bRsyfDwExB4Yu";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";

var answers1 = ["Disabled", "Enable"];
var answers2 = ["Disabled", "Enable"];
var answers3 = ["Default", "Enable", "Disable"];
Game.AddOption("Keyboard instance fix", "Only use if you're using one kb/m and the kb instance isn't working correctly.", "FIX", answers1);
Game.AddOption("Windowed mode.", "Only use if you want the instances to open in regular windowed mode.", "Windowed", answers2);
Game.AddOption("Enable multiple keyboards and mice support?", "Launch then close Nucleus and open it again for the mkb support to enable.", "MKB", answers3);

Game.DirSymlinkExclusions = ["binaries\\win32"];
Game.FileSymlinkExclusions = ["steam_api.dll", "steam_appid.txt", "steam_interfaces.txt", "d3d9.dll"];
Game.GameName = "Borderlands The Pre-Sequel";
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = true;
Game.SupportsKeyboard = true;
Game.ExecutableName = "borderlandspresequel.exe";
Game.SteamID = "261640";
Game.GUID = "Borderlands The Pre-Sequel";
Game.MaxPlayers = 4;
Game.MaxPlayersOneMonitor = 4;
Game.BinariesFolder = "binaries\\win32";
Game.NeedsSteamEmulation = false;
Game.UseGoldberg = true;
Game.LauncherTitle = "splashscreen";
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "Borderlands: The Pre-Sequel (32-bit, DX9)";
Game.UseDirectX9Wrapper = true;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.XInputPlusDll = ["xinput1_3.dll"];
Game.Hook.CustomDllEnabled = false;
Game.FakeFocus = false;
Game.HookFocus = true;
Game.SetWindowHookStart = false;
Game.ResetWindows = false;
Game.UserProfileSavePath = "Documents\\My Games\\Borderlands The Pre-Sequel\\WillowGame\\SaveData";
Game.UserProfileConfigPath = "Documents\\My Games\\Borderlands The Pre-Sequel\\WillowGame\\Config";
Game.Description =
  "Go to network options, network mode and select LAN in each instance, then use the find games option to join the other players. If you launch an instance with the keyboard icon the last instance that opens will always be the keyboard player. If you enable multikeyboard/mice support in the UI options press the END key in your keyboard to unlock the input when you finish playing. You can also use CTRL+Q to close Nucleus and all its instances.";
Game.PauseBetweenStarts = 35;

Game.SupportsMultipleKeyboardsAndMice = false;

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

Game.SendNormalMouseInput = true;
Game.SendNormalKeyboardInput = true;
Game.SendScrollWheel = false;
Game.ForwardRawKeyboardInput = false;
Game.ForwardRawMouseInput = false;
Game.HookReRegisterRawInput = false;
Game.HookReRegisterRawInputMouse = false;
Game.HookReRegisterRawInputKeyboard = false;
Game.DrawFakeMouseCursor = true;
Game.LockInputAtStart = true;
Game.LockInputToggleKey = 0x23;

Game.Play = function() {
  var savePath = Context.GetFolder(Nucleus.Folder.Documents) + "\\My Games\\Borderlands The Pre-Sequel\\WillowGame\\Config\\WillowEngine.ini";
  Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
    new Nucleus.IniSaveInfo("SystemSettings", "WindowedFullscreen", Context.IsFullscreen),
    new Nucleus.IniSaveInfo("SystemSettings", "Fullscreen", true),
    new Nucleus.IniSaveInfo("Engine.Engine", "bPauseOnLossOfFocus", false),
    new Nucleus.IniSaveInfo("WillowGame.WillowGameEngine", "bPauseLostFocusWindowed", false),
    new Nucleus.IniSaveInfo("Engine.Engine", "bMuteAudioWhenNotInFocus", false),
    new Nucleus.IniSaveInfo("Engine.Engine", "bPauseOnLossOfFocus", false),
    new Nucleus.IniSaveInfo("WillowGame.WillowGameEngine", "bMuteAudioWhenNotInFocus", false)
  ]);

  if (Context.IsKeyboardPlayer) {
    Context.StartArguments = "-AlwaysFocus -nosplash -NoController" + " -ResX= " + Context.Width + " -ResY= " + Context.Height;

    Context.Hook.BlockMouseEvents = "False";
    Context.Hook.BlockKeyboardEvents = "False";
    Context.Hook.BlockInputEvents = "False";
    Context.Hook.ForceFocus = "False";
  } else {
    Context.StartArguments = "-AlwaysFocus -nosplash -nomouse" + " -ResX= " + Context.Width + " -ResY= " + Context.Height;

    Context.Hook.BlockMouseEvents = "True";
    Context.Hook.BlockKeyboardEvents = "True";
    Context.Hook.BlockInputEvents = "True";
    Context.Hook.ForceFocus = "True";
  }

  var interfaces = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\binaries\\win32\\steam_interfaces.txt";
  var lines = [
    "SteamClient012",
    "SteamGameServer011",
    "SteamGameServerStats001",
    "SteamUser016",
    "SteamFriends013",
    "SteamUtils005",
    "SteamMatchMaking009",
    "SteamMatchMakingServers002",
    "STEAMUSERSTATS_INTERFACE_VERSION011",
    "STEAMAPPS_INTERFACE_VERSION005",
    "SteamNetworking005",
    "STEAMREMOTESTORAGE_INTERFACE_VERSION008",
    "STEAMSCREENSHOTS_INTERFACE_VERSION001",
    "STEAMHTTP_INTERFACE_VERSION001"
  ];

  Context.WriteTextFile(interfaces, lines);

  var fix = Context.Options["FIX"];
  var windowed = Context.Options["Windowed"];
  var mkb = Context.Options["MKB"];

  if (fix == "Disabled") {
  }

  if (fix == "Enable") {
    Game.Hook.CustomDllEnabled = true;
    Game.Hook.UseAlpha8CustomDll = true;
    Game.HookFocus = false;
  }
  if (windowed == "Disabled") {
  }

  if (windowed == "Enable") {
    Game.SetWindowHookStart = true;
    Game.ResetWindows = true;

    var savePath = Context.GetFolder(Nucleus.Folder.Documents) + "\\My Games\\Borderlands The Pre-Sequel\\WillowGame\\Config\\WillowEngine.ini";
    Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
      new Nucleus.IniSaveInfo("SystemSettings", "WindowedFullscreen", Context.IsFullscreen),
      new Nucleus.IniSaveInfo("SystemSettings", "Fullscreen", false),
      new Nucleus.IniSaveInfo("Engine.Engine", "bPauseOnLossOfFocus", false),
      new Nucleus.IniSaveInfo("WillowGame.WillowGameEngine", "bPauseLostFocusWindowed", false),
      new Nucleus.IniSaveInfo("Engine.Engine", "bMuteAudioWhenNotInFocus", false),
      new Nucleus.IniSaveInfo("Engine.Engine", "bPauseOnLossOfFocus", false),
      new Nucleus.IniSaveInfo("WillowGame.WillowGameEngine", "bMuteAudioWhenNotInFocus", false)
    ]);

    if (Context.IsKeyboardPlayer) {
      Context.StartArguments = "-windowed -AlwaysFocus -nosplash -NoController" + " -ResX= " + Context.Width + " -ResY= " + Context.Height;

      Context.Hook.BlockMouseEvents = "False";
      Context.Hook.BlockKeyboardEvents = "False";
      Context.Hook.BlockInputEvents = "False";
      Context.Hook.ForceFocus = "False";
    } else {
      Context.StartArguments = "-windowed -AlwaysFocus -nosplash -nomouse" + " -ResX= " + Context.Width + " -ResY= " + Context.Height;

      Context.Hook.BlockMouseEvents = "True";
      Context.Hook.BlockKeyboardEvents = "True";
      Context.Hook.BlockInputEvents = "True";
      Context.Hook.ForceFocus = "True";
    }
  }
  if (mkb == "Default") {
  }

  if (mkb == "Enable") {
    var NucleusRoot = System.IO.Path.Combine(Game.Folder, "..", "..");
    var cfgFilePath = NucleusRoot + "\\scripts\\Borderlands The Pre-Sequel.js";

    var multiple = Context.FindLineNumberInTextFile(cfgFilePath, "Game.SupportsMultipleKeyboardsAndMice", Nucleus.SearchType.StartsWith);
    var keyboard = Context.FindLineNumberInTextFile(cfgFilePath, "Game.SupportsKeyboard", Nucleus.SearchType.StartsWith);

    Context.ReplaceLinesInTextFile(cfgFilePath, [multiple + "|Game.SupportsMultipleKeyboardsAndMice = true; ", keyboard + "|Game.SupportsKeyboard = false; "]);
  }
  if (mkb == "Disable") {
    var NucleusRoot = System.IO.Path.Combine(Game.Folder, "..", "..");
    var cfgFilePath = NucleusRoot + "\\scripts\\Borderlands The Pre-Sequel.js";

    var multiple = Context.FindLineNumberInTextFile(cfgFilePath, "Game.SupportsMultipleKeyboardsAndMice", Nucleus.SearchType.StartsWith);
    var keyboard = Context.FindLineNumberInTextFile(cfgFilePath, "Game.SupportsKeyboard", Nucleus.SearchType.StartsWith);

    Context.ReplaceLinesInTextFile(cfgFilePath, [multiple + "|Game.SupportsMultipleKeyboardsAndMice = false; ", keyboard + "|Game.SupportsKeyboard = true; "]);
  }
};