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

Speed radius can now no longer be less than collection radius.

This commit is contained in:
Rich Dunne 2020-09-04 19:55:55 -06:00
parent c40f2e13a5
commit beeafcb6a0
2 changed files with 36 additions and 1 deletions

View file

@ -49,6 +49,7 @@ namespace SceneManager
pathCreationMenu.RefreshIndex();
pathCreationMenu.OnItemSelect += PathCreation_OnItemSelected;
pathCreationMenu.OnCheckboxChange += PathCreation_OnCheckboxChanged;
pathCreationMenu.OnScrollerChange += PathCreation_OnScrollerChanged;
}
private static void PathCreation_OnCheckboxChanged(UIMenu sender, UIMenuCheckboxItem checkboxItem, bool @checked)
@ -183,6 +184,25 @@ namespace SceneManager
}
}
private static void PathCreation_OnScrollerChanged(UIMenu sender, UIMenuScrollerItem scrollerItem, int first, int last)
{
if (scrollerItem == collectorRadius)
{
if (collectorRadius.Value > speedZoneRadius.Value)
{
speedZoneRadius.ScrollToNextOption();
}
}
if(scrollerItem == speedZoneRadius)
{
if(speedZoneRadius.Value < collectorRadius.Value)
{
collectorRadius.Value = speedZoneRadius.Value;
}
}
}
private static void ToggleTrafficEndPathMenuItem(int pathIndex)
{
if (PathMainMenu.GetPaths()[pathIndex].Waypoints.Count > 0)