Skip to content

Commit 740a3e6

Browse files
committed
#1944 added missing exit button connections to menus
1 parent 8175549 commit 740a3e6

File tree

8 files changed

+65
-0
lines changed

8 files changed

+65
-0
lines changed

objects/dialogs/ingame/coinfodialog.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,21 @@ COInfoDialog::COInfoDialog(spCO pCO, spPlayer pPlayer,
7777
m_pPanel->addItem(m_COInfo);
7878
showCO();
7979
connect(this, &COInfoDialog::quit, this, &COInfoDialog::remove, Qt::QueuedConnection);
80+
connect(Mainapp::getInstance(), &Mainapp::sigKeyDown, this, &COInfoDialog::keyInput, Qt::QueuedConnection);
81+
}
82+
83+
void COInfoDialog::keyInput(oxygine::KeyEvent event)
84+
{
85+
if (!event.getContinousPress())
86+
{
87+
// for debugging
88+
Qt::Key cur = event.getKey();
89+
if (cur == Settings::getInstance()->getKey_cancel() ||
90+
cur == Settings::getInstance()->getKey_cancel2())
91+
{
92+
emit quit();
93+
}
94+
}
8095
}
8196

8297
void COInfoDialog::remove()

objects/dialogs/ingame/coinfodialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public slots:
3636
void slotBack();
3737
private slots:
3838
void remove();
39+
void keyInput(oxygine::KeyEvent event);
3940
private:
4041
oxygine::spButton m_NextButton;
4142
oxygine::spButton m_QuitButton;

objects/dialogs/ingame/dialogattacklog.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,21 @@ DialogAttackLog::DialogAttackLog(GameMap* pMap, Player* pPlayer)
268268

269269
connect(this, &DialogAttackLog::sigShowAttack, this, &DialogAttackLog::showAttack, Qt::QueuedConnection);
270270
connect(this, &DialogAttackLog::sigFinished, this, &DialogAttackLog::remove, Qt::QueuedConnection);
271+
connect(Mainapp::getInstance(), &Mainapp::sigKeyDown, this, &DialogAttackLog::keyInput, Qt::QueuedConnection);
272+
}
273+
274+
void DialogAttackLog::keyInput(oxygine::KeyEvent event)
275+
{
276+
if (!event.getContinousPress())
277+
{
278+
// for debugging
279+
Qt::Key cur = event.getKey();
280+
if (cur == Settings::getInstance()->getKey_cancel() ||
281+
cur == Settings::getInstance()->getKey_cancel2())
282+
{
283+
emit sigFinished();
284+
}
285+
}
271286
}
272287

273288
void DialogAttackLog::remove()

objects/dialogs/ingame/dialogattacklog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public slots:
2828
void showAttack(qint32 posAtkX, qint32 posAtkY, qint32 playerAtk, qint32 posDefX, qint32 posDefY, qint32 playerDef);
2929
private slots:
3030
void remove();
31+
void keyInput(oxygine::KeyEvent event);
3132
private:
3233
QVector<spAttackReport> m_Log;
3334
Player* m_pPlayer{nullptr};

objects/dialogs/ingame/dialogunitinfo.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,21 @@ DialogUnitInfo::DialogUnitInfo(Player* pPlayer)
170170

171171
connect(this, &DialogUnitInfo::sigMoveToUnit, this, &DialogUnitInfo::moveToUnit, Qt::QueuedConnection);
172172
connect(this, &DialogUnitInfo::sigFinished, this, &DialogUnitInfo::remove, Qt::QueuedConnection);
173+
connect(Mainapp::getInstance(), &Mainapp::sigKeyDown, this, &DialogUnitInfo::keyInput, Qt::QueuedConnection);
174+
}
175+
176+
void DialogUnitInfo::keyInput(oxygine::KeyEvent event)
177+
{
178+
if (!event.getContinousPress())
179+
{
180+
// for debugging
181+
Qt::Key cur = event.getKey();
182+
if (cur == Settings::getInstance()->getKey_cancel() ||
183+
cur == Settings::getInstance()->getKey_cancel2())
184+
{
185+
emit sigFinished();
186+
}
187+
}
173188
}
174189

175190
void DialogUnitInfo::remove()

objects/dialogs/ingame/dialogunitinfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public slots:
2424
void moveToUnit(qint32 posX, qint32 posY);
2525
private slots:
2626
void remove();
27+
void keyInput(oxygine::KeyEvent event);
2728
private:
2829
Player* m_pPlayer{nullptr};
2930
};

objects/dialogs/ingame/dialogvictoryconditions.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,21 @@ DialogVictoryConditions::DialogVictoryConditions(GameMap* pMap)
141141
pPanel->setContentHeigth(y + 40);
142142
connect(this, &DialogVictoryConditions::sigShowPopup, this, &DialogVictoryConditions::showPopup, Qt::QueuedConnection);
143143
connect(this, &DialogVictoryConditions::sigFinished, this, &DialogVictoryConditions::remove, Qt::QueuedConnection);
144+
connect(Mainapp::getInstance(), &Mainapp::sigKeyDown, this, &DialogVictoryConditions::keyInput, Qt::QueuedConnection);
145+
}
146+
147+
void DialogVictoryConditions::keyInput(oxygine::KeyEvent event)
148+
{
149+
if (!event.getContinousPress())
150+
{
151+
// for debugging
152+
Qt::Key cur = event.getKey();
153+
if (cur == Settings::getInstance()->getKey_cancel() ||
154+
cur == Settings::getInstance()->getKey_cancel2())
155+
{
156+
emit sigFinished();
157+
}
158+
}
144159
}
145160

146161
void DialogVictoryConditions::remove()
@@ -161,3 +176,4 @@ void DialogVictoryConditions::showPopup(QString rule)
161176
}
162177
}
163178
}
179+

objects/dialogs/ingame/dialogvictoryconditions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class DialogVictoryConditions final : public QObject, public oxygine::Actor
2222
void sigShowPopup(QString rule);
2323
protected slots:
2424
void showPopup(QString rule);
25+
void keyInput(oxygine::KeyEvent event);
2526
void remove();
2627
private:
2728
oxygine::spButton m_OkButton;

0 commit comments

Comments
 (0)