Skip to content

Commit ef4fc55

Browse files
authored
Merge pull request #260 from krzychu124/119-migration-to-harmony
Migration to Harmony / RedirectionFramework
2 parents 36631b9 + 6b37e17 commit ef4fc55

File tree

260 files changed

+32224
-35916
lines changed

Some content is hidden

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

260 files changed

+32224
-35916
lines changed

.gitmodules

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[submodule "TLM/OptionsFramework"]
22
path = TLM/OptionsFramework
3-
url = ../OptionsFramework.git
3+
url = https://github.com/krzychu124/OptionsFramework.git
44
[submodule "TLM/CSUtil.CameraControl"]
55
path = TLM/CSUtil.CameraControl
6-
url = ../CSUtil.CameraControl.git
6+
url = https://github.com/krzychu124/CSUtil.CameraControl.git
7+
[submodule "TLM/TLM/RedirectionFramework"]
8+
path = TLM/TLM/RedirectionFramework
9+
url = https://github.com/krzychu124/RedirectionFramework.git

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@
33
<p align="center"><a href="https://steamcommunity.com/sharedfiles/filedetails/?id=583429740">Steam Workshop</a> • <a href="https://discord.gg/faKUnST">Discord Guild</a> • <a href="https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/wiki/Installation">Installation Guide</a> • <a href="http://www.viathinksoft.de/tmpe/wiki">User Guide</a> • <a href="https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/issues">Issue Tracker</a> • <a href="https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/wiki/Report-a-Bug">Report a Bug</a><br /></p>
44
<p align="center"><a href="https://steamcommunity.com/sharedfiles/filedetails/?id=583429740"><img src="https://img.shields.io/endpoint.svg?url=https://shieldsio-steam-workshop.jross.me/583429740" /></a> <a href="https://store.steampowered.com/app/255710/Cities_Skylines/"><img src="https://img.shields.io/badge/Game%20Version-1.12.1--f1-brightgreen.svg"></a> <a href="https://discord.gg/faKUnST"><img src="https://img.shields.io/discord/545065285862948894.svg?logo=discord&logoColor=F5F5F5" /></a> <a href="https://ci.appveyor.com/project/krzychu124/cities-skylines-traffic-manager-president-edition/branch/master"><img src="https://ci.appveyor.com/api/projects/status/dehkvuxk8b3h66e7/branch/master?svg=true" /></a></p>
55

6+
> ## Notice
7+
> We are currently working on version 11, which uses Harmony library. If you had any existing pull requests, or repository forks, they will need rebasing to the heavily modified `master` branch. If you need any help, please contact us using the links above.
8+
69
## Current release
710

