Permalink
Browse files

fixes #4692: new configuration option quitConfirmation can skip confi…

…rmation dialogue after pressing in-game option buttons "Quit" or "Host Quit" (patch 2/2)
  • Loading branch information...
Forgon2100
Forgon2100 committed Jan 2, 2018
1 parent d58598c commit 8434f02e750d512240e0a962fdd9cf7208f89164
Showing with 8 additions and 2 deletions.
  1. +3 −0 src/configuration.cpp
  2. +3 −2 src/ingameop.cpp
  3. +2 −0 src/ingameop.h
View
@@ -37,6 +37,7 @@
#include "configuration.h"
#include "difficulty.h"
#include "display3d.h"
#include "ingameop.h"
#include "multiint.h"
#include "multiplay.h"
#include "radar.h"
@@ -99,6 +100,7 @@ bool loadConfig()
setMiddleClickRotate(ini.value("MiddleClickRotate", false).toBool());
rotateRadar = ini.value("rotateRadar", true).toBool();
radarRotationArrow = ini.value("radarRotationArrow", true).toBool();
quitConfirmation = ini.value("quitConfirmation", true).toBool();
war_SetPauseOnFocusLoss(ini.value("PauseOnFocusLoss", false).toBool());
NETsetMasterserverName(ini.value("masterserver_name", "lobby.wz2100.net").toString().toUtf8().constData());
iV_font(ini.value("fontname", "DejaVu Sans").toString().toUtf8().constData(),
@@ -222,6 +224,7 @@ bool saveConfig()
ini.setValue("UPnP", (SDWORD)NetPlay.isUPNP);
ini.setValue("rotateRadar", rotateRadar);
ini.setValue("radarRotationArrow", radarRotationArrow);
ini.setValue("quitConfirmation", quitConfirmation);
ini.setValue("PauseOnFocusLoss", war_GetPauseOnFocusLoss());
ini.setValue("masterserver_name", NETgetMasterserverName());
ini.setValue("masterserver_port", NETgetMasterserverPort());
View
@@ -53,6 +53,7 @@
#include "main.h"
#include "warzoneconfig.h"
bool quitConfirmation;
bool InGameOpUp = false;
bool isInGamePopupUp = false;
@@ -207,11 +208,11 @@ static bool _intAddInGameOptions()
// add 'quit' text
if (NetPlay.isHost && bMultiPlayer && NetPlay.bComms)
{
addIGTextButton(INTINGAMEOP_QUIT , INTINGAMEOP_1_X, s ? INTINGAMEOP_3_Y : INTINGAMEOP_5_Y, INTINGAMEOP_OP_W, _("Host Quit"), OPALIGN);
addIGTextButton(quitConfirmation ? INTINGAMEOP_QUIT : INTINGAMEOP_QUIT_CONFIRM, INTINGAMEOP_1_X, s ? INTINGAMEOP_3_Y : INTINGAMEOP_5_Y, INTINGAMEOP_OP_W, _("Host Quit"), OPALIGN);
}
else
{
addIGTextButton(INTINGAMEOP_QUIT, INTINGAMEOP_1_X, s ? INTINGAMEOP_3_Y : INTINGAMEOP_5_Y, INTINGAMEOP_OP_W, _("Quit"), OPALIGN);
addIGTextButton(quitConfirmation ? INTINGAMEOP_QUIT : INTINGAMEOP_QUIT_CONFIRM, INTINGAMEOP_1_X, s ? INTINGAMEOP_3_Y : INTINGAMEOP_5_Y, INTINGAMEOP_OP_W, _("Quit"), OPALIGN);
}
// add 'resume'
View
@@ -32,6 +32,8 @@ bool intRunInGameOptions();
void intProcessInGameOptions(UDWORD);
void intAddInGamePopup();
extern bool quitConfirmation;
// status bools.
extern bool InGameOpUp;
extern bool isInGamePopupUp;

0 comments on commit 8434f02

Please sign in to comment.