Skip to content

Commit

Permalink
v7.0.1.1339
Browse files Browse the repository at this point in the history
+ Added an option to skip NIS scenes.
* Fixed disambiguation between "Headlights" and "HeadLights".
  • Loading branch information
nlgxzef committed Apr 5, 2018
1 parent 57d3813 commit d90775c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 29 deletions.
Binary file modified NFSMWExtraOptions/NFSMWExtraOptions.rc
Binary file not shown.
54 changes: 30 additions & 24 deletions NFSMWExtraOptions/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <math.h>

float heatLevel, gameSpeed, FallingRainSize, RainAmount, RoadReflection, RainIntensity, RainXing, RainFallSpeed, RainGravity, SplashScreenTimeLimit, LowBeamAmount, HighBeamAmount, MaxHeatLevel, MinHeatLevel, copLightsAmount, WorldAnimationSpeed, CarScale, VTRed, VTBlue, VTGreen, VTBlackBloom, VTColorBloom, VTSaturation, DebugCameraTurboSpeed, DebugCameraSuperTurboSpeed, SBRechargeTime, SBRechargeSpeedLimit, SBMassMultiplier, SpeedingLimit, ExcessiveSpeedingLimit, RecklessDrivingLimit;
int hotkeyToggleForceHeat, hotkeyForceHeatLevel, hotkeyToggleCopLights, hotkeyToggleHeadLights, hotkeyCarHack, hotkeyUnlockAllThings, hotkeyDrunkDriver, randomizeCount;
unsigned char raceType, raceMode, minLaps, maxLaps, minOpponents, maxOpponents, maxLapsRandomQR, maxOpponentsRandomQR, maxBlacklist, csBlacklist, headLightsMode, lowTraffic, medTraffic, highTraffic, ShowHiddenTracks, MaxUniqueOpponentCars, ShowAllCarsInFE, WindowedMode, SelectableMarkerCount;
bool copLightsEnabled, ShowTollbooth, ShowMoreRaceOptions, HideOnline, ShowOnlineOpts, removeSceneryGroupDoor, removePlayerBarriers, unfreezeKO, EnablePresetAndDebugCars, AlwaysRain, SkipMovies, EnableSound, EnableMusic, EnableCameras, ExOptsTeamTakeOver, ShowSubs, EnableHeatLevelOverride, CarbonStyleRaceProgress, moreVinyls, eatSomeBurgers, UnlockAllThings, ShowChallenge, GarageRotate, GarageZoom, GarageShowcase, EnableSaveLoadHotPos, EnableMaxPerfOnShop, EnableVTOverride, EnableDebugWorldCamera, DebugWorldCamera, DebugWatchCarCamera, ForceBlackEdition, HelicopterFix, X10Fix, WheelFix, ExperimentalSplitScreenFix, ShowDebugCarCustomize, CarbonStyleBustedScreen, ShowMessage, ReplayBlacklistRaces, PursuitActionMode, MoreCarsForOpponents, VisualFixesAndTweaks, UncensoredBustedScreen, ShowNonPursuitCops, ShowDebugEventID, CarbonStyleRandomCars, ShowMoreCustomizationOptions, SkipCareerIntro, ShowTimeOfDay, BetterRandomRaces, AllowMultipleInstances, TimeBugFix, NoCatchUp, CarSkinFix, ImmobileColFix, NFSU2StyleLookBackCamera, NoRevLimiter;
int hotkeyToggleForceHeat, hotkeyForceHeatLevel, hotkeyToggleCopLights, hotkeyToggleHeadlights, hotkeyCarHack, hotkeyUnlockAllThings, hotkeyDrunkDriver, randomizeCount;
unsigned char raceType, raceMode, minLaps, maxLaps, minOpponents, maxOpponents, maxLapsRandomQR, maxOpponentsRandomQR, maxBlacklist, csBlacklist, headlightsMode, lowTraffic, medTraffic, highTraffic, ShowHiddenTracks, MaxUniqueOpponentCars, ShowAllCarsInFE, WindowedMode, SelectableMarkerCount;
bool copLightsEnabled, ShowTollbooth, ShowMoreRaceOptions, HideOnline, ShowOnlineOpts, removeSceneryGroupDoor, removePlayerBarriers, unfreezeKO, EnablePresetAndDebugCars, AlwaysRain, SkipMovies, EnableSound, EnableMusic, EnableCameras, ExOptsTeamTakeOver, ShowSubs, EnableHeatLevelOverride, CarbonStyleRaceProgress, moreVinyls, eatSomeBurgers, UnlockAllThings, ShowChallenge, GarageRotate, GarageZoom, GarageShowcase, EnableSaveLoadHotPos, EnableMaxPerfOnShop, EnableVTOverride, EnableDebugWorldCamera, DebugWorldCamera, DebugWatchCarCamera, ForceBlackEdition, HelicopterFix, X10Fix, WheelFix, ExperimentalSplitScreenFix, ShowDebugCarCustomize, CarbonStyleBustedScreen, ShowMessage, ReplayBlacklistRaces, PursuitActionMode, MoreCarsForOpponents, VisualFixesAndTweaks, UncensoredBustedScreen, ShowNonPursuitCops, ShowDebugEventID, CarbonStyleRandomCars, ShowMoreCustomizationOptions, SkipCareerIntro, ShowTimeOfDay, BetterRandomRaces, AllowMultipleInstances, TimeBugFix, NoCatchUp, CarSkinFix, ImmobileColFix, NFSU2StyleLookBackCamera, NoRevLimiter, SkipNISs;
DWORD selectedCar, careerCar, raceOptions, Strings, HeatLevelAddr, VTecx, StartingCashDWORD, GameState, ThreadDelay;
HWND windowHandle;

