Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 33 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Binary files
*.png binary
*.jpg binary
*.dll binary
*.exe binary

# Shell scripts (Unix)
*.sh text eol=lf

# Windows Batch and Command scripts
*.bat text eol=crlf
*.cmd text eol=crlf

# PowerShell scripts
*.ps1 text eol=lf

# Unity text-based assets
*.meta text eol=lf
*.unity text eol=lf
*.prefab text eol=lf
*.asset text eol=lf
*.mat text eol=lf
*.anim text eol=lf

# C# scripts and text
*.cs text eol=lf
*.shader text eol=lf

# Markdown
*.md text eol=lf
23 changes: 8 additions & 15 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,18 @@ Tell us what happens
Tell us what should actually happen

### Steps to reproduce
- Reproducible (mark with x): [ ] always, [ ] sometimes

Please provide detailed step-by-step instructions to help us understand and replicate the issue you encountered.
Try to use as few steps as possible after starting the game. Clear and concise instructions will make sure that the issue can be addressed promptly.

Please supply step-by-step instructions so that anyone with the same environment can reproduce the issue. Whenever you offer a description, imagine
yourself in the shoes of someone who has never encountered this problem before and would like to know exactly how to observe it under a given set of conditions.
Here is an example:

1. Navigate to the song selection menu
1. Open the ultrastarplay.exe
2. Click on button X, then on the menu that appears, click Y
3. Wait for 3 seconds, and note the appearance of an unexpected message

### Details
Please provide additional information.

- Game version:
- Operating System and version:
- Song details, if applicable (e.g. audio and video file format):
- Attach screenshots and screen recordings
- Attach a log file. To find the log file, see https://melodymania.org/how-to-report-issues
### Details
Provide some additional information:

### Implementation hints
Information on how the expected behavior could be achieved (optional).
- UltraStar Play version:
- Operating System + version
- if applicable, add a log file
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ For support questions, please use our Discord: https://discord.gg/PAUJFKCGbb
-->

### Actual behaviour
Tell us what happens.

Tell us what happens

### Expected behaviour
Tell us what should actually happen.

### Implementation hints
Information on how the expected behavior could be achieved (optional).
Tell us what should actually happen
4 changes: 2 additions & 2 deletions .github/workflows/acquire-unity-license-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
# Request manual activation file
- name: Request manual activation file
id: getManualLicenseFile
uses: game-ci/unity-request-activation-file@v2.1.0
uses: game-ci/unity-request-activation-file@v2
# Upload artifact (Unity_v20XX.X.XXXX.alf)
- name: Expose as artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v2
with:
name: ${{ steps.getManualLicenseFile.outputs.filePath }}
path: ${{ steps.getManualLicenseFile.outputs.filePath }}
7 changes: 6 additions & 1 deletion .github/workflows/build-companion-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ jobs:
unityVersion:
- 6000.1.3f1
targetPlatform:
# TODO: Android build has "JDK not found" issue, https://github.com/game-ci/unity-builder/issues/489
# - StandaloneWindows64
# - StandaloneLinux64
# - StandaloneOSX

