public static bool IsKeyCombinationDownComputerCheck(Keys MainKey, Keys ModifierKey) { if (MainKey != Keys.None) { return(ExtensionMethods.IsKeyDownComputerCheck(MainKey) && (ExtensionMethods.IsKeyDownRightNowComputerCheck(ModifierKey) || (ModifierKey == Keys.None && !ExtensionMethods.IsKeyDownRightNowComputerCheck(Keys.Shift) && !ExtensionMethods.IsKeyDownRightNowComputerCheck(Keys.Control) && !ExtensionMethods.IsKeyDownRightNowComputerCheck(Keys.LControlKey) && !ExtensionMethods.IsKeyDownRightNowComputerCheck(Keys.LShiftKey)))); } else { return(false); } }
internal static void MainLoop() { Game.LogTrivial("Custom Pullover.Mainloop started"); Game.LogTrivial("Loading Custom Pullover settings..."); LoadValuesFromIniFile(); IsSomeoneFollowing = false; IsSomeoneRunningTheLight = false; GameFiber.StartNew(delegate { while (true) { GameFiber.Yield(); if (Functions.IsPlayerPerformingPullover()) { if (ExtensionMethods.IsKeyDownRightNowComputerCheck(TrafficStopFollowModifierKey) || (TrafficStopFollowModifierKey == Keys.None)) { if (ExtensionMethods.IsKeyDownComputerCheck(TrafficStopFollowKey)) { if (!IsSomeoneFollowing) { TrafficStopAssist.FollowMe(); } else { IsSomeoneFollowing = false; } } } if (ExtensionMethods.IsKeyDownRightNowComputerCheck(TrafficStopMimicModifierKey) || (TrafficStopMimicModifierKey == Keys.None)) { if (ExtensionMethods.IsKeyDownComputerCheck(TrafficStopMimicKey)) { if (!IsSomeoneFollowing) { TrafficStopAssist.MimicMe(); } else { IsSomeoneFollowing = false; } } } if (ExtensionMethods.IsKeyDownRightNowComputerCheck(CustomPulloverLocationModifierKey) || (CustomPulloverLocationModifierKey == Keys.None)) { if (ExtensionMethods.IsKeyDownComputerCheck(CustomPulloverLocationKey)) { if (!IsSomeoneFollowing) { TrafficStopAssist.SetCustomPulloverLocation(); } else { Game.LogTrivial("Already doing custom pullover location."); } } } if (!IsSomeoneRunningTheLight) { TrafficStopAssist.CheckForceRedLightRun(); } } } }); while (true) { GameFiber.Yield(); TrafficStopAssist.CheckForYieldDisable(); if (AutoVehicleDoorLock) { TrafficStopAssist.LockPlayerDoors(); } //VehicleDetails.CheckForTextEntry(); } }