@@ -761,10 +761,15 @@ HUD_ELEMENT_MODE2(velang, "0", 0, 2,
761761 ctx->DrawElement (" velang: -" );
762762 }
763763}
764- HUD_ELEMENT2 (groundspeed, " 0" , " Draw the speed of the player upon leaving the ground.\n " , HudType_InGame | HudType_Paused | HudType_LoadingScreen) {
764+ HUD_ELEMENT_MODE2 (groundspeed, " 0" , 0 , 2 , " Draw the speed of the player upon leaving the ground.\n "
765+ " 0 = Default\n "
766+ " 1 = Groundspeed\n "
767+ " 2 = Groundspeed (Gain)\n " ,
768+ HudType_InGame | HudType_Paused | HudType_LoadingScreen) {
765769 static float speeds[2 ];
766770 static float drawSpeeds[2 ];
767771 static bool groundeds[2 ];
772+ static float lastSpeeds[2 ] = {0 };
768773
769774 auto player = client->GetPlayer (ctx->slot + 1 );
770775 if (!player) {
@@ -779,10 +784,15 @@ HUD_ELEMENT2(groundspeed, "0", "Draw the speed of the player upon leaving the gr
779784 speeds[ctx->slot ] = client->GetLocalVelocity (player).Length ();
780785 } else if (groundeds[ctx->slot ]) {
781786 groundeds[ctx->slot ] = false ;
787+ lastSpeeds[ctx->slot ] = drawSpeeds[ctx->slot ];
782788 drawSpeeds[ctx->slot ] = speeds[ctx->slot ];
783789 }
784-
785- ctx->DrawElement (" groundspeed: %.*f" , getPrecision (true ), drawSpeeds[ctx->slot ]);
790+ if (mode == 2 ) {
791+ ctx->DrawElement (" groundspeed: %.*f (%.*f)" , getPrecision (true ), drawSpeeds[ctx->slot ], getPrecision (true ), drawSpeeds[ctx->slot ] - lastSpeeds[ctx->slot ]);
792+ } else {
793+ ctx->DrawElement (" groundspeed: %.*f" , getPrecision (true ), drawSpeeds[ctx->slot ]);
794+ }
795+
786796}
787797QAngle g_bluePortalAngles[2 ];
788798QAngle g_orangePortalAngles[2 ];
0 commit comments