mirror of https://github.com/mgba-emu/mgba.git
Qt: Add time elapsed to Discord Rich Presence (closes #2225)
This commit is contained in:
parent
d9627e3623
commit
e3ad33366b
1
CHANGES
1
CHANGES
|
@ -7,6 +7,7 @@ Features:
|
|||
- Cheat code support in homebrew ports
|
||||
- Support for combo "Super Game Boy Color" SGB + GBC ROM hacks
|
||||
- Support for 64 kiB SRAM saves used in some bootlegs
|
||||
- Discord Rich Presence now supports time elapsed
|
||||
- Additional scaling shaders
|
||||
Emulation fixes:
|
||||
- GB Memory: Add cursory cartridge open bus emulation (fixes mgba.io/i/2032)
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
#include "DiscordCoordinator.h"
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
#include "CoreController.h"
|
||||
#include "GBAApp.h"
|
||||
|
||||
|
@ -31,6 +33,11 @@ static void updatePresence() {
|
|||
discordPresence.details = s_title.toUtf8().constData();
|
||||
discordPresence.instance = 1;
|
||||
discordPresence.largeImageKey = "mgba";
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
|
||||
discordPresence.startTimestamp = QDateTime::currentSecsSinceEpoch();
|
||||
#else
|
||||
discordPresence.startTimestamp = QDateTime::currentMSecsSinceEpoch() / 1000;
|
||||
#endif
|
||||
Discord_UpdatePresence(&discordPresence);
|
||||
} else {
|
||||
Discord_ClearPresence();
|
||||
|
|
Loading…
Reference in New Issue