Skip to content

Commit

Permalink
Merge remote-tracking branch 'or/master' into work
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharpe49 committed Apr 20, 2023
2 parents 3da8c09 + efe66c5 commit 4e32512
Show file tree
Hide file tree
Showing 19 changed files with 527 additions and 325 deletions.
13 changes: 9 additions & 4 deletions Source/Documentation/Manual/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -617,14 +617,19 @@ bottom of the screen.
This is helpful for operations that don't have visible feedback and also
allows you to control the train without being in the cab.

The default setting is checked.
Uncheck this option if you prefer to monitor your cab instruments and
don't want to see these messages.
Informational, Warning and Error messages are displayed here also.

The default setting of this option is to show all messages. Dropdown list gives the following choices:

- None: no messages suppressed (default)
- Information: informational messages and control confirmations suppressed
- Warning: warning messages and the ones mentioned above suppressed
- Error: error messages and the ones mentioned above suppressed

OR uses the same message scheme for system messages such as "Game saved"
or "Replay ended" but you cannot suppress these system messages.

Once the game has started, you can toggle the confirmations on and off
Once the game has started, you can cycle through the above settings
by pressing ``Ctrl+Alt+F10``.


Expand Down
84 changes: 49 additions & 35 deletions Source/Menu/Options.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 16 additions & 3 deletions Source/Menu/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,20 @@ orderby folder.Key
checkWindowed.Checked = !Settings.FullScreen;
comboWindowSize.Text = Settings.WindowSize;
checkWindowGlass.Checked = Settings.WindowGlass;
checkControlConfirmations.Checked = !Settings.SuppressConfirmations;

// keep values in line with enum Orts.Simulation.ConfirmLevel
// see also function Message(CabControl control, ConfirmLevel level, string message)
// in Source\Orts.Simulation\Simulation\Confirmer.cs
comboControlConfirmations.DataSource = new[] {
new ComboBoxMember { Code = "None", Name = catalog.GetString("None") },
new ComboBoxMember { Code = "Information", Name = catalog.GetString("Information") },
new ComboBoxMember { Code = "Warning", Name = catalog.GetString("Warning") },
new ComboBoxMember { Code = "Error", Name = catalog.GetString("Error") },
}.ToList();
comboControlConfirmations.DisplayMember = "Name";
comboControlConfirmations.ValueMember = "Code";
comboControlConfirmations.SelectedIndex = Settings.SuppressConfirmations;

numericWebServerPort.Value = Settings.WebServerPort;
checkPerformanceTuner.Checked = Settings.PerformanceTuner;
labelPerformanceTunerTarget.Enabled = checkPerformanceTuner.Checked;
Expand Down Expand Up @@ -447,7 +460,7 @@ void buttonOK_Click(object sender, EventArgs e)
Settings.FullScreen = !checkWindowed.Checked;
Settings.WindowSize = GetValidWindowSize(comboWindowSize.Text);
Settings.WindowGlass = checkWindowGlass.Checked;
Settings.SuppressConfirmations = !checkControlConfirmations.Checked;
Settings.SuppressConfirmations = comboControlConfirmations.SelectedIndex;
Settings.WebServerPort = (int)numericWebServerPort.Value;
Settings.PerformanceTuner = checkPerformanceTuner.Checked;
Settings.PerformanceTunerTarget = (int)numericPerformanceTunerTarget.Value;
Expand Down Expand Up @@ -829,7 +842,7 @@ private void InitializeHelpIcons()
(pbLanguage, new Control[] { labelLanguage, comboLanguage }),
(pbWindowed, new Control[] { checkWindowed, labelWindowSize, comboWindowSize }),
(pbWindowGlass, new[] { checkWindowGlass }),
(pbControlConfirmations, new[] { checkControlConfirmations }),
(pbControlConfirmations, new Control[] { labelControlConfirmations, comboControlConfirmations }),
(pbWebServerPort, new Control[] { labelWebServerPort }),
(pbPerformanceTuner, new Control[] { checkPerformanceTuner, labelPerformanceTunerTarget }),
};
Expand Down
4 changes: 2 additions & 2 deletions Source/ORTS.Settings/UserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ public enum DirectXFeature
public string WindowSize { get; set; }
[Default(false)]
public bool WindowGlass { get; set; }
[Default(false)]
public bool SuppressConfirmations { get; set; }
[Default(0)]
public int SuppressConfirmations { get; set; }
[Default(2150)]
public int WebServerPort { get; set; }
[Default(false)]
Expand Down
Loading

0 comments on commit 4e32512

Please sign in to comment.