Skip to content

Commit 3dc09da

Browse files
committed
Automatic merge of T1.5.1-535-g2f57132ee and 9 pull requests
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations - Pull request #799 at dc03850: Consolidated wind simulation - Pull request #821 at cc3af66: Adds suppression of safety valves - Pull request #831 at 61bbf43: poor mans switch panel on tablet - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #841 at 410a585: https://blueprints.launchpad.net/or/+spec/animating-trainset-windows - Pull request #853 at 52a513d: Notify out of focus - Pull request #855 at b39e5d8: Adds new route from TrainSimulations - Pull request #856 at ce66076: Add Alternate Syntax for Confusing Tokens
11 parents 37c16d9 + 2f57132 + 98dd1a7 + dc03850 + cc3af66 + 61bbf43 + d00beb9 + 410a585 + 52a513d + b39e5d8 + ce66076 commit 3dc09da

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

Source/RunActivity/Viewer3D/Popups/OutOfFocusWindow.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
// along with Open Rails. If not, see <http://www.gnu.org/licenses/>.
1717
//
1818

19+
/*
20+
* This out of focus window is a somewhat strange Window
21+
* When the main window is out of focus (so not receving any keystrokes)
22+
* it is surrounded by a red square to notify the user
23+
* The red square is the only functionality, so no save, no move, no resize etc.
24+
*/
25+
1926
using Microsoft.Xna.Framework;
2027
using Microsoft.Xna.Framework.Graphics;
2128

Source/RunActivity/Viewer3D/Popups/Window.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ public abstract class Window : RenderPrimitive
4545
VertexBuffer WindowVertexBuffer;
4646
IndexBuffer WindowIndexBuffer;
4747

48-
readonly bool DoNotDisplayWindow;
48+
public bool DoNotDisplayWindow // true for a NotInFocus window
49+
{
50+
get;
51+
private set;
52+
}
4953

5054
public Window(WindowManager owner, int width, int height, string caption)
5155
{

Source/RunActivity/Viewer3D/Popups/WindowManager.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,20 @@ public void Initialize()
171171
public void Save(BinaryWriter outf)
172172
{
173173
foreach (var window in Windows)
174-
window.Save(outf);
174+
if (!window.DoNotDisplayWindow)
175+
// This if is added to not do the save in case of the out of focus window
176+
// See Source\RunActivity\Viewer3D\Popups\OutOfFocusWindow.cs
177+
window.Save(outf);
175178
}
176179

177180
[CallOnThread("Render")]
178181
public void Restore(BinaryReader inf)
179182
{
180183
foreach (var window in Windows)
181-
window.Restore(inf);
184+
if (!window.DoNotDisplayWindow)
185+
// This if is added to not do the restore in case of the out of focus window
186+
// See Source\RunActivity\Viewer3D\Popups\OutOfFocusWindow.cs
187+
window.Restore(inf);
182188
}
183189

184190
[CallOnThread("Updater")]

0 commit comments

Comments
 (0)