mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2025-02-24 14:14:25 +01:00
misc: chore: cleanup AppletMetadata.CanStart
This commit is contained in:
parent
27993b789f
commit
845c86f545
@ -32,29 +32,27 @@ namespace Ryujinx.Ava.Utilities
|
|||||||
|
|
||||||
public string GetContentPath(ContentManager contentManager)
|
public string GetContentPath(ContentManager contentManager)
|
||||||
=> (contentManager ?? _contentManager)
|
=> (contentManager ?? _contentManager)
|
||||||
.GetInstalledContentPath(ProgramId, StorageId.BuiltInSystem, NcaContentType.Program);
|
?.GetInstalledContentPath(ProgramId, StorageId.BuiltInSystem, NcaContentType.Program);
|
||||||
|
|
||||||
public bool CanStart(ContentManager contentManager, out ApplicationData appData,
|
public bool CanStart(ContentManager contentManager, out ApplicationData appData,
|
||||||
out BlitStruct<ApplicationControlProperty> appControl)
|
out BlitStruct<ApplicationControlProperty> appControl)
|
||||||
{
|
{
|
||||||
contentManager ??= _contentManager;
|
contentManager ??= _contentManager;
|
||||||
if (contentManager == null)
|
if (contentManager == null)
|
||||||
{
|
goto BadData;
|
||||||
|
|
||||||
|
string contentPath = GetContentPath(contentManager);
|
||||||
|
if (string.IsNullOrEmpty(contentPath))
|
||||||
|
goto BadData;
|
||||||
|
|
||||||
|
appData = new() { Name = Name, Id = ProgramId, Path = GetContentPath(contentManager) };
|
||||||
|
appControl = StructHelpers.CreateCustomNacpData(Name, Version);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
BadData:
|
||||||
appData = null;
|
appData = null;
|
||||||
appControl = new BlitStruct<ApplicationControlProperty>(0);
|
appControl = new BlitStruct<ApplicationControlProperty>(0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
appData = new() { Name = Name, Id = ProgramId, Path = GetContentPath(contentManager) };
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(appData.Path))
|
|
||||||
{
|
|
||||||
appControl = new BlitStruct<ApplicationControlProperty>(0);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
appControl = StructHelpers.CreateCustomNacpData(Name, Version);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user