diff --git a/TLM/TLM/Configuration.cs b/TLM/TLM/Configuration.cs index 2557952d..4cf8bf92 100644 --- a/TLM/TLM/Configuration.cs +++ b/TLM/TLM/Configuration.cs @@ -11,14 +11,14 @@ public class Configuration public string LaneFlags; public List PrioritySegments = new List(); - public List NodeDictionary = new List(); - public List ManualSegments = new List(); + public List NodeDictionary = new List(); + public List ManualSegments = new List(); public List TimedNodes = new List(); public List TimedNodeGroups = new List(); public List TimedNodeSteps = new List(); - public List TimedNodeStepSegments = new List(); - + public List TimedNodeStepSegments = new List(); + public static void SaveConfigurationToFile(string filename, Configuration config) { var serializer = new XmlSerializer(typeof(Configuration)); @@ -49,4 +49,4 @@ public static Configuration LoadConfigurationFromFile(string filename) return null; } } -} \ No newline at end of file +} diff --git a/TLM/TLM/CustomAI/CustomHumanAI.cs b/TLM/TLM/CustomAI/CustomHumanAI.cs index f72f8751..a91df129 100644 --- a/TLM/TLM/CustomAI/CustomHumanAI.cs +++ b/TLM/TLM/CustomAI/CustomHumanAI.cs @@ -11,7 +11,7 @@ public bool CheckTrafficLights(ushort node, ushort segment) var instance = Singleton.instance; var currentFrameIndex = Singleton.instance.m_currentFrameIndex; - + var num = (uint)((node << 8) / 32768); var num2 = currentFrameIndex - num & 255u; diff --git a/TLM/TLM/CustomAI/CustomRoadAI.cs b/TLM/TLM/CustomAI/CustomRoadAI.cs index 6159d728..de091624 100644 --- a/TLM/TLM/CustomAI/CustomRoadAI.cs +++ b/TLM/TLM/CustomAI/CustomRoadAI.cs @@ -76,7 +76,7 @@ public void Update() foreach (var nodeId in NodeDictionary.Keys) { var node = GetNodeSimulation(nodeId); - + if (node.FlagManualTrafficLights || (node.FlagTimedTrafficLights && node.TimedTrafficLightsActive)) { var data = TrafficLightTool.GetNetNode(nodeId); diff --git a/TLM/TLM/CustomPathFind.cs b/TLM/TLM/CustomPathFind.cs index 1e08e210..4db22a98 100644 --- a/TLM/TLM/CustomPathFind.cs +++ b/TLM/TLM/CustomPathFind.cs @@ -24,7 +24,7 @@ private struct BufferItem public CustomPathFind() { - + } //Expose the private fields @@ -41,7 +41,7 @@ private Array32 PathUnits get { return _fieldpathUnits.GetValue(this) as Array32; } set { _fieldpathUnits.SetValue(this, value); } } - + private uint QueueFirst { get { return (uint)_fieldQueueFirst.GetValue(this); } @@ -954,7 +954,7 @@ private void ProcessItem1(BufferItem item, ushort nodeId, ref NetNode node, byte // ref num, // connectOffset, true, false, preferedLaneId, preferedLaneNum); // } - //} + //} else { if (ProcessItem4(item, nodeId, num16, ref instance.m_segments.m_buffer[num16], ref num, diff --git a/TLM/TLM/CustomPathManager.cs b/TLM/TLM/CustomPathManager.cs index 3a222d7f..e0ce9d80 100644 --- a/TLM/TLM/CustomPathManager.cs +++ b/TLM/TLM/CustomPathManager.cs @@ -191,4 +191,4 @@ private static byte createSimulationFlag(bool isHeavyVehicle, bool ignoreBlocked return simulationFlags; } } -} \ No newline at end of file +} diff --git a/TLM/TLM/LaneRestrictions.cs b/TLM/TLM/LaneRestrictions.cs index 0f6241c1..2888c607 100644 --- a/TLM/TLM/LaneRestrictions.cs +++ b/TLM/TLM/LaneRestrictions.cs @@ -5,7 +5,7 @@ class LaneRestrictions public uint LaneId; public int LaneNum; public NetInfo.Direction Direction; - + public bool EnableCars = true; public bool EnableService = true; public bool EnableTransport = true; @@ -49,4 +49,4 @@ public void ToggleTransport() EnabledTypes = EnableTransport ? EnabledTypes + 1 : EnabledTypes - 1; } } -} \ No newline at end of file +} diff --git a/TLM/TLM/LoadingExtension.cs b/TLM/TLM/LoadingExtension.cs index 9865791f..69519c8a 100644 --- a/TLM/TLM/LoadingExtension.cs +++ b/TLM/TLM/LoadingExtension.cs @@ -65,7 +65,7 @@ public override void OnLevelLoaded(LoadMode mode) OnLoaded(); break; } - + if (mode == LoadMode.NewGame || mode == LoadMode.LoadGame) { if (Instance == null) @@ -75,7 +75,7 @@ public override void OnLevelLoaded(LoadMode mode) { PathfinderIncompatibility = true; } - + Instance = this; } @@ -176,4 +176,4 @@ private void DestroyTool() } } } -} \ No newline at end of file +} diff --git a/TLM/TLM/PriorityCar.cs b/TLM/TLM/PriorityCar.cs index 6c82a23e..63ce0c30 100644 --- a/TLM/TLM/PriorityCar.cs +++ b/TLM/TLM/PriorityCar.cs @@ -41,4 +41,4 @@ public void resetCar() carState = CarState.None; } } -} \ No newline at end of file +} diff --git a/TLM/TLM/PrioritySegment.cs b/TLM/TLM/PrioritySegment.cs index e215dc1c..4e6c6785 100644 --- a/TLM/TLM/PrioritySegment.cs +++ b/TLM/TLM/PrioritySegment.cs @@ -24,9 +24,9 @@ public enum PriorityType public int NumCars; - public List Cars = new List(); + public List Cars = new List(); - public int[] CarsOnLanes = new int[24]; + public int[] CarsOnLanes = new int[24]; public PrioritySegment(ushort nodeid, int segmentid, PriorityType type) { @@ -91,4 +91,4 @@ private void _numCarsOnLane() } } } -} \ No newline at end of file +} diff --git a/TLM/TLM/Properties/AssemblyInfo.cs b/TLM/TLM/Properties/AssemblyInfo.cs index 88a48d5f..27c1e236 100644 --- a/TLM/TLM/Properties/AssemblyInfo.cs +++ b/TLM/TLM/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("TLM")] @@ -14,8 +14,8 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,11 +25,11 @@ // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] diff --git a/TLM/TLM/SegmentRestrictions.cs b/TLM/TLM/SegmentRestrictions.cs index 8fa67e9f..3c113752 100644 --- a/TLM/TLM/SegmentRestrictions.cs +++ b/TLM/TLM/SegmentRestrictions.cs @@ -11,7 +11,7 @@ class SegmentRestrictions public List Lanes = new List(); - public List SegmentGroup; + public List SegmentGroup; public SegmentRestrictions(int segmentid, List segmentGroup ) { @@ -34,4 +34,4 @@ public LaneRestrictions GetLaneByNum(int laneNum) return Lanes.FirstOrDefault(laneRestriction => laneRestriction.LaneNum == laneNum); } } -} \ No newline at end of file +} diff --git a/TLM/TLM/SerializableDataExtension.cs b/TLM/TLM/SerializableDataExtension.cs index 7db7438a..94485e65 100644 --- a/TLM/TLM/SerializableDataExtension.cs +++ b/TLM/TLM/SerializableDataExtension.cs @@ -22,7 +22,7 @@ public class SerializableDataExtension : ISerializableDataExtension public static ISerializableData SerializableData; private static Timer _timer; - + public void OnCreated(ISerializableData serializableData) { UniqueId = 0u; @@ -54,7 +54,7 @@ public void OnLoadData() else { _timer = new Timer(2000); - // Hook up the Elapsed event for the timer. + // Hook up the Elapsed event for the timer. _timer.Elapsed += OnLoadDataTimed; _timer.Enabled = true; } @@ -76,7 +76,7 @@ private static void OnLoadDataTimed(Object source, ElapsedEventArgs e) if (!File.Exists(filepath)) { - + return; } @@ -219,7 +219,7 @@ public void OnSaveData() FastList data = new FastList(); - GenerateUniqueId(); + GenerateUniqueId(); byte[] uniqueIdBytes = BitConverter.GetBytes(UniqueId); foreach (byte uniqueIdByte in uniqueIdBytes) @@ -241,7 +241,7 @@ public void OnSaveData() if (TrafficPriority.PrioritySegments[i].Node1 != 0) { configuration.PrioritySegments.Add(new[] { TrafficPriority.PrioritySegments[i].Node1, i, (int)TrafficPriority.PrioritySegments[i].Instance1.Type }); - } + } if (TrafficPriority.PrioritySegments[i].Node2 != 0) { configuration.PrioritySegments.Add(new[] { TrafficPriority.PrioritySegments[i].Node2, i, (int)TrafficPriority.PrioritySegments[i].Instance2.Type }); diff --git a/TLM/TLM/TLM.csproj b/TLM/TLM/TLM.csproj index cb44d0a8..a36c2477 100644 --- a/TLM/TLM/TLM.csproj +++ b/TLM/TLM/TLM.csproj @@ -131,11 +131,11 @@ - - \ No newline at end of file + diff --git a/TLM/TLM/ThreadingExtension.cs b/TLM/TLM/ThreadingExtension.cs index c15bcec1..f595a2a6 100644 --- a/TLM/TLM/ThreadingExtension.cs +++ b/TLM/TLM/ThreadingExtension.cs @@ -120,4 +120,4 @@ public override void OnUpdate(float realTimeDelta, float simulationTimeDelta) } } } -} \ No newline at end of file +} diff --git a/TLM/TLM/Traffic/TimedTrafficSteps.cs b/TLM/TLM/Traffic/TimedTrafficSteps.cs index bc3e8303..0db5feec 100644 --- a/TLM/TLM/Traffic/TimedTrafficSteps.cs +++ b/TLM/TLM/Traffic/TimedTrafficSteps.cs @@ -16,7 +16,7 @@ public class TimedTrafficSteps : ICloneable public List LightMain = new List(); public List LightLeft = new List(); public List LightRight = new List(); - public List LightPedestrian = new List(); + public List LightPedestrian = new List(); public TimedTrafficSteps(int num, ushort nodeId) { @@ -126,4 +126,4 @@ public object Clone() return MemberwiseClone(); } } -} \ No newline at end of file +} diff --git a/TLM/TLM/Traffic/TrafficPriority.cs b/TLM/TLM/Traffic/TrafficPriority.cs index e6054ff8..bb026973 100644 --- a/TLM/TLM/Traffic/TrafficPriority.cs +++ b/TLM/TLM/Traffic/TrafficPriority.cs @@ -701,7 +701,7 @@ public static bool HasRightLane(ushort nodeId, int segmentId) } return false; - } + } public static Vector3 GetSegmentDir(int segment, ushort nodeid) { diff --git a/TLM/TLM/Traffic/TrafficRoadRestrictions.cs b/TLM/TLM/Traffic/TrafficRoadRestrictions.cs index 8f4c22d1..d007caf4 100644 --- a/TLM/TLM/Traffic/TrafficRoadRestrictions.cs +++ b/TLM/TLM/Traffic/TrafficRoadRestrictions.cs @@ -42,7 +42,7 @@ public static VehicleType VehicleType(byte simulationFlags) return Traffic.VehicleType.Service; if ((simulationFlags & 128) == 128) return Traffic.VehicleType.Car; - + return Traffic.VehicleType.Car; } } diff --git a/TLM/TLM/Traffic/TrafficSegment.cs b/TLM/TLM/Traffic/TrafficSegment.cs index 4a786d08..496a9024 100644 --- a/TLM/TLM/Traffic/TrafficSegment.cs +++ b/TLM/TLM/Traffic/TrafficSegment.cs @@ -10,4 +10,4 @@ class TrafficSegment public PrioritySegment Instance1; public PrioritySegment Instance2; } -} \ No newline at end of file +} diff --git a/TLM/TLM/Traffic/VehicleType.cs b/TLM/TLM/Traffic/VehicleType.cs index 3c1ac9f7..318e5082 100644 --- a/TLM/TLM/Traffic/VehicleType.cs +++ b/TLM/TLM/Traffic/VehicleType.cs @@ -7,4 +7,4 @@ internal enum VehicleType Transport, Cargo } -} \ No newline at end of file +} diff --git a/TLM/TLM/TrafficLight/ManualSegment.cs b/TLM/TLM/TrafficLight/ManualSegment.cs index 600cc357..06beb833 100644 --- a/TLM/TLM/TrafficLight/ManualSegment.cs +++ b/TLM/TLM/TrafficLight/ManualSegment.cs @@ -8,4 +8,4 @@ class ManualSegment public ManualSegmentLight Instance1; public ManualSegmentLight Instance2; } -} \ No newline at end of file +} diff --git a/TLM/TLM/TrafficLight/ManualSegmentLight.cs b/TLM/TLM/TrafficLight/ManualSegmentLight.cs index 605e1de3..a315e6e0 100644 --- a/TLM/TLM/TrafficLight/ManualSegmentLight.cs +++ b/TLM/TLM/TrafficLight/ManualSegmentLight.cs @@ -240,4 +240,4 @@ private RoadBaseAI.TrafficLightState _checkPedestrianLight() return RoadBaseAI.TrafficLightState.Red; } } -} \ No newline at end of file +} diff --git a/TLM/TLM/TrafficLight/ToolMode.cs b/TLM/TLM/TrafficLight/ToolMode.cs index 8ff2b376..926bae8b 100644 --- a/TLM/TLM/TrafficLight/ToolMode.cs +++ b/TLM/TLM/TrafficLight/ToolMode.cs @@ -12,4 +12,4 @@ public enum ToolMode LaneRestrictions, Crosswalk } -} \ No newline at end of file +} diff --git a/TLM/TLM/TrafficLight/TrafficLightTool.cs b/TLM/TLM/TrafficLight/TrafficLightTool.cs index 65b24421..f9d93549 100644 --- a/TLM/TLM/TrafficLight/TrafficLightTool.cs +++ b/TLM/TLM/TrafficLight/TrafficLightTool.cs @@ -24,7 +24,7 @@ public class TrafficLightTool : DefaultTool private int _hoveredSegmentIdx; public static List SelectedNodeIndexes = new List(); - public static List SelectedSegmentIndexes = new List(); + public static List SelectedSegmentIndexes = new List(); private readonly int[] _hoveredButton = new int[2]; private ushort _hoveredNode; @@ -141,7 +141,7 @@ protected override void Awake() _signYield = LoadDllResource("sign_yield.png", 200, 200); _signPriority = LoadDllResource("sign_priority.png", 200, 200); _signNone = LoadDllResource("sign_none.png", 200, 200); - + _secondPanelTexture = MakeTex(1200, 560, new Color(0.5f, 0.5f, 0.5f, 1f)); base.Awake(); @@ -282,7 +282,7 @@ public override void RenderOverlay(RenderManager.CameraInfo cameraInfo) } else if (ToolMode == ToolMode.TimedLightsShowLights) { - + } else if (ToolMode == ToolMode.LaneChange) { @@ -663,7 +663,7 @@ protected override void OnToolUpdate() { if (SelectedNodeIndexes.Count == 0) { - + } ShowToolInfo(true, "Node is part of timed script", node.m_position); } @@ -944,7 +944,7 @@ protected void _guiManualTrafficLights() // SWITCH MODE BUTTON var modeWidth = 41f*zoom; var modeHeight = 38f*zoom; - + guiColor.a = _hoveredButton[0] == segmentId && _hoveredButton[1] == -1 ? 0.92f : 0.45f; @@ -2364,7 +2364,7 @@ protected void _guiLaneChange() if (SelectedNode != 0 && SelectedSegment != 0) { var segment = Singleton.instance.m_segments.m_buffer[SelectedSegment]; - + var info = segment.Info; uint num2 = segment.m_lanes; int num3 = 0; @@ -2514,7 +2514,7 @@ protected void _guiLaneChangeWindow(int num) } GUILayout.BeginHorizontal(); - + for (var i = 0; i < laneList.Count; i++) { var flags = (NetLane.Flags) Singleton.instance.m_lanes.m_buffer[(int)laneList[i][0]].m_flags; @@ -2770,7 +2770,7 @@ protected void _guiLaneRestrictionsOneWayWindow(int num) { return -1; } - + return 1; }); } @@ -2823,7 +2823,7 @@ protected void _guiLaneRestrictionsOneWayWindow(int num) _setSpeed = (int) laneList[i][2]; } } - + //if (GUILayout.Button(lane.enableCars ? "Disable cars" : "Enable cars", lane.enableCars ? style1 : style2)) //{ // lane.toggleCars(); diff --git a/TLM/TLM/TrafficLight/TrafficLightsTimed.cs b/TLM/TLM/TrafficLight/TrafficLightsTimed.cs index eb086784..0838e0f1 100644 --- a/TLM/TLM/TrafficLight/TrafficLightsTimed.cs +++ b/TLM/TLM/TrafficLight/TrafficLightsTimed.cs @@ -9,12 +9,12 @@ public class TrafficLightsTimed { public ushort NodeId; - public static Dictionary TimedScripts = new Dictionary(); + public static Dictionary TimedScripts = new Dictionary(); public List Steps = new List(); public int CurrentStep; - public List NodeGroup; + public List NodeGroup; public TrafficLightsTimed(ushort nodeId, IEnumerable nodeGroup) { diff --git a/TLM/TLM/TrafficManagerMod.cs b/TLM/TLM/TrafficManagerMod.cs index c8a74456..903e9795 100644 --- a/TLM/TLM/TrafficManagerMod.cs +++ b/TLM/TLM/TrafficManagerMod.cs @@ -19,4 +19,4 @@ public void OnDisabled() Debug.Log("TrafficManagerMod Disabled"); } } -} \ No newline at end of file +} diff --git a/TLM/TLM/TrafficManagerMode.cs b/TLM/TLM/TrafficManagerMode.cs index 8aec9400..17543721 100644 --- a/TLM/TLM/TrafficManagerMode.cs +++ b/TLM/TLM/TrafficManagerMode.cs @@ -5,4 +5,4 @@ public enum TrafficManagerMode None = 0, TrafficLight = 1 } -} \ No newline at end of file +} diff --git a/TLM/TLM/UI/UIBase.cs b/TLM/TLM/UI/UIBase.cs index 71fef55d..35bb1158 100644 --- a/TLM/TLM/UI/UIBase.cs +++ b/TLM/TLM/UI/UIBase.cs @@ -92,4 +92,4 @@ public void Close() _uiShown = false; } } -} \ No newline at end of file +} diff --git a/TLM/TLM/UI/UIState.cs b/TLM/TLM/UI/UIState.cs index 6a15c6ed..f2ab2555 100644 --- a/TLM/TLM/UI/UIState.cs +++ b/TLM/TLM/UI/UIState.cs @@ -12,4 +12,4 @@ public enum UIState LaneRestrictions, Crosswalk } -} \ No newline at end of file +} diff --git a/TLM/TLM/UI/UITrafficManager.cs b/TLM/TLM/UI/UITrafficManager.cs index 15e414e8..e8c1a023 100644 --- a/TLM/TLM/UI/UITrafficManager.cs +++ b/TLM/TLM/UI/UITrafficManager.cs @@ -25,7 +25,7 @@ public static UIState UIState _buttonManualControl.focusedBgSprite = "ButtonMenu"; _buttonTimedMain.focusedBgSprite = "ButtonMenu"; - + //buttonLaneRestrictions.focusedBgSprite = "ButtonMenu"; _buttonCrosswalk.focusedBgSprite = "ButtonMenu"; _buttonClearTraffic.focusedBgSprite = "ButtonMenu"; @@ -198,7 +198,7 @@ private void clickClearTraffic(UIComponent component, UIMouseEventParameter even lock (Singleton.instance) { - foreach (var vehicle in + foreach (var vehicle in from vehicle in vehicleList let vehicleData = Singleton.instance.m_vehicles.m_buffer[vehicle] where vehicleData.Info.m_vehicleType == VehicleInfo.VehicleType.Car