]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/sandbox.qc
Allow editing object alpha as well
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / sandbox.qc
index b20b93824bd7ad78974e3bdef8767fe2c8c1f0b9..c879fd59dd852a2f6bb93d3877a275fead5501c8 100644 (file)
@@ -62,6 +62,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                print_to(self, "^7\"^2edit_object ^3property value^7\" edits the given property of the object. Players can only edit their own objects");
                                print_to(self, "^7Object properties for ^2edit_object^7:");
                                print_to(self, "^3skin ^7- changes the skin of the object");
+                               print_to(self, "^3alpha ^7- sets object transparency");
                                print_to(self, "^3frame ^7- object animation frame, for self-animated models");
                                print_to(self, "^3scale ^7- changes object scale. 0.5 is half size and 2 is double size");
                                print_to(self, "^3physics ^7- object physics, 0 = static, 1 = movable, 2 = physical");
@@ -148,6 +149,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                        // set clipboard properties
                                        self.object_clipboard = strcat(e.model, " ");
                                        self.object_clipboard = strcat(self.object_clipboard, ftos(e.skin), " ");
+                                       self.object_clipboard = strcat(self.object_clipboard, ftos(e.alpha), " ");
                                        self.object_clipboard = strcat(self.object_clipboard, ftos(e.frame), " ");
                                        self.object_clipboard = strcat(self.object_clipboard, ftos(e.scale), " ");
                                        self.object_clipboard = strcat(self.object_clipboard, ftos(e.movetype), " ");
@@ -176,9 +178,10 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                // apply clipboard properties
                                setmodel(e, argv(0));
                                e.skin = stof(argv(1));
-                               e.frame = stof(argv(2));
-                               e.scale = stof(argv(3));        setsize(e, e.mins * e.scale, e.maxs * e.scale); // adapt bounding box size to model size
-                               e.movetype = stof(argv(4));
+                               e.alpha = stof(argv(2));
+                               e.frame = stof(argv(3));
+                               e.scale = stof(argv(4));        setsize(e, e.mins * e.scale, e.maxs * e.scale); // adapt bounding box size to model size
+                               e.movetype = stof(argv(5));
 
                                print_to(self, "Object pasted");
                                if(autocvar_g_sandbox_info)
@@ -202,6 +205,9 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                                case "skin":
                                                        e.skin = stof(argv(3));
                                                        break;
+                                               case "alpha":
+                                                       e.alpha = stof(argv(3));
+                                                       break;
                                                case "frame":
                                                        e.frame = stof(argv(3));
                                                        break;