Commit 31bff4b 1 parent 8e6a5bb commit 31bff4b Copy full SHA for 31bff4b
File tree 5 files changed +9
-6
lines changed
5 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,12 @@ GameState::~GameState()
89
89
}
90
90
91
91
92
+ GameState::ReturnToMainMenuDelegate GameState::onReturnToMainMenuDelegate ()
93
+ {
94
+ return {&mMapViewState , &MapViewState::onGameOver};
95
+ }
96
+
97
+
92
98
void GameState::initializeGameState ()
93
99
{
94
100
mMainReportsState .initialize ();
Original file line number Diff line number Diff line change @@ -251,8 +251,6 @@ MapViewState::~MapViewState()
251
251
eventHandler.windowResized ().disconnect ({this , &MapViewState::onWindowResized});
252
252
253
253
NAS2D::Utility<std::map<class MineFacility *, Route>>::get ().clear ();
254
-
255
- mGameOptionsDialog .returnToMainMenuButtonSignal ().disconnect ({this , &MapViewState::onGameOver});
256
254
}
257
255
258
256
Original file line number Diff line number Diff line change @@ -130,6 +130,8 @@ class MapViewState : public Wrapper
130
130
131
131
void save (const std::string& filePath);
132
132
133
+ void onGameOver ();
134
+
133
135
private:
134
136
void onDeactivate () override ;
135
137
void onActivate () override ;
@@ -269,8 +271,6 @@ class MapViewState : public Wrapper
269
271
270
272
void onNotificationClicked (const NotificationArea::Notification&);
271
273
272
- void onGameOver ();
273
-
274
274
void onStructuresSelectionChange (const IconGrid::Item*);
275
275
void onConnectionsSelectionChange (const IconGrid::Item*);
276
276
void onRobotsSelectionChange (const IconGrid::Item*);
Original file line number Diff line number Diff line change @@ -85,8 +85,6 @@ void MapViewState::initUi()
85
85
mGameOverDialog .returnToMainMenu ().connect ({this , &MapViewState::onGameOver});
86
86
mGameOverDialog .hide ();
87
87
88
- mGameOptionsDialog .returnToMainMenuButtonSignal ().connect ({this , &MapViewState::onGameOver});
89
-
90
88
mAnnouncement .hide ();
91
89
mMineOperationsWindow .hide ();
92
90
mWarehouseInspector .hide ();
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ GameViewContainer::GameViewContainer(GameState& gameState) :
11
11
12
12
mGameOptionsDialog .saveGameDialogButtonSignal ().connect ({this , &GameViewContainer::showSaveDialog});
13
13
mGameOptionsDialog .loadGameDialogButtonSignal ().connect ({this , &GameViewContainer::showLoadDialog});
14
+ mGameOptionsDialog .returnToMainMenuButtonSignal ().connect (gameState.onReturnToMainMenuDelegate ());
14
15
15
16
mFileIoDialog .hide ();
16
17
mFileIoDialog .anchored (true );
You can’t perform that action at this time.
0 commit comments