]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
First functionality for the sandbox menu. Allows specifying the model in an input...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 25 Oct 2011 12:55:39 +0000 (15:55 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 25 Oct 2011 12:55:39 +0000 (15:55 +0300)
defaultXonotic.cfg
qcsrc/menu/xonotic/dialog_sandboxtools.c

index 7ae4c6678859b17494411a88ed5a7bc7b89d5251..2fd8df062fdc2287a823d5c441a5c639b106aa24 100644 (file)
@@ -546,6 +546,8 @@ set g_sandbox_info 1 "print non-critical information to the server"
 set g_sandbox_editor_distance_spawn 200 "distance at which objects spawn in front of the player"
 set g_sandbox_editor_distance_edit 350 "distance at which players can edit or remove objects they are looking at"
 
+set menu_sandbox_spawn_model "" // used to store the model in the input field
+
 alias menu_showsandboxtools "menu_cmd directmenu SandboxTools"
 bind f7 menu_showsandboxtools
 
index 86e32ad5c5d8de6b7144cceb65bced36faddba3c..bf55814374cc25e75e3c4fd6224acfd9c394aa5d 100644 (file)
@@ -3,8 +3,8 @@ CLASS(XonoticSandboxToolsDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticSandboxToolsDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
        ATTRIB(XonoticSandboxToolsDialog, title, string, _("Sandbox Tools")) // ;)
        ATTRIB(XonoticSandboxToolsDialog, color, vector, SKINCOLOR_DIALOG_SANDBOXTOOLS)
-       ATTRIB(XonoticSandboxToolsDialog, intendedWidth, float, 0.4)
-       ATTRIB(XonoticSandboxToolsDialog, rows, float, 5)
+       ATTRIB(XonoticSandboxToolsDialog, intendedWidth, float, 0.8)
+       ATTRIB(XonoticSandboxToolsDialog, rows, float, 20)
        ATTRIB(XonoticSandboxToolsDialog, columns, float, 4)
        ATTRIB(XonoticSandboxToolsDialog, name, string, "SandboxTools")
 ENDCLASS(XonoticSandboxToolsDialog)
@@ -13,7 +13,16 @@ ENDCLASS(XonoticSandboxToolsDialog)
 #ifdef IMPLEMENTATION
 void XonoticSandboxToolsDialog_fill(entity me)
 {
-       entity e;
+       entity e, box;
+
+       me.TR(me);
+               me.TD(me, 1, 0.25, e = makeXonoticTextLabel(0, _("Model:")));
+               me.TD(me, 1, 2.0, box = makeXonoticInputBox(1, "menu_sandbox_spawn_model"));
+                       box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
+                       box.maxLength = -127; // negative means encoded length in bytes
+                       box.saveImmediately = 1;
+       me.TDempty(me, 0.2);
+               me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Spawn"), '0 0 0', "sandbox spawn_object $menu_sandbox_spawn_model", 0));
 
        me.gotoRC(me, me.rows - 1, 0);
                me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));