Skip to content

Commit 89bf334

Browse files
committed
Merge branch '1.9.0'
2 parents dc99ae8 + 914df4a commit 89bf334

File tree

208 files changed

+18482
-6774
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+18482
-6774
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@ A work-in-progress modification for **Cities: Skylines** to add additional traff
44
User manual: http://www.viathinksoft.de/tmpe
55

66
# Changelog
7+
1.9.0, 04/09/2017
8+
- Updated for game version 1.7.0-f5
9+
- New feature: Parking restrictions
10+
- New feature: Speed limits can be set up for individual lanes with the Control key
11+
- New feature: Added timed traffic light and speed limit support for monorails
12+
- New feature: Copy & paste for individual timed traffic lights
13+
- New feature: Rotate individual timed traffic lights
14+
- New feature: Lane customizations may come into effect instantaneously
15+
- Unified traffic light toggling feature with game code
16+
- Performance improvements
17+
- Reworked the way that traffic measurements are performed
18+
- Advanced Vehicle AI: Algorithm updated, performance improved - Possible routing decisions are now being precalculated
19+
- Path-finding cost multiplicator for vehicle restrictions is now configurable in TMPE_GlobalConfig.xml
20+
- UI: More compact, movable main menu UI
21+
- Added support for custom languages
22+
- Updated translations: German, Polish, Russian, Portuguese, Traditional Chinese
23+
- Major code refactorings
24+
- AI: Tuned parameters
25+
- New option: Main button position can be locked
26+
- New option: Main menu position can be locked
27+
- New option: Added language selection in options dialog
28+
- New option: Customization of lane arrows, lane connections and vehicle restrictions can now come into effect instantaneously
29+
- Bugfix: Cars sometimes get stuck forever when the Advanced Parking AI is activated (thanks to @cmfcmf for reporting this issue)
30+
- Bugfix: Busses do not perform u-turns even if the transport line show u-turns (thanks to @dymanoid for reporting this issue)
31+
- Bugfix: Timed traffic lights do not work as expected on single-direction train tracks (thanks to @DaEgi01 for reporting this issue)
32+
- Bugfix: Vehicle restriction and speed limit signs overlay is displayed on the wrong side of inverted road segments
33+
- Bugfix: Influx statistics value is zero (thanks to @hjo for reporting this issue)
34+
735
1.8.16, 03/20/2017
836
- Lane connections can now also be removed by pressing the backspace key
937
- Improved lane selection for busses if the option "Busses may ignore lane arrows" is activated
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{D3ADE06E-F493-4819-865A-3BB44FEEDF01}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>CSUtil.Commons</RootNamespace>
11+
<AssemblyName>CSUtil.Commons</AssemblyName>
12+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<TargetFrameworkProfile />
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="System" />
35+
<Reference Include="System.Core" />
36+
<Reference Include="System.Xml.Linq" />
37+
<Reference Include="System.Data.DataSetExtensions" />
38+
<Reference Include="System.Data" />
39+
<Reference Include="System.Xml" />
40+
<Reference Include="UnityEngine">
41+
<HintPath>D:\Games\Steam\steamapps\common\Cities_Skylines\Cities_Data\Managed\UnityEngine.dll</HintPath>
42+
</Reference>
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Compile Include="EnumUtil.cs" />
46+
<Compile Include="Log.cs" />
47+
<Compile Include="LogicUtil.cs" />
48+
<Compile Include="Properties\AssemblyInfo.cs" />
49+
<Compile Include="ToStringExt.cs" />
50+
<Compile Include="VectorUtil.cs" />
51+
</ItemGroup>
52+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
53+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
54+
Other similar extension points exist, see Microsoft.Common.targets.
55+
<Target Name="BeforeBuild">
56+
</Target>
57+
<Target Name="AfterBuild">
58+
</Target>
59+
-->
60+
</Project>

TLM/CSUtil.Commons/EnumUtil.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace CSUtil.Commons {
7+
public static class EnumUtil {
8+
public static IEnumerable<T> GetValues<T>() {
9+
return Enum.GetValues(typeof(T)).Cast<T>();
10+
}
11+
}
12+
}

TLM/TLM/Log.cs renamed to TLM/CSUtil.Commons/Log.cs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Threading;
66
using UnityEngine;
77

