diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-04-15 16:08:16 +0100 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-04-19 23:07:48 +0200 |
commit | 6e8f81a9a9127654112c5b1cec227c764b4ca8fd (patch) | |
tree | c4df30c6b67fa292d946e35316c436afe73b3926 /Northstar.Client/mod/scripts/vscripts/state_client.nut | |
parent | ffdf44de4aed8e34cdc1d749193271ac80facaf3 (diff) | |
download | NorthstarMods-6e8f81a9a9127654112c5b1cec227c764b4ca8fd.tar.gz NorthstarMods-6e8f81a9a9127654112c5b1cec227c764b4ca8fd.zip |
cleanup file structure and code for presence and chat (#292)
* refactor presence and chat
* improve spacing in cl_chat
Diffstat (limited to 'Northstar.Client/mod/scripts/vscripts/state_client.nut')
-rw-r--r-- | Northstar.Client/mod/scripts/vscripts/state_client.nut | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/Northstar.Client/mod/scripts/vscripts/state_client.nut b/Northstar.Client/mod/scripts/vscripts/state_client.nut deleted file mode 100644 index 2a380e35..00000000 --- a/Northstar.Client/mod/scripts/vscripts/state_client.nut +++ /dev/null @@ -1,59 +0,0 @@ -untyped - -int highestScore = 0 -int secondHighestScore = 0 -int ourScore = 0 - -globalize_all_functions - -void function OnPrematchStart() -{ - if (GetServerVar( "roundBased" )) - NSUpdateTimeInfo( level.nv.roundEndTime - Time() ) - else - NSUpdateTimeInfo( level.nv.gameEndTime - Time() ) -} - -void function NSUpdateGameStateClientStart() -{ - #if MP - AddCallback_GameStateEnter( eGameState.Prematch, OnPrematchStart ) - #endif - thread NSUpdateGameStateLoopClient() - OnPrematchStart() -} - -void function NSUpdateGameStateLoopClient() -{ - while ( true ) - { - if(GetConVarString( "mp_gamemode" ) == "solo") - { - - NSUpdateGameStateClient( GetPlayerArray().len(), GetCurrentPlaylistVarInt( "max_players", 65535 ), 1, 1, 1, GetServerVar( "roundBased" ), 1 ) - wait 1.0 - } - else - { - foreach ( player in GetPlayerArray() ) - { - if ( GameRules_GetTeamScore( player.GetTeam() ) >= highestScore ) - { - highestScore = GameRules_GetTeamScore( player.GetTeam() ) - } - else if ( GameRules_GetTeamScore( player.GetTeam() ) > secondHighestScore ) - { - secondHighestScore = GameRules_GetTeamScore( player.GetTeam() ) - } - } - if ( GetLocalClientPlayer() != null ) - { - ourScore = GameRules_GetTeamScore( GetLocalClientPlayer().GetTeam() ) - } - int limit = GetServerVar( "roundBased" ) ? GetCurrentPlaylistVarInt( "roundscorelimit", 0 ) : GetCurrentPlaylistVarInt( "scorelimit", 0 ) - NSUpdateGameStateClient( GetPlayerArray().len(), GetCurrentPlaylistVarInt( "max_players", 65535 ), ourScore, secondHighestScore, highestScore, GetServerVar( "roundBased" ), limit ) - OnPrematchStart() - wait 1.0 - } - } -} |