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

Removed menu option to adjust barrier placement distance and removed any references for it.

This commit is contained in:
Rich Dunne 2020-09-14 12:01:28 -06:00
parent 70ef7a6596
commit 530686a8b2
2 changed files with 2 additions and 8 deletions

View file

@ -13,7 +13,6 @@ namespace SceneManager
hints = new UIMenuCheckboxItem("Enable Hints", Settings.EnableHints); hints = new UIMenuCheckboxItem("Enable Hints", Settings.EnableHints);
private static SpeedUnits[] speedArray = {SpeedUnits.MPH, SpeedUnits.KPH }; private static SpeedUnits[] speedArray = {SpeedUnits.MPH, SpeedUnits.KPH };
public static UIMenuListScrollerItem<SpeedUnits> speedUnits = new UIMenuListScrollerItem<SpeedUnits>("Speed Unit of Measure", "", new[] { SpeedUnits.MPH, SpeedUnits.KPH }); public static UIMenuListScrollerItem<SpeedUnits> speedUnits = new UIMenuListScrollerItem<SpeedUnits>("Speed Unit of Measure", "", new[] { SpeedUnits.MPH, SpeedUnits.KPH });
public static UIMenuNumericScrollerItem<int> barrierPlacementDistance = new UIMenuNumericScrollerItem<int>("Barrier Placement Distance", "How far away you can place a barrier (in meters)", 1, (int)Settings.BarrierPlacementDistance, 1);
public static UIMenuItem saveSettings = new UIMenuItem("Save settings to .ini", "Updates the plugin's .ini file with the current settings so the next time the plugin is loaded, it will use these settings."); public static UIMenuItem saveSettings = new UIMenuItem("Save settings to .ini", "Updates the plugin's .ini file with the current settings so the next time the plugin is loaded, it will use these settings.");
internal static void InstantiateMenu() internal static void InstantiateMenu()
@ -30,8 +29,6 @@ namespace SceneManager
settingsMenu.AddItem(hints); settingsMenu.AddItem(hints);
settingsMenu.AddItem(speedUnits); settingsMenu.AddItem(speedUnits);
speedUnits.Index = Array.IndexOf(speedArray, Settings.SpeedUnit); speedUnits.Index = Array.IndexOf(speedArray, Settings.SpeedUnit);
settingsMenu.AddItem(barrierPlacementDistance);
barrierPlacementDistance.Index = barrierPlacementDistance.OptionCount - 1;
settingsMenu.AddItem(saveSettings); settingsMenu.AddItem(saveSettings);
saveSettings.ForeColor = System.Drawing.Color.Gold; saveSettings.ForeColor = System.Drawing.Color.Gold;
@ -44,7 +41,7 @@ namespace SceneManager
{ {
if(selectedItem == saveSettings) if(selectedItem == saveSettings)
{ {
Settings.UpdateSettings(threeDWaypoints.Checked, mapBlips.Checked, hints.Checked, speedUnits.SelectedItem, barrierPlacementDistance.Value); Settings.UpdateSettings(threeDWaypoints.Checked, mapBlips.Checked, hints.Checked, speedUnits.SelectedItem);
Game.DisplayHelp($"Settings saved"); Game.DisplayHelp($"Settings saved");
} }
} }

View file

@ -50,17 +50,14 @@ namespace SceneManager
foreach(string key in ini.GetKeyNames("Barriers")) foreach(string key in ini.GetKeyNames("Barriers"))
{ {
//Game.LogTrivial($"Key: {key.Trim()}");
//Game.LogTrivial($"Value: {ini.ReadString("Barriers",key)}");
barrierKeys.Add(key.Trim()); barrierKeys.Add(key.Trim());
var m = new Model(ini.ReadString("Barriers", key)); var m = new Model(ini.ReadString("Barriers", key));
if (m.IsValid) if (m.IsValid)
barrierValues.Add(m.Name); barrierValues.Add(m.Name);
//barrierValues.Add(ini.ReadString("Barriers", key));
} }
} }
internal static void UpdateSettings(bool threeDWaypointsEnabled, bool mapBlipsEnabled, bool hintsEnabled, SpeedUnits unit, float distance) internal static void UpdateSettings(bool threeDWaypointsEnabled, bool mapBlipsEnabled, bool hintsEnabled, SpeedUnits unit)
{ {
ini.Write("Other Settings", "Enable3DWaypoints", threeDWaypointsEnabled); ini.Write("Other Settings", "Enable3DWaypoints", threeDWaypointsEnabled);
ini.Write("Other Settings", "EnableMapBlips", mapBlipsEnabled); ini.Write("Other Settings", "EnableMapBlips", mapBlipsEnabled);