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. Added delay to load settings while the game is loading. Excluded EntryPoint class and Main method from obfuscation.

This commit is contained in:
Rich Dunne 2020-12-06 07:34:13 -07:00
parent 572091196d
commit f9631d8514

View file

@ -4,13 +4,17 @@ using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using Rage;
using SceneManager.Objects;
using SceneManager.Utils;
[assembly: Rage.Attributes.Plugin("Scene Manager", Author = "Rich", Description = "Control your scenes with custom AI pathing and traffic barrier management.", PrefersSingleInstance = true)]
namespace SceneManager
{
[Obfuscation(Exclude = false, Feature = "-rename", ApplyToMembers = false)]
public class EntryPoint
{
[Obfuscation(Exclude = false, Feature = "-rename")]
internal static void Main()
{
if(!InputManagerChecker() || !CheckRNUIVersion())
@ -19,6 +23,11 @@ namespace SceneManager
return;
}
while (Game.IsLoading)
{
GameFiber.Yield();
}
AppDomain.CurrentDomain.DomainUnload += MyTerminationHandler;
Settings.LoadSettings();
GetAssemblyVersion();
@ -35,6 +44,7 @@ namespace SceneManager
Game.LogTrivial($"Scene Manager V{version} is ready.");
}
}
private static bool CheckRNUIVersion()
{
var directory = Directory.GetCurrentDirectory();
@ -73,6 +83,7 @@ namespace SceneManager
}
return true;
}
private static void DisplayHintsToOpenMenu()
{
if (Settings.ModifierKey == Keys.None && Settings.ModifierButton == ControllerButtons.None)
@ -92,6 +103,7 @@ namespace SceneManager
Hints.Display($"~o~Scene Manager ~y~[Hint]\n~w~To open the menu, press the ~b~{Settings.ModifierKey} ~w~+ ~b~{Settings.ToggleKey} keys ~w~or ~b~{Settings.ModifierButton} ~w~+ ~b~{Settings.ToggleButton} buttons");
}
}
private static void MyTerminationHandler(object sender, EventArgs e)
{
// Clean up cones
@ -107,7 +119,7 @@ namespace SceneManager
// Clean up paths
for (int i = 0; i < PathMainMenu.paths.Count; i++)
{
PathMainMenu.DeletePath(PathMainMenu.paths[i], PathMainMenu.Delete.All);
PathMainMenu.DeletePath(PathMainMenu.paths[i], Delete.All);
}
Game.LogTrivial($"Plugin has shut down.");