]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/command/cl_cmd.qc
Add debugmodel command to cl_cmd.qc
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / command / cl_cmd.qc
index 4be39bf8b764ecbcd99d117ded9cd4b771f08372..28d5d57a34fd6cb57a462e118f31848667ecb674 100644 (file)
@@ -145,6 +145,36 @@ void GameCommand_blurtest(float request)
        #endif
 }
 
+void GameCommand_debugmodel(float request, float argc)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       string modelname = argv(1);
+                       entity debugmodel_entity;
+                       
+                       debugmodel_entity = spawn();
+                       precache_model(modelname);
+                       setmodel(debugmodel_entity, modelname);
+                       setorigin(debugmodel_entity, view_origin);
+                       debugmodel_entity.angles = view_angles;
+                       debugmodel_entity.draw = DrawDebugModel;
+                       debugmodel_entity.classname = "debugmodel";
+                       
+                       return; 
+               }
+                       
+               default:
+               case CMD_REQUEST_USAGE:
+               {
+                       print("\nUsage:^3 cl_cmd debugmodel model\n");
+                       print("  Where 'model' is a string of the model name to use for the debug model.\n");
+                       return;
+               }
+       }
+}
+
 void GameCommand_hud(float request, float argc) // TODO: Add aliases in commands.cfg
 {
        switch(request)
@@ -213,6 +243,27 @@ void GameCommand_hud(float request, float argc) // TODO: Add aliases in commands
        }
 }
 
+void GameCommand_mv_download(float request, float argc)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       Cmd_MapVote_MapDownload(argc);
+                       
+                       return; 
+               }
+                       
+               default:
+               case CMD_REQUEST_USAGE:
+               {
+                       print("\nUsage:^3 cl_cmd mapvote_download mapid\n");
+                       print("  Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.\n");
+                       return;
+               }
+       }
+}
+
 void GameCommand_sendcvar(float request, float argc)
 {
        switch(request)
@@ -248,7 +299,7 @@ void GameCommand_settemp(float request, float argc)
 {
        switch(request)
        {
-               case GC_REQUEST_COMMAND:
+               case CMD_REQUEST_COMMAND:
                {
                        if((argv(1) == "restore") && (argc == 3))
                        {
@@ -271,7 +322,7 @@ void GameCommand_settemp(float request, float argc)
                }
                        
                default:
-               case GC_REQUEST_USAGE:
+               case CMD_REQUEST_USAGE:
                {
                        print("\nUsage:^3 cl_cmd settemp <cvar> | [restore]\n");
                        print("  Where 'cvar' is the cvar plus arguments to send to the server,\n");
@@ -311,7 +362,9 @@ void GameCommand_(float request)
 // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
 #define CLIENT_COMMANDS(request,arguments) \
        CLIENT_COMMAND("blurtest", GameCommand_blurtest(request), "Feature for testing blur postprocessing") \
+       CLIENT_COMMAND("debugmodel", GameCommand_debugmodel(request, arguments), "Spawn a debug model manually") \
        CLIENT_COMMAND("hud", GameCommand_hud(request, arguments), "Commands regarding/controlling the HUD system") \
+       CLIENT_COMMAND("mv_download", GameCommand_mv_download(request, arguments), "Retrieve mapshot picture from the server") \
        CLIENT_COMMAND("sendcvar", GameCommand_sendcvar(request, arguments), "Send a cvar to the server (like weaponpriority)") \
        CLIENT_COMMAND("settemp", GameCommand_settemp(request, arguments), "Temporarily set a value to a cvar which is restored by command or end of each match") \
        /* nothing */