Expand Down Expand Up @@ -922,7 +922,7 @@ void Init()
hotkeyToggleForceHeat = iniReader.ReadInteger("Hotkeys", "HeatLevelHack", 118); //F7
hotkeyForceHeatLevel = iniReader.ReadInteger("Hotkeys", "ChangeHeatLevel", 33); //PageUp
hotkeyToggleCopLights = iniReader.ReadInteger("Hotkeys", "CopLights", 79); // O
hotkeyToggleHeadLights = iniReader.ReadInteger("Hotkeys", "HeadLights", 72); // H
hotkeyToggleHeadlights = iniReader.ReadInteger("Hotkeys", "Headlights", 72); // H
hotkeyCarHack = iniReader.ReadInteger("Hotkeys", "FreezeCar", 115); //F4
hotkeyUnlockAllThings = iniReader.ReadInteger("Hotkeys", "UnlockAllThings", 116); //F5
hotkeyDrunkDriver = iniReader.ReadInteger("Hotkeys", "AutoDrive", 117); //F6
Expand Down Expand Up @@ -983,7 +983,7 @@ void Init()
CarScale = iniReader.ReadFloat("Gameplay", "CarScale", 1.0f);
copLightsEnabled = iniReader.ReadInteger("Gameplay", "CopLightsMode", 0) == 1;
copLightsAmount = iniReader.ReadFloat("Gameplay", "CopLightsBrightness", 1.00f);
headLightsMode = iniReader.ReadInteger("Gameplay", "HeadLightsMode", 2);
headlightsMode = iniReader.ReadInteger("Gameplay", "HeadlightsMode", 2);
LowBeamAmount = iniReader.ReadFloat("Gameplay", "LowBeamBrightness", 0.75f);
HighBeamAmount = iniReader.ReadFloat("Gameplay", "HighBeamBrightness", 1.00f);
removeSceneryGroupDoor = iniReader.ReadInteger("Gameplay", "RemoveOldBridgeBarrier", 0) == 1;
Expand Down Expand Up @@ -1045,6 +1045,7 @@ void Init()
// Misc
WindowedMode = iniReader.ReadInteger("Misc", "WindowedMode", 0);
SkipMovies = iniReader.ReadInteger("Misc", "SkipMovies", 0) == 1;
SkipNISs = iniReader.ReadInteger("Misc", "SkipNISs", 0) == 1;
EnableSound = iniReader.ReadInteger("Misc", "EnableSound", 1) == 1;
EnableMusic = iniReader.ReadInteger("Misc", "EnableMusic", 1) == 1;
ShowMessage = iniReader.ReadInteger("Misc", "ShowMessage", 1) == 1;
Expand All @@ -1063,7 +1064,7 @@ void Init()
maxOpponents %= 16;
maxOpponentsRandomQR %= 16;

