Files
EonaCat.XSBox/launcher/windows/LauncherBrand.cs
T
EonaCat 53e6e612c9
Rust validation / Windows x64 build and tests (push) Waiting to run
Rust validation / Formatting (push) Failing after 26s
EonaCat/ci-workflows: SonarQube / sonar (push) Successful in 47s
Initial
2026-12-04 21:27:30 +01:00

33 lines
986 B
C#

using System.Drawing;
namespace EonaCat.XSBOX.Launcher;
internal static class LauncherBrand
{
public static string? ResolveLogoPath()
{
var candidates = new List<string>
{
Path.Combine(AppContext.BaseDirectory, "assets", "eonacat-logo.ico"),
Path.Combine(AppContext.BaseDirectory, "eonacat-logo.ico")
};
var directory = new DirectoryInfo(AppContext.BaseDirectory);
for (var depth = 0; depth < 8 && directory != null; depth++, directory = directory.Parent)
{
candidates.Add(Path.Combine(directory.FullName, "assets", "eonacat-logo.ico"));
candidates.Add(Path.Combine(directory.FullName, "eonacat-logo.ico"));
}
return candidates.FirstOrDefault(File.Exists);
}
public static Icon? CreateIcon()
{
var path = ResolveLogoPath();
if (path == null) return null;
try { return new Icon(path); }
catch { return null; }
}
}