mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-03-10 17:14:25 +00:00
misc: chore: rewrite PlayReports.Analyzer creation to use Lazy and create the value alongside DiscordIntegrationModule init
This commit is contained in:
parent
45ee8cd0e8
commit
f92d09711b
@ -56,6 +56,7 @@ namespace Ryujinx.Ava
|
|||||||
ConfigurationState.Instance.EnableDiscordIntegration.Event += Update;
|
ConfigurationState.Instance.EnableDiscordIntegration.Event += Update;
|
||||||
TitleIDs.CurrentApplication.Event += (_, e) => Use(e.NewValue);
|
TitleIDs.CurrentApplication.Event += (_, e) => Use(e.NewValue);
|
||||||
HorizonStatic.PlayReport += HandlePlayReport;
|
HorizonStatic.PlayReport += HandlePlayReport;
|
||||||
|
PlayReports.Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Update(object sender, ReactiveEventArgs<bool> evnt)
|
private static void Update(object sender, ReactiveEventArgs<bool> evnt)
|
||||||
|
@ -1,8 +1,19 @@
|
|||||||
namespace Ryujinx.Ava.Utilities.PlayReport
|
using System;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.Utilities.PlayReport
|
||||||
{
|
{
|
||||||
public static partial class PlayReports
|
public static partial class PlayReports
|
||||||
{
|
{
|
||||||
public static Analyzer Analyzer { get; } = new Analyzer()
|
public static void Initialize()
|
||||||
|
{
|
||||||
|
// init lazy value
|
||||||
|
_ = Analyzer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Analyzer Analyzer => _analyzerLazy.Value;
|
||||||
|
|
||||||
|
private static readonly Lazy<Analyzer> _analyzerLazy = new(() =>
|
||||||
|
new Analyzer()
|
||||||
.AddSpec(
|
.AddSpec(
|
||||||
"01007ef00011e000",
|
"01007ef00011e000",
|
||||||
spec => spec
|
spec => spec
|
||||||
@ -59,8 +70,11 @@
|
|||||||
.AddSpec(
|
.AddSpec(
|
||||||
[
|
[
|
||||||
"0100c9a00ece6000", "01008d300c50c000", "0100d870045b6000",
|
"0100c9a00ece6000", "01008d300c50c000", "0100d870045b6000",
|
||||||
"010012f017576000", "0100c62011050000", "0100b3c014bda000"],
|
"010012f017576000", "0100c62011050000", "0100b3c014bda000"
|
||||||
|
],
|
||||||
spec => spec.AddValueFormatter("launch_title_id", NsoEmulator_LaunchedGame)
|
spec => spec.AddValueFormatter("launch_title_id", NsoEmulator_LaunchedGame)
|
||||||
|
)
|
||||||
|
.AddSpec("01002da013484000", spec => spec.AddValueFormatter("rupees", SkywardSwordHD_Rupees))
|
||||||
);
|
);
|
||||||
|
|
||||||
private static string Playing(string game) => $"Playing {game}";
|
private static string Playing(string game) => $"Playing {game}";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user