8-
namespace TrafficManager {
8+
namespace CSUtil.Commons {
99

1010
public static class Log {
1111
private enum LogLevel {
@@ -17,11 +17,8 @@ private enum LogLevel {
1717

1818
private static object logLock = new object();
1919

20-
const string Prefix = "TrafficLightManager: ";
21-
22-
private static string logFilename = Path.Combine(Application.dataPath, "TMPE.log");
20+
private static string logFilename = Path.Combine(Application.dataPath, "TMPE.log"); // TODO refactor log filename to configuration
2321
private static Stopwatch sw = Stopwatch.StartNew();
24-
private static bool logToConsole = false;
2522
private static bool logFileAccessible = true;
2623

2724

@@ -42,8 +39,6 @@ public static void _Debug(string s) {
4239

4340
try {
4441
Monitor.Enter(logLock);
45-
if (logToConsole)
46-
UnityEngine.Debug.Log(Prefix + s);
4742
LogToFile(s, LogLevel.Debug);
4843
} catch (Exception) {
4944

@@ -58,10 +53,6 @@ public static void Info(string s) {
5853
}
5954

6055
try {
61-
#if DEBUG
62-
if (logToConsole)
63-
UnityEngine.Debug.Log(Prefix + s);
64-
#endif
6556
Monitor.Enter(logLock);
6657
LogToFile(s, LogLevel.Info);
6758
} catch (Exception) {
@@ -77,10 +68,6 @@ public static void Error(string s) {
7768
}
7869

7970
try {
80-
#if DEBUG
81-
if (logToConsole)
82-
UnityEngine.Debug.LogError(Prefix + s + " " + (new System.Diagnostics.StackTrace()).ToString());
83-
#endif
8471
Monitor.Enter(logLock);
8572
LogToFile(s, LogLevel.Error);
8673
} catch (Exception) {
@@ -96,10 +83,6 @@ public static void Warning(string s) {
9683
}
9784

9885
try {
99-
#if DEBUG
100-
if (logToConsole)
101-
UnityEngine.Debug.LogWarning(Prefix + s + ": " + (new System.Diagnostics.StackTrace()).ToString());
102-
#endif
10386
Monitor.Enter(logLock);
10487
LogToFile(s, LogLevel.Warning);
10588
} catch (Exception) {

TLM/CSUtil.Commons/LogicUtil.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace CSUtil.Commons {
7+
public static class LogicUtil {
8+
public static bool CheckFlags(uint flags, uint flagMask, uint? expectedResult=null) {
9+
uint res = flags & flagMask;
10+
if (expectedResult == null) {
11+
return res != 0;
12+
} else {
13+
return res == expectedResult;
14+
}
15+
}
16+
}
17+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Util")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("Util")]
13+
[assembly: AssemblyCopyright("Copyright © 2017")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("d3ade06e-f493-4819-865a-3bb44feedf01")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

TLM/CSUtil.Commons/ToStringExt.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
7+
namespace CSUtil.Commons {
8+
public static class ToStringExt {
9+
public static string DictionaryToString<K, V>(this IDictionary<K, V> element) {
10+
return string.Join(", ", element.Keys.Select(x => $"{ToString(x)}={ToString(element[x])}").ToArray());
11+
}
12+
13+
public static string CollectionToString<T>(this ICollection<T> elements) {
14+
return string.Join(", ", elements.Select(x => ToString(x)).ToArray());
15+
}
16+
17+
public static string ArrayToString<T>(this T[] elements) {
18+
return string.Join(", ", elements.Select(x => ToString(x)).ToArray());
19+
}
20+
21+
public static string ToString(object obj) {
22+
return obj == null ? "<null>" : obj.ToString();
23+
}
24+
}
25+
}

TLM/CSUtil.Commons/VectorUtil.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using UnityEngine;
6+
7+
namespace CSUtil.Commons {
8+
public static class VectorUtil {
9+
public static void ClampPosToScreen(ref Vector3 pos) {
10+
if (pos.x < 0)
11+
pos.x = 0;
12+
if (pos.y < 0)
13+
pos.y = 0;
14+
if (pos.x >= Screen.currentResolution.width)
15+
pos.x = Screen.currentResolution.width - 1;
16+
if (pos.y >= Screen.currentResolution.height)
17+
pos.y = Screen.currentResolution.height - 1;
18+
}
19+
}
20+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>8.0.30703</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{7DCC08EF-DC85-47A4-BD6F-79FC52C7EF13}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>CSUtil.Redirection</RootNamespace>
12+
<AssemblyName>CSUtil.Redirection</AssemblyName>
13+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<TargetFrameworkProfile />
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
35+
</PropertyGroup>
36+
<ItemGroup>
37+
<Reference Include="System" />
38+
<Reference Include="System.Core" />
39+
<Reference Include="System.Xml.Linq" />
40+
<Reference Include="System.Data.DataSetExtensions" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Xml" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Compile Include="Properties\AssemblyInfo.cs" />
46+
<Compile Include="RedirectionHelper.cs" />
47+
<Compile Include="Redirector.cs" />
48+
<Compile Include="MethodInfoExt.cs" />
49+
</ItemGroup>
50+
<ItemGroup>
51+
<ProjectReference Include="..\CSUtil.Commons\CSUtil.Commons.csproj">
52+
<Project>{D3ADE06E-F493-4819-865A-3BB44FEEDF01}</Project>
53+
<Name>CSUtil.Commons</Name>
54+
</ProjectReference>
55+
</ItemGroup>
56+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
57+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
58+
Other similar extension points exist, see Microsoft.Common.targets.
59+
<Target Name="BeforeBuild">
60+
</Target>
61+
<Target Name="AfterBuild">
62+
</Target>
63+
-->
64+
</Project>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using System;
2+
using System.Reflection;
3+
4+
namespace CSUtil.Redirection {
5+
public static class MethodInfoExt
6+
{
7+
internal static Redirector.MethodRedirection RedirectTo(this MethodInfo originalMethod, MethodInfo newMethod, Assembly redirectionSource)
8+
{
9+
return new Redirector.MethodRedirection(originalMethod, newMethod, redirectionSource);
10+
}
11+
12+
public static bool IsCompatibleWith(this MethodInfo thisMethod, MethodInfo otherMethod)
13+
{
14+
if (thisMethod.ReturnType != otherMethod.ReturnType)
15+
return false;
16+
17+
ParameterInfo[] thisParameters = thisMethod.GetParameters();
18+
ParameterInfo[] otherParameters = otherMethod.GetParameters();
19+
20+
if (thisParameters.Length != otherParameters.Length)
21+
return false;
22+
23+
for (int i = 0; i < thisParameters.Length; i++)
24+
{
25+
if (!otherParameters[i].ParameterType.IsAssignableFrom(thisParameters[i].ParameterType))
26+
{
27+
return false;
28+
}
29+
}
30+
31+
return true;
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)