Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ryujinx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tartifless
Ryujinx
Commits
4d311dfc
Commit
4d311dfc
authored
5 months ago
by
GreemDev
Browse files
Options
Downloads
Patches
Plain Diff
UI: RPC: show game version when hovering large image asset.
parent
5b6e3521
No related branches found
Branches containing commit
Tags
1.2.21
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Ryujinx.UI.Common/DiscordIntegrationModule.cs
+11
-7
11 additions, 7 deletions
src/Ryujinx.UI.Common/DiscordIntegrationModule.cs
src/Ryujinx/AppHost.cs
+4
-5
4 additions, 5 deletions
src/Ryujinx/AppHost.cs
with
15 additions
and
12 deletions
src/Ryujinx.UI.Common/DiscordIntegrationModule.cs
+
11
−
7
View file @
4d311dfc
using
DiscordRPC
;
using
Humanizer
;
using
LibHac.Bcat
;
using
Ryujinx.Common
;
using
Ryujinx.HLE.Loaders.Processes
;
using
Ryujinx.UI.App.Common
;
using
Ryujinx.UI.Common.Configuration
;
using
System.Collections.Generic
;
...
...
@@ -13,7 +15,7 @@ namespace Ryujinx.UI.Common
{
public
static
Timestamps
StartedAt
{
get
;
set
;
}
private
const
string
D
escription
=
"A simple, experimental Nintendo Switch emulator.
"
;
private
static
readonly
string
_d
escription
=
$"
{
ReleaseInformation
.
ReleaseChannelOwner
}
/
{
ReleaseInformation
.
ReleaseChannelRepo
}
{
ReleaseInformation
.
Version
}
"
;
private
const
string
ApplicationId
=
"1293250299716173864"
;
private
const
int
ApplicationByteLimit
=
128
;
...
...
@@ -29,7 +31,7 @@ namespace Ryujinx.UI.Common
Assets
=
new
Assets
{
LargeImageKey
=
"ryujinx"
,
LargeImageText
=
D
escription
LargeImageText
=
TruncateToByteLength
(
_d
escription
)
},
Details
=
"Main Menu"
,
State
=
"Idling"
,
...
...
@@ -62,19 +64,21 @@ namespace Ryujinx.UI.Common
}
}
public
static
void
SwitchToPlayingState
(
string
titleId
,
ApplicationMetadata
appMeta
)
public
static
void
SwitchToPlayingState
(
ApplicationMetadata
appMeta
,
ProcessResult
procRes
)
{
_discordClient
?.
SetPresence
(
new
RichPresence
{
Assets
=
new
Assets
{
LargeImageKey
=
_discordGameAssets
.
Contains
(
titleId
.
ToLower
())
?
titleId
:
"game"
,
LargeImageText
=
TruncateToByteLength
(
appMeta
.
Title
),
LargeImageKey
=
_discordGameAssets
.
Contains
(
procRes
.
ProgramIdText
.
ToLower
())
?
procRes
.
ProgramIdText
:
"game"
,
LargeImageText
=
TruncateToByteLength
(
$"
{
appMeta
.
Title
}
|
{
procRes
.
DisplayVersion
}
"
),
SmallImageKey
=
"ryujinx"
,
SmallImageText
=
D
escription
SmallImageText
=
TruncateToByteLength
(
_d
escription
)
},
Details
=
TruncateToByteLength
(
$"Playing
{
appMeta
.
Title
}
"
),
State
=
$"Total play time:
{
appMeta
.
TimePlayed
.
Humanize
(
2
,
false
)}
"
,
State
=
appMeta
.
LastPlayed
.
HasValue
?
$"Total play time:
{
appMeta
.
TimePlayed
.
Humanize
(
2
,
false
)}
"
:
"Never played"
,
Timestamps
=
Timestamps
.
Now
});
}
...
...
This diff is collapsed.
Click to expand it.
src/Ryujinx/AppHost.cs
+
4
−
5
View file @
4d311dfc
...
...
@@ -785,12 +785,11 @@ namespace Ryujinx.Ava
return
false
;
}
ApplicationMetadata
appMeta
=
ApplicationLibrary
.
LoadAndSaveMetaData
(
Device
.
Processes
.
ActiveApplication
.
ProgramIdText
,
appMetadata
=>
{
appMetadata
.
UpdatePreGame
();
});
ApplicationMetadata
appMeta
=
ApplicationLibrary
.
LoadAndSaveMetaData
(
Device
.
Processes
.
ActiveApplication
.
ProgramIdText
,
appMetadata
=>
appMetadata
.
UpdatePreGame
()
);
DiscordIntegrationModule
.
SwitchToPlayingState
(
Device
.
Processes
.
ActiveApplication
.
ProgramIdText
,
appMeta
);
DiscordIntegrationModule
.
SwitchToPlayingState
(
appMeta
,
Device
.
Processes
.
ActiveApplication
);
return
true
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment