#include "xonotic/dialog_singleplayer_winner.c"
#include "xonotic/dialog_credits.c"
#include "xonotic/credits.c"
+#include "xonotic/dialog_multiplayer_playersetup_hudconfirm.c"
#include "xonotic/dialog_multiplayer_playersetup_view.c"
#include "xonotic/dialog_multiplayer_playersetup_weapons.c"
#include "xonotic/weaponslist.c"
SKINVECTOR(COLOR_DIALOG_VIEW, '1 0.7 0.7');
SKINVECTOR(COLOR_DIALOG_SERVERINFO, '0.7 0.7 1');
SKINVECTOR(COLOR_DIALOG_CVARS, '1 0 0');
+ SKINVECTOR(COLOR_DIALOG_HUDCONFIRM, '1 0 0');
// nexposee positions of windows (they are the scale transformation
// centers, NOT the actual positions of the windows!)
ATTRIB(XonoticPlayerSettingsTab, playerNameLabelAlpha, float, 0)
ENDCLASS(XonoticPlayerSettingsTab)
entity makeXonoticPlayerSettingsTab();
-
-void HUDSetup_Join_Click(entity me, entity btn);
+void HUDSetup_Start(entity me, entity btn);
#endif
#ifdef IMPLEMENTATION
-
+void HUDSetup_Check_Gamestatus(entity me, entity btn)
+{
+ if not(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)) // we're not in a match, ask the player if they want to start one anyway
+ {
+ DialogOpenButton_Click(btn, main.hudconfirmDialog);
+ }
+ else // already in a match, lets just cut to the point and open up the hud editor directly
+ {
+ HUDSetup_Start(me, btn);
+ }
+}
entity makeXonoticPlayerSettingsTab()
{
entity me;
me.TR(me);
me.TDempty(me, 0.5);
me.TD(me, 1, 2, e = makeXonoticButton(_("Other crosshair settings"), '0 0 0'));
- e.onClick = HUDSetup_Join_Click;
+ e.onClick = HUDSetup_Start;
e.onClickEntity = me;
setDependent(e, "crosshair_enabled", 1, 2);
// TODO: show status of crosshair dot and hittest and pickups and such here with text
me.TR(me);
me.TDempty(me, 0.5);
me.TD(me, 1, 2, e = makeXonoticButton(_("Model settings"), '0 0 0'));
- e.onClick = HUDSetup_Join_Click;
+ e.onClick = HUDSetup_Start;
e.onClickEntity = me;
// TODO: show csqc model settings like forcemyplayer and deglowing/ghosting bodies with text here
me.TR(me);
me.TR(me);
me.TDempty(me, 0.5);
me.TD(me, 1, 2, e = makeXonoticButton(_("HUD settings"), '0 0 0'));
- if not(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))
- {
- e.onClick = DialogOpenButton_Click;
- e.onClickEntity = main.weaponsDialog;
- }
- else
- {
- e.onClick = HUDSetup_Join_Click;
+ e.onClick = HUDSetup_Check_Gamestatus;
e.onClickEntity = me;
- }
// TODO: show hud config name with text here
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "color -1 -1;name \"$_cl_name\";cl_cmd sendcvar cl_weaponpriority;sendcvar cl_zoomfactor;sendcvar cl_zoomspeed;sendcvar cl_autoswitch;sendcvar cl_forceplayermodelsfromxonotic;sendcvar cl_forceplayermodels;playermodel $_cl_playermodel;playerskin $_cl_playerskin", COMMANDBUTTON_APPLY));
}
-void HUDSetup_Join_Click(entity me, entity btn)
-{
- localcmd("togglemenu 0\n");
- localcmd("_hud_configure 1", "\n");
-}
#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDConfirmDialog) EXTENDS(XonoticDialog)
+ METHOD(XonoticHUDConfirmDialog, fill, void(entity))
+ ATTRIB(XonoticHUDConfirmDialog, title, string, _("Enter HUD editor"))
+ ATTRIB(XonoticHUDConfirmDialog, color, vector, SKINCOLOR_DIALOG_HUDCONFIRM)
+ ATTRIB(XonoticHUDConfirmDialog, intendedWidth, float, 0.5)
+ ATTRIB(XonoticHUDConfirmDialog, rows, float, 4)
+ ATTRIB(XonoticHUDConfirmDialog, columns, float, 2)
+ENDCLASS(XonoticHUDConfirmDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void HUDSetup_Start(entity me, entity btn)
+{
+ if not(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))
+ localcmd("map hudsetup/hudsetup", "\n");
+ else
+ localcmd("togglemenu 0\n");
+
+ localcmd("_hud_configure 1", "\n");
+}
+
+void XonoticHUDConfirmDialog_fill(entity me)
+{
+ entity e;
+
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("In order for the HUD editor to show, you must first be in game.")));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("Do you wish to start a local game to set up the HUD?")));
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 1, e = makeXonoticButton(_("Yes"), '1 0 0'));
+ e.onClick = HUDSetup_Start;
+ e.onClickEntity = me;
+ me.TD(me, 1, 1, e = makeXonoticButton(_("No"), '0 1 0'));
+ e.onClick = Dialog_Close;
+ e.onClickEntity = me;
+}
+#endif
ATTRIB(MainWindow, serverInfoDialog, entity, NULL)
ATTRIB(MainWindow, cvarsDialog, entity, NULL)
ATTRIB(MainWindow, viewDialog, entity, NULL)
+ ATTRIB(MainWindow, hudconfirmDialog, entity, NULL)
ATTRIB(MainWindow, mainNexposee, entity, NULL)
ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
ATTRIB(MainWindow, dialogToShow, entity, NULL)
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
me.advancedDialog = i = spawnXonoticAdvancedDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);