Skip to content

Commit 26c77b4

Browse files
committed
Automatic merge of T1.5.1-1076-g60df6ba81e and 22 pull requests
- Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at 8f695a4: Blueprint/train car operations UI window - Pull request #885 at e267870: feat: Add notifications to Menu - Pull request #891 at 9a1d6b2: Auto save - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #900 at c27f32d: DMI updates - Pull request #903 at 3e390b8: Downloading route content (Github, zip) - Pull request #922 at a3bc9e7: Autopilot for timetable mode - Pull request #946 at 91a03af: Advanced track sounds - Pull request #952 at 8347095: Investigation - Pulsing graphics - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #954 at f837ffd: Add Support for Multiple Track Profiles - Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value - Pull request #962 at 46d0472: Fix pantographs on unpowered cars - Pull request #964 at b11c894: fix: Warning CA1417: Do not use the 'OutAttribute' for string parameter - Pull request #965 at 7554f02: style: Renormalize line endings - Pull request #966 at 6353e03: fix: Warning CS0618: 'string.Copy(string)' is obsolete - Pull request #968 at 1ccdf71: Initial build of adding track section identifier for rack railway - Pull request #969 at e7a10c5: Bugfix refocus to the main window when opening the map window
24 parents 8e33b48 + 60df6ba + dfc715e + d00beb9 + f92de76 + 8f695a4 + e267870 + 9a1d6b2 + 1f5ba4c + 5866028 + c27f32d + 3e390b8 + a3bc9e7 + 91a03af + 8347095 + a519452 + f837ffd + 2452cb0 + 46d0472 + b11c894 + 7554f02 + 6353e03 + 1ccdf71 + e7a10c5 commit 26c77b4

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

Source/RunActivity/Viewer3D/Map/MapForm.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,12 @@ void UITimer_Tick(object sender, EventArgs e)
13451345
if (Viewer.MapViewerEnabledSetToTrue)
13461346
{
13471347
GenerateView();
1348-
GameForm.Focus();
1348+
if (!mapBehindGameForm())
1349+
{
1350+
// do not return focus to the main OR game window
1351+
// when map is (partially) overlapping the game window
1352+
GameForm.Focus();
1353+
}
13491354
Viewer.MapViewerEnabledSetToTrue = false;
13501355
}
13511356

@@ -1357,6 +1362,25 @@ void UITimer_Tick(object sender, EventArgs e)
13571362
GenerateView();
13581363
}
13591364

1365+
private bool mapBehindGameForm()
1366+
{
1367+
int mapX0 = Bounds.X;
1368+
int mapY0 = Bounds.Y;
1369+
int mapX1 = mapX0 + Size.Width;
1370+
int mapY1 = mapY0 + Size.Height;
1371+
1372+
int gameX0 = GameForm.Bounds.X;
1373+
int gameY0 = GameForm.Bounds.Y;
1374+
int gameX1 = GameForm.Size.Width;
1375+
int gameY1 = GameForm.Size.Height;
1376+
1377+
return
1378+
(((mapX0 >= gameX0) && (mapX0 <= gameX1)) && ((mapY0 >= gameY0) && (mapY0 <= gameY1))) ||
1379+
(((mapX0 >= gameX0) && (mapX0 <= gameX1)) && ((mapY1 >= gameY0) && (mapY1 <= gameY1))) ||
1380+
(((mapX1 >= gameX0) && (mapX1 <= gameX1)) && ((mapY0 >= gameY0) && (mapY0 <= gameY1))) ||
1381+
(((mapX1 >= gameX0) && (mapX1 <= gameX1)) && ((mapY1 >= gameY0) && (mapY1 <= gameY1)));
1382+
}
1383+
13601384
private void allowJoiningCheckbox_CheckedChanged(object sender, EventArgs e)
13611385
{
13621386
MPManager.Instance().AllowNewPlayer = allowJoiningCheckbox.Checked;

0 commit comments

Comments
 (0)