#include <menu/xonotic/dialog_settings_game_weapons.qc>
#include <menu/xonotic/dialog_settings_input.qc>
#include <menu/xonotic/dialog_settings_input_userbind.qc>
+#include <menu/xonotic/dialog_settings_bindings_reset.qc>
#include <menu/xonotic/dialog_settings_misc.qc>
#include <menu/xonotic/dialog_settings_misc_cvars.qc>
#include <menu/xonotic/dialog_settings_misc_reset.qc>
#include <menu/xonotic/dialog_settings_game_weapons.qh>
#include <menu/xonotic/dialog_settings_input.qh>
#include <menu/xonotic/dialog_settings_input_userbind.qh>
+#include <menu/xonotic/dialog_settings_bindings_reset.qh>
#include <menu/xonotic/dialog_settings_misc.qh>
#include <menu/xonotic/dialog_settings_misc_cvars.qh>
#include <menu/xonotic/dialog_settings_misc_reset.qh>
--- /dev/null
+#include "dialog_settings_bindings_reset.qh"
+
+#include "textlabel.qh"
+#include "commandbutton.qh"
+#include "button.qh"
+#include "keybinder.qh"
+
+void XonoticBindingsResetDialog_fill(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TD(me, 1, 2, makeXonoticTextLabel(0.5, _("Are you sure you want to reset all keybindings?")));
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 1, e = makeXonoticButton(_("Yes"), '1 0 0'));
+ e.onClick = KeyBinder_Bind_Reset_All;
+ e.onClickEntity = me;
+ me.TD(me, 1, 1, e = makeXonoticButton(_("No"), '0 1 0'));
+ e.onClick = Dialog_Close;
+ e.onClickEntity = me;
+}
--- /dev/null
+#pragma once
+
+#include "dialog.qh"
+CLASS(XonoticBindingsResetDialog, XonoticDialog)
+ METHOD(XonoticBindingsResetDialog, fill, void(entity));
+ ATTRIB(XonoticBindingsResetDialog, title, string, _("Reset bindings"));
+ ATTRIB(XonoticBindingsResetDialog, color, vector, SKINCOLOR_DIALOG_QUIT);
+ ATTRIB(XonoticBindingsResetDialog, intendedWidth, float, 0.5);
+ ATTRIB(XonoticBindingsResetDialog, rows, float, 3);
+ ATTRIB(XonoticBindingsResetDialog, columns, float, 2);
+ ATTRIB(XonoticBindingsResetDialog, name, string, "Reset bindings");
+ENDCLASS(XonoticBindingsResetDialog)
kb.clearButton = e;
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticButton(_("Reset all"), '0 0 0'));
- e.onClick = KeyBinder_Bind_Reset_All;
- e.onClickEntity = kb;
+ e.onClick = DialogOpenButton_Click;
+ e.onClickEntity = main.bindingsResetDialog;
me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Mouse")));
localcmd("exec binds-xonotic.cfg\n");
localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
cvar_set("_hud_showbinds_reload", "1");
+ me.close(me);
}
void XonoticKeyBinder_doubleClickListBoxItem(entity me, float i, vector where)
{
#include "dialog_hudpanel_quickmenu.qh"
#include "dialog_settings_input_userbind.qh"
+#include "dialog_settings_bindings_reset.qh"
#include "dialog_settings_misc_cvars.qh"
#include "dialog_settings_misc_reset.qh"
#include "dialog_settings_user_languagewarning.qh"
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.bindingsResetDialog = i = NEW(XonoticBindingsResetDialog);
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
me.cvarsDialog = i = NEW(XonoticCvarsDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
ATTRIB(MainWindow, mutatorsDialog, entity);
ATTRIB(MainWindow, mapInfoDialog, entity);
ATTRIB(MainWindow, userbindEditDialog, entity);
+ ATTRIB(MainWindow, bindingsResetDialog, entity);
ATTRIB(MainWindow, winnerDialog, entity);
ATTRIB(MainWindow, serverInfoDialog, entity);
ATTRIB(MainWindow, cvarsDialog, entity);