From: Mircea Kitsune Date: Tue, 25 Oct 2011 21:07:13 +0000 (+0300) Subject: Allow editing of object physics X-Git-Tag: xonotic-v0.6.0~35^2~18^2~165 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cbd124a746d7ef40d830655369a0d8d08eb4de9c;p=xonotic%2Fxonotic-data.pk3dir.git Allow editing of object physics --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 75eef67c7..424d82d9a 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -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 diff --git a/qcsrc/menu/xonotic/dialog_sandboxtools.c b/qcsrc/menu/xonotic/dialog_sandboxtools.c index 8291b2a73..2bcc714e2 100644 --- a/qcsrc/menu/xonotic/dialog_sandboxtools.c +++ b/qcsrc/menu/xonotic/dialog_sandboxtools.c @@ -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')); diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index ef97f3692..50a4f5f07 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -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'");