]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_sandboxtools.qc
Merge branch 'terencehill/obsolete_cvars_removal' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_sandboxtools.qc
1 #ifndef DIALOG_SANDBOXTOOLS_H
2 #define DIALOG_SANDBOXTOOLS_H
3 #include "rootdialog.qc"
4 CLASS(XonoticSandboxToolsDialog, XonoticRootDialog)
5         METHOD(XonoticSandboxToolsDialog, fill, void(entity)); // to be overridden by user to fill the dialog with controls
6         ATTRIB(XonoticSandboxToolsDialog, title, string, _("Sandbox Tools")) // ;)
7         ATTRIB(XonoticSandboxToolsDialog, color, vector, SKINCOLOR_DIALOG_SANDBOXTOOLS)
8         ATTRIB(XonoticSandboxToolsDialog, intendedWidth, float, 0.8)
9         ATTRIB(XonoticSandboxToolsDialog, rows, float, 16)
10         ATTRIB(XonoticSandboxToolsDialog, columns, float, 4)
11         ATTRIB(XonoticSandboxToolsDialog, name, string, "SandboxTools")
12         ATTRIB(XonoticSandboxToolsDialog, requiresConnection, float, true)
13 ENDCLASS(XonoticSandboxToolsDialog)
14 #endif
15
16 #ifdef IMPLEMENTATION
17 void XonoticSandboxToolsDialog_fill(entity me)
18 {
19         entity e, box;
20
21         me.TR(me);
22                 me.TD(me, 1, 0.25, e = makeXonoticTextLabel(0, _("Model:")));
23                 me.TD(me, 1, 1.5, box = makeXonoticInputBox(1, "menu_sandbox_spawn_model"));
24                         box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
25                         box.maxLength = -127; // negative means encoded length in bytes
26                         box.saveImmediately = 1;
27                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Spawn"), '0 0 0', "sandbox object_spawn \"$menu_sandbox_spawn_model\"", 0));
28                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Remove *"), '0 0 0', "sandbox object_remove", 0));
29         me.TDempty(me, 0.1);
30                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Copy *"), '0 0 0', "sandbox object_duplicate copy cl_sandbox_clipboard", 0));
31                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Paste"), '0 0 0', "sandbox object_duplicate paste \"$cl_sandbox_clipboard\"", 0));
32         me.TR(me);
33                 me.TD(me, 1, 0.25, e = makeXonoticTextLabel(0, _("Bone:")));
34                 me.TD(me, 1, 1.5, box = makeXonoticInputBox(1, "menu_sandbox_attach_bone"));
35                         box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
36                         box.maxLength = -127; // negative means encoded length in bytes
37                         box.saveImmediately = 1;
38                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Set * as child"), '0 0 0', "sandbox object_attach get", 0));
39                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Attach to *"), '0 0 0', "sandbox object_attach set \"$menu_sandbox_attach_bone\"", 0));
40         me.TDempty(me, 0.1);
41                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Detach from *"), '0 0 0', "sandbox object_attach remove", 0));
42         me.TR(me);
43         me.TR(me);
44         me.TD(me, 1, 1.5, e = makeXonoticTextLabel(0, _("Visual object properties for *:")));
45         me.TR(me);
46                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Set skin:"), '0 0 0', "sandbox object_edit skin $menu_sandbox_edit_skin", 0));
47                 me.TD(me, 1, 1.5, e = makeXonoticSlider(0, 99, 1, "menu_sandbox_edit_skin"));
48                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Set alpha:"), '0 0 0', "sandbox object_edit alpha $menu_sandbox_edit_alpha", 0));
49                 me.TD(me, 1, 1.5, e = makeXonoticSlider(0.1, 1, 0.05, "menu_sandbox_edit_alpha"));
50         me.TR(me);
51                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Set color main:"), '0 0 0', "sandbox object_edit color_main \"$menu_sandbox_edit_color_main\"", 0));
52                 me.TD(me, 2, 1.5, e = makeXonoticColorpickerString("menu_sandbox_edit_color_main", "menu_sandbox_edit_color_main"));
53                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Set color glow:"), '0 0 0', "sandbox object_edit color_glow \"$menu_sandbox_edit_color_glow\"", 0));
54                 me.TD(me, 2, 1.5, e = makeXonoticColorpickerString("menu_sandbox_edit_color_glow", "menu_sandbox_edit_color_glow"));
55         me.TR(me);
56         me.TR(me);
57                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Set frame:"), '0 0 0', "sandbox object_edit frame $menu_sandbox_edit_frame", 0));
58                 me.TD(me, 1, 1.5, e = makeXonoticSlider(0, 99, 1, "menu_sandbox_edit_frame"));
59         me.TR(me);
60         me.TR(me);
61         me.TD(me, 1, 1.5, e = makeXonoticTextLabel(0, _("Physical object properties for *:")));
62         me.TR(me);
63                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Set material:"), '0 0 0', "sandbox object_edit material \"$menu_sandbox_edit_material\"", 0));
64                 me.TD(me, 1, 1.5, box = makeXonoticInputBox(1, "menu_sandbox_edit_material"));
65                         box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
66                         box.maxLength = -127; // negative means encoded length in bytes
67                         box.saveImmediately = 1;
68         me.TR(me);
69                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Set solidity:"), '0 0 0', "sandbox object_edit solidity $menu_sandbox_edit_solidity", 0));
70                 me.TD(me, 1, 0.75, e = makeXonoticRadioButton(1, "menu_sandbox_edit_solidity", "0", _("Non-solid")));
71                 me.TD(me, 1, 0.75, e = makeXonoticRadioButton(1, "menu_sandbox_edit_solidity", "1", _("Solid")));
72                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Set physics:"), '0 0 0', "sandbox object_edit physics $menu_sandbox_edit_physics", 0));
73                 me.TD(me, 1, 0.5, e = makeXonoticRadioButton(2, "menu_sandbox_edit_physics", "0", _("Static")));
74                 me.TD(me, 1, 0.5, e = makeXonoticRadioButton(2, "menu_sandbox_edit_physics", "1", _("Movable")));
75                 me.TD(me, 1, 0.5, e = makeXonoticRadioButton(2, "menu_sandbox_edit_physics", "2", _("Physical")));
76         me.TR(me);
77                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Set scale:"), '0 0 0', "sandbox object_edit scale $menu_sandbox_edit_scale", 0));
78                 me.TD(me, 1, 1.5, e = makeXonoticSlider(0.25, 2, 0.05, "menu_sandbox_edit_scale"));
79                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Set force:"), '0 0 0', "sandbox object_edit force $menu_sandbox_edit_force", 0));
80                 me.TD(me, 1, 1.5, e = makeXonoticSlider(0, 10, 0.5, "menu_sandbox_edit_force"));
81         me.TR(me);
82         me.TR(me);
83                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Claim *"), '0 0 0', "sandbox object_claim", 0));
84                 me.TDempty(me, 0.5);
85                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("* object info"), '1 1 0.5', "sandbox object_info object; toggleconsole", 0));
86                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("* mesh info"), '1 1 0.5', "sandbox object_info mesh; toggleconsole", 0));
87                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("* attachment info"), '1 1 0.5', "sandbox object_info attachments; toggleconsole", 0));
88                 me.TD(me, 1, 0.5, e = makeXonoticCommandButton(_("Show help"), '1 0.5 0.5', "sandbox help; toggleconsole", 0));
89                 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("* is the object you are facing")));
90
91         me.gotoRC(me, me.rows - 1, 0);
92                 me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
93                         e.onClick = Dialog_Close;
94                         e.onClickEntity = me;
95 }
96 #endif
97
98 /* Click. The c-word is here so you can grep for it :-) */