File tree Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,7 @@ void PollSDLEvents() {
245
245
// / Game menus loop.
246
246
// / </summary>
247
247
void RunMenuLoop () {
248
+ g_MenuMan.SetIsInMenuScreen (true );
248
249
g_UInputMan.DisableKeys (false );
249
250
g_UInputMan.TrapMousePos (false );
250
251
@@ -282,6 +283,8 @@ void RunMenuLoop() {
282
283
g_WindowMan.GetScreenBuffer ()->End ();
283
284
g_WindowMan.UploadFrame ();
284
285
}
286
+
287
+ g_MenuMan.SetIsInMenuScreen (false );
285
288
}
286
289
287
290
// / <summary>
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ void MenuMan::Initialize(bool firstTimeInit) {
29
29
m_GUIInput = std::make_unique<GUIInputWrapper>(-1 , g_UInputMan.GetJoystickCount () > 0 );
30
30
31
31
if (firstTimeInit) {
32
+ m_IsInMenuScreen = false ;
32
33
g_LoadingScreen.Create (m_GUIScreen.get (), m_GUIInput.get (), g_SettingsMan.GetLoadingScreenProgressReportDisabled ());
33
34
}
34
35
@@ -129,12 +130,6 @@ void MenuMan::HandleTransitionIntoMenuLoop() {
129
130
}
130
131
131
132
bool MenuMan::Update () {
132
- // If we're in the menu but the activity isn't set as paused, then exit
133
- // This can mismatch sometimes like when loading a saved game
134
- if (m_ActiveMenu != ActiveMenu::MenusDisabled && !g_ActivityMan.ActivityPaused ()) {
135
- return true ;
136
- }
137
-
138
133
m_TitleScreen->Update ();
139
134
SetActiveMenu ();
140
135
Original file line number Diff line number Diff line change @@ -44,6 +44,16 @@ namespace RTE {
44
44
void Draw () const ;
45
45
#pragma endregion
46
46
47
+ #pragma region Getters/Setters
48
+ // / Checks if we're currently in a menu screen.
49
+ // / @return True if in a menu screen; false otherwise.
50
+ bool GetIsInMenuScreen () const { return m_IsInMenuScreen; }
51
+
52
+ // / Sets if we're currently in a menu screen.
53
+ // / @param isInMenuScreen Whether we're in any menu screen.
54
+ void SetIsInMenuScreen (bool isInMenuScreen) { m_IsInMenuScreen = isInMenuScreen; }
55
+ #pragma endregion
56
+
47
57
private:
48
58
// / Enumeration for the different menu screens that are active based on transition states.
49
59
enum ActiveMenu {
@@ -54,6 +64,7 @@ namespace RTE {
54
64
PauseMenuActive,
55
65
};
56
66
67
+ bool m_IsInMenuScreen; // !< Whether we're currently in a menu screen.
57
68
ActiveMenu m_ActiveMenu; // !< The currently active menu screen that is being updated and drawn. See ActiveMenu enumeration.
58
69
59
70
std::unique_ptr<GUIInputWrapper> m_GUIInput; // !< The GUIInput interface of this MenuMan.
Original file line number Diff line number Diff line change 8
8
#include " ConsoleMan.h"
9
9
#include " PresetMan.h"
10
10
#include " PerformanceMan.h"
11
+ #include " MenuMan.h"
11
12
#include " Icon.h"
12
13
#include " GameActivity.h"
13
14
#include " System.h"
@@ -1177,7 +1178,7 @@ void UInputMan::UpdateMouseInput() {
1177
1178
// The mouse cursor is visible and can move about the screen/window, but it should still be contained within the mouse player's part of the window
1178
1179
for (int player = PlayerOne; player < MaxPlayerCount; player++) {
1179
1180
if (m_ControlScheme[player].GetDevice () == InputDevice::DEVICE_MOUSE_KEYB) {
1180
- ForceMouseWithinPlayerScreen (g_ActivityMan.IsInActivity (), player);
1181
+ ForceMouseWithinPlayerScreen (g_ActivityMan.IsInActivity () && !g_MenuMan. GetIsInMenuScreen () , player);
1181
1182
}
1182
1183
}
1183
1184
}
You can’t perform that action at this time.
0 commit comments