Skip to content

Commit

Permalink
misc: chore: Cleanup AppletMetadata usage
Browse files Browse the repository at this point in the history
  • Loading branch information
GreemDev committed Jan 20, 2025
1 parent 09446fd commit bbd64fd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
using Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption;
using Ryujinx.HLE.UI;
using Ryujinx.Input.HLE;
using Silk.NET.Vulkan;
using SkiaSharp;
using System;
using System.Collections.Generic;
Expand Down
12 changes: 6 additions & 6 deletions src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ public async Task OpenSettings()
ViewModel.LoadConfigurableHotKeys();
}

public static readonly AppletMetadata MiiApplet = new("miiEdit", 0x0100000000001009);

public AppletMetadata MiiApplet => new(ViewModel.ContentManager, "miiEdit", 0x0100000000001009);
public async Task OpenMiiApplet()
{
if (MiiApplet.CanStart(ViewModel.ContentManager, out var appData, out var nacpData))
{
await ViewModel.LoadApplication(appData, ViewModel.IsFullScreen || ViewModel.StartGamesInFullscreen, nacpData);
}
if (!MiiApplet.CanStart(out var appData, out var nacpData))
return;

await ViewModel.LoadApplication(appData, ViewModel.IsFullScreen || ViewModel.StartGamesInFullscreen, nacpData);
}

public async Task OpenCheatManagerForCurrentApp()
Expand Down
4 changes: 4 additions & 0 deletions src/Ryujinx/Utilities/AppletMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,9 @@ public bool CanStart(ContentManager contentManager, out ApplicationData appData,
appControl = new BlitStruct<ApplicationControlProperty>(0);
return false;
}

public bool CanStart(out ApplicationData appData,
out BlitStruct<ApplicationControlProperty> appControl)
=> CanStart(null, out appData, out appControl);
}
}

0 comments on commit bbd64fd

Please sign in to comment.