mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 23:50:29 +01:00
Added State and SpeedUnits enums to the class. Added code to save settings from the settings menu to plugin's .ini file
This commit is contained in:
parent
2f6956be20
commit
ac10c987ac
1 changed files with 32 additions and 1 deletions
|
|
@ -3,26 +3,57 @@ using System.Windows.Forms;
|
||||||
|
|
||||||
namespace SceneManager
|
namespace SceneManager
|
||||||
{
|
{
|
||||||
|
public enum State
|
||||||
|
{
|
||||||
|
Uninitialized,
|
||||||
|
Creating,
|
||||||
|
Finished
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SpeedUnits
|
||||||
|
{
|
||||||
|
MPH,
|
||||||
|
KPH
|
||||||
|
}
|
||||||
|
|
||||||
internal static class Settings
|
internal static class Settings
|
||||||
{
|
{
|
||||||
|
internal static readonly InitializationFile ini = new InitializationFile("Plugins/SceneManager.ini");
|
||||||
|
|
||||||
internal static Keys ToggleKey = Keys.T;
|
internal static Keys ToggleKey = Keys.T;
|
||||||
internal static Keys ModifierKey = Keys.LShiftKey;
|
internal static Keys ModifierKey = Keys.LShiftKey;
|
||||||
internal static ControllerButtons ToggleButton = ControllerButtons.Y;
|
internal static ControllerButtons ToggleButton = ControllerButtons.Y;
|
||||||
internal static ControllerButtons ModifierButton = ControllerButtons.A;
|
internal static ControllerButtons ModifierButton = ControllerButtons.A;
|
||||||
|
internal static bool Enable3DWaypoints = true;
|
||||||
|
internal static bool EnableMapBlips = true;
|
||||||
internal static bool EnableHints = true;
|
internal static bool EnableHints = true;
|
||||||
|
internal static SpeedUnits SpeedUnit = SpeedUnits.MPH;
|
||||||
|
internal static float BarrierPlacementDistance = 30f;
|
||||||
internal static Object[] barriers;
|
internal static Object[] barriers;
|
||||||
|
|
||||||
internal static void LoadSettings()
|
internal static void LoadSettings()
|
||||||
{
|
{
|
||||||
Game.LogTrivial("Loading SceneManager.ini settings");
|
Game.LogTrivial("Loading SceneManager.ini settings");
|
||||||
InitializationFile ini = new InitializationFile("Plugins/SceneManager.ini");
|
//InitializationFile ini = new InitializationFile("Plugins/SceneManager.ini");
|
||||||
ini.Create();
|
ini.Create();
|
||||||
|
|
||||||
ToggleKey = ini.ReadEnum("Keybindings", "ToggleKey", Keys.T);
|
ToggleKey = ini.ReadEnum("Keybindings", "ToggleKey", Keys.T);
|
||||||
ModifierKey = ini.ReadEnum("Keybindings", "ModifierKey", Keys.LShiftKey);
|
ModifierKey = ini.ReadEnum("Keybindings", "ModifierKey", Keys.LShiftKey);
|
||||||
ToggleButton = ini.ReadEnum("Keybindings", "ToggleButton", ControllerButtons.A);
|
ToggleButton = ini.ReadEnum("Keybindings", "ToggleButton", ControllerButtons.A);
|
||||||
ModifierButton = ini.ReadEnum("Keybindings", "ModifierButton", ControllerButtons.DPadDown);
|
ModifierButton = ini.ReadEnum("Keybindings", "ModifierButton", ControllerButtons.DPadDown);
|
||||||
|
Enable3DWaypoints = ini.ReadBoolean("Other Settings", "Enable3DWaypoints", true);
|
||||||
|
EnableMapBlips = ini.ReadBoolean("Other Settings", "EnableMapBlips", true);
|
||||||
EnableHints = ini.ReadBoolean("Other Settings", "EnableHints", true);
|
EnableHints = ini.ReadBoolean("Other Settings", "EnableHints", true);
|
||||||
|
SpeedUnit = ini.ReadEnum("Other Settings", "SpeedUnits", SpeedUnits.MPH);
|
||||||
|
BarrierPlacementDistance = ini.ReadInt32("Other Settings", "BarrierPlacementDistance", 30);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static void UpdateSettings(bool threeDWaypointsEnabled, bool mapBlipsEnabled, bool hintsEnabled, SpeedUnits unit, float distance)
|
||||||
|
{
|
||||||
|
ini.Write("Other Settings", "Enable3DWaypoints", threeDWaypointsEnabled);
|
||||||
|
ini.Write("Other Settings", "EnableMapBlips", mapBlipsEnabled);
|
||||||
|
ini.Write("Other Settings", "EnableHints", hintsEnabled);
|
||||||
|
ini.Write("Other Settings", "SpeedUnits", unit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue