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

Dragon Quest Builders 2 · handler “DragonQuestB2”

Version 4

Release notes

aspect ratio fix support for more monitor resolutions.

Released
Size
2.0 KB
Downloads
235
Check
Verified
SHA-256
d081bd881704c9766612d5f866344f20899b197d7de1d80a44da588d1a864ce5
Download v4 (.nc)All versions

Files 1

PathSize
handler.js11 KB

handler.js

Plain text
Hub.Handler.Version = 4; // Released at https://hub.splitscreen.me/ on Mon May 09 2022 03:06:12 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "8MzyqkLztCzTmhQf2";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";

var answers1 = ["Yes", "No"];
Game.AddOption(
  "Edit resolution to match window size?",
  "Fixes stretching in split-screen for various 16:9 monitor resolutions, set your monitor scale to 100% if you do not see the changes.",
  "AR",
  answers1
);

Game.ExecutableContext = ["md"];
Game.KillMutex = ["BLD_MUTEX"];
Game.FileSymlinkExclusions = ["steam_api64.dll", "steam_appid.txt", "winmm.dll", "DQB2_EU.exe", "GameLauncher.exe"];
Game.FileSymlinkCopyInstead = ["KTSLXA2C.dll", "KTSLXA27.dll", "KTSLXA29.dll", "LINKDATA.idx", "LINKDATA_PATCH.idx", "Config.exe"];
Game.NeedsSteamEmulation = false;
Game.UseGoldberg = true;
Game.GoldbergExperimental = true;
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = true;
Game.SupportsKeyboard = true;
Game.ExecutableName = "DQB2_EU.exe";
Game.SteamID = "1072420";
Game.GUID = "Dragon Quest Builders 2";
Game.GameName = "DRAGON QUEST BUILDERS 2";
Game.MaxPlayers = 4;
Game.MaxPlayersOneMonitor = 4;
Game.LauncherTitle = "";
Game.HideTaskbar = false;
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "DRAGON QUEST BUILDERS 2";
Game.PreventWindowDeactivation = true;
Game.KeyboardPlayerSkipPreventWindowDeactivate = true;
Game.HookInit = true;
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\\DRAGON QUEST BUILDERS II\\Steam";
Game.PlayerSteamIDs = ["76561198422152817"];
Game.Description =
  "Co-op unlocks when you complete the first tablet three targets after returning to the first island from Furrowfield. You can access each instance save from the app, after the first launch click game options/open user profile save path in the UI. If you get uneven fps in the instances try alt tabbing to the Nucleus app window when using multiple gamepads only, the game windows will still remain on top. Open the menu in all instances if the keyboard player can not move the cursor.";
Game.PauseBetweenStarts = 30;

