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

Extracted Settings class to separate file

This commit is contained in:
Rich Dunne 2020-08-26 18:36:30 -06:00
parent 028c80035a
commit 1cd719b076
3 changed files with 29 additions and 24 deletions

View file

@ -10,30 +10,6 @@ namespace SceneManager
{
public class EntryPoint
{
internal static class Settings
{
internal static Keys ToggleKey = Keys.T;
internal static Keys ModifierKey = Keys.LShiftKey;
internal static ControllerButtons ToggleButton = ControllerButtons.Y;
internal static ControllerButtons ModifierButton = ControllerButtons.A;
internal static bool EnableHints = true;
//internal static string id = Verification.passThrough(Verification.GetID());
//internal static string PatronKey = null; // This cannot reference VerifyUser because the file can just be shared and it will always work. Must be manually set to each user's ID
internal static void LoadSettings()
{
Game.LogTrivial("Loading SceneManager.ini settings");
InitializationFile ini = new InitializationFile("Plugins/SceneManager.ini");
ini.Create();
//PatronKey = ini.ReadString("Patreon","PatronKey", null);
ToggleKey = ini.ReadEnum("Keybindings", "ToggleKey", Keys.T);
ModifierKey = ini.ReadEnum("Keybindings", "ModifierKey", Keys.LShiftKey);
ToggleButton = ini.ReadEnum("Keybindings", "ToggleButton", ControllerButtons.A);
ModifierButton = ini.ReadEnum("Keybindings", "ModifierButton", ControllerButtons.DPadDown);
EnableHints = ini.ReadBoolean("Other Settings", "EnableHints", true);
}
}
public static void Main()
{
AppDomain.CurrentDomain.DomainUnload += MyTerminationHandler;

View file

@ -65,6 +65,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Menus\PathMainMenu.cs" />
<Compile Include="Menus\SettingsMenu.cs" />
<Compile Include="Settings.cs" />
<Compile Include="VehicleCollector.cs" />
<Compile Include="Verification.cs" />
<Compile Include="Object Classes\Waypoint.cs" />

28
SceneManager/Settings.cs Normal file
View file

@ -0,0 +1,28 @@
using Rage;
using System.Windows.Forms;
namespace SceneManager
{
internal static class Settings
{
internal static Keys ToggleKey = Keys.T;
internal static Keys ModifierKey = Keys.LShiftKey;
internal static ControllerButtons ToggleButton = ControllerButtons.Y;
internal static ControllerButtons ModifierButton = ControllerButtons.A;
internal static bool EnableHints = true;
internal static Object[] barriers;
internal static void LoadSettings()
{
Game.LogTrivial("Loading SceneManager.ini settings");
InitializationFile ini = new InitializationFile("Plugins/SceneManager.ini");
ini.Create();
ToggleKey = ini.ReadEnum("Keybindings", "ToggleKey", Keys.T);
ModifierKey = ini.ReadEnum("Keybindings", "ModifierKey", Keys.LShiftKey);
ToggleButton = ini.ReadEnum("Keybindings", "ToggleButton", ControllerButtons.A);
ModifierButton = ini.ReadEnum("Keybindings", "ModifierButton", ControllerButtons.DPadDown);
EnableHints = ini.ReadBoolean("Other Settings", "EnableHints", true);
}
}
}