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

Extracted blip opacity code to new method within Path class as part of Path class refactor

This commit is contained in:
Rich Dunne 2020-08-20 16:30:17 -06:00
parent 42acd1c56a
commit 24f3c70474

View file

@ -40,33 +40,16 @@ namespace SceneManager
{ {
if (checkboxItem == togglePath) if (checkboxItem == togglePath)
{ {
var currentPath = TrafficMenu.paths[TrafficMenu.editPath.Index];
if (togglePath.Checked) if (togglePath.Checked)
{ {
TrafficMenu.paths[TrafficMenu.editPath.Index].PathDisabled = true; currentPath.DisablePath();
Game.LogTrivial($"Path {TrafficMenu.paths[TrafficMenu.editPath.Index].PathNum} disabled."); Game.LogTrivial($"Path {currentPath.PathNum} disabled.");
foreach (Waypoint wd in TrafficMenu.paths[TrafficMenu.editPath.Index].Waypoint)
{
wd.Blip.Alpha = 0.5f;
if (wd.CollectorRadiusBlip)
{
wd.CollectorRadiusBlip.Alpha = 0.25f;
}
}
} }
else else
{ {
TrafficMenu.paths[TrafficMenu.editPath.Index].PathDisabled = false; currentPath.EnablePath();
Game.LogTrivial($"Path {TrafficMenu.paths[TrafficMenu.editPath.Index].PathNum} enabled."); Game.LogTrivial($"Path {currentPath.PathNum} enabled.");
foreach (Waypoint wd in TrafficMenu.paths[TrafficMenu.editPath.Index].Waypoint)
{
wd.Blip.Alpha = 1.0f;
if (wd.CollectorRadiusBlip)
{
wd.CollectorRadiusBlip.Alpha = 0.5f;
}
}
} }
} }
} }