# Skip Android build until "JDK not found" issue has been solved (https://github.com/game-ci/unity-builder/issues/489)
#- Android
- iOS
# - WebGL
steps:
# Clone repo and restore cache
- uses: actions/checkout@v4
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/build-main-game.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ jobs:
- StandaloneWindows64
- StandaloneLinux64
- StandaloneOSX
# TODO: Android build has "JDK not found" issue, https://github.com/game-ci/unity-builder/issues/489
# Skip Android build until "JDK not found" issue has been solved (https://github.com/game-ci/unity-builder/issues/489)
#- Android
# TODO: iOS build has issues
# - iOS
# TODO: UltraStar Play does not support WebGL yet
- iOS
# - WebGL
steps:
# Clone repo and restore cache
Expand Down
10 changes: 5 additions & 5 deletions NukeBuild/BaseDependencyDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public virtual async Task DownloadAsync()
*/
private void CreateVersionTxtFile()
{
var path = unityProjectDir / "Assets" / "VERSION.txt";
var path = unityProjectDir / "Assets/VERSION.txt";
if (!File.Exists(path))
{
Console.WriteLine("Create empty VERSION.txt file");
Expand All @@ -42,7 +42,7 @@ private void DownloadLeanTween()
RemoteUrl = "https://github.com/UltraStar-Deluxe/LeanTween.git",
CommitHash = "ea745c3f94d8682327c912030dfc6b65cbe1ced5",
Branch = "master",
TargetDir = unityProjectDir / "Assets" / "Plugins" / "LeanTween",
TargetDir = unityProjectDir / "Assets/Plugins/LeanTween",
Depth = cloneDepth,
SparseCheckoutPatterns =
{
Expand Down Expand Up @@ -72,10 +72,10 @@ private void DownloadUniRx()
// - Cannot use prepared Unity package from GitHub because Unity dependency resolution inside a package (inside playshared) does not work with GitHub repositories
var downloader = new GitDownloader
{
RemoteUrl = "https://github.com/neuecc/UniRx.git",
CommitHash = "66205df49631860dd8f7c3314cb518b54c944d30",
RemoteUrl = "https://github.com/achimmihca/UniRx",
CommitHash = "7870c2d6cd035b4c18bb264c3dd529a4ac452e6e",
Branch = "master",
TargetDir = unityProjectDir / "Assets" / "Plugins" / "UniRx",
TargetDir = unityProjectDir / "Assets/Plugins/UniRx",
Depth = cloneDepth,
SparseCheckoutPatterns =
{
Expand Down
20 changes: 14 additions & 6 deletions NukeBuild/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class Build : NukeBuild
[Parameter] readonly AbsolutePath buildOutput = RootDirectory / "Build";
[Parameter] readonly AbsolutePath unityExecutable;
[Parameter] readonly UnityTestPlatform testPlatform = UnityTestPlatform.EditMode;
[Parameter] readonly bool downloadAiModels;
[Parameter] readonly bool downloadFfmpegLibraries;

private readonly AbsolutePath mainGameDir = RootDirectory / "UltraStar Play";
private readonly AbsolutePath companionAppDir = RootDirectory / "UltraStar Play Companion";
Expand Down Expand Up @@ -58,7 +60,7 @@ public enum UnityProject
{
BuildMainGame("BuildMacOS");
});

Target BuildMainGameAndroidApk => _ => _
.Executes(() =>
{
Expand Down Expand Up @@ -100,7 +102,7 @@ public enum UnityProject
{
AbsolutePath mainGameNuGetPackagesSourceFolder = GetNuGetPackagesProjectFolder(mainGameDir) / "bin";
AbsolutePath mainGameNuGetPackagesTargetFolder = GetNuGetPackagesTargetFolder(mainGameDir);
AbsolutePath playsharedNuGetPackagesTargetFolder = mainGameDir / "Packages" / "playshared" / "Runtime" / "Plugins" / "NuGetPackages";
AbsolutePath playsharedNuGetPackagesTargetFolder = mainGameDir / "Packages/playshared/Runtime/Plugins/NuGetPackages";

// Delete old packages
DirectoryUtils.DeleteDirectory(mainGameNuGetPackagesSourceFolder);
Expand All @@ -123,6 +125,7 @@ public enum UnityProject
"System.Diagnostics.DiagnosticSource.dll", // transitive dependency of Serilog
"System.Runtime.CompilerServices.Unsafe.dll", // transitive dependency of Serilog
"System.Threading.Channels.dll", // transitive dependency of Serilog
"Utf8Json.dll",
"YamlDotNet.dll");

// Move libraries for main game
Expand All @@ -133,13 +136,18 @@ public enum UnityProject
"NHyphenator.dll",
"Opportunity.LrcParser.dll",
"System.Linq.Dynamic.Core.dll",
"System.Text.Encoding.CodePages.dll"
"System.Text.Encoding.CodePages.dll",
"TagLibSharp.dll",
"Microsoft.ML.OnnxRuntime.dll",
"NWaves.dll",
"Ffmpeg.Autogen.dll",
"WindowsInput.dll" // Only used in mod "TriggerKeyStrokeToToggleMicWhenSinging"
);
});

Target RestoreMainGameDependencies => _ => _
.DependsOn(RestoreMainGameNuGetDependencies)
.Executes(() => new MainGameDependencyDownloader(mainGameDir, cloneDepth).DownloadAsync());
.Executes(() => new MainGameDependencyDownloader(mainGameDir, cloneDepth, downloadAiModels, downloadFfmpegLibraries).DownloadAsync());

Target RestoreCompanionAppNuGetDependencies => _ => _
.DependsOn(RestoreMainGameNuGetDependencies) // Restore main game dependencies for playshared
Expand Down Expand Up @@ -169,12 +177,12 @@ public enum UnityProject

private AbsolutePath GetNuGetPackagesProjectFolder(AbsolutePath unityProjectDir)
{
return unityProjectDir / "Packages" / "NuGetPackages";
return unityProjectDir / "Packages/NuGetPackages";
}

private AbsolutePath GetNuGetPackagesTargetFolder(AbsolutePath unityProjectDir)
{
return unityProjectDir / "Assets" / "Plugins" / "NuGetPackages";
return unityProjectDir / "Assets/Plugins/NuGetPackages";
}

private void TestUnityProject(UnityProject unityProject, UnityTestPlatform unityTestPlatform)
Expand Down
78 changes: 78 additions & 0 deletions NukeBuild/FileDownloader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
using Nuke.Common.IO;

namespace DefaultNamespace;

public static class FileDownloader
{
private static readonly HttpClient httpClient = new();

public static async Task DownloadFilesAsync(string baseUrl, AbsolutePath targetDir, params string[] relativeFilePaths)
{
foreach (string relativePath in relativeFilePaths)
{
await DownloadFileAsync($"{baseUrl}/{relativePath}", targetDir / relativePath);
}
}

public static async Task DownloadFileAsync(string url, AbsolutePath targetFile)
{
if (File.Exists(targetFile) && new FileInfo(targetFile).Length > 0)
{
Console.WriteLine($"File already exists, skipping download: '{targetFile}'");
return;
}

Console.WriteLine($"Downloading '{url}' to '{targetFile}'");
DirectoryUtils.CreateDirectory(targetFile.Parent);

AbsolutePath tempFile = (AbsolutePath)$"{targetFile}.tmp";
FileUtils.DeleteFile(tempFile);

using (var response = await httpClient.GetAsync(url, HttpCompletionOption.ResponseHeadersRead))
{
response.EnsureSuccessStatusCode();
long? totalBytes = response.Content.Headers.ContentLength;
await using var sourceStream = await response.Content.ReadAsStreamAsync();
await using var fileStream = new FileStream(tempFile, FileMode.Create, FileAccess.Write, FileShare.None);

byte[] buffer = new byte[81920];
long totalBytesRead = 0;
int bytesRead;
Stopwatch stopwatch = Stopwatch.StartNew();
long lastLogMs = 0;

while ((bytesRead = await sourceStream.ReadAsync(buffer, 0, buffer.Length)) > 0)
{
await fileStream.WriteAsync(buffer.AsMemory(0, bytesRead));
totalBytesRead += bytesRead;

if (stopwatch.ElapsedMilliseconds - lastLogMs >= 3000)
{
lastLogMs = stopwatch.ElapsedMilliseconds;
Console.WriteLine(FormatProgress(targetFile.Name, totalBytesRead, totalBytes));
}
}
}

FileUtils.MoveFile(tempFile, targetFile, new FileUtils.FileMoveSettings { Overwrite = true });
Console.WriteLine($"Done downloading '{targetFile}'");
}

private static string FormatProgress(string fileName, long bytesRead, long? totalBytes)
{
double currentMb = bytesRead / (1024.0 * 1024.0);
if (totalBytes is > 0)
{
double totalMb = totalBytes.Value / (1024.0 * 1024.0);
double percent = (double)bytesRead / totalBytes.Value * 100.0;
return $"Downloading '{fileName}': {currentMb:F1} MB / {totalMb:F1} MB ({percent:F0}%)";
}

return $"Downloading '{fileName}': {currentMb:F1} MB";
}
}
2 changes: 1 addition & 1 deletion NukeBuild/GitDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private void PrepareTargetDirectory()

private void CloneRepository()
{
Console.WriteLine($"Cloning from remote: RemoteUrl='{RemoteUrl}', CommitHash='{{CommitHash}}', Depth='{Depth}'");
Console.WriteLine($"Cloning from remote: RemoteUrl='{RemoteUrl}', CommitHash='{CommitHash}', Depth='{Depth}'");

Git($"init", workingDirectory: TargetDir);
Git($"remote add origin {RemoteUrl}", workingDirectory: TargetDir);
Expand Down
Loading
Loading