2 CLASS(XonoticSandboxToolsDialog) EXTENDS(XonoticRootDialog)
3 METHOD(XonoticSandboxToolsDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
4 ATTRIB(XonoticSandboxToolsDialog, title, string, _("Sandbox Tools")) // ;)
5 ATTRIB(XonoticSandboxToolsDialog, color, vector, SKINCOLOR_DIALOG_SANDBOXTOOLS)
6 ATTRIB(XonoticSandboxToolsDialog, intendedWidth, float, 0.8)
7 ATTRIB(XonoticSandboxToolsDialog, rows, float, 15)
8 ATTRIB(XonoticSandboxToolsDialog, columns, float, 4)
9 ATTRIB(XonoticSandboxToolsDialog, name, string, "SandboxTools")
10 ENDCLASS(XonoticSandboxToolsDialog)
14 void XonoticSandboxToolsDialog_fill(entity me)
19 me.TD(me, 1, 0.25, e = makeXonoticTextLabel(0, _("Model:")));
20 me.TD(me, 1, 1.5, box = makeXonoticInputBox(1, "menu_sandbox_spawn_model"));
21 box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
22 box.maxLength = -127; // negative means encoded length in bytes
23 box.saveImmediately = 1;
24 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Spawn"), '0 0 0', "sandbox object_spawn \"$menu_sandbox_spawn_model\"", 0));
25 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Remove *"), '0 0 0', "sandbox object_remove", 0));
27 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Copy *"), '0 0 0', "sandbox object_duplicate copy cl_sandbox_clipboard", 0));
28 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Paste"), '0 0 0', "sandbox object_duplicate paste \"$cl_sandbox_clipboard\"", 0));
30 me.TD(me, 1, 0.25, e = makeXonoticTextLabel(0, _("Bone:")));
31 me.TD(me, 1, 1.5, box = makeXonoticInputBox(1, "menu_sandbox_attach_bone"));
32 box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
33 box.maxLength = -127; // negative means encoded length in bytes
34 box.saveImmediately = 1;
35 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set * as child"), '0 0 0', "sandbox object_attach get", 0));
36 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Attach to *"), '0 0 0', "sandbox object_attach set \"$menu_sandbox_attach_bone\"", 0));
38 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Detach from *"), '0 0 0', "sandbox object_attach remove", 0));
41 me.TD(me, 1, 1.5, e = makeXonoticTextLabel(0, _("Visual object properties for *:")));
43 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set skin:"), '0 0 0', "sandbox object_edit skin $menu_sandbox_edit_skin", 0));
44 me.TD(me, 1, 1.5, e = makeXonoticSlider(0, 99, 1, "menu_sandbox_edit_skin"));
45 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set alpha:"), '0 0 0', "sandbox object_edit alpha $menu_sandbox_edit_alpha", 0));
46 me.TD(me, 1, 1.5, e = makeXonoticSlider(0.1, 1, 0.05, "menu_sandbox_edit_alpha"));
48 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set color main:"), '0 0 0', "sandbox object_edit color_main \"$menu_sandbox_edit_color_main\"", 0));
49 me.TD(me, 2, 1.5, e = makeXonoticColorpickerString("menu_sandbox_edit_color_main", "menu_sandbox_edit_color_main"));
50 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set color glow:"), '0 0 0', "sandbox object_edit color_glow \"$menu_sandbox_edit_color_glow\"", 0));
51 me.TD(me, 2, 1.5, e = makeXonoticColorpickerString("menu_sandbox_edit_color_glow", "menu_sandbox_edit_color_glow"));
54 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set frame:"), '0 0 0', "sandbox object_edit frame $menu_sandbox_edit_frame", 0));
55 me.TD(me, 1, 1.5, e = makeXonoticSlider(0, 99, 1, "menu_sandbox_edit_frame"));
58 me.TD(me, 1, 1.5, e = makeXonoticTextLabel(0, _("Physical object properties for *:")));
60 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set material:"), '0 0 0', "sandbox object_edit material \"$menu_sandbox_edit_material\"", 0));
61 me.TD(me, 1, 1.5, box = makeXonoticInputBox(1, "menu_sandbox_edit_material"));
62 box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
63 box.maxLength = -127; // negative means encoded length in bytes
64 box.saveImmediately = 1;
65 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set physics:"), '0 0 0', "sandbox object_edit physics $menu_sandbox_edit_physics", 0));
66 me.TD(me, 1, 0.5, e = makeXonoticRadioButton(1, "menu_sandbox_edit_physics", "0", _("Static")));
67 me.TD(me, 1, 0.5, e = makeXonoticRadioButton(1, "menu_sandbox_edit_physics", "1", _("Movable")));
68 me.TD(me, 1, 0.5, e = makeXonoticRadioButton(1, "menu_sandbox_edit_physics", "2", _("Physical")));
70 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set scale:"), '0 0 0', "sandbox object_edit scale $menu_sandbox_edit_scale", 0));
71 me.TD(me, 1, 1.5, e = makeXonoticSlider(0.5, 2, 0.05, "menu_sandbox_edit_scale"));
72 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set force:"), '0 0 0', "sandbox object_edit force $menu_sandbox_edit_force", 0));
73 me.TD(me, 1, 1.5, e = makeXonoticSlider(0, 10, 0.5, "menu_sandbox_edit_force"));
76 me.TD(me, 1, 1.5, e = makeXonoticTextLabel(0, _("* is the object you are facing")));
77 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Show help"), '1 0 0', "sandbox help; toggleconsole", 0));
79 me.gotoRC(me, me.rows - 1, 0);
80 me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
81 e.onClick = Dialog_Close;
86 /* Click. The c-word is here so you can grep for it :-) */