From: Mircea Kitsune Date: Tue, 25 Oct 2011 10:24:16 +0000 (+0300) Subject: Sandbox Tools menu. Works just like the Join Team menu, and is binded to F7 by defaul... X-Git-Tag: xonotic-v0.6.0~35^2~18^2~185 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4b07c0c7ea387ce5be64b23ecebe92a80a1c7099;p=xonotic%2Fxonotic-data.pk3dir.git Sandbox Tools menu. Works just like the Join Team menu, and is binded to F7 by default. Currently an empty menu, with sandbox commands to follow. --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index c08de9a36..7ae4c6678 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -546,6 +546,9 @@ 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" +alias menu_showsandboxtools "menu_cmd directmenu SandboxTools" +bind f7 menu_showsandboxtools + set g_playerclip_collisions 1 "0 = disable collision testing against playerclips, might be useful on some defrag maps" set g_botclip_collisions 1 "0 = disable collision testing against botclips, might be useful on some defrag maps" diff --git a/keybinds.txt b/keybinds.txt index 2c89f704b..d7ec276f5 100644 --- a/keybinds.txt +++ b/keybinds.txt @@ -53,6 +53,7 @@ "messagemode2" "team chat" "team_auto" "auto-join team" "menu_showteamselect" "team menu" +"menu_showsandboxtools" "sandbox menu" "spec" "enter spectator mode" "dropweapon" "drop weapon" "+use" "drop key / drop flag" diff --git a/qcsrc/menu/classes.c b/qcsrc/menu/classes.c index 5b7331e37..c0a978047 100644 --- a/qcsrc/menu/classes.c +++ b/qcsrc/menu/classes.c @@ -29,6 +29,7 @@ #include "xonotic/bigcommandbutton.c" #include "xonotic/dialog_firstrun.c" #include "xonotic/dialog_teamselect.c" +#include "xonotic/dialog_sandboxtools.c" #include "xonotic/dialog_settings.c" #include "xonotic/dialog_settings_video.c" #include "xonotic/dialog_settings_effects.c" diff --git a/qcsrc/menu/skin-customizables.inc b/qcsrc/menu/skin-customizables.inc index ca8f4cf8e..e8cfba368 100644 --- a/qcsrc/menu/skin-customizables.inc +++ b/qcsrc/menu/skin-customizables.inc @@ -55,6 +55,7 @@ SKINBEGIN SKINVECTOR(COLOR_DIALOG_MULTIPLAYER, '0.7 0.7 1'); SKINVECTOR(COLOR_DIALOG_SETTINGS, '0.7 0.7 1'); SKINVECTOR(COLOR_DIALOG_TEAMSELECT, '1 1 1'); + SKINVECTOR(COLOR_DIALOG_SANDBOXTOOLS, '1 1 1'); SKINVECTOR(COLOR_DIALOG_QUIT, '1 0 0'); SKINVECTOR(COLOR_DIALOG_ADVANCED, '0.7 0.7 1'); SKINVECTOR(COLOR_DIALOG_MUTATORS, '0.7 0.7 1'); diff --git a/qcsrc/menu/xonotic/dialog_sandboxtools.c b/qcsrc/menu/xonotic/dialog_sandboxtools.c new file mode 100644 index 000000000..86e32ad5c --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_sandboxtools.c @@ -0,0 +1,25 @@ +#ifdef INTERFACE +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, columns, float, 4) + ATTRIB(XonoticSandboxToolsDialog, name, string, "SandboxTools") +ENDCLASS(XonoticSandboxToolsDialog) +#endif + +#ifdef IMPLEMENTATION +void XonoticSandboxToolsDialog_fill(entity me) +{ + entity e; + + me.gotoRC(me, me.rows - 1, 0); + me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0')); + e.onClick = Dialog_Close; + e.onClickEntity = me; +} +#endif + +/* Click. The c-word is here so you can grep for it :-) */ diff --git a/qcsrc/menu/xonotic/mainwindow.c b/qcsrc/menu/xonotic/mainwindow.c index 55d496047..20627c7a5 100644 --- a/qcsrc/menu/xonotic/mainwindow.c +++ b/qcsrc/menu/xonotic/mainwindow.c @@ -49,6 +49,10 @@ void MainWindow_configureMainWindow(entity me) i = spawnXonoticTeamSelectDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); + + i = spawnXonoticSandboxToolsDialog(); + i.configureDialog(i); + me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); i = spawnXonoticHUDExitDialog(); i.configureDialog(i);