#include "hudskinlist.qh"
#include "colorpicker_string.qh"
#include "checkbox.qh"
+#include "mainwindow.qh"
#include "commandbutton.qh"
+void HUDSkinList_Reset_Click(entity me, entity btn)
+{
+ DialogOpenButton_Click(me, main.skinResetDialog);
+}
+
+void XonoticSkinResetDialog_fill(entity me)
+{
+ entity e;
+ if (!hudskinlist)
+ hudskinlist = makeXonoticHUDSkinList();
+
+ me.TR(me);
+ me.TD(me, 1, 2, makeXonoticTextLabel(0.5, _("Are you sure you want to reset your HUD to this skin?")));
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 1, e = makeXonoticButton(_("Yes"), '1 0 0'));
+ e.onClick = SetHUDSkin_Click;
+ e.onClickEntity = hudskinlist;
+ me.TD(me, 1, 1, e = makeXonoticButton(_("No"), '0 1 0'));
+ e.onClick = Dialog_Close;
+ e.onClickEntity = me;
+}
+
void XonoticHUDExitDialog_fill(entity me)
{
entity e;
int i;
- hudskinlist = makeXonoticHUDSkinList();
+ if (!hudskinlist)
+ hudskinlist = makeXonoticHUDSkinList();
me.TR(me);
me.TD(me, 1, 4, makeXonoticHeaderLabel(_("HUD skins")));
e.onClick = HUDSkinList_Refresh_Click;
e.onClickEntity = hudskinlist;
me.TD(me, 1, 2.2, e = makeXonoticButton(_("Set skin"), '0 0 0'));
- e.onClick = SetHUDSkin_Click;
- e.onClickEntity = hudskinlist;
+ e.onClick = HUDSkinList_Reset_Click;
+ e.onClickEntity = me;
me.gotoRC(me, me.rows - 2.5, 0);
me.TD(me, 1, 2, e = makeXonoticButton_T(_("Save current skin"), '0 0 0',
- "Note: HUD skins are saved in data/data/ directory and can be manually renamed/deleted from there"));
+ _("Note: HUD skins are saved in data/data/ directory and can be manually renamed/deleted from there")));
e.onClick = SaveHUDSkin_Click;
e.onClickEntity = hudskinlist;
me.TD(me, 1, 2, e = makeXonoticInputBox(0, string_null));
ATTRIB(XonoticHUDExitDialog, name, string, "HUDExit");
ATTRIB(XonoticHUDExitDialog, requiresConnection, float, true);
ENDCLASS(XonoticHUDExitDialog)
+
+#include "dialog.qh"
+CLASS(XonoticSkinResetDialog, XonoticDialog)
+ METHOD(XonoticSkinResetDialog, fill, void(entity));
+ ATTRIB(XonoticSkinResetDialog, title, string, _("Reset HUD skin"));
+ ATTRIB(XonoticSkinResetDialog, color, vector, SKINCOLOR_DIALOG_QUIT);
+ ATTRIB(XonoticSkinResetDialog, intendedWidth, float, 0.5);
+ ATTRIB(XonoticSkinResetDialog, rows, float, 3);
+ ATTRIB(XonoticSkinResetDialog, columns, float, 2);
+ENDCLASS(XonoticSkinResetDialog)
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.skinResetDialog = i = NEW(XonoticSkinResetDialog);
+ 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, mapInfoDialog, entity);
ATTRIB(MainWindow, userbindEditDialog, entity);
ATTRIB(MainWindow, bindingsResetDialog, entity);
+ ATTRIB(MainWindow, skinResetDialog, entity);
ATTRIB(MainWindow, winnerDialog, entity);
ATTRIB(MainWindow, serverInfoDialog, entity);
ATTRIB(MainWindow, cvarsDialog, entity);