]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow editing of object physics
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 25 Oct 2011 21:07:13 +0000 (00:07 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 25 Oct 2011 21:07:13 +0000 (00:07 +0300)
defaultXonotic.cfg
qcsrc/menu/xonotic/dialog_sandboxtools.c
qcsrc/server/mutators/sandbox.qc

index 75eef67c7397742f5fe3b72365e520eaa4aef7a1..424d82d9a1015266da9a78a79bc32a648450178a 100644 (file)
@@ -549,6 +549,7 @@ set g_sandbox_editor_distance_edit 350 "distance at which players can edit or re
 seta menu_sandbox_spawn_model "" // used to store the model in the input field
 set menu_sandbox_edit_skin 0
 set menu_sandbox_edit_frame 0
+set menu_sandbox_edit_physics 0
 
 alias menu_showsandboxtools "menu_cmd directmenu SandboxTools"
 bind f7 menu_showsandboxtools
index 8291b2a73b75fd22cd8facd8ed48e7bc54cd92ac..2bcc714e2baf7f4c570ade77c6fddbb937ad7eed 100644 (file)
@@ -33,6 +33,12 @@ void XonoticSandboxToolsDialog_fill(entity me)
                me.TD(me, 1, 1.5, e = makeXonoticSlider(0, 99, 1, "menu_sandbox_edit_skin"));
                me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set frame:"), '0 0 0', "sandbox edit_object frame $menu_sandbox_edit_frame", 0));
                me.TD(me, 1, 1.5, e = makeXonoticSlider(0, 99, 1, "menu_sandbox_edit_frame"));
+       me.TR(me);
+               me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set physics:"), '0 0 0', "sandbox edit_object physics $menu_sandbox_edit_physics", 0));
+       me.TDempty(me, 0.1);
+               me.TD(me, 1, 0.5, e = makeXonoticRadioButton(0, "menu_sandbox_edit_physics", "0", _("Static")));
+               me.TD(me, 1, 0.5, e = makeXonoticRadioButton(0, "menu_sandbox_edit_physics", "1", _("Movable")));
+               me.TD(me, 1, 0.5, e = makeXonoticRadioButton(0, "menu_sandbox_edit_physics", "2", _("Physical")));
 
        me.gotoRC(me, me.rows - 1, 0);
                me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
index ef97f3692f1458620ed24ed9d41b4ded645dc33c..50a4f5f0730f1d3e9916b5c1da73cf891cab3fba 100644 (file)
@@ -60,6 +60,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                        print_to(self, "^7Object properties for ^2edit_object^7:");
                        print_to(self, "^3skin ^7- changes the skin of the object");
                        print_to(self, "^3frame ^7- object animation frame, for self-animated models");
+                       print_to(self, "^3physics ^7- object physics, 0 = static, 1 = movable, 2 = physical");
                        print_to(self, "^7The ^1drag object ^7key can be used to grab and carry objects. Players can only grab their own objects");
                        return TRUE;
                }
@@ -189,6 +190,15 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                        e.skin = stof(argv(3));
                                else if(argv(2) == "frame")
                                        e.frame = stof(argv(3));
+                               else if(argv(2) == "physics")
+                               {
+                                       if(argv(3) == "0") // static
+                                               e.movetype = MOVETYPE_NONE;
+                                       else if(argv(3) == "1") // movable
+                                               e.movetype = MOVETYPE_TOSS;
+                                       else if(argv(3) == "2") // physical
+                                               e.movetype = MOVETYPE_PHYSICS;
+                               }
                                else
                                        print_to(self, "WARNING: Invalid object property. For usage information, type 'sandbox help'");