// TODO: Remove cvar_cl_handicap vector after 0.9 release
#ifdef GAMEQC
+REPLICATE_INIT(bool, cvar__menu_forfeit_dialog_available);
REPLICATE_INIT(bool, cvar_cl_autoswitch);
REPLICATE_INIT(int, cvar_cl_autoscreenshot);
REPLICATE_INIT(bool, cvar_cl_clippedspectating);
REPLICATE_INIT(float, cvar_cl_handicap_damage_taken);
REPLICATE_INIT(bool, cvar_cl_noantilag);
REPLICATE_INIT(string, cvar_g_xonoticversion);
+REPLICATE(cvar__menu_forfeit_dialog_available, bool, "_menu_forfeit_dialog_available");
REPLICATE(cvar_cl_autoswitch, bool, "cl_autoswitch");
REPLICATE(cvar_cl_autoscreenshot, int, "cl_autoscreenshot");
REPLICATE(cvar_cl_clippedspectating, bool, "cl_clippedspectating");
#include "commandbutton.qh"
#include "textlabel.qh"
+void XonoticForfeitDialog_destroy(entity me)
+{
+ cvar_set("_menu_forfeit_dialog_available", "0");
+}
+
void XonoticForfeitDialog_fill(entity me)
{
+ registercvar("_menu_forfeit_dialog_available", "0", 0);
+ cvar_set("_menu_forfeit_dialog_available", "1");
+
entity e;
me.TR(me);
me.TD(me, 1, 2, makeXonoticTextLabel(0.5, _("Are you sure you want to observe and quit current match?")));
if (argv(2) == "FORFEIT" || warmup_stage)
caller_wants_to_forfeit = true; // player replied that they want to forfeit
- if (IS_PLAYER(caller) && !caller_wants_to_forfeit)
+ if (IS_PLAYER(caller) && !caller_wants_to_forfeit && caller.cvar__menu_forfeit_dialog_available)
{
// ask player if they want to forfeit
stuffcmd(caller, "menu_showforfeitdialog\n");
if (mutator_returnvalue == MUT_SPECCMD_RETURN_FORFEIT)
{
- if (caller_wants_to_forfeit)
+ if (caller_wants_to_forfeit || !caller.cvar__menu_forfeit_dialog_available)
mutator_returnvalue = MUT_SPECCMD_FORCE;
else
{
- stuffcmd(caller, "menu_showobservedialog\n");
+ stuffcmd(caller, "menu_showforfeitdialog\n");
return;
}
}