mirror of
https://github.com/tgeorgiadis/quiver-launcher.git
synced 2026-12-06 03:38:02 -05:00
- Introduce Android app - Migrate project files to .NET 10, updating dependencies and workflows. - Migrate project to Avalonia 12 - Refactor App.axaml to include a ResourceDictionary for theme management. - Introduce new styles for gamepad navigation and focus rings. - Implement hosted main view management for better application lifecycle handling. - Remove deprecated MainWindow.Mods.cs file and related code. - Update README to reflect changes in project structure and requirements. Co-authored-by: Cursor <cursoragent@cursor.com>
46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using QuiverLauncher.Core.Models;
|
|
using QuiverLauncher.Core.Services;
|
|
using QuiverLauncher.Models;
|
|
|
|
namespace QuiverLauncher.Services;
|
|
|
|
public static class GameDownloadService
|
|
{
|
|
public static bool TrySelectPlatformDownload(GameInfo game, GitHubRelease? release, AppSettings settings)
|
|
{
|
|
if (release == null)
|
|
return false;
|
|
|
|
var assets = GitHubReleaseService.GetDownloadableAssets(release, game.ReleaseAssetFilter);
|
|
if (assets.Count == 0)
|
|
return false;
|
|
|
|
game.AvailableDownloads = assets;
|
|
|
|
var platformIdentifier = GameInfo.GetPlatformIdentifier(settings);
|
|
var matchingAsset = assets.FirstOrDefault(asset =>
|
|
GameInfo.MatchesPlatform(asset.name, platformIdentifier));
|
|
|
|
if (string.Equals(platformIdentifier, "Android", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
if (matchingAsset == null)
|
|
{
|
|
game.SelectedDownload = null;
|
|
return false;
|
|
}
|
|
|
|
game.SelectedDownload = matchingAsset;
|
|
return true;
|
|
}
|
|
|
|
if (assets.Count == 1)
|
|
{
|
|
game.SelectedDownload = assets[0];
|
|
return true;
|
|
}
|
|
|
|
game.SelectedDownload = matchingAsset ?? assets[0];
|
|
return true;
|
|
}
|
|
}
|