Game.Play = function() {
  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\SQUARE ENIX\\DRAGON QUEST BUILDERS 2\\Graphic Setting", "WindowMode", 2, Nucleus.RegType.DWord);

  var filePath = (Context.filePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\steam_settings");
  System.IO.Directory.CreateDirectory(filePath);

  var nolay = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\steam_settings\\disable_overlay.txt";
  var lines = [""];
  Context.WriteTextFile(nolay, lines);

  if (Context.HasKeyboardPlayer == true) {
  } else {
    Game.SetForegroundWindowElsewhere = true;
  }

  var ar = Context.Options["AR"];

  if (ar == "Yes") {
    var screenreswidth = Context.Width;
    var screenresheight = Context.Height;

    if (screenreswidth == 1920 && screenresheight == 540) {
      //1080p Horizontal

      Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\SQUARE ENIX\\DRAGON QUEST BUILDERS 2\\Graphic Setting", "Resolution", 6, Nucleus.RegType.DWord);

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootInstallFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x03, 0x00, 0x00, 0x38, 0x04, 0x00], //1080
        [0x03, 0x00, 0x00, 0x1c, 0x02, 0x00]
      );
    }

    if (screenreswidth == 960 && screenresheight == 1080) {
      //1080p Vertical

      Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\SQUARE ENIX\\DRAGON QUEST BUILDERS 2\\Graphic Setting", "Resolution", 6, Nucleus.RegType.DWord);

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootInstallFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x06, 0x00, 0x00, 0x80, 0x07], //1920
        [0x06, 0x00, 0x00, 0xc0, 0x03]
      );
    }

    if (screenreswidth == 960 && screenresheight == 540) {
      //1080p 1/4

      Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\SQUARE ENIX\\DRAGON QUEST BUILDERS 2\\Graphic Setting", "Resolution", 6, Nucleus.RegType.DWord);

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootInstallFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x06, 0x00, 0x00, 0x80, 0x07], //1920
        [0x06, 0x00, 0x00, 0xc0, 0x03]
      );

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x03, 0x00, 0x00, 0x38, 0x04, 0x00], //1080
        [0x03, 0x00, 0x00, 0x1c, 0x02, 0x00]
      );
    }

    if (screenreswidth == 1280 && screenresheight == 360) {
      //720p Horizontal

      Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\SQUARE ENIX\\DRAGON QUEST BUILDERS 2\\Graphic Setting", "Resolution", 6, Nucleus.RegType.DWord);

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootInstallFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x06, 0x00, 0x00, 0x80, 0x07], //1920
        [0x06, 0x00, 0x00, 0x00, 0x05]
      );

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x03, 0x00, 0x00, 0x38, 0x04, 0x00], //1080
        [0x03, 0x00, 0x00, 0x68, 0x01, 0x00]
      );
    }

    if (screenreswidth == 640 && screenresheight == 720) {
      //720p Vertical

      Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\SQUARE ENIX\\DRAGON QUEST BUILDERS 2\\Graphic Setting", "Resolution", 6, Nucleus.RegType.DWord);

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootInstallFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x06, 0x00, 0x00, 0x80, 0x07], //1920
        [0x06, 0x00, 0x00, 0x80, 0x02]
      );

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x03, 0x00, 0x00, 0x38, 0x04, 0x00], //1080
        [0x03, 0x00, 0x00, 0xd0, 0x02, 0x00]
      );
    }

    if (screenreswidth == 640 && screenresheight == 360) {
      //720p 1/4

      Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\SQUARE ENIX\\DRAGON QUEST BUILDERS 2\\Graphic Setting", "Resolution", 6, Nucleus.RegType.DWord);

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootInstallFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x06, 0x00, 0x00, 0x80, 0x07], //1920
        [0x06, 0x00, 0x00, 0x80, 0x02]
      );

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x03, 0x00, 0x00, 0x38, 0x04, 0x00], //1080
        [0x03, 0x00, 0x00, 0x68, 0x01, 0x00]
      );
    }

    if (screenreswidth == 2560 && screenresheight == 720) {
      //1440p Horizontal

      Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\SQUARE ENIX\\DRAGON QUEST BUILDERS 2\\Graphic Setting", "Resolution", 6, Nucleus.RegType.DWord);

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootInstallFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x06, 0x00, 0x00, 0x80, 0x07], //1920
        [0x06, 0x00, 0x00, 0x00, 0x0a]
      );

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x03, 0x00, 0x00, 0x38, 0x04, 0x00], //1080
        [0x03, 0x00, 0x00, 0xd0, 0x02, 0x00]
      );
    }

    if (screenreswidth == 1280 && screenresheight == 1440) {
      //1440p Vertical

      Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\SQUARE ENIX\\DRAGON QUEST BUILDERS 2\\Graphic Setting", "Resolution", 6, Nucleus.RegType.DWord);

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootInstallFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x06, 0x00, 0x00, 0x80, 0x07], //1920
        [0x06, 0x00, 0x00, 0x00, 0x05]
      );

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x03, 0x00, 0x00, 0x38, 0x04, 0x00], //1080
        [0x03, 0x00, 0x00, 0xa0, 0x05, 0x00]
      );
    }

    if (screenreswidth == 1280 && screenresheight == 720) {
      //1440p 1/4

      Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\SQUARE ENIX\\DRAGON QUEST BUILDERS 2\\Graphic Setting", "Resolution", 6, Nucleus.RegType.DWord);

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootInstallFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x06, 0x00, 0x00, 0x80, 0x07], //1920
        [0x06, 0x00, 0x00, 0x00, 0x05]
      );

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x03, 0x00, 0x00, 0x38, 0x04, 0x00], //1080
        [0x03, 0x00, 0x00, 0xd0, 0x02, 0x00]
      );
    }

    if (screenreswidth == 3840 && screenresheight == 1080) {
      //4k Horizontal

      Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\SQUARE ENIX\\DRAGON QUEST BUILDERS 2\\Graphic Setting", "Resolution", 6, Nucleus.RegType.DWord);

      Context.PatchFile(
        System.IO.Path.Combine(Context.RootInstallFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x06, 0x00, 0x00, 0x80, 0x07], //1920
        [0x06, 0x00, 0x00, 0x00, 0x0f]
      );
    }

    if (screenreswidth == 1920 && screenresheight == 2160) {
      //4k Vertical

      Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\SQUARE ENIX\\DRAGON QUEST BUILDERS 2\\Graphic Setting", "Resolution", 6, Nucleus.RegType.DWord);

      Context.PatchFile(
        System.IO.Path.Combine(RootInstallFolder, "DQB2_EU.exe"),
        System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"),
        [0x03, 0x00, 0x00, 0x38, 0x04, 0x00], //1080
        [0x03, 0x00, 0x00, 0x70, 0x08, 0x00]
      );
    }

    if (screenreswidth == 1920 && screenresheight == 1080) {
      //4k 1/4

      Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\SQUARE ENIX\\DRAGON QUEST BUILDERS 2\\Graphic Setting", "Resolution", 6, Nucleus.RegType.DWord);

      System.IO.File.Copy(System.IO.Path.Combine(Context.RootInstallFolder, "DQB2_EU.exe"), System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"), true);
    }
  }

  if (ar == "No") {
    System.IO.File.Copy(System.IO.Path.Combine(Context.RootInstallFolder, "DQB2_EU.exe"), System.IO.Path.Combine(Context.RootFolder, "DQB2_EU.exe"), true);
  }
};