Skip to content

Commit a9760ec

Browse files
Replaced the option OutOfFocus" with check on option SuppressConfirmations
1 parent 36736ce commit a9760ec

File tree

6 files changed

+23
-68
lines changed

6 files changed

+23
-68
lines changed
Loading

Source/Documentation/Manual/options.rst

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ The default setting is checked.
408408

409409

410410
At game start, Electric - power connected
411-
-----------------------------------------
411+
-----------------------------------
412412

413413
When this option is checked, stationary electric locos start the simulation with power available.
414414
Uncheck this option for a more detailed behaviour in which the player has to switch on electrical equipment.
@@ -602,15 +602,6 @@ specific width and height to be used.
602602

603603
The format is <width>x<height>, for example 1024x768.
604604

605-
.. -options-out-of-focus:
606-
607-
Notify out of focus
608-
-------------------
609-
610-
When this option is checked, on the corners of the Open Rails main window a red rectangle is shown when the window is not in focus.
611-
Just a reminder that the main window currently does not react on keystrokes.
612-
613-
The default setting is unchecked.
614605

615606
.. _options-window-glass:
616607

Source/Menu/Options.Designer.cs

Lines changed: 16 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Menu/Options.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ orderby folder.Key
303303

304304
checkWindowed.Checked = !Settings.FullScreen;
305305
comboWindowSize.Text = Settings.WindowSize;
306-
checkOutOfFocus.Checked = Settings.OutOfFocus;
307306
checkWindowGlass.Checked = Settings.WindowGlass;
308307

309308
// keep values in line with enum Orts.Simulation.ConfirmLevel
@@ -508,7 +507,6 @@ void buttonOK_Click(object sender, EventArgs e)
508507
UpdateManager.SetChannel((string)control.Tag);
509508
Settings.FullScreen = !checkWindowed.Checked;
510509
Settings.WindowSize = GetValidWindowSize(comboWindowSize.Text);
511-
Settings.OutOfFocus = checkOutOfFocus.Checked;
512510
Settings.WindowGlass = checkWindowGlass.Checked;
513511
Settings.SuppressConfirmations = comboControlConfirmations.SelectedIndex;
514512
Settings.WebServerPort = (int)numericWebServerPort.Value;
@@ -892,7 +890,6 @@ private void InitializeHelpIcons()
892890
(pbLanguage, new Control[] { labelLanguage, comboLanguage }),
893891
(pbUpdateMode, new Control[] { labelUpdateMode }),
894892
(pbWindowed, new Control[] { checkWindowed, labelWindowSize, comboWindowSize }),
895-
(pbOutOfFocus, new[] { checkOutOfFocus }),
896893
(pbWindowGlass, new[] { checkWindowGlass }),
897894
(pbControlConfirmations, new Control[] { labelControlConfirmations, comboControlConfirmations }),
898895
(pbWebServerPort, new Control[] { labelWebServerPort }),
@@ -1039,10 +1036,6 @@ private void HelpIcon_Click(object sender, EventArgs _)
10391036
pbWindowed,
10401037
baseUrl + "/options.html#windowed"
10411038
},
1042-
{
1043-
pbOutOfFocus,
1044-
baseUrl + "/options.html#out-of-focus"
1045-
},
10461039
{
10471040
pbWindowGlass,
10481041
baseUrl + "/options.html#window-glass"

Source/ORTS.Settings/UserSettings.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,6 @@ public enum DirectXFeature
277277
public bool FullScreen { get; set; }
278278
[Default("1024x768")]
279279
public string WindowSize { get; set; }
280-
[Default(true)]
281-
public bool OutOfFocus { get; set; }
282280
[Default(false)]
283281
public bool WindowGlass { get; set; }
284282
[Default(0)]

Source/RunActivity/Viewer3D/Viewer.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,9 @@ internal void Initialize()
504504
TrainListWindow = new TrainListWindow(WindowManager);
505505
TTDetachWindow = new TTDetachWindow(WindowManager);
506506
EOTListWindow = new EOTListWindow(WindowManager);
507-
if (Settings.OutOfFocus)
507+
if (Settings.SuppressConfirmations < (int)ConfirmLevel.Error)
508+
// confirm level Error might be set to suppressed when taking a movie
509+
// do not show the out of focus red square in that case
508510
OutOfFocusWindow = new OutOfFocusWindow(WindowManager);
509511
WindowManager.Initialize();
510512

@@ -859,7 +861,9 @@ public void Update(RenderFrame frame, float elapsedRealTime)
859861
// TODO: This is not correct. The ActivityWindow's PrepareFrame is already called by the WindowManager!
860862
if (Simulator.ActivityRun != null) ActivityWindow.PrepareFrame(elapsedTime, true);
861863

862-
if (Settings.OutOfFocus)
864+
if (Settings.SuppressConfirmations < (int)ConfirmLevel.Error)
865+
// confirm level Error might be set to suppressed when taking a movie
866+
// do not show the out of focus red square in that case
863867
OutOfFocusWindow.Visible = !this.Game.IsActive;
864868

865869
WindowManager.PrepareFrame(frame, elapsedTime);

0 commit comments

Comments
 (0)