From: Mircea Kitsune Date: Thu, 27 Oct 2011 20:01:25 +0000 (+0300) Subject: Allow the menu to specify material as a text string X-Git-Tag: xonotic-v0.6.0~35^2~18^2~104 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3b7d3b8d4d62b04d3477003941b8d2890755f899;p=xonotic%2Fxonotic-data.pk3dir.git Allow the menu to specify material as a text string --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 331b421b2..0f6827eab 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -562,7 +562,7 @@ seta menu_sandbox_edit_frame 0 seta menu_sandbox_edit_scale 1 seta menu_sandbox_edit_physics 1 seta menu_sandbox_edit_force 1 -seta menu_sandbox_edit_material 0 +seta menu_sandbox_edit_material "" 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 a8f0e6a29..320eaa800 100644 --- a/qcsrc/menu/xonotic/dialog_sandboxtools.c +++ b/qcsrc/menu/xonotic/dialog_sandboxtools.c @@ -58,13 +58,20 @@ void XonoticSandboxToolsDialog_fill(entity me) me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Physical object properties for *:"))); me.TR(me); me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set material:"), '0 0 0', "sandbox edit_object material $menu_sandbox_edit_material", 0)); - me.TD(me, 1, 1.5, e = makeXonoticTextSlider("menu_sandbox_edit_material")); + + /*me.TD(me, 1, 1.5, e = makeXonoticTextSlider("menu_sandbox_edit_material")); e.addValue(e, _("none"), "0"); e.addValue(e, _("metal"), "1"); e.addValue(e, _("stone"), "2"); e.addValue(e, _("wood"), "3"); e.addValue(e, _("flesh"), "4"); - e.configureXonoticTextSliderValues(e); + e.configureXonoticTextSliderValues(e);*/ + + me.TD(me, 1, 1.5, box = makeXonoticInputBox(1, "menu_sandbox_edit_material")); + box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved + box.maxLength = -127; // negative means encoded length in bytes + box.saveImmediately = 1; + me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set physics:"), '0 0 0', "sandbox edit_object physics $menu_sandbox_edit_physics", 0)); me.TD(me, 1, 0.5, e = makeXonoticRadioButton(1, "menu_sandbox_edit_physics", "0", _("Static"))); me.TD(me, 1, 0.5, e = makeXonoticRadioButton(1, "menu_sandbox_edit_physics", "1", _("Movable")));