headLightsMode %= 3;
headlightsMode %= 3;

randomizeCount %= 501;

Expand Down Expand Up @@ -1306,21 +1307,21 @@ void Init()
if (ShowOnlineOpts) injector::MakeNOP(0x5290B2, 2, true); // Show Online Options menu

// Load headlights preferences
switch (headLightsMode)
switch (headlightsMode)
{
case 0:
injector::WriteMemory<float>(0x742b94, 0, true); // Left HeadLight
injector::WriteMemory<float>(0x742bb3, 0, true); // Right HeadLight
injector::WriteMemory<float>(0x742b94, 0, true); // Left Headlight
injector::WriteMemory<float>(0x742bb3, 0, true); // Right Headlight
injector::WriteMemory<unsigned char>(0x8AF2AC, 0x00, true); //Remove flare
break;
case 1:
injector::WriteMemory<float>(0x742b94, LowBeamAmount, true); // Left HeadLight
injector::WriteMemory<float>(0x742bb3, LowBeamAmount, true); // Right HeadLight
injector::WriteMemory<float>(0x742b94, LowBeamAmount, true); // Left Headlight
injector::WriteMemory<float>(0x742bb3, LowBeamAmount, true); // Right Headlight
injector::WriteMemory<unsigned char>(0x8AF2AC, 'H', true);
break;
case 2: default:
injector::WriteMemory<float>(0x742b94, HighBeamAmount, true); // Left HeadLight
injector::WriteMemory<float>(0x742bb3, HighBeamAmount, true); // Right HeadLight
injector::WriteMemory<float>(0x742b94, HighBeamAmount, true); // Left Headlight
injector::WriteMemory<float>(0x742bb3, HighBeamAmount, true); // Right Headlight
injector::WriteMemory<unsigned char>(0x8AF2AC, 'H', true);
break;
}
Expand Down Expand Up @@ -1371,6 +1372,11 @@ void Init()
injector::WriteMemory<unsigned char>(0x926144, SkipMovies, true);
}

if (SkipNISs)
{
injector::WriteMemory<unsigned char>(0x9260A4, SkipNISs, true);
}

if (!EnableSound)
{
injector::WriteMemory<unsigned char>(0x8F86F8, EnableSound, true);
Expand Down Expand Up @@ -1946,32 +1952,32 @@ DWORD WINAPI Thing(LPVOID)
}

// Headlights
if ((GetAsyncKeyState(hotkeyToggleHeadLights) & 1) && (GameState == 6) && IsOnFocus) // When pressed "Toggle Head Lights" key
if ((GetAsyncKeyState(hotkeyToggleHeadlights) & 1) && (GameState == 6) && IsOnFocus) // When pressed "Toggle Head Lights" key
{
headLightsMode = (headLightsMode + 1) % 3; // 0, 1 or 2
headlightsMode = (headlightsMode + 1) % 3; // 0, 1 or 2
CIniReader iniReader("NFSMWExtraOptionsSettings.ini");
iniReader.WriteInteger("Gameplay", "HeadLightsMode", headLightsMode);
iniReader.WriteInteger("Gameplay", "HeadlightsMode", headlightsMode);

switch (headLightsMode)
switch (headlightsMode)
{
case 0:
injector::WriteMemory<float>(0x742b94, 0, true); // Left HeadLight
injector::WriteMemory<float>(0x742bb3, 0, true); // Right HeadLight
injector::WriteMemory<float>(0x742b94, 0, true); // Left Headlight
injector::WriteMemory<float>(0x742bb3, 0, true); // Right Headlight
injector::WriteMemory<unsigned char>(0x8AF2AC, 0x00, true);
break;
case 1:
injector::WriteMemory<float>(0x742b94, LowBeamAmount, true); // Left HeadLight
injector::WriteMemory<float>(0x742bb3, LowBeamAmount, true); // Right HeadLight
injector::WriteMemory<float>(0x742b94, LowBeamAmount, true); // Left Headlight
injector::WriteMemory<float>(0x742bb3, LowBeamAmount, true); // Right Headlight
injector::WriteMemory<unsigned char>(0x8AF2AC, 'H', true);
break;
default:
injector::WriteMemory<float>(0x742b94, HighBeamAmount, true); // Left HeadLight
injector::WriteMemory<float>(0x742bb3, HighBeamAmount, true); // Right HeadLight
injector::WriteMemory<float>(0x742b94, HighBeamAmount, true); // Left Headlight
injector::WriteMemory<float>(0x742bb3, HighBeamAmount, true); // Right Headlight
injector::WriteMemory<unsigned char>(0x8AF2AC, 'H', true);
break;
}

while ((GetAsyncKeyState(hotkeyToggleHeadLights) & 0x8000) > 0) { Sleep(ThreadDelay); }
while ((GetAsyncKeyState(hotkeyToggleHeadlights) & 0x8000) > 0) { Sleep(ThreadDelay); }
}


