Skip to content

Commit 7ac3925

Browse files
authored
Merge pull request #104 from patchkit-net/dev/v3.10.x
Release candidate: v3.10.3-rc1
2 parents 62736e7 + 593ccb2 commit 7ac3925

File tree

7 files changed

+53
-53
lines changed

7 files changed

+53
-53
lines changed

Assets/Editor/BuildScript.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,6 @@ public static void BuildWindows64Development()
2727
Build(BuildTarget.StandaloneWindows64, true);
2828
}
2929

30-
public static void BuildOSX32Release()
31-
{
32-
Build(BuildTarget.StandaloneOSXIntel, false);
33-
}
34-
35-
public static void BuildOSX32Development()
36-
{
37-
Build(BuildTarget.StandaloneOSXIntel, true);
38-
}
39-
4030
public static void BuildOSX64Release()
4131
{
4232
Build(BuildTarget.StandaloneOSXIntel64, false);

Assets/PatchKit Patcher/Editor/CustomBuilding.cs

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
using UnityEditor.SceneManagement;
33
using System.Linq;
44
using System.Diagnostics;
5+
using System.IO;
6+
using System;
57

68
namespace PatchKit.Unity
79
{
8-
public class CustomBuildScripts
10+
public class CustomBuildScripts
911
{
1012
[MenuItem("Tools/Build/Windows x86")]
1113
public static void BuildWindows86 ()
@@ -37,44 +39,47 @@ public static void BuildLinux ()
3739
Build(BuildTarget.StandaloneLinuxUniversal);
3840
}
3941

40-
[MenuItem("Tools/Build/OSX")]
41-
public static void BuildOsx ()
42-
{
43-
Build(BuildTarget.StandaloneOSXIntel);
44-
}
45-
4642
[MenuItem("Tools/Build/OSX x64")]
4743
public static void BuildOsx64 ()
4844
{
4945
Build(BuildTarget.StandaloneOSXIntel64);
5046
}
5147

52-
[MenuItem("Tools/Build/OSX Universal")]
53-
public static void BuildOsxUniversal ()
54-
{
55-
Build(BuildTarget.StandaloneOSXUniversal);
56-
}
57-
5848
private static string PatcherExecutableName(BuildTarget target)
5949
{
6050
switch (target)
6151
{
6252
case BuildTarget.StandaloneWindows:
6353
case BuildTarget.StandaloneWindows64:
6454
return "Patcher.exe";
65-
6655
case BuildTarget.StandaloneLinux:
6756
case BuildTarget.StandaloneLinux64:
6857
case BuildTarget.StandaloneLinuxUniversal:
6958
return "Patcher";
70-
71-
case BuildTarget.StandaloneOSXIntel:
7259
case BuildTarget.StandaloneOSXIntel64:
73-
case BuildTarget.StandaloneOSXUniversal:
7460
return "Patcher.app";
61+
default:
62+
throw new NotSupportedException();
63+
}
64+
}
7565

66+
public static string PatcherDataDirectory(BuildTarget target, string executablePath)
67+
{
68+
switch (target)
69+
{
70+
case BuildTarget.StandaloneWindows:
71+
case BuildTarget.StandaloneWindows64:
72+
case BuildTarget.StandaloneLinux:
73+
case BuildTarget.StandaloneLinux64:
74+
case BuildTarget.StandaloneLinuxUniversal:
75+
string buildDir = Path.GetDirectoryName(executablePath);
76+
string patcherName = Path.GetFileNameWithoutExtension (executablePath);
77+
78+
return Path.Combine(buildDir, patcherName + "_Data");
79+
case BuildTarget.StandaloneOSXIntel64:
80+
return Path.Combine(executablePath, "Contents");
7681
default:
77-
return "";
82+
throw new NotSupportedException();
7883
}
7984
}
8085

@@ -133,7 +138,7 @@ private static void Build(BuildTarget target)
133138
}
134139
}
135140

136-
BuildOptions buildOptions = BuildOptions.ForceEnableAssertions
141+
BuildOptions buildOptions = BuildOptions.ForceEnableAssertions
137142
| BuildOptions.ShowBuiltPlayer;
138143

139144
string path = EditorUtility.SaveFolderPanel("Choose where to build the Patcher", "", "");

