e.onClick = DialogOpenButton_Click;
e.onClickEntity = main.cvarsDialog;
me.TR(me);
+ me.TDempty(me, 0.5);
+ me.TD(me, 1, 2, e = makeXonoticButton(_("Factory reset"), '0 0 0'));
+ e.onClick = DialogOpenButton_Click;
+ e.onClickEntity = main.resetDialog;
+ me.TR(me);
}
#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticResetDialog) EXTENDS(XonoticDialog)
+ METHOD(XonoticResetDialog, fill, void(entity))
+ ATTRIB(XonoticResetDialog, title, string, _("Factory reset"))
+ ATTRIB(XonoticResetDialog, color, vector, SKINCOLOR_DIALOG_QUIT)
+ ATTRIB(XonoticResetDialog, intendedWidth, float, 0.5)
+ ATTRIB(XonoticResetDialog, rows, float, 4)
+ ATTRIB(XonoticResetDialog, columns, float, 2)
+ ATTRIB(XonoticResetDialog, name, string, "Factory reset")
+ENDCLASS(XonoticResetDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void XonoticResetDialog_fill(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TD(me, 1, 2, makeXonoticTextLabel(0.5, _("Are you sure you want to reset all settings?")));
+ me.TR(me);
+ me.TD(me, 1, 2, makeXonoticTextLabel(0.5, _("This will create a backup config in your data directory")));
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Yes"), '1 0 0', "saveconfig backup.cfg\n;\n exec defaultXonotic.cfg\n", 0));
+ me.TD(me, 1, 1, e = makeXonoticButton(_("No"), '0 1 0'));
+ e.onClick = Dialog_Close;
+ e.onClickEntity = me;
+}
+#endif
ATTRIB(MainWindow, mainNexposee, entity, NULL)
ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
ATTRIB(MainWindow, dialogToShow, entity, NULL)
+ ATTRIB(MainWindow, resetDialog, entity, NULL)
ENDCLASS(MainWindow)
#endif
me.cvarsDialog = i = spawnXonoticCvarsDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ me.resetDialog = i = spawnXonoticResetDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
me.languageWarningDialog = i = spawnXonoticLanguageWarningDialog();
i.configureDialog(i);