]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow the menu to specify material as a text string
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 27 Oct 2011 20:01:25 +0000 (23:01 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 27 Oct 2011 20:01:25 +0000 (23:01 +0300)
defaultXonotic.cfg
qcsrc/menu/xonotic/dialog_sandboxtools.c

index 331b421b23d1e237be1fcb8be96b85bcbf1c499c..0f6827eabfc53797d7c751b048674c66e764733f 100644 (file)
@@ -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
index a8f0e6a29038937f213a743b7f386393f78f4bcf..320eaa800762d2ca351fa5a95f3283ecdaeb0a8e 100644 (file)
@@ -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")));