]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_sandboxtools.c
Properly name the color buttons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_sandboxtools.c
1 #ifdef INTERFACE
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, 20)
8         ATTRIB(XonoticSandboxToolsDialog, columns, float, 4)
9         ATTRIB(XonoticSandboxToolsDialog, name, string, "SandboxTools")
10 ENDCLASS(XonoticSandboxToolsDialog)
11 #endif
12
13 #ifdef IMPLEMENTATION
14 void XonoticSandboxToolsDialog_fill(entity me)
15 {
16         entity e, box;
17
18         me.TR(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 spawn_object $menu_sandbox_spawn_model", 0));
25                 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Remove"), '0 0 0', "sandbox remove_object", 0));
26         me.TDempty(me, 0.1);
27                 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Copy"), '0 0 0', "sandbox duplicate_object_copy", 0));
28                 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Paste"), '0 0 0', "sandbox duplicate_object_paste", 0));
29         me.TR(me);
30         me.TR(me);
31         me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Visual object properties:")));
32         me.TR(me);
33                 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set skin:"), '0 0 0', "sandbox edit_object skin $menu_sandbox_edit_skin", 0));
34                 me.TD(me, 1, 1.5, e = makeXonoticSlider(0, 99, 1, "menu_sandbox_edit_skin"));
35                 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set alpha:"), '0 0 0', "sandbox edit_object alpha $menu_sandbox_edit_alpha", 0));
36                 me.TD(me, 1, 1.5, e = makeXonoticSlider(0.1, 1, 0.05, "menu_sandbox_edit_alpha"));
37         me.TR(me);
38                 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set color main:"), '0 0 0', "sandbox edit_object color_main \"$menu_sandbox_edit_color_main\"", 0));
39                 me.TD(me, 2, 1.5, e = makeXonoticColorpickerString("menu_sandbox_edit_color_main", "menu_sandbox_edit_color_main"));
40                 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set color glow:"), '0 0 0', "sandbox edit_object color_glow \"$menu_sandbox_edit_color_glow\"", 0));
41                 me.TD(me, 2, 1.5, e = makeXonoticColorpickerString("menu_sandbox_edit_color_glow", "menu_sandbox_edit_color_glow"));
42         me.TR(me);
43         me.TR(me);
44                 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set frame:"), '0 0 0', "sandbox edit_object frame $menu_sandbox_edit_frame", 0));
45                 me.TD(me, 1, 1.5, e = makeXonoticSlider(0, 99, 1, "menu_sandbox_edit_frame"));
46         me.TR(me);
47         me.TR(me);
48         me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Physical object properties:")));
49         me.TR(me);
50                 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set material:"), '0 0 0', "sandbox edit_object material $menu_sandbox_edit_material", 0));
51                 me.TD(me, 1, 1.5, e = makeXonoticTextSlider("menu_sandbox_edit_material"));
52                         e.addValue(e, _("none"), "0");
53                         e.addValue(e, _("metal"), "1");
54                         e.addValue(e, _("stone"), "2");
55                         e.addValue(e, _("wood"), "3");
56                         e.addValue(e, _("flesh"), "4");
57                         e.configureXonoticTextSliderValues(e);
58                 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set physics:"), '0 0 0', "sandbox edit_object physics $menu_sandbox_edit_physics", 0));
59                 me.TD(me, 1, 0.5, e = makeXonoticRadioButton(1, "menu_sandbox_edit_physics", "0", _("Static")));
60                 me.TD(me, 1, 0.5, e = makeXonoticRadioButton(1, "menu_sandbox_edit_physics", "1", _("Movable")));
61                 me.TD(me, 1, 0.5, e = makeXonoticRadioButton(1, "menu_sandbox_edit_physics", "2", _("Physical")));
62         me.TR(me);
63                 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set scale:"), '0 0 0', "sandbox edit_object scale $menu_sandbox_edit_scale", 0));
64                 me.TD(me, 1, 1.5, e = makeXonoticSlider(0.5, 2, 0.05, "menu_sandbox_edit_scale"));
65                 me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set force:"), '0 0 0', "sandbox edit_object force $menu_sandbox_edit_force", 0));
66                 me.TD(me, 1, 1.5, e = makeXonoticSlider(0, 10, 0.5, "menu_sandbox_edit_force"));
67
68         me.gotoRC(me, me.rows - 1, 0);
69                 me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
70                         e.onClick = Dialog_Close;
71                         e.onClickEntity = me;
72 }
73 #endif
74
75 /* Click. The c-word is here so you can grep for it :-) */