Call of Duty: World at War · handler “Call of Duty World at War”
Version 24
Release notes
changed title under ForceFocusWindowName as the windows were not repositioning properly when using mouse/keyboard
- Released
- Size
- 6.3 MB
- Downloads
- 4,096
- Check
- Verified
- SHA-256
- 2601b7370e6f9bb4099563c981d1c939282f3cd8908e1762be8c0160582a2026
Files 16
| Path | Size |
|---|---|
| handler/config.cfg | 15 KB |
| handler/config_mp.cfg | 16 KB |
| handler/d3d9.dll | 8.0 MB |
| handler/d3d9.ini | 4.5 KB |
| handler/F3 FOV.au3 | 891 B |
| handler/F3 FOV.exe | 894 KB |
| handler/mods.bat | 215 B |
| handler/osd.ini | 4.6 KB |
| handler/Prompt.au3 | 1.2 KB |
| handler/Prompt.exe | 894 KB |
| handler/RegistryFix.bat | 1.7 KB |
| handler/start.au3 | 1.2 KB |
| handler/start.exe | 894 KB |
| handler/T4M.dll | 3.2 MB |
| handler/t4m.ini | 272 B |
| handler.js | 36 KB |
handler.js
Plain textHub.Handler.Version = 24; // Released at https://hub.splitscreen.me/ on Thu May 11 2023 23:24:56 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "ZeCGPXaap5Dzs5PXc";
Hub.Maintainer.Name = "Perserveruz";
Hub.Maintainer.Id = "nFAYvHKj75jAFRAgt";
var answers = ["No", "Yes"];
var answers1 = ["None", "Backrooms", "Clinic Of Evil", "HelloKittyRemastered", "sanatorium", "Spongebob", "SuperMario64", "TheCrazyPlace"];
var answers2 = ["Yes", "No"];
var answers3 = ["No", "720p", "1080p"];
var answers4 = ["Default", "Yes", "No"];
var answers5 = ["60", "45", "30", "0"];
var answers6 = ["Default", "Low", "Mid", "High", "Extra"];
Game.AddOption("Choose your preferred graphic settings", "Default will use the previous or default settings", "Graphics", answers6);
Game.AddOption("Swap shoulder and trigger buttons (useful for Playstation controllers)", "Default will use the previous or default settings", "pscontrollers", answers4);
Game.AddOption("Select Custom Mod", "", "Mod", answers1);
Game.AddOption("Apply 720p or 1080p resolution and fullscreen for low-end PC (no splitscreen)", "", "fullscreen", answers3);
Game.AddOption("Enable music only in the first instance?", "", "Mus", answers2);
Game.AddOption("Select the FPS Cap the game will use", "", "FPS", answers5);
Game.AddOption("Apply registry fix for cd key already in use message and profile error", "", "registry", answers);
Game.FileSymlinkExclusions = ["d3d9.dll", "Xinputplus.ini", "xinput1_4.dll", "xinput1_3.dll"];
Game.SymlinkGame = true;
Game.SymlinkExe = false;
Game.ChangeExe = true;
Game.SymlinkFolders = false;
Game.KeepSymLinkOnExit = true;
Game.SupportsKeyboard = false;
Game.UseNucleusEnvironment = true;
Game.HandlerInterval = 100;
Game.ExecutableName = "CoDWaW.exe";
Game.NeedsSteamEmulation = false;
Game.SteamID = "10090";
Game.GUID = "CoDWaW";
Game.GameName = "CoDWaW";
Game.MaxPlayers = 2;
Game.MaxPlayersOneMonitor = 2;
Game.SupportsPositioning = true;
Game.HideTaskbar = false;
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "Call of Duty: World at War Campaign/Coop - T4M MHD4 Editon";
Game.HasDynamicWindowTitle = false;
Game.HookFocus = true;
Game.PreventWindowDeactivation = false;
Game.KeyboardPlayerSkipPreventWindowDeactivate = false;
Game.Hook.DInputEnabled = false;
Game.Hook.DInputForceDisable = true;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.BlockRawInput = false;
Game.Hook.CustomDllEnabled = false;
Game.Hook.UseAlpha8CustomDll = false;
Game.ResetWindows = false;
Game.InjectHookXinput = true;
Game.PromptBetweenInstances = false;
Game.UserProfileConfigPath = "AppData\\Local\\Activision";
Game.SetForegroundWindowElsewhere = true;
Game.KillProcessesOnClose = ["start", "Prompt", "F3 FOV", "cmd"];
Game.Description =
"Place the CoDWaW Lan Fix in the CoDWaW handler folder. See guide for instructions on how to do this (https://www.reddit.com/user/Perseveruz/comments/xcogci/call_of_duty_world_at_war_split_screen_on_pc_with/). Assign either controllers or mouse/keyboard and launch your instances(max 2 players split-screen, and max 3 players over LAN). Only if you're using a keyboard/mouse, once the instances have resized/repositioned press the end key to lock and apply hooks. You will need to press the end key again to unlock your instances and close Nucleus, this only applies if you're using keyboard/mouse. In case the mouse cursor is not responding in one of the instances, just press the end key and then press it again to apply hooks again. Once the instances are unlocked, you can quickly close all your instances by holding Ctrl and Q. If asked to create an online profile select cancel, no and exit. Setup your LAN campaign/zombie match in the first instance and have the other player join by searching the match under find game, remember to select LAN under source. For custom mods to work, unless the name of the mod is already reflected under Select Custom Mod, you will need to open and edit the game handler by right clicking on the CoDWaW icon in the left column of Nucleus Coop, and on the second line, you will need to add the exact name of the mod preceded by a coma and putting quotations. You will then need to place your custom mod in the mods folder located in the CoDWaW handler folder. In case you want to change the FOV, especially for vertical split-screen, press F3 once the match has started, in case it doesn't work the first time, press F3 again until you see the FOV change in each instance. Have fun playing split screen!";
Game.SupportsMultipleKeyboardsAndMice = true;
Game.Play = function() {
// 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.SendNormalMouseInput = false;
Game.SendNormalKeyboardInput = false;
Game.SendScrollWheel = false;
Game.ForwardRawKeyboardInput = false;
Game.ForwardRawMouseInput = false;
Game.DrawFakeMouseCursor = false;
Game.LockInputAtStart = false;
Game.LockInputSuspendsExplorer = false;
Game.LockInputToggleKey = 0x23;
Context.RunAdditionalFiles([Context.ScriptFolder + "\\start.exe"], false, 10);
Context.RunAdditionalFiles([Context.ScriptFolder + "\\Prompt.exe"], false, 10);
Context.RunAdditionalFiles([Context.ScriptFolder + "\\F3 FOV.exe"], false, 10);
var registry = Context.Options["registry"];
if (registry == "Yes") {
if (Context.PlayerID == 0) {
var savePath = (Context.SavePath = Context.OrigRootFolder + "\\RegistryFix.bat");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "RegistryFix.bat");
System.IO.File.Copy(savePkgOrigin, savePath, true);
Context.RunAdditionalFiles([Context.OrigRootFolder + "\\RegistryFix.bat"], false, 0, true, false);
} else {
}
}
var registry = Context.Options["registry"];
if (registry == "No") {
}
if (System.IO.File.Exists(Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\__CoDWaW")) {
System.IO.File.Delete(Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\__CoDWaW");
}
if (System.IO.File.Exists(Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\__CoDWaWmp")) {
System.IO.File.Delete(Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\__CoDWaWmp");
}
var filePath = Context.GetFolder(Nucleus.Folder.Documents) + "\\My Mods";
System.IO.Directory.CreateDirectory(filePath);
var filePath = Context.GetFolder(Nucleus.Folder.Documents) + "\\My Mods\\SpecialK";
System.IO.Directory.CreateDirectory(filePath);
var filePath = Context.GetFolder(Nucleus.Folder.Documents) + "\\My Mods\\SpecialK\\Global";
System.IO.Directory.CreateDirectory(filePath);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.Documents) + "\\My Mods\\SpecialK\\Global\\osd.ini");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "osd.ini");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\CoDWaW.exe");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "CoDWaW.exe");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\d3d9.dll");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "d3d9.dll");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\d3d9.ini");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "d3d9.ini");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Whatever.dll");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "T4M.dll");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\t4m.ini");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "t4m.ini");
System.IO.File.Copy(savePkgOrigin, savePath, true);
if (!System.IO.File.Exists(Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "")) {
var filePath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "";
System.IO.Directory.CreateDirectory(filePath);
}
if (!System.IO.File.Exists(Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg")) {
var savePath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg";
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "config.cfg");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config_mp.cfg")) {
var savePath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config_mp.cfg";
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "config_mp.cfg");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
var txtPath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\active.txt";
var dict = ["" + Context.Nickname + ""];
Context.WriteTextFile(txtPath, dict);
var Mod = Context.Options["Mod"];
if (Mod == "None") {
var Args = (Context.Args = " +r_fullscreen 0 +cg_fov 90 ");
Context.StartArguments = Args;
} else {
if (!System.IO.File.Exists(Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\mods")) {
var filePath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\mods";
System.IO.Directory.CreateDirectory(filePath);
}
var txtPath = Context.ScriptFolder + "\\mods.bat";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "SET SrcRoot=", Nucleus.SearchType.StartsWith) + "|SET SrcRoot=" + Context.ScriptFolder + "\\mods",
Context.FindLineNumberInTextFile(txtPath, "SET TargetRoot=", Nucleus.SearchType.StartsWith) + "|SET TargetRoot=" + Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\mods"
];
Context.ReplaceLinesInTextFile(txtPath, dict);
Context.RunAdditionalFiles(["all|" + Context.ScriptFolder + "\\mods.bat"], false, 0, true, false);
var Args = (Context.Args = " +r_fullscreen 0 +cg_fov 90 +set fs_game mods/" + Mod + " ");
Context.StartArguments = Args;
}
var pscontrollers = Context.Options["pscontrollers"];
if (pscontrollers == "Default") {
}
if (pscontrollers == "Yes") {
var txtPath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_LSHLDR", Nucleus.SearchType.StartsWith) + '|bind BUTTON_LSHLDR "+speed_throw"',
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_RSHLDR", Nucleus.SearchType.StartsWith) + '|bind BUTTON_RSHLDR "+attack"',
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_LTRIG", Nucleus.SearchType.StartsWith) + '|bind BUTTON_LTRIG "+smoke"',
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_RTRIG", Nucleus.SearchType.StartsWith) + '|bind BUTTON_RTRIG "+frag"',
Context.FindLineNumberInTextFile(txtPath, "seta gpad_buttonsConfig", Nucleus.SearchType.StartsWith) + '|seta gpad_buttonsConfig "buttons_default_alt"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
var pscontrollers = Context.Options["pscontrollers"];
if (pscontrollers == "No") {
var txtPath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_LSHLDR", Nucleus.SearchType.StartsWith) + '|bind BUTTON_LSHLDR "+smoke"',
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_RSHLDR", Nucleus.SearchType.StartsWith) + '|bind BUTTON_RSHLDR "+frag"',
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_LTRIG", Nucleus.SearchType.StartsWith) + '|bind BUTTON_LTRIG "+speed_throw"',
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_RTRIG", Nucleus.SearchType.StartsWith) + '|bind BUTTON_RTRIG "+attack"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
var FPS = Context.Options["FPS"];
var Graphics = Context.Options["Graphics"];
if (Graphics == "Low") {
var txtPath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta com_maxfps", Nucleus.SearchType.StartsWith) + '|seta com_maxfps "' + FPS + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_dof_enable", Nucleus.SearchType.StartsWith) + '|seta r_dof_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_aaSamples", Nucleus.SearchType.StartsWith) + '|seta r_aaSamples "0"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_enable", Nucleus.SearchType.StartsWith) + '|seta sm_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta ragdoll_enable", Nucleus.SearchType.StartsWith) + '|seta ragdoll_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_vsync", Nucleus.SearchType.StartsWith) + '|seta r_vsync "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip", Nucleus.SearchType.StartsWith) + '|seta r_picmip "3"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_bump", Nucleus.SearchType.StartsWith) + '|seta r_picmip_bump "3"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_manual", Nucleus.SearchType.StartsWith) + '|seta r_picmip_manual "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_spec", Nucleus.SearchType.StartsWith) + '|seta r_picmip_spec "3"',
Context.FindLineNumberInTextFile(txtPath, "seta r_specular", Nucleus.SearchType.StartsWith) + '|seta r_specular "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_zFeather", Nucleus.SearchType.StartsWith) + '|seta r_zFeather "0"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_maxLights", Nucleus.SearchType.StartsWith) + '|seta sm_maxLights "4"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (Graphics == "Mid") {
var txtPath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta com_maxfps", Nucleus.SearchType.StartsWith) + '|seta com_maxfps "' + FPS + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_dof_enable", Nucleus.SearchType.StartsWith) + '|seta r_dof_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_aaSamples", Nucleus.SearchType.StartsWith) + '|seta r_aaSamples "0"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_enable", Nucleus.SearchType.StartsWith) + '|seta sm_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta ragdoll_enable", Nucleus.SearchType.StartsWith) + '|seta ragdoll_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_vsync", Nucleus.SearchType.StartsWith) + '|seta r_vsync "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip", Nucleus.SearchType.StartsWith) + '|seta r_picmip "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_bump", Nucleus.SearchType.StartsWith) + '|seta r_picmip_bump "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_manual", Nucleus.SearchType.StartsWith) + '|seta r_picmip_manual "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_spec", Nucleus.SearchType.StartsWith) + '|seta r_picmip_spec "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_specular", Nucleus.SearchType.StartsWith) + '|seta r_specular "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_zFeather", Nucleus.SearchType.StartsWith) + '|seta r_zFeather "1"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_maxLights", Nucleus.SearchType.StartsWith) + '|seta sm_maxLights "4"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (Graphics == "High") {
var txtPath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta com_maxfps", Nucleus.SearchType.StartsWith) + '|seta com_maxfps "' + FPS + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_dof_enable", Nucleus.SearchType.StartsWith) + '|seta r_dof_enable "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_aaSamples", Nucleus.SearchType.StartsWith) + '|seta r_aaSamples "1"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_enable", Nucleus.SearchType.StartsWith) + '|seta sm_enable "1"',
Context.FindLineNumberInTextFile(txtPath, "seta ragdoll_enable", Nucleus.SearchType.StartsWith) + '|seta ragdoll_enable "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_vsync", Nucleus.SearchType.StartsWith) + '|seta r_vsync "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip", Nucleus.SearchType.StartsWith) + '|seta r_picmip "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_bump", Nucleus.SearchType.StartsWith) + '|seta r_picmip_bump "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_manual", Nucleus.SearchType.StartsWith) + '|seta r_picmip_manual "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_spec", Nucleus.SearchType.StartsWith) + '|seta r_picmip_spec "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_specular", Nucleus.SearchType.StartsWith) + '|seta r_specular "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_zFeather", Nucleus.SearchType.StartsWith) + '|seta r_zFeather "1"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_maxLights", Nucleus.SearchType.StartsWith) + '|seta sm_maxLights "4"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (Graphics == "Extra") {
var txtPath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta com_maxfps", Nucleus.SearchType.StartsWith) + '|seta com_maxfps "' + FPS + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_dof_enable", Nucleus.SearchType.StartsWith) + '|seta r_dof_enable "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_aaSamples", Nucleus.SearchType.StartsWith) + '|seta r_aaSamples "4"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_enable", Nucleus.SearchType.StartsWith) + '|seta sm_enable "1"',
Context.FindLineNumberInTextFile(txtPath, "seta ragdoll_enable", Nucleus.SearchType.StartsWith) + '|seta ragdoll_enable "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_vsync", Nucleus.SearchType.StartsWith) + '|seta r_vsync "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip", Nucleus.SearchType.StartsWith) + '|seta r_picmip "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_bump", Nucleus.SearchType.StartsWith) + '|seta r_picmip_bump "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_manual", Nucleus.SearchType.StartsWith) + '|seta r_picmip_manual "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_spec", Nucleus.SearchType.StartsWith) + '|seta r_picmip_spec "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_specular", Nucleus.SearchType.StartsWith) + '|seta r_specular "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_zFeather", Nucleus.SearchType.StartsWith) + '|seta r_zFeather "1"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_maxLights", Nucleus.SearchType.StartsWith) + '|seta sm_maxLights "4"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\CoDWaW - Player " + (Context.PlayerID + 1) + ".exe";
var savePkgOrigin = System.IO.Path.Combine(Context.RootFolder, "CoDWaW.exe");
System.IO.File.Copy(savePkgOrigin, savePath, true);
if (Context.AspectRatioDecimal < 1.2) {
Context.PatchFile(
System.IO.Path.Combine(Game.Folder, "CoDWaW.exe"),
System.IO.Path.Combine(Context.RootFolder, "CoDWaW.exe"),
[0xab, 0xaa, 0xaa, 0x3f],
Context.ConvertToBytes(Context.AspectRatioDecimal)
);
var txtPath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta net_port", Nucleus.SearchType.StartsWith) + '|seta net_port "2896' + (Context.PlayerID + 1) + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_fullscreen", Nucleus.SearchType.StartsWith) + '|seta r_fullscreen "0"',
Context.FindLineNumberInTextFile(txtPath, "seta cg_fov", Nucleus.SearchType.StartsWith) + '|seta cg_fov "90"',
Context.FindLineNumberInTextFile(txtPath, "seta name", Nucleus.SearchType.StartsWith) + '|seta name "' + Context.Nickname + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_customMode", Nucleus.SearchType.StartsWith) + '|seta r_customMode "' + Context.Width + "x" + Context.Height + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_mode", Nucleus.SearchType.StartsWith) + '|seta r_mode "' + Context.Width + "x" + Context.Height + '"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\d3d9.ini";
Context.ReplaceLinesInTextFile(
txtPath,
[
Context.FindLineNumberInTextFile(txtPath, "ConfineCursor=", Nucleus.SearchType.StartsWith) + "|ConfineCursor=true",
Context.FindLineNumberInTextFile(txtPath, "UnconfineCursor=", Nucleus.SearchType.StartsWith) + "|UnconfineCursor=true",
Context.FindLineNumberInTextFile(txtPath, "AlwaysOnTop=", Nucleus.SearchType.StartsWith) + "|AlwaysOnTop=1",
Context.FindLineNumberInTextFile(txtPath, "Borderless=", Nucleus.SearchType.StartsWith) + "|Borderless=true",
Context.FindLineNumberInTextFile(txtPath, "Center=", Nucleus.SearchType.StartsWith) + "|Center=false",
Context.FindLineNumberInTextFile(txtPath, "OverrideRes=", Nucleus.SearchType.StartsWith) + "|OverrideRes=" + Context.Width + "x" + Context.Height
],
"utf-8"
);
} else {
var fullscreen = Context.Options["fullscreen"];
if (fullscreen == "No") {
Context.PatchFile(
System.IO.Path.Combine(Game.Folder, "CoDWaW.exe"),
System.IO.Path.Combine(Context.RootFolder, "CoDWaW.exe"),
[0x39, 0x8e, 0xe3, 0x3f],
Context.ConvertToBytes(Context.AspectRatioDecimal)
);
var txtPath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta com_maxfps", Nucleus.SearchType.StartsWith) + '|seta com_maxfps "' + FPS + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_fullscreen", Nucleus.SearchType.StartsWith) + '|seta r_fullscreen "0"',
Context.FindLineNumberInTextFile(txtPath, "seta name", Nucleus.SearchType.StartsWith) + '|seta name "' + Context.Nickname + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_customMode", Nucleus.SearchType.StartsWith) + '|seta r_customMode "' + Context.Width + "x" + Context.Height + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_mode", Nucleus.SearchType.StartsWith) + '|seta r_mode "' + Context.Width + "x" + Context.Height + '"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\d3d9.ini";
Context.ReplaceLinesInTextFile(
txtPath,
[
Context.FindLineNumberInTextFile(txtPath, "ConfineCursor=", Nucleus.SearchType.StartsWith) + "|ConfineCursor=true",
Context.FindLineNumberInTextFile(txtPath, "Fullscreen=", Nucleus.SearchType.StartsWith) + "|Fullscreen=false",
Context.FindLineNumberInTextFile(txtPath, "UnconfineCursor=", Nucleus.SearchType.StartsWith) + "|UnconfineCursor=true",
Context.FindLineNumberInTextFile(txtPath, "AlwaysOnTop=", Nucleus.SearchType.StartsWith) + "|AlwaysOnTop=1",
Context.FindLineNumberInTextFile(txtPath, "Borderless=", Nucleus.SearchType.StartsWith) + "|Borderless=true",
Context.FindLineNumberInTextFile(txtPath, "Center=", Nucleus.SearchType.StartsWith) + "|Center=false",
Context.FindLineNumberInTextFile(txtPath, "OverrideRes=", Nucleus.SearchType.StartsWith) + "|OverrideRes=" + Context.Width + "x" + Context.Height
],
"utf-8"
);
}
if (fullscreen == "720p") {
Game.DontResize = true;
Game.DontRemoveBorders = true;
Game.DontReposition = true;
var txtPath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta com_maxfps", Nucleus.SearchType.StartsWith) + '|seta com_maxfps "' + FPS + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_fullscreen", Nucleus.SearchType.StartsWith) + '|seta r_fullscreen "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_aaSamples", Nucleus.SearchType.StartsWith) + '|seta r_aaSamples "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_specular", Nucleus.SearchType.StartsWith) + '|seta r_specular "0"',
Context.FindLineNumberInTextFile(txtPath, "seta cg_fov", Nucleus.SearchType.StartsWith) + '|seta cg_fov "80"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_enable", Nucleus.SearchType.StartsWith) + '|seta sm_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_vsync", Nucleus.SearchType.StartsWith) + '|seta r_vsync "1"',
Context.FindLineNumberInTextFile(txtPath, "seta name", Nucleus.SearchType.StartsWith) + '|seta name "' + Context.Nickname + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_dof_enable", Nucleus.SearchType.StartsWith) + '|seta r_dof_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta ragdoll_enable", Nucleus.SearchType.StartsWith) + '|seta ragdoll_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_customMode", Nucleus.SearchType.StartsWith) + '|seta r_customMode "1280x720"',
Context.FindLineNumberInTextFile(txtPath, "seta r_mode", Nucleus.SearchType.StartsWith) + '|seta r_mode "1280x720"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (fullscreen == "1080p") {
Game.DontResize = true;
Game.DontRemoveBorders = true;
Game.DontReposition = true;
var txtPath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta com_maxfps", Nucleus.SearchType.StartsWith) + '|seta com_maxfps "' + FPS + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_fullscreen", Nucleus.SearchType.StartsWith) + '|seta r_fullscreen "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_aaSamples", Nucleus.SearchType.StartsWith) + '|seta r_aaSamples "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_specular", Nucleus.SearchType.StartsWith) + '|seta r_specular "0"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_enable", Nucleus.SearchType.StartsWith) + '|seta sm_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta cg_fov", Nucleus.SearchType.StartsWith) + '|seta cg_fov "80"',
Context.FindLineNumberInTextFile(txtPath, "seta r_vsync", Nucleus.SearchType.StartsWith) + '|seta r_vsync "1"',
Context.FindLineNumberInTextFile(txtPath, "seta name", Nucleus.SearchType.StartsWith) + '|seta name "' + Context.Nickname + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_dof_enable", Nucleus.SearchType.StartsWith) + '|seta r_dof_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta ragdoll_enable", Nucleus.SearchType.StartsWith) + '|seta ragdoll_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_customMode", Nucleus.SearchType.StartsWith) + '|seta r_customMode "1920x1080"',
Context.FindLineNumberInTextFile(txtPath, "seta r_mode", Nucleus.SearchType.StartsWith) + '|seta r_mode "1920x1080"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
}
var Mus = Context.Options["Mus"];
if (Mus == "Yes") {
if (Context.PlayerID == 0) {
var txtPath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta snd_menu_music", Nucleus.SearchType.StartsWith) + '|seta snd_menu_music "1"',
Context.FindLineNumberInTextFile(txtPath, "seta snd_menu_voice", Nucleus.SearchType.StartsWith) + '|seta snd_menu_voice "1"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
} else {
var txtPath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta snd_menu_music", Nucleus.SearchType.StartsWith) + '|seta snd_menu_music "0"',
Context.FindLineNumberInTextFile(txtPath, "seta snd_menu_voice", Nucleus.SearchType.StartsWith) + '|seta snd_menu_voice "0"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
}
if (Mus == "No") {
var txtPath = Context.EnvironmentPlayer + "\\Appdata\\Local\\Activision\\CoDWaW\\players\\profiles\\" + Context.Nickname + "\\config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta snd_menu_music", Nucleus.SearchType.StartsWith) + '|seta snd_menu_music "1"',
Context.FindLineNumberInTextFile(txtPath, "seta snd_menu_voice", Nucleus.SearchType.StartsWith) + '|seta snd_menu_voice "1"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (Context.HasKeyboardPlayer) {
if (System.IO.File.Exists((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\d3d9.dll"))) {
System.IO.File.Delete((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\d3d9.dll"));
}
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\d3d9.dll");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "T4M.dll");
System.IO.File.Copy(savePkgOrigin, savePath, true);
Game.PauseBetweenProcessGrab = 25;
Game.ProtoInput.InjectStartup = false;
Game.ProtoInput.InjectRuntime_RemoteLoadMethod = false;
Game.ProtoInput.InjectRuntime_EasyHookMethod = true;
Game.ProtoInput.InjectRuntime_EasyHookStealthMethod = false;
Game.ProtoInput.FindWindowHook = true;
Game.ProtoInput.RegisterRawInputHook = true;
Game.ProtoInput.GetRawInputDataHook = false;
Game.ProtoInput.MessageFilterHook = true;
Game.ProtoInput.GetCursorPosHook = false;
Game.ProtoInput.SetCursorPosHook = false;
Game.ProtoInput.GetKeyStateHook = false;
Game.ProtoInput.GetAsyncKeyStateHook = false;
Game.ProtoInput.GetKeyboardStateHook = false;
Game.ProtoInput.CursorVisibilityHook = true;
Game.ProtoInput.ClipCursorHook = true;
Game.ProtoInput.FocusHooks = false;
Game.ProtoInput.DrawFakeCursor = 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 = true;
Game.ProtoInput.SendMouseWheelMessages = true;
Game.ProtoInput.SendMouseButtonMessages = true;
Game.ProtoInput.SendMouseMovementMessages = true;
Game.ProtoInput.SendKeyboardButtonMessages = true;
Game.ProtoInput.EnableFocusMessageLoop = false;
Game.ProtoInput.FocusLoopIntervalMilliseconds = 0;
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 = [];
Game.ProtoInput.RenameHandlesHook = false;
Game.ProtoInput.RenameHandles = [];
Game.ProtoInput.RenameNamedPipes = [];
} else {
Game.ResetWindows = true;
Game.PauseBetweenProcessGrab = 5;
Game.PauseBetweenStarts = 15;
}
Game.ProtoInput.OnInputLocked = function() {
if (Context.HasKeyboardPlayer) {
for (var i = 0; i < PlayerList.Count; i++) {
var player = PlayerList[i];
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.FocusHooksHookID);
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetCursorPosHookID);
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.SetCursorPosHookID);
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.CursorVisibilityStateHookID);
ProtoInput.StartFocusMessageLoop(player.ProtoInputInstanceHandle, 5, true, true, true, true, true);
System.Threading.Thread.Sleep(1000);
ProtoInput.SetRawInputBypass(player.ProtoInputInstanceHandle, false);
ProtoInput.StopFocusMessageLoop(player.ProtoInputInstanceHandle);
ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.RawInputFilterID);
ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.KeyboardButtonFilterID);
ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseButtonFilterID);
ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.WindowActivateFilterID);
ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseWheelFilterID);
}
}
};
Game.ProtoInput.OnInputUnlocked = function() {
for (var i = 0; i < PlayerList.Count; i++) {
var player = PlayerList[i];
ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.FocusHooksHookID);
ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetCursorPosHookID);
ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.SetCursorPosHookID);
ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.CursorVisibilityStateHookID);
ProtoInput.SetDrawFakeCursor(player.ProtoInputInstanceHandle, false);
ProtoInput.SetRawInputBypass(player.ProtoInputInstanceHandle, true);
ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.RawInputFilterID);
ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.WindowActivateFilterID);
ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseWheelFilterID);
ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseButtonFilterID);
ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.KeyboardButtonFilterID);
}
};
};