4545#include " ScreenSpaceEffects.h"
4646#include " sourcevr/isourcevirtualreality.h"
4747#include " client_virtualreality.h"
48+ #ifdef BDSBASE
49+ #include " fmtstr.h"
50+ #include " vgui/ISystem.h"
51+ #endif
4852
4953#if defined( REPLAY_ENABLED )
5054#include " replay/ireplaysystem.h"
@@ -1299,21 +1303,61 @@ static void GetPos( const CCommand &args, Vector &vecOrigin, QAngle &angles )
12991303 }
13001304}
13011305
1306+ #ifdef BDSBASE
1307+ CON_COMMAND (spec_pos, " dump position and angles to the console ( 1 = to clipboard )" )
1308+ #else
13021309CON_COMMAND ( spec_pos, " dump position and angles to the console" )
1310+ #endif
13031311{
13041312 Vector vecOrigin;
13051313 QAngle angles;
13061314 GetPos ( args, vecOrigin, angles );
1315+ #ifdef BDSBASE
1316+ bool bClip = (args.ArgC () >= 2 && Q_atoi (args[1 ]) == 1 );
1317+
1318+ CFmtStr fmtCommand (
1319+ " spec_goto %.1f %.1f %.1f %.1f %.1f" ,
1320+ vecOrigin.x , vecOrigin.y , vecOrigin.z , angles.x , angles.y
1321+ );
1322+
1323+ Warning (" %s\n " , fmtCommand.String ());
1324+ if (bClip)
1325+ {
1326+ vgui::system ()->SetClipboardText (fmtCommand.String (), fmtCommand.Length ());
1327+ }
1328+ #else
13071329 Warning ( " spec_goto %.1f %.1f %.1f %.1f %.1f\n " , vecOrigin.x , vecOrigin.y ,
13081330 vecOrigin.z , angles.x , angles.y );
1331+ #endif
13091332}
13101333
1334+ #ifdef BDSBASE
1335+ CON_COMMAND (getpos, " dump position and angles to the console ( 1 = to clipboard, 2 = exact pos, 3 = all )" )
1336+ #else
13111337CON_COMMAND ( getpos, " dump position and angles to the console" )
1338+ #endif
13121339{
13131340 Vector vecOrigin;
13141341 QAngle angles;
13151342 GetPos ( args, vecOrigin, angles );
13161343
1344+ #ifdef BDSBASE
1345+ int nParm = (args.ArgC () >= 2 ) ? Q_atoi (args[1 ]) : 0 ;
1346+ bool bClip = (nParm == 1 || nParm == 3 );
1347+ bool bExact = (nParm == 2 || nParm == 3 );
1348+
1349+ CFmtStr fmtCommand (
1350+ " %s %f %f %f;%s %f %f %f" ,
1351+ bExact ? " setpos_exact" : " setpos" , vecOrigin.x , vecOrigin.y , vecOrigin.z ,
1352+ bExact ? " setang_exact" : " setang" , angles.x , angles.y , angles.z
1353+ );
1354+
1355+ Warning (" %s\n " , fmtCommand.String ());
1356+ if (bClip)
1357+ {
1358+ vgui::system ()->SetClipboardText (fmtCommand.String (), fmtCommand.Length ());
1359+ }
1360+ #else
13171361 const char *pCommand1 = " setpos" ;
13181362 const char *pCommand2 = " setang" ;
13191363 if ( args.ArgC () == 2 && atoi ( args[1 ] ) == 2 )
@@ -1324,5 +1368,6 @@ CON_COMMAND( getpos, "dump position and angles to the console" )
13241368
13251369 Warning ( " %s %f %f %f;" , pCommand1, vecOrigin.x , vecOrigin.y , vecOrigin.z );
13261370 Warning ( " %s %f %f %f\n " , pCommand2, angles.x , angles.y , angles.z );
1371+ #endif
13271372}
13281373
0 commit comments