Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/aevitas/unity-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
aevitas committed Jan 21, 2020
2 parents cd9e2d7 + 17807d9 commit f7d57af
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 41 deletions.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Bug report
about: Report an issue with the patcher
title: ''
labels: ''
assignees: ''

---

**Description**
A clear and concise description of what the bug is.

**Version Information**
* What Operating System are you running the patcher on?
* What Unity Version are you using?

**Diagnostics**
What does the patcher output instead of the expected behaviour?

**Arguments**
Please provide the exact command line arguments you are using the patcher with, e.g.:

`sudo ./linux-x64/Patcher -e=/path/to/Unity -t=dark -linux`
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/incompatible-version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Incompatible Version
about: Report an issue related to patcher compatibility
title: ''
labels: ''
assignees: ''

---

**Description**
A clear and concise description of what the bug is.

**Version Information**
* What Operating System are you running the patcher on?
* What Unity Version are you using?

**Diagnostics**
What does the patcher output instead of the expected behaviour?

**Arguments**
Please provide the exact command line arguments you are using the patcher with, e.g.:

`sudo ./linux-x64/Patcher -e=/path/to/Unity -t=dark -linux`

**Binaries**
If possible, provide a link to the Unity binary that corresponds with the version and OS you're using.
62 changes: 21 additions & 41 deletions Patcher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,57 +129,37 @@ internal static void Main(string[] args)
return;
}

if (mac)
{
var patch = _patches["mac"]
.FirstOrDefault(p => p.Version.Equals(version, StringComparison.OrdinalIgnoreCase));

if (patch == null)
{
patch = _patches["mac"].First();
Console.WriteLine(string.IsNullOrWhiteSpace(version)
? $"Version not explicitly specified -- defaulting to version {patch.Version} for Mac"
: $"Could not find patch details for Mac Unity version {version} -- defaulting to version {patch.Version}.");
}
string os = null;

_darkPattern = patch.DarkPattern;
_lightPattern = patch.LightPattern;
}
if (mac)
os = "mac";

if (linux)
{
var patch = _patches["linux"]
.FirstOrDefault(p => p.Version.Equals(version, StringComparison.OrdinalIgnoreCase));

if (patch == null)
{
patch = _patches["linux"].First();
Console.WriteLine(string.IsNullOrWhiteSpace(version)
? $"Version not explicitly specified -- defaulting to version {patch.Version} for Linux"
: $"Could not find patch details for Linux Unity version {version} -- defaulting to version {patch.Version}.");
}

_darkPattern = patch.DarkPattern;
_lightPattern = patch.LightPattern;
}
os = "linux";

if (windows)
os = "windows";

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

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

_darkPattern = patch.DarkPattern;
_lightPattern = patch.LightPattern;
if (patch == null)
{
patch = _patches[os].First();
Console.WriteLine(string.IsNullOrWhiteSpace(version)
? $"Version not explicitly specified -- defaulting to version {patch.Version} for {os}"
: $"Could not find patch details for {os} Unity version {version} -- defaulting to version {patch.Version}.");
}

_darkPattern = patch.DarkPattern;
_lightPattern = patch.LightPattern;

Console.WriteLine($"Opening Unity executable from {fileLocation}...");

try
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ You can pass various arguments to the patcher:

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

Issues
======

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.

Linux and MacOS
===============

Expand Down

0 comments on commit f7d57af

Please sign in to comment.