1
Fork 0
mirror of https://github.com/thegeneralist01/Scene-Manager-DevRepo synced 2026-01-11 15:40:29 +01:00

Added check for InputManager.dll alongside RNUI version checker.

This commit is contained in:
Rich Dunne 2020-11-27 15:07:04 -07:00
parent 23af515692
commit d760675b27

View file

@ -13,8 +13,12 @@ namespace SceneManager
{ {
internal static void Main() internal static void Main()
{ {
if (CheckRNUIVersion()) if(!InputManagerChecker() || !CheckRNUIVersion())
{ {
Game.UnloadActivePlugin();
return;
}
AppDomain.CurrentDomain.DomainUnload += MyTerminationHandler; AppDomain.CurrentDomain.DomainUnload += MyTerminationHandler;
Settings.LoadSettings(); Settings.LoadSettings();
GetAssemblyVersion(); GetAssemblyVersion();
@ -24,12 +28,6 @@ namespace SceneManager
GameFiber UserInputFiber = new GameFiber(() => GetUserInput.LoopForUserInput()); GameFiber UserInputFiber = new GameFiber(() => GetUserInput.LoopForUserInput());
UserInputFiber.Start(); UserInputFiber.Start();
}
else
{
Game.UnloadActivePlugin();
return;
}
void GetAssemblyVersion() void GetAssemblyVersion()
{ {
@ -62,6 +60,19 @@ namespace SceneManager
} }
} }
private static bool InputManagerChecker()
{
var directory = Directory.GetCurrentDirectory();
var exists = File.Exists(directory + @"\InputManager.dll");
if (!exists)
{
Game.LogTrivial($"InputManager was not found in the user's GTA V directory.");
Game.DisplayNotification($"~o~Scene Manager ~r~[Error]\n~w~InputManager.dll was not found in your GTA V directory. Please install InputManager.dll and try again.");
return false;
}
return true;
}
private static void DisplayHintsToOpenMenu() private static void DisplayHintsToOpenMenu()
{ {
if (Settings.ModifierKey == Keys.None && Settings.ModifierButton == ControllerButtons.None) if (Settings.ModifierKey == Keys.None && Settings.ModifierButton == ControllerButtons.None)