mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-03-25 16:11:09 +00:00
chore: move HasPtcCacheFiles & HasShaderCacheFiles into ApplicationData, instead of having the weird static dependency helpers
This commit is contained in:
@@ -11,11 +11,13 @@ using LibHac.Tools.FsSystem.NcaUtils;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Systems.PlayReport;
|
||||
using Ryujinx.Ava.Utilities;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.Loaders.Processes.Extensions;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Ryujinx.Ava.Systems.AppLibrary
|
||||
@@ -84,6 +86,32 @@ namespace Ryujinx.Ava.Systems.AppLibrary
|
||||
|
||||
public LocaleKeys? PlayabilityStatus => Compatibility.Convert(x => x.Status).OrElse(null);
|
||||
|
||||
public bool HasPtcCacheFiles
|
||||
{
|
||||
get
|
||||
{
|
||||
DirectoryInfo mainDir = new(System.IO.Path.Combine(AppDataManager.GamesDirPath, IdString, "cache", "cpu", "0"));
|
||||
DirectoryInfo backupDir = new(System.IO.Path.Combine(AppDataManager.GamesDirPath, IdString, "cache", "cpu", "1"));
|
||||
|
||||
return (mainDir.Exists && (mainDir.EnumerateFiles("*.cache").Any() || mainDir.EnumerateFiles("*.info").Any())) ||
|
||||
(backupDir.Exists && (backupDir.EnumerateFiles("*.cache").Any() || backupDir.EnumerateFiles("*.info").Any()));
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasShaderCacheFiles
|
||||
{
|
||||
get
|
||||
{
|
||||
DirectoryInfo shaderCacheDir = new(System.IO.Path.Combine(AppDataManager.GamesDirPath, IdString, "cache", "shader"));
|
||||
|
||||
if (!shaderCacheDir.Exists) return false;
|
||||
|
||||
return shaderCacheDir.EnumerateDirectories("*").Any() ||
|
||||
shaderCacheDir.GetFiles("*.toc").Length != 0 ||
|
||||
shaderCacheDir.GetFiles("*.data").Length != 0;
|
||||
}
|
||||
}
|
||||
|
||||
public string LocalizedStatusTooltip =>
|
||||
Compatibility.Convert(x =>
|
||||
#pragma warning disable CS8509 // It is exhaustive for all possible values this can contain.
|
||||
|
||||
Reference in New Issue
Block a user