Skip to content

Commit

Permalink
fixes #4692: new configuration option quitConfirmation can skip confi…
Browse files Browse the repository at this point in the history
…rmation dialogue after pressing in-game option buttons "Quit" or "Host Quit" (patch 2/2)
  • Loading branch information
Forgon2100 committed Jan 6, 2018
1 parent 3c27440 commit 2e2c2a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/configuration.cpp
Expand Up @@ -37,6 +37,7 @@
#include "configuration.h" #include "configuration.h"
#include "difficulty.h" #include "difficulty.h"
#include "display3d.h" #include "display3d.h"
#include "ingameop.h"
#include "multiint.h" #include "multiint.h"
#include "multiplay.h" #include "multiplay.h"
#include "radar.h" #include "radar.h"
Expand Down Expand Up @@ -99,6 +100,7 @@ bool loadConfig()
setMiddleClickRotate(ini.value("MiddleClickRotate", false).toBool()); setMiddleClickRotate(ini.value("MiddleClickRotate", false).toBool());
rotateRadar = ini.value("rotateRadar", true).toBool(); rotateRadar = ini.value("rotateRadar", true).toBool();
radarRotationArrow = ini.value("radarRotationArrow", true).toBool(); radarRotationArrow = ini.value("radarRotationArrow", true).toBool();
quitConfirmation = ini.value("quitConfirmation", true).toBool();
war_SetPauseOnFocusLoss(ini.value("PauseOnFocusLoss", false).toBool()); war_SetPauseOnFocusLoss(ini.value("PauseOnFocusLoss", false).toBool());
NETsetMasterserverName(ini.value("masterserver_name", "lobby.wz2100.net").toString().toUtf8().constData()); NETsetMasterserverName(ini.value("masterserver_name", "lobby.wz2100.net").toString().toUtf8().constData());
iV_font(ini.value("fontname", "DejaVu Sans").toString().toUtf8().constData(), iV_font(ini.value("fontname", "DejaVu Sans").toString().toUtf8().constData(),
Expand Down Expand Up @@ -222,6 +224,7 @@ bool saveConfig()
ini.setValue("UPnP", (SDWORD)NetPlay.isUPNP); ini.setValue("UPnP", (SDWORD)NetPlay.isUPNP);
ini.setValue("rotateRadar", rotateRadar); ini.setValue("rotateRadar", rotateRadar);
ini.setValue("radarRotationArrow", radarRotationArrow); ini.setValue("radarRotationArrow", radarRotationArrow);
ini.setValue("quitConfirmation", quitConfirmation);
ini.setValue("PauseOnFocusLoss", war_GetPauseOnFocusLoss()); ini.setValue("PauseOnFocusLoss", war_GetPauseOnFocusLoss());
ini.setValue("masterserver_name", NETgetMasterserverName()); ini.setValue("masterserver_name", NETgetMasterserverName());
ini.setValue("masterserver_port", NETgetMasterserverPort()); ini.setValue("masterserver_port", NETgetMasterserverPort());
Expand Down
5 changes: 3 additions & 2 deletions src/ingameop.cpp
Expand Up @@ -53,6 +53,7 @@
#include "main.h" #include "main.h"
#include "warzoneconfig.h" #include "warzoneconfig.h"


bool quitConfirmation;


bool InGameOpUp = false; bool InGameOpUp = false;
bool isInGamePopupUp = false; bool isInGamePopupUp = false;
Expand Down Expand Up @@ -207,11 +208,11 @@ static bool _intAddInGameOptions()
// add 'quit' text // add 'quit' text
if (NetPlay.isHost && bMultiPlayer && NetPlay.bComms) 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 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' // add 'resume'
Expand Down
2 changes: 2 additions & 0 deletions src/ingameop.h
Expand Up @@ -32,6 +32,8 @@ bool intRunInGameOptions();
void intProcessInGameOptions(UDWORD); void intProcessInGameOptions(UDWORD);
void intAddInGamePopup(); void intAddInGamePopup();


extern bool quitConfirmation;

// status bools. // status bools.
extern bool InGameOpUp; extern bool InGameOpUp;
extern bool isInGamePopupUp; extern bool isInGamePopupUp;
Expand Down

0 comments on commit 2e2c2a8

Please sign in to comment.