Skip to content

Commit f7d57af

Browse files
committed
Merge branch 'master' of https://github.com/aevitas/unity-patch
2 parents cd9e2d7 + 17807d9 commit f7d57af

4 files changed

Lines changed: 75 additions & 41 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Bug report
3+
about: Report an issue with the patcher
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Description**
11+
A clear and concise description of what the bug is.
12+
13+
**Version Information**
14+
* What Operating System are you running the patcher on?
15+
* What Unity Version are you using?
16+
17+
**Diagnostics**
18+
What does the patcher output instead of the expected behaviour?
19+
20+
**Arguments**
21+
Please provide the exact command line arguments you are using the patcher with, e.g.:
22+
23+
`sudo ./linux-x64/Patcher -e=/path/to/Unity -t=dark -linux`
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Incompatible Version
3+
about: Report an issue related to patcher compatibility
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Description**
11+
A clear and concise description of what the bug is.
12+
13+
**Version Information**
14+
* What Operating System are you running the patcher on?
15+
* What Unity Version are you using?
16+
17+
**Diagnostics**
18+
What does the patcher output instead of the expected behaviour?
19+
20+
**Arguments**
21+
Please provide the exact command line arguments you are using the patcher with, e.g.:
22+
23+
`sudo ./linux-x64/Patcher -e=/path/to/Unity -t=dark -linux`
24+
25+
**Binaries**
26+
If possible, provide a link to the Unity binary that corresponds with the version and OS you're using.

Patcher/Program.cs

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -129,57 +129,37 @@ internal static void Main(string[] args)
129129
return;
130130
}
131131

132-
if (mac)
133-
{
134-
var patch = _patches["mac"]
135-
.FirstOrDefault(p => p.Version.Equals(version, StringComparison.OrdinalIgnoreCase));
136-
137-
if (patch == null)
138-
{
139-
patch = _patches["mac"].First();
140-
Console.WriteLine(string.IsNullOrWhiteSpace(version)
141-
? $"Version not explicitly specified -- defaulting to version {patch.Version} for Mac"
142-
: $"Could not find patch details for Mac Unity version {version} -- defaulting to version {patch.Version}.");
143-
}
132+
string os = null;
144133

145-
_darkPattern = patch.DarkPattern;
146-
_lightPattern = patch.LightPattern;
147-
}
134+
if (mac)
135+
os = "mac";
148136

149137
if (linux)
150-
{
151-
var patch = _patches["linux"]
152-
.FirstOrDefault(p => p.Version.Equals(version, StringComparison.OrdinalIgnoreCase));
153-
154-
if (patch == null)
155-
{
156-
patch = _patches["linux"].First();
157-
Console.WriteLine(string.IsNullOrWhiteSpace(version)
158-
? $"Version not explicitly specified -- defaulting to version {patch.Version} for Linux"
159-
: $"Could not find patch details for Linux Unity version {version} -- defaulting to version {patch.Version}.");
160-
}
161-
162-
_darkPattern = patch.DarkPattern;
163-
_lightPattern = patch.LightPattern;
164-
}
138+
os = "linux";
165139

166140
if (windows)
141+
os = "windows";
142+
143+
if (string.IsNullOrWhiteSpace(os))
167144
{
168-
var patch = _patches["windows"]
169-
.FirstOrDefault(p => p.Version.Equals(version, StringComparison.OrdinalIgnoreCase));
145+
Console.WriteLine($"No OS was specified - please specify a valid operating system when running the patcher. See patcher -h for available options.");
146+
return;
147+
}
170148

171-
if (patch == null)
172-
{
173-
patch = _patches["windows"].First();
174-
Console.WriteLine(string.IsNullOrWhiteSpace(version)
175-
? $"Version not explicitly specified -- defaulting to version {patch.Version} for Windows"
176-
: $"Could not find patch details for Windows Unity version {version} -- defaulting to version {patch.Version}.");
177-
}
149+
var patch = _patches[os]
150+
.FirstOrDefault(p => p.Version.Equals(version, StringComparison.OrdinalIgnoreCase));
178151

179-
_darkPattern = patch.DarkPattern;
180-
_lightPattern = patch.LightPattern;
152+
if (patch == null)
153+
{
154+
patch = _patches[os].First();
155+
Console.WriteLine(string.IsNullOrWhiteSpace(version)
156+
? $"Version not explicitly specified -- defaulting to version {patch.Version} for {os}"
157+
: $"Could not find patch details for {os} Unity version {version} -- defaulting to version {patch.Version}.");
181158
}
182159

160+
_darkPattern = patch.DarkPattern;
161+
_lightPattern = patch.LightPattern;
162+
183163
Console.WriteLine($"Opening Unity executable from {fileLocation}...");
184164

185165
try

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ You can pass various arguments to the patcher:
2222

2323
Depending on your system, looking up the offsets to patch can take a couple moments.
2424

25+
Issues
26+
======
27+
28+
If the patcher doesn't work, please let us know by opening an [issue](https://github.com/aevitas/unity-patch/issues), and provide as much details as you can. We provide some issue templates for common issues - please use them when applicable. They help us resolve issues faster.
29+
2530
Linux and MacOS
2631
===============
2732

0 commit comments

Comments
 (0)