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 8

Release notes

new ach option and cleaning.

Released
Size
2.6 KB
Downloads
985
Check
Verified
SHA-256
7f002f4f7329fb4b47c4176dd7ceb72a35ba40ff95c855c4aa601b6a7cbbd054
Download v8 (.nc)All versions

Files 1

PathSize
handler.js9.5 KB

handler.js

Plain text
Hub.Handler.Version = 8; // Released at https://hub.splitscreen.me/ on Sat Jun 12 2021 20:08:24 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"];
var answers4 = ["No", "Yes"];
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.AddOption("Launch all instances under your steam account?", "Only use if you want to unlock achievements or are using UCP for mods.", "Mods", answers4);

Game.DirSymlinkExclusions = ["Binaries\\Win32"];
Game.FileSymlinkExclusions = ["steam_api.dll", "steam_appid.txt", "steam_interfaces.txt", "d3d9.dll", "xinput1_3.dll"];
Game.FileSymlinkCopyInstead = ["Patch.txt", "PatchOffline.txt"];
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.FakeFocus = false;
Game.HookFocus = true;
Game.SetWindowHookStart = false;
Game.ResetWindows = false;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.XInputPlusDll = ["xinput1_3.dll"];
Game.Hook.CustomDllEnabled = false;
Game.UserProfileSavePath = "Documents\\My Games\\Borderlands The Pre-Sequel\\WillowGame\\SaveData";
Game.UserProfileConfigPath = "Documents\\My Games\\Borderlands The Pre-Sequel\\WillowGame\\Config";
Game.UserProfileSavePathNoCopy = true;
Game.UserProfileConfigPathNoCopy = true;
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. If you use the launch under one steam account UI option you will be able to unlock steam achievements, set each instance to LAN before opening the next.";
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 mods = Context.Options["Mods"];
  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 (mods == "No") {
  }

  if (mods == "Yes") {
    Game.UseNucleusEnvironment = true;
    Game.PromptBetweenInstances = true;

    var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "steam_api.dll");
    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Binaries\\Win32\\steam_api.dll");
    System.IO.File.Copy(savePkgOrigin, savePath, true);
  }

  if (mkb == "Default") {
  }

  if (mkb == "Enable") {
    var NucleusRoot = System.IO.Path.Combine(Game.Folder, "..", "..");

    var txtPath = NucleusRoot + "\\scripts\\Borderlands The Pre-Sequel.js";
    var dict = [
      Context.FindLineNumberInTextFile(txtPath, "Game.SupportsMultipleKeyboardsAndMice", Nucleus.SearchType.StartsWith) + "|Game.SupportsMultipleKeyboardsAndMice = true;",
      Context.FindLineNumberInTextFile(txtPath, "Game.SupportsKeyboard", Nucleus.SearchType.StartsWith) + "|Game.SupportsKeyboard = false;"
    ];
    Context.ReplaceLinesInTextFile(txtPath, dict);
  }

  if (mkb == "Disable") {
    var NucleusRoot = System.IO.Path.Combine(Game.Folder, "..", "..");

    var txtPath = NucleusRoot + "\\scripts\\Borderlands The Pre-Sequel.js";
    var dict = [
      Context.FindLineNumberInTextFile(txtPath, "Game.SupportsMultipleKeyboardsAndMice", Nucleus.SearchType.StartsWith) + "|Game.SupportsMultipleKeyboardsAndMice = false;",
      Context.FindLineNumberInTextFile(txtPath, "Game.SupportsKeyboard", Nucleus.SearchType.StartsWith) + "|Game.SupportsKeyboard = true;"
    ];
    Context.ReplaceLinesInTextFile(txtPath, dict);
  }
};