From 0c61ea8d1b62415f25b1e54230195d455269b6aa Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Fri, 15 Apr 2022 16:08:16 +0100 Subject: cleanup file structure and code for presence and chat (#292) * refactor presence and chat * improve spacing in cl_chat --- .../mod/scripts/vscripts/presence/ui_presence.nut | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Northstar.Client/mod/scripts/vscripts/presence/ui_presence.nut (limited to 'Northstar.Client/mod/scripts/vscripts/presence/ui_presence.nut') diff --git a/Northstar.Client/mod/scripts/vscripts/presence/ui_presence.nut b/Northstar.Client/mod/scripts/vscripts/presence/ui_presence.nut new file mode 100644 index 000000000..5f42cc7d8 --- /dev/null +++ b/Northstar.Client/mod/scripts/vscripts/presence/ui_presence.nut @@ -0,0 +1,38 @@ +untyped +globalize_all_functions + +void function NSUpdateGameStateUIStart() +{ + thread NSUpdateGameStateLoopUI() +} + +void function NSUpdateGameStateLoopUI() +{ + while ( true ) + { + wait 1.0 + + if ( uiGlobal.loadedLevel == "" ) + { + if ( uiGlobal.isLoading ) + NSSetLoading( true ) + else + { + NSSetLoading( false ) + NSUpdateGameStateUI( "", "", "", "", true, false ) + } + + continue + } + + NSSetLoading( false ) + if( GetConVarString( "mp_gamemode" ) == "solo" ) + { + NSUpdateGameStateUI( "northstar", Localize( GetMapDisplayName( GetActiveLevel() + "_CAMPAIGN_NAME" ) ), "Campaign", "Campaign", IsFullyConnected(), false ) + } + else + { + NSUpdateGameStateUI( GetActiveLevel(), Localize( GetMapDisplayName( GetActiveLevel() ) ), GetConVarString( "mp_gamemode" ), Localize( GetPlaylistDisplayName( GetConVarString( "mp_gamemode" ) ) ), IsFullyConnected(), false ) + } + } +} -- cgit v1.2.3