From 963f024838c1b91a1b367c114a478f7d0f082f06 Mon Sep 17 00:00:00 2001 From: awesomeangotti Date: Sun, 14 Jun 2026 17:32:12 +0000 Subject: [PATCH] Discord Rich Presence: Miitopia (#129) Hello and welcome to my PR that adds discord rich presence stuff from play reports generated by Miitopia. The following items are tracked and displayed: Main menu (for booting game) MII Selector (from main menu) Region (Game stage based) Gold (Only updates at start of game play due to lack of play reports generated after loading into world) As a bonus, I will be exporting the title icon for discord rich presence images and providing the title ID so it can be added to rich presence images. (See bottom of my message) Examples of current rich presence messages: At Greenhorne (Starting area) ![image](/attachments/663acf62-2149-4e69-a68d-94c107876182) After defeating final boss ![image](/attachments/52363124-742b-4214-8b69-f8043ae382bc) Rich presence image and titleID: titleID: 01003da010e8a000 ![01003da010e8a000](/attachments/952d9218-9b99-4d55-929e-d3c48dcf87a4) Co-authored-by: Awesomeangotti <143439211+Awesomeangotti@users.noreply.github.com> Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/129 --- src/Ryujinx.Common/TitleIDs.cs | 1 + .../PlayReport/PlayReports.Formatters.cs | 28 +++++++++++++++++++ src/Ryujinx/Systems/PlayReport/PlayReports.cs | 6 ++++ 3 files changed, 35 insertions(+) diff --git a/src/Ryujinx.Common/TitleIDs.cs b/src/Ryujinx.Common/TitleIDs.cs index 890cf2793..24a6e364a 100644 --- a/src/Ryujinx.Common/TitleIDs.cs +++ b/src/Ryujinx.Common/TitleIDs.cs @@ -147,6 +147,7 @@ namespace Ryujinx.Common "0100c1f0051b6000", // Donkey Kong Country: Tropical Freeze "0100ed000d390000", // Dr. Kawashima's Brain Training "010067b017588000", // Endless Ocean Luminous + "01003da010e8a000", // Miitopia "01006b5012b32000", // Part Time UFO "0100704000B3A000", // Snipperclips "01006a800016e000", // Super Smash Bros. Ultimate diff --git a/src/Ryujinx/Systems/PlayReport/PlayReports.Formatters.cs b/src/Ryujinx/Systems/PlayReport/PlayReports.Formatters.cs index d8df7b627..90931e0cb 100644 --- a/src/Ryujinx/Systems/PlayReport/PlayReports.Formatters.cs +++ b/src/Ryujinx/Systems/PlayReport/PlayReports.Formatters.cs @@ -1088,5 +1088,33 @@ namespace Ryujinx.Ava.Systems.PlayReport return $"Living on {messagePackObjectDictionary["LandName"].AsString()} Island"; } + + private static FormattedValue MiitopiaRPC(SparseMultiValue values) + { + if (values.Matched.TryGetValue("gold", out Value gold) && values.Matched.TryGetValue("stage", out Value location)) + { + return $"{LocFinal(location.ToString())} with {gold} gold"; + } + + if (values.Matched.TryGetValue("secret", out Value secret)) // Yes "secret" is unused, but it only appears in the MII selector. + { + return $"In the MII selector"; + } + + return $"At the main menu"; + + static string LocFinal(string? location) => location switch + { + "0" => "Somewhere in Miitopia", + "1" => "Wandering around Greenhorne", + "2" => "Trodding through Neksdor", + "3" => "Exploring The Realm of the Fey", + "4" => "Burning their feet at Karkaton", + "5" => "Soaring in the skies of Miitopia", + "6" => "Fighting up The Sky Scraper", + "7" => "Traveling Miitopia", + _ => "Wandering" + }; + } } } diff --git a/src/Ryujinx/Systems/PlayReport/PlayReports.cs b/src/Ryujinx/Systems/PlayReport/PlayReports.cs index 8880ed5d4..16ff80933 100644 --- a/src/Ryujinx/Systems/PlayReport/PlayReports.cs +++ b/src/Ryujinx/Systems/PlayReport/PlayReports.cs @@ -132,6 +132,12 @@ namespace Ryujinx.Ava.Systems.PlayReport .WithDescription("based on your island name.") .AddValueFormatter("AppCmn", AnimalCrossingNewHorizons_AppCommon) ) + .AddSpec( + "01003da010e8a000", // Miitopia 01003da010e8a000 + spec => spec + .WithDescription("based on gold count, report info only in the mii selector, and gamestage (progression)") + .AddSparseMultiValueFormatter(["gold", "secret", "stage"], MiitopiaRPC) + ) ); private static string Playing(string game) => $"Playing {game}";