811
> Having problems with traffic despawning after updating roads or rails? Try [Broken Node Detector](https://steamcommunity.com/sharedfiles/filedetails/?id=1777173984) which helps detect a game bug. Collossal Order are aware of the issue.
912
10-
#### Version [10.21.1 hotfix](https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/compare/10.21...10.21.1), 06/07/2019
13+
### TM:PE [10.21.1 hotfix](https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/compare/10.21...10.21.1), 06/07/2019
1114

1215
- Fixed: Speed panel tanks fps if train tracks on screen (thanks rlas & DaEgi01!) (#411, #413)
1316
- Meta: Main changelog refactored (#412)
1417

15-
#### Version [10.21](https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/compare/10.20...10.21), 02/07/2019
18+
### TM:PE [10.21](https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/compare/10.20...10.21), 02/07/2019
19+
1620
- Added: Cims have individual driving styles to determine lane changes and driving speed (#263 #334)
1721
- Added: Miles Per Hour option for speed limits (thanks kvakvs) (#384)
1822
- Added: Selectable style (US, UK, EU) of speed sign in speed limits UI (thanks kvakvs) (#384)
1923
- Added: Differentiate LABS, STABLE and DEBUG branches in UI (#326, #333)
2024
- Added: Keybinds tab in mod options - choose your own shortcuts! (thanks kvakvs) (#382)
2125
- Added: Show keyboard shortcuts in button tooltips where applicable (thanks kvakvs) (#382)
2226
- Added: Basic support of offline mode for users playing on EA's Origin service (#333, #400)
23-
- Improved: Avoid setting loss due to duplicate TM:PE subscriptions (#333, #306, #149, #190, #211, #400)
27+
- Improved:: Avoid setting loss due to duplicate TM:PE subscriptions (#333, #306, #149, #190, #211, #400)
2428
- Fixed: Vehicle limit count; compatibility with More Vehicles mod (thanks Dymanoid) (#362)
2529
- Fixed: Mail trucks ignoring lane arrows (thanks Subaru & eudyptula for feedback) (#307, #338)
2630
- Fixed: Vehicles stop in road trying to find parking (thanks eudyptula for investigating) (#259, #359)
@@ -71,4 +75,4 @@ We will not provide support if:
7175
- You are using an older version of the mod.
7276
- You are using an older version of Cities: Skylines.
7377

74-
TM:PE is only tested on and updated for the latest version of Cities: Skylines.
78+
TM:PE is only tested on and updated for the latest version of Cities: Skylines.

TLM/CSUtil.Commons/Log.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace CSUtil.Commons {
99

1010
public static class Log {
1111
private enum LogLevel {
12+
Trace,
1213
Debug,
1314
Info,
1415
Warning,
@@ -35,6 +36,11 @@ public static void _Debug(string s) {
3536
LogToFile(s, LogLevel.Debug);
3637
}
3738

39+
[Conditional("TRACE")]
40+
public static void _Trace(string s) {
41+
LogToFile(s, LogLevel.Trace);
42+
}
43+
3844
public static void Info(string s) {
3945
LogToFile(s, LogLevel.Info);
4046
}

TLM/CSUtil.Redirection/CSUtil.Redirection.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
4545
</PropertyGroup>
4646
<ItemGroup>
47+
<Reference Include="0Harmony">
48+
<HintPath>lib\0Harmony.dll</HintPath>
49+
</Reference>
4750
<Reference Include="System" />
4851
<Reference Include="System.Core" />
4952
<Reference Include="System.Xml.Linq" />
@@ -52,10 +55,8 @@
5255
<Reference Include="System.Xml" />
5356
</ItemGroup>
5457
<ItemGroup>
58+
<Compile Include="HarmonyUtil.cs" />
5559
<Compile Include="Properties\AssemblyInfo.cs" />
56-
<Compile Include="RedirectionHelper.cs" />
57-
<Compile Include="Redirector.cs" />
58-
<Compile Include="MethodInfoExt.cs" />
5960
</ItemGroup>
6061
<ItemGroup>
6162
<ProjectReference Include="..\CSUtil.Commons\CSUtil.Commons.csproj">
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using Harmony;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Reflection;
6+
using System.Text;
7+
8+
namespace CSUtil.Redirection {
9+
public static class HarmonyUtil {
10+
/// <summary>
11+
/// Finds the method that is represented by the given harmony method.
12+
/// </summary>
13+
/// <param name="method">queried harmony method</param>
14+
/// <returns>method information</returns>
15+
public static MethodBase GetOriginalMethod(HarmonyMethod method) {
16+
if (method.originalType == null) return null;
17+
if (method.methodName == null)
18+
return AccessTools.Constructor(method.originalType, method.parameter);
19+
return AccessTools.Method(method.originalType, method.methodName, method.parameter);
20+
}
21+
}
22+
}

TLM/CSUtil.Redirection/MethodInfoExt.cs

Lines changed: 0 additions & 34 deletions
This file was deleted.

TLM/CSUtil.Redirection/RedirectionHelper.cs

Lines changed: 0 additions & 119 deletions
This file was deleted.

0 commit comments

Comments
 (0)