Assets/PatchKit Patcher/Editor/PatcherManifestCreator.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.IO;
1+
using System;
2+
using System.IO;
23
using JetBrains.Annotations;
34
using Newtonsoft.Json;
45
using UnityEditor;
@@ -13,25 +14,24 @@ public static class PatcherManifestCreator
1314
[PostProcessBuild, UsedImplicitly]
1415
private static void PostProcessBuild(BuildTarget buildTarget, string buildPath)
1516
{
16-
Manifest manifest = new Manifest();
17+
Manifest manifest;
1718

18-
if (buildTarget == BuildTarget.StandaloneWindows || buildTarget == BuildTarget.StandaloneWindows64)
19+
switch (buildTarget)
1920
{
20-
manifest = WindowsManifest(buildPath);
21-
}
22-
23-
if (buildTarget == BuildTarget.StandaloneOSXUniversal ||
24-
buildTarget == BuildTarget.StandaloneOSXIntel ||
25-
buildTarget == BuildTarget.StandaloneOSXIntel64)
26-
{
27-
manifest = OsxManifest(buildPath);
28-
}
29-
30-
if (buildTarget == BuildTarget.StandaloneLinux ||
31-
buildTarget == BuildTarget.StandaloneLinux64 ||
32-
buildTarget == BuildTarget.StandaloneLinuxUniversal)
33-
{
34-
manifest = LinuxManifest(buildPath);
21+
case BuildTarget.StandaloneWindows:
22+
case BuildTarget.StandaloneWindows64:
23+
manifest = WindowsManifest(buildPath);
24+
break;
25+
case BuildTarget.StandaloneOSXIntel64:
26+
manifest = OsxManifest(buildPath);
27+
break;
28+
case BuildTarget.StandaloneLinux:
29+
case BuildTarget.StandaloneLinux64:
30+
case BuildTarget.StandaloneLinuxUniversal:
31+
manifest = LinuxManifest(buildPath);
32+
break;
33+
default:
34+
throw new NotSupportedException();
3535
}
3636

3737
string manifestPath = Path.Combine(Path.GetDirectoryName(buildPath), "patcher.manifest");

Assets/PatchKit Patcher/Editor/ScreenSizeCorrection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static class ScreenSizeCorrection
1212
public static void SaveScreenSize(BuildTarget buildTarget, string buildPath)
1313
{
1414
string content = string.Format("{0} {1}", PlayerSettings.defaultScreenWidth, PlayerSettings.defaultScreenHeight);
15-
string filename = Path.Combine(Path.GetDirectoryName(buildPath), BorderlessWindow.ScreenSizeFilename);
15+
string filename = Path.Combine(CustomBuildScripts.PatcherDataDirectory(buildTarget, buildPath), BorderlessWindow.ScreenSizeFilename);
1616

1717
File.WriteAllText(filename, content);
1818
}

Assets/PatchKit Patcher/Scripts/UI/BorderlessWindow.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,16 @@ private void Awake()
144144

145145
private void EnforceCorrectScreenSize()
146146
{
147-
_logger.LogDebug("Reading correct screen size from " + ScreenSizeFilename);
147+
string screenSizeFilePath = Path.Combine(Application.dataPath, ScreenSizeFilename);
148+
_logger.LogDebug("Reading correct screen size from " + screenSizeFilePath);
148149

149-
if (!File.Exists(ScreenSizeFilename))
150+
if (!File.Exists(screenSizeFilePath))
150151
{
151-
_logger.LogWarning(ScreenSizeFilename + " file does not exist.");
152+
_logger.LogWarning(screenSizeFilePath + " file does not exist.");
152153
return;
153154
}
154155

155-
var screenResolutionText = File.ReadAllText(ScreenSizeFilename).Split(' ');
156+
var screenResolutionText = File.ReadAllText(screenSizeFilePath).Split(' ');
156157

157158
try
158159
{

Assets/PatchKit Patcher/Scripts/Version.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public static class Version
44
{
55
public const int Major = 3;
66
public const int Minor = 10;
7-
public const int Release = 2;
7+
public const int Release = 3;
88

99
public static string Value
1010
{

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [3.10.3]
8+
### Fixed
9+
- Fix issue with locating screensize file
10+
711
## [3.10.2]
812
### Fixed
913
- An edge case which caused the download to never terminate

0 commit comments

Comments
 (0)