Expand Down
11 changes: 6 additions & 5 deletions NFSMWExtraOptionsSettings.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[Hotkeys] // Look at http://cherrytree.at/misc/vk.htm for key values (decimal)
HeatLevelHack = 118 // Force-enables Heat Level Override and lets you select a heat level with the key below. (Default = 118 = F7 key)
ChangeHeatLevel = 33 // Changes heat levels when the upper option is enabled. (Default = 33 = PageUp key)
CopLights = 79 // Enables "Cop Lights". Use a cop car for best results. (Default = 79 = O key)
Headlights = 72 // Changes "Head Lights" between closed (0), short (1) and long (2). (Default = 72 = H key)
FreezeCar = 115 // Enables "Freeze Car" hack. (Default = 115 = F4 key)
CopLights = 79 // Enables Cop Lights. Use a cop car for best results. (Default = 79 = O key)
Headlights = 72 // Changes Headlights between closed (0), short (1) and long (2). (Default = 72 = H key)
FreezeCar = 115 // Enables Freeze Car hack. (Default = 115 = F4 key)
UnlockAllThings = 116 // Unlocks everything in game and lets you play hidden tracks. (Default = 116 = F5 key)
AutoDrive = 117 // Enables "Auto Drive" (Drunk Driver) hack. (Default = 117 = F6 key)
AutoDrive = 117 // Enables Auto Drive (Drunk Driver) hack. (Default = 117 = F6 key)
EnableSaveLoadHotPos = 0 // Lets you save (LShift + 1/5) or load (LCtrl + 1/5) your position on the world. (0 = False (Default), 1 = True)

[LapControllers]
Expand Down Expand Up @@ -63,7 +63,7 @@ DebugCamSuperTurboSpeed = 7.16 // Speed modifier for Debug World Camera Sup
CarScale = 1 // Resizes car model (FOR FUN) (Default = 1.0)
CopLightsMode = 0 // Current mode for Cop Lights. (0 = Off (Default), 1 = On)
CopLightsBrightness = 1 // Brightness of Cop Lights. (Default = 1)
HeadLightsMode = 2 // Current mode for Headlights. (0 = Off, 1 = Low Beam, 2 = High Beam (Default))
HeadlightsMode = 2 // Current mode for Headlights. (0 = Off, 1 = Low Beam, 2 = High Beam (Default))
LowBeamBrightness = 0.75 // Headlight brightness for Low Beam setting. (Default = 0.75)
HighBeamBrightness = 1 // Headlight brightness for High Beam setting. (Default = 1)
RemoveOldBridgeBarrier = 0 // Removes the barrier which closes the road to the Old Bridge. (0 = False (Default), 1 = True)
Expand Down Expand Up @@ -125,6 +125,7 @@ ImmobileColFix = 1 // (EXPERIMENTAL) Fixes infinite mass of som
[Misc]
WindowedMode = 0 // Runs the game in a window instead of full screen. (0 = False (Default), 1 = True, 2 = Bordered)
SkipMovies = 0 // Skips cutscenes. (0 = False (Default), 1 = True)
SkipNISs = 0 // Skips some NISs (non-interactive scenes). (0 = False (Default), 1 = True)
EnableSound = 1 // Enables in-game sounds. (0 = False, 1 = True (Default))
EnableMusic = 1 // Enables in-game music. (0 = False, 1 = True (Default))
ShowMessage = 1 // Shows in-game messages when you use some features. (0 = False, 1 = True (Default))
Expand Down

0 comments on commit d90775c

Please sign in to comment.