mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 07:30:40 +01:00
Added check for CollectorRadius being more than SpeedZoneRadius. Added debug messages when values are reset to default.
This commit is contained in:
parent
36fa5ffbf3
commit
1321b0b91d
1 changed files with 13 additions and 1 deletions
|
|
@ -67,12 +67,14 @@ namespace SceneManager
|
||||||
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);
|
||||||
|
|
||||||
// Plugin Settings
|
// Plugin Settings
|
||||||
Enable3DWaypoints = ini.ReadBoolean("Plugin Settings", "Enable3DWaypoints", true);
|
Enable3DWaypoints = ini.ReadBoolean("Plugin Settings", "Enable3DWaypoints", true);
|
||||||
EnableMapBlips = ini.ReadBoolean("Plugin Settings", "EnableMapBlips", true);
|
EnableMapBlips = ini.ReadBoolean("Plugin Settings", "EnableMapBlips", true);
|
||||||
EnableHints = ini.ReadBoolean("Plugin Settings", "EnableHints", true);
|
EnableHints = ini.ReadBoolean("Plugin Settings", "EnableHints", true);
|
||||||
SpeedUnit = ini.ReadEnum("Plugin Settings", "SpeedUnits", SpeedUnits.MPH);
|
SpeedUnit = ini.ReadEnum("Plugin Settings", "SpeedUnits", SpeedUnits.MPH);
|
||||||
BarrierPlacementDistance = ini.ReadInt32("Plugin Settings", "BarrierPlacementDistance", 30);
|
BarrierPlacementDistance = ini.ReadInt32("Plugin Settings", "BarrierPlacementDistance", 30);
|
||||||
|
|
||||||
// Default Waypoint Settings
|
// Default Waypoint Settings
|
||||||
CollectorRadius = ini.ReadInt32("Default Waypoint Settings", "CollectorRadius", 1);
|
CollectorRadius = ini.ReadInt32("Default Waypoint Settings", "CollectorRadius", 1);
|
||||||
SpeedZoneRadius = ini.ReadInt32("Default Waypoint Settings", "SpeedZoneRadius", 5);
|
SpeedZoneRadius = ini.ReadInt32("Default Waypoint Settings", "SpeedZoneRadius", 5);
|
||||||
|
|
@ -80,6 +82,7 @@ namespace SceneManager
|
||||||
DirectDrivingBehavior = ini.ReadBoolean("Default Waypoint Settings", "DirectDrivingBehavior", false);
|
DirectDrivingBehavior = ini.ReadBoolean("Default Waypoint Settings", "DirectDrivingBehavior", false);
|
||||||
WaypointSpeed = ini.ReadInt32("Default Waypoint Settings", "WaypointSpeed", 5);
|
WaypointSpeed = ini.ReadInt32("Default Waypoint Settings", "WaypointSpeed", 5);
|
||||||
CheckForValidWaypointSettings();
|
CheckForValidWaypointSettings();
|
||||||
|
|
||||||
// Barriers
|
// Barriers
|
||||||
foreach(string key in ini.GetKeyNames("Barriers"))
|
foreach(string key in ini.GetKeyNames("Barriers"))
|
||||||
{
|
{
|
||||||
|
|
@ -94,14 +97,23 @@ namespace SceneManager
|
||||||
if(CollectorRadius > 50 || CollectorRadius < 1)
|
if(CollectorRadius > 50 || CollectorRadius < 1)
|
||||||
{
|
{
|
||||||
CollectorRadius = 1;
|
CollectorRadius = 1;
|
||||||
|
Game.LogTrivial($"Invalid value for CollectorRadius in user settings, resetting to default.");
|
||||||
}
|
}
|
||||||
if(SpeedZoneRadius > 200 || SpeedZoneRadius < 5)
|
if(SpeedZoneRadius > 200 || SpeedZoneRadius < 5)
|
||||||
{
|
{
|
||||||
SpeedZoneRadius = 5;
|
SpeedZoneRadius = 5;
|
||||||
|
Game.LogTrivial($"Invalid value for SpeedZoneRadius in user settings, resetting to default.");
|
||||||
}
|
}
|
||||||
if(WaypointSpeed > 100 || WaypointSpeed < 5)
|
if (CollectorRadius > SpeedZoneRadius)
|
||||||
|
{
|
||||||
|
CollectorRadius = 1;
|
||||||
|
SpeedZoneRadius = 5;
|
||||||
|
Game.LogTrivial($"CollectorRadius is greater than SpeedZoneRadius in user settings, resetting to defaults.");
|
||||||
|
}
|
||||||
|
if (WaypointSpeed > 100 || WaypointSpeed < 5)
|
||||||
{
|
{
|
||||||
WaypointSpeed = 5;
|
WaypointSpeed = 5;
|
||||||
|
Game.LogTrivial($"Invalid value for WaypointSpeed in user settings, resetting to default.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue