Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryMarkle committed Jun 10, 2024
1 parent a3ccf5d commit fd6cf78
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Release v0.9.90
release_name: Release v0.9.90-2
body: ${{ steps.read_release_notes.outputs.notes }}
draft: false
prerelease: false
Expand Down
2 changes: 1 addition & 1 deletion Leditor/Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ internal static string AssetsDirectory {

internal static System.Timers.Timer AutoSaveTimer = new(30_000);

internal const string Version = "Henry's Leditor v0.9.90";
internal const string Version = "Henry's Leditor v0.9.90-2";
internal const string RaylibVersion = "Raylib v5.0.0";
internal static string BuildConfiguration { get; set; } = "Build Configuration: Unknown";
internal static string OperatingSystem { get; set; } = "Operating System: Unknown";
Expand Down
42 changes: 27 additions & 15 deletions Leditor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -721,11 +721,15 @@ private static void Main()
var entries = Directory.GetFiles(Path.Combine(GLOBALS.Paths.RendererDirectory, "Props"));

if (entries.Length > 0) {
var found = entries
.Select(Path.GetFileNameWithoutExtension)
.SingleOrDefault(f => string.Equals(f, prop.Name, StringComparison.OrdinalIgnoreCase));

return Path.Combine(GLOBALS.Paths.RendererDirectory, "Props", (found ?? prop.Name) + ".png");
try {
var found = entries
.Select(Path.GetFileNameWithoutExtension)
.SingleOrDefault(f => string.Equals(f, prop.Name, StringComparison.OrdinalIgnoreCase));

return Path.Combine(GLOBALS.Paths.RendererDirectory, "Props", (found ?? prop.Name) + ".png");
} catch {
return Path.Combine(GLOBALS.Paths.RendererDirectory, "Props", prop.Name + ".png");
}
}

return Path.Combine(GLOBALS.Paths.RendererDirectory, "Props", prop.Name + ".png");
Expand All @@ -741,11 +745,15 @@ private static void Main()
var entries = Directory.GetFiles(Path.Combine(GLOBALS.Paths.RendererDirectory, "Props"));

if (entries.Length > 0) {
var found = entries
.Select(Path.GetFileNameWithoutExtension)
.SingleOrDefault(f => string.Equals(f, prop.Name, StringComparison.OrdinalIgnoreCase));

return Path.Combine(GLOBALS.Paths.RendererDirectory, "Props", (found ?? prop.Name) + ".png");
try {
var found = entries
.Select(Path.GetFileNameWithoutExtension)
.SingleOrDefault(f => string.Equals(f, prop.Name, StringComparison.OrdinalIgnoreCase));

return Path.Combine(GLOBALS.Paths.RendererDirectory, "Props", (found ?? prop.Name) + ".png");
} catch {
return Path.Combine(GLOBALS.Paths.RendererDirectory, "Props", prop.Name + ".png");
}
}

return Path.Combine(GLOBALS.Paths.RendererDirectory, "Props", prop.Name + ".png");
Expand All @@ -761,11 +769,15 @@ private static void Main()
var entries = Directory.GetFiles(Path.Combine(GLOBALS.Paths.RendererDirectory, "Props"));

if (entries.Length > 0) {
var found = entries
.Select(Path.GetFileNameWithoutExtension)
.SingleOrDefault(f => string.Equals(f, prop.Name, StringComparison.OrdinalIgnoreCase));

return Path.Combine(GLOBALS.Paths.RendererDirectory, "Props", (found ?? prop.Name) + ".png");
try {
var found = entries
.Select(Path.GetFileNameWithoutExtension)
.SingleOrDefault(f => string.Equals(f, prop.Name, StringComparison.OrdinalIgnoreCase));

return Path.Combine(GLOBALS.Paths.RendererDirectory, "Props", (found ?? prop.Name) + ".png");
} catch {
return Path.Combine(GLOBALS.Paths.RendererDirectory, "Props", prop.Name + ".png");
}
}

return Path.Combine(GLOBALS.Paths.RendererDirectory, "Props", prop.Name + ".png");
Expand Down
8 changes: 6 additions & 2 deletions Leditor/TileLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,13 @@ internal bool Proceed()
var filePaths = Directory.GetFiles(pack.Directory, "*");

if (filePaths.Length > 0) {
var found = filePaths.SingleOrDefault(f => string.Equals(Path.GetFileNameWithoutExtension(f), tile.Name, StringComparison.OrdinalIgnoreCase));
try {
var found = filePaths.SingleOrDefault(f => string.Equals(Path.GetFileNameWithoutExtension(f), tile.Name, StringComparison.OrdinalIgnoreCase));

if (found is not null) tilePath = found;
if (found is not null) tilePath = found;
} catch {
tilePath = Path.Combine(pack.Directory, $"{tile.Name}.png");
}
}
}
//
Expand Down
7 changes: 6 additions & 1 deletion Release_Notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@

### Fixes

- Fixed some tile textures not loading on Linux machines.
- Fixed some tile textures not loading on Linux machines.


### Revision 0.9.90-2

- Fixed a crash that occurs when more than one texture share the same name.

0 comments on commit fd6cf78

Please sign in to comment.