Skip to content

Commit 5ebf566

Browse files
Fix crash when missing tracker sprites and add path logging
1 parent 671bfd6 commit 5ebf566

Some content is hidden

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

45 files changed

+725
-601
lines changed

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: .NET Build + Test + Publish
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, launch-issue-fixes]
66
pull_request:
77
branches: [main]
88

setup/LinuxBuildZipper.ps1

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,33 @@ else {
1919
}
2020
$version = $version -replace "\+.*", ""
2121

22+
# Setup default data folder
23+
$dataFolder = "$folder\DefaultData"
24+
New-Item -Path "$dataFolder" -ItemType Directory -Force
25+
2226
# Copy sprites to be bundled together
23-
if (Test-Path -LiteralPath "$folder\Sprites") {
24-
Remove-Item -LiteralPath "$folder\Sprites" -Recurse
27+
if (Test-Path -LiteralPath "$dataFolder\Sprites") {
28+
Remove-Item -LiteralPath "$dataFolder\Sprites" -Recurse
2529
}
26-
Copy-Item "$parentFolder\sprites\Sprites\" -Destination "$folder\Sprites" -Recurse
30+
Copy-Item "$parentFolder\sprites\Sprites\" -Destination "$dataFolder\Sprites" -Recurse
2731

2832
# Copy tracker sprites to be bundled together
29-
if (Test-Path -LiteralPath "$folder\TrackerSprites") {
30-
Remove-Item -LiteralPath "$folder\TrackerSprites" -Recurse
33+
if (Test-Path -LiteralPath "$dataFolder\TrackerSprites") {
34+
Remove-Item -LiteralPath "$dataFolder\TrackerSprites" -Recurse
3135
}
32-
Copy-Item "$parentFolder\trackersprites\" -Destination "$folder\TrackerSprites" -Recurse
36+
Copy-Item "$parentFolder\trackersprites\" -Destination "$dataFolder\TrackerSprites" -Recurse
3337

3438
# Copy configs to be bundled together
35-
if (Test-Path -LiteralPath "$folder\Configs") {
36-
Remove-Item -LiteralPath "$folder\Configs" -Recurse
39+
if (Test-Path -LiteralPath "$dataFolder\Configs") {
40+
Remove-Item -LiteralPath "$dataFolder\Configs" -Recurse
41+
}
42+
Copy-Item "$parentFolder\configs\Profiles\" -Destination "$dataFolder\Configs" -Recurse
43+
44+
# Copy schemas to be bundled together
45+
if (Test-Path -LiteralPath "$dataFolder\Schemas") {
46+
Remove-Item -LiteralPath "$dataFolder\Schemas" -Recurse
3747
}
38-
Copy-Item "$parentFolder\configs\Profiles\" -Destination "$folder\Configs" -Recurse
48+
Copy-Item "$parentFolder\configs\Schemas\" -Destination "$dataFolder\Schemas" -Recurse
3949

4050
# Create package
4151
$fullVersion = "SMZ3CasRandomizerLinux_$version"

setup/package-macos-app.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ echo $GITHUB_OUTPUT
1414

1515
# Create the .app bundle structure
1616
mkdir -p "$APP_NAME/Contents/MacOS"
17+
mkdir -p "$APP_NAME/Contents/MacOS/DefaultData"
1718
mkdir -p "$APP_NAME/Contents/Resources"
1819

1920
# Copy the Info.plist file and the icon
@@ -24,9 +25,10 @@ cp "setup/$ICON_FILE" "$APP_NAME/Contents/Resources/AppIcon.icns"
2425
cp -a "$PUBLISH_OUTPUT_DIRECTORY/." "$APP_NAME/Contents/MacOS"
2526

2627
# Bundle sprites and configs
27-
cp -r "sprites/Sprites" "$APP_NAME/Contents/MacOS/Sprites"
28-
cp -r "trackersprites" "$APP_NAME/Contents/MacOS/TrackerSprites"
29-
cp -r "configs/Profiles" "$APP_NAME/Contents/MacOS/Configs"
28+
cp -r "sprites/Sprites" "$APP_NAME/Contents/MacOS/DefaultData/Sprites"
29+
cp -r "trackersprites" "$APP_NAME/Contents/MacOS/DefaultData/TrackerSprites"
30+
cp -r "configs/Profiles" "$APP_NAME/Contents/MacOS/DefaultData/Configs"
31+
cp -r "configs/Schemas" "$APP_NAME/Contents/MacOS/DefaultData/Schemas"
3032

3133
echo "Packaged $APP_NAME successfully."
3234

setup/randomizer.app.iss

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,15 @@ Type: filesandordirs; Name: "{app}\TrackerSprites"
5353
[Files]
5454
Source: "netcorecheck.exe"; Flags: dontcopy noencryption
5555
Source: "netcorecheck_x64.exe"; Flags: dontcopy noencryption
56-
Source: "..\sprites\Sprites\*"; DestDir: "{app}\Sprites"; Excludes: "\bin\*,obj\*,*.cs,*.csproj"; Flags: ignoreversion recursesubdirs createallsubdirs
57-
58-
Source: "..\trackersprites\*"; DestDir: "{app}\TrackerSprites"; Excludes: "\bin\*,obj\*,*.cs,*.csproj"; Flags: ignoreversion recursesubdirs createallsubdirs
56+
Source: "..\sprites\Sprites\*"; DestDir: "{localappdata}\SMZ3CasRandomizer\DefaultData\Sprites"; Excludes: "\bin\*,obj\*,*.cs,*.csproj"; Flags: ignoreversion recursesubdirs createallsubdirs
57+
Source: "..\trackersprites\*"; DestDir: "{localappdata}\SMZ3CasRandomizer\DefaultData\TrackerSprites"; Excludes: "\bin\*,obj\*,*.cs,*.csproj"; Flags: ignoreversion recursesubdirs createallsubdirs
5958
Source: "..\src\TrackerCouncil.Smz3.UI\bin\Release\net8.0\win-x64\publish\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode;
6059
Source: "..\src\TrackerCouncil.Smz3.UI\bin\Release\net8.0\win-x64\publish\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: Is64BitInstallMode;
6160
Source: "..\src\TrackerCouncil.Smz3.UI\bin\Release\net8.0\win-x86\publish\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Check: "not Is64BitInstallMode";
6261
Source: "..\src\TrackerCouncil.Smz3.UI\bin\Release\net8.0\win-x86\publish\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: "not Is64BitInstallMode";
6362
Source: "..\src\TrackerCouncil.Smz3.Data\maps.json"; DestDir: "{localappdata}\SMZ3CasRandomizer"; Flags: comparetimestamp
64-
Source: "..\configs\Profiles\*"; DestDir: "{localappdata}\SMZ3CasRandomizer\Configs"; Flags: ignoreversion recursesubdirs createallsubdirs
65-
Source: "..\configs\Schemas\*"; DestDir: "{localappdata}\SMZ3CasRandomizer\Schemas"; Flags: ignoreversion recursesubdirs createallsubdirs
63+
Source: "..\configs\Profiles\*"; DestDir: "{localappdata}\SMZ3CasRandomizer\DefaultData\Configs"; Flags: ignoreversion recursesubdirs createallsubdirs
64+
Source: "..\configs\Schemas\*"; DestDir: "{localappdata}\SMZ3CasRandomizer\DefaultData\Schemas"; Flags: ignoreversion recursesubdirs createallsubdirs
6665
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
6766

6867
[Icons]

src/TrackerCouncil.Smz3.Abstractions/TrackerBase.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,5 @@ protected virtual void OnVoiceRecognitionEnabledChanged()
365365
VoiceRecognitionEnabledChanged?.Invoke(this, EventArgs.Empty);
366366
}
367367

368-
/// <summary>
369-
/// Updates the responses to reflect the selected tracker image pack
370-
/// </summary>
371-
/// <param name="packName">The name of the pack</param>
372-
public abstract void SetImagePack(string? packName);
373-
374368
public abstract void Dispose();
375369
}

src/TrackerCouncil.Smz3.Data.SchemaGenerator/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using TrackerCouncil.Smz3.Data.Configuration.ConfigFiles;
1414
using TrackerCouncil.Smz3.Data.Configuration.ConfigTypes;
1515
using TrackerCouncil.Smz3.Data.Options;
16+
using TrackerCouncil.Smz3.Shared;
1617
using YamlDotNet.Serialization;
1718
using JsonSchemaGenerator = NJsonSchema.Generation.JsonSchemaGenerator;
1819

@@ -288,7 +289,7 @@ private static SchrodingersString GetPopulatedSchrodingersString(string name, bo
288289

289290
private static string GetOutputPath()
290291
{
291-
var slnDirectory = new DirectoryInfo(RandomizerDirectories.SolutionPath);
292+
var slnDirectory = new DirectoryInfo(Directories.SolutionPath);
292293
if (slnDirectory.Parent?.GetDirectories().Any(x => x.Name == "SMZ3CasConfigs") == true)
293294
{
294295
return slnDirectory.Parent.GetDirectories().First(x => x.Name == "SMZ3CasConfigs").FullName;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
using System.Runtime.CompilerServices;
2+
3+
[assembly: InternalsVisibleTo("TrackerCouncil.Smz3.Tests")]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.Collections.Generic;
2+
using System.IO;
3+
4+
namespace TrackerCouncil.Smz3.Data.Configuration;
5+
6+
public class ConfigProfileDetails
7+
{
8+
public ConfigProfileDetails(string configFolderPath, HashSet<string>? moods)
9+
{
10+
Name = new DirectoryInfo(configFolderPath).Name;
11+
ConfigFolderPath = configFolderPath;
12+
Moods = moods;
13+
14+
if (Directory.Exists(Path.Combine(configFolderPath, "Sprites")))
15+
{
16+
SpritePath = Path.Combine(configFolderPath, "Sprites");
17+
HasSprites = Directory.GetFiles(SpritePath).Length > 0;
18+
}
19+
}
20+
21+
public string Name { get; }
22+
public string ConfigFolderPath { get; set; }
23+
public HashSet<string>? Moods { get; }
24+
public string? SpritePath { get; }
25+
public bool HasSprites { get; }
26+
}

0 commit comments

Comments
 (0)