Compare commits

...

3 Commits

2 changed files with 22 additions and 8 deletions

View File

@@ -15,21 +15,24 @@ namespace Ryujinx.Ava.Utilities
"01007ef00011e000", "01007ef00011e000",
spec => spec.AddValueFormatter("IsHardMode", BreathOfTheWild_MasterMode) spec => spec.AddValueFormatter("IsHardMode", BreathOfTheWild_MasterMode)
) )
.AddSpec( // Super Mario Odyssey .AddSpec(
"0100f2c0115b6000",
spec => spec.AddValueFormatter("PlayerPosY", TearsOfTheKingdom_CurrentField))
.AddSpec(
"0100000000010000", "0100000000010000",
spec => spec =>
spec.AddValueFormatter("is_kids_mode", SuperMarioOdyssey_AssistMode) spec.AddValueFormatter("is_kids_mode", SuperMarioOdyssey_AssistMode)
) )
.AddSpec( // Super Mario Odyssey (China) .AddSpec(
"010075000ECBE000", "010075000ECBE000",
spec => spec =>
spec.AddValueFormatter("is_kids_mode", SuperMarioOdysseyChina_AssistMode) spec.AddValueFormatter("is_kids_mode", SuperMarioOdysseyChina_AssistMode)
) )
.AddSpec( // Super Mario 3D World + Bowser's Fury .AddSpec(
"010028600EBDA000", "010028600EBDA000",
spec => spec.AddValueFormatter("mode", SuperMario3DWorldOrBowsersFury) spec => spec.AddValueFormatter("mode", SuperMario3DWorldOrBowsersFury)
) )
.AddSpec( // Mario Kart 8 Deluxe, Mario Kart 8 Deluxe (China) .AddSpec( // Global & China IDs
["0100152000022000", "010075100E8EC000"], ["0100152000022000", "010075100E8EC000"],
spec => spec.AddValueFormatter("To", MarioKart8Deluxe_Mode) spec => spec.AddValueFormatter("To", MarioKart8Deluxe_Mode)
); );
@@ -37,6 +40,14 @@ namespace Ryujinx.Ava.Utilities
private static PlayReportFormattedValue BreathOfTheWild_MasterMode(ref PlayReportValue value) private static PlayReportFormattedValue BreathOfTheWild_MasterMode(ref PlayReportValue value)
=> value.BoxedValue is 1 ? "Playing Master Mode" : PlayReportFormattedValue.ForceReset; => value.BoxedValue is 1 ? "Playing Master Mode" : PlayReportFormattedValue.ForceReset;
private static PlayReportFormattedValue TearsOfTheKingdom_CurrentField(ref PlayReportValue value) =>
value.PackedValue.AsDouble() switch
{
> 800d => "Exploring the Sky Islands",
< -201d => "Exploring the Depths",
_ => "Roaming Hyrule"
};
private static PlayReportFormattedValue SuperMarioOdyssey_AssistMode(ref PlayReportValue value) private static PlayReportFormattedValue SuperMarioOdyssey_AssistMode(ref PlayReportValue value)
=> value.BoxedValue is 1 ? "Playing in Assist Mode" : "Playing in Regular Mode"; => value.BoxedValue is 1 ? "Playing in Assist Mode" : "Playing in Regular Mode";
@@ -121,7 +132,7 @@ namespace Ryujinx.Ava.Utilities
PlayReportValue value = new() PlayReportValue value = new()
{ {
Application = appMeta, Application = appMeta,
BoxedValue = valuePackObject.ToObject() PackedValue = valuePackObject
}; };
return formatSpec.ValueFormatter(ref value); return formatSpec.ValueFormatter(ref value);
@@ -160,10 +171,13 @@ namespace Ryujinx.Ava.Utilities
} }
} }
public struct PlayReportValue public readonly struct PlayReportValue
{ {
public ApplicationMetadata Application { get; init; } public ApplicationMetadata Application { get; init; }
public object BoxedValue { get; init; }
public MessagePackObject PackedValue { get; init; }
public object BoxedValue => PackedValue.ToObject();
} }
public struct PlayReportFormattedValue public struct PlayReportFormattedValue