aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Client/mod/scripts/vscripts/presence/ui_presence.nut
diff options
context:
space:
mode:
authorcat_or_not <41955154+catornot@users.noreply.github.com>2023-11-05 20:23:45 -0500
committerGitHub <noreply@github.com>2023-11-06 02:23:45 +0100
commitc0e8a9084846a12e549851aa9b734c5b1c8498b8 (patch)
tree15500de85284891e9c9af58dbc5493bdaa9e4cce /Northstar.Client/mod/scripts/vscripts/presence/ui_presence.nut
parent318561f5a6a1f965bca5caaef962ea1deb6f6b31 (diff)
downloadNorthstarMods-c0e8a9084846a12e549851aa9b734c5b1c8498b8.tar.gz
NorthstarMods-c0e8a9084846a12e549851aa9b734c5b1c8498b8.zip
Plugins v3 (#652)v1.20.0-rc3v1.20.0
Script component of plugins v3. See launcher PR for more info. https://github.com/R2Northstar/NorthstarLauncher/pull/472
Diffstat (limited to 'Northstar.Client/mod/scripts/vscripts/presence/ui_presence.nut')
-rw-r--r--Northstar.Client/mod/scripts/vscripts/presence/ui_presence.nut20
1 files changed, 12 insertions, 8 deletions
diff --git a/Northstar.Client/mod/scripts/vscripts/presence/ui_presence.nut b/Northstar.Client/mod/scripts/vscripts/presence/ui_presence.nut
index cdf1c9815..ce5abe865 100644
--- a/Northstar.Client/mod/scripts/vscripts/presence/ui_presence.nut
+++ b/Northstar.Client/mod/scripts/vscripts/presence/ui_presence.nut
@@ -1,12 +1,16 @@
untyped
globalize_all_functions
-void function NorthstarCodeCallback_GenerateUIPresence() {
- UIPresenceStruct uis
+UIPresenceStruct function DiscordRPC_GenerateUIPresence( UIPresenceStruct uis )
+{
+ if ( uiGlobal.isLoading )
+ uis.gameState = eDiscordGameState.LOADING;
+ else if ( uiGlobal.loadedLevel == "" )
+ uis.gameState = eDiscordGameState.MAINMENU;
+ else if ( IsLobby() || uiGlobal.loadedLevel == "mp_lobby" )
+ uis.gameState = eDiscordGameState.LOBBY;
+ else
+ uis.gameState = eDiscordGameState.INGAME;
- uis.isLoading = uiGlobal.isLoading
- uis.isLobby = IsLobby()
- uis.loadingLevel = uiGlobal.loadingLevel
- uis.loadedLevel = uiGlobal.loadedLevel
- NSPushUIPresence(uis)
-} \ No newline at end of file
+ return uis
+}