Skip to content

Commit ca17ca5

Browse files
committed
Automatic merge of T1.5.1-1732-gfdbea15ea and 18 pull requests
- Pull request #570 at f11a428: glTF 2.0 support with PBR lighting - Pull request #1030 at d3ae4a2: Refactor settings, in prep for settings exporter - Pull request #1052 at 3b5cb90: Content Manager: Add axle count, and lowest derail force - Pull request #1062 at bbc0013: Train Forces popup Window. - Pull request #1064 at cb510d6: Add Train Info tab to Help window (F1) - Pull request #1066 at 62c89c1: Log derailment, using TraceInformation. - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #1049 at 6a0c471: Re-organise document storage and access - Pull request #1057 at 254b6d4: Switchable brake system - Pull request #1069 at 3f153f0: Mouse wheel control only with Alt – Followup for #1051 - Pull request #1070 at f818e40: Fix a NullReferenceException in TCS scripts - Pull request #1071 at 722dd3f: Change cover image for v1.6 - Pull request #1074 at e9a66c1: Gradient - commit 2024-16-12 - Pull request #1076 at d1ff8fd: Allow depart early - Pull request #1077 at 7e73abd: Fix SME brakes not working - Pull request #1079 at 5e37059: Adds Polish transations - Pull request #1080 at a637cb8: arranges Options > System tab for longer texts - Pull request #1078 at 9ab642e: Default PowerSupply script for steam locomotives
20 parents bf6d0c2 + fdbea15 + f11a428 + d3ae4a2 + 3b5cb90 + bbc0013 + cb510d6 + 62c89c1 + 1f5ba4c + 6a0c471 + 254b6d4 + 3f153f0 + f818e40 + 722dd3f + e9a66c1 + d1ff8fd + 7e73abd + 5e37059 + a637cb8 + 9ab642e commit ca17ca5

File tree

3 files changed

+70
-67
lines changed

3 files changed

+70
-67
lines changed

Source/Menu/Options.Designer.cs

+21-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Menu/Options.cs

+49-43
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public OptionsForm(UserSettings settings, UpdateManager updateManager, Telemetry
219219
checkDataLogTrainSpeed.Checked = Settings.DataLogTrainSpeed;
220220
labelDataLogTSInterval.Enabled = checkDataLogTrainSpeed.Checked;
221221
numericDataLogTSInterval.Enabled = checkDataLogTrainSpeed.Checked;
222-
checkListDataLogTSContents.Enabled = checkDataLogTrainSpeed.Checked;
222+
checkListDataLogTSContents.Enabled = checkDataLogTrainSpeed.Checked;
223223
numericDataLogTSInterval.Value = Settings.DataLogTSInterval;
224224
checkListDataLogTSContents.Items.AddRange(new object[] {
225225
catalog.GetString("Time"),
@@ -240,48 +240,7 @@ public OptionsForm(UserSettings settings, UpdateManager updateManager, Telemetry
240240
checkDataLogStationStops.Checked = Settings.DataLogStationStops;
241241

242242
// System tab
243-
comboLanguage.Text = Settings.Language;
244-
245-
var updateChannelNames = new Dictionary<string, string> {
246-
{ "stable", catalog.GetString("Stable (recommended)") },
247-
{ "testing", catalog.GetString("Testing") },
248-
{ "unstable", catalog.GetString("Unstable") },
249-
{ "", catalog.GetString("None") },
250-
};
251-
var updateChannelDescriptions = new Dictionary<string, string> {
252-
{ "stable", catalog.GetString("Infrequent updates to official, hand-picked versions. Recommended for most users.") },
253-
{ "testing", catalog.GetString("Weekly updates which may contain noticable defects. For project supporters.") },
254-
{ "unstable", catalog.GetString("Daily updates which may contain serious defects. For developers only.") },
255-
{ "", catalog.GetString("No updates.") },
256-
};
257-
var spacing = labelUpdateMode.Margin.Size;
258-
var indent = 180;
259-
var top = labelUpdateMode.Bottom + spacing.Height;
260-
foreach (var channel in UpdateManager.GetChannels())
261-
{
262-
var radio = new RadioButton()
263-
{
264-
Text = updateChannelNames[channel.ToLowerInvariant()],
265-
Margin = labelUpdateMode.Margin,
266-
Left = spacing.Width + 32, // to leave room for HelpIcon
267-
Top = top,
268-
Checked = updateManager.ChannelName.Equals(channel, StringComparison.InvariantCultureIgnoreCase),
269-
AutoSize = true,
270-
Tag = channel,
271-
};
272-
tabPageSystem.Controls.Add(radio);
273-
var label = new Label()
274-
{
275-
Text = updateChannelDescriptions[channel.ToLowerInvariant()],
276-
Margin = labelUpdateMode.Margin,
277-
Left = spacing.Width + indent,
278-
Top = top + 2, // Offset to align with radio button text
279-
Width = tabPageSystem.ClientSize.Width - indent - spacing.Width * 2,
280-
AutoSize = true,
281-
};
282-
tabPageSystem.Controls.Add(label);
283-
top += label.Height + spacing.Height - 3; // -3 to close them up a bit
284-
}
243+
DrawSystemTab(updateManager);
285244

286245
checkWindowed.Checked = !Settings.FullScreen;
287246
comboWindowSize.Text = Settings.WindowSize;
@@ -323,6 +282,53 @@ public OptionsForm(UserSettings settings, UpdateManager updateManager, Telemetry
323282
numericActWeatherRandomizationLevel.Value = Settings.ActWeatherRandomizationLevel;
324283
}
325284

285+
private void DrawSystemTab(UpdateManager updateManager)
286+
{
287+
comboLanguage.Text = Settings.Language;
288+
289+
var updateChannelNames = new Dictionary<string, string> {
290+
{ "stable", catalog.GetString("Stable (recommended)") },
291+
{ "testing", catalog.GetString("Testing") },
292+
{ "unstable", catalog.GetString("Unstable") },
293+
{ "", catalog.GetString("None") },
294+
};
295+
var updateChannelDescriptions = new Dictionary<string, string> {
296+
{ "stable", catalog.GetString("Infrequent updates to official, hand-picked versions. Recommended for most users.") },
297+
{ "testing", catalog.GetString("Weekly updates which may contain noticable defects. For project supporters.") },
298+
{ "unstable", catalog.GetString("Daily updates which may contain serious defects. For developers only.") },
299+
{ "", catalog.GetString("No updates.") },
300+
};
301+
var spacing = labelUpdateMode.Margin.Size;
302+
var indent = 180;
303+
var top = labelUpdateMode.Bottom + spacing.Height;
304+
// Positioning gives maximum spave for lengthy Russian text.
305+
foreach (var channel in UpdateManager.GetChannels())
306+
{
307+
var radio = new RadioButton()
308+
{
309+
Text = updateChannelNames[channel.ToLowerInvariant()],
310+
Margin = labelUpdateMode.Margin,
311+
Left = spacing.Width + 32, // to leave room for HelpIcon
312+
Top = top,
313+
Checked = updateManager.ChannelName.Equals(channel, StringComparison.InvariantCultureIgnoreCase),
314+
AutoSize = true,
315+
Tag = channel,
316+
};
317+
tabPageSystem.Controls.Add(radio);
318+
var label = new Label()
319+
{
320+
Text = updateChannelDescriptions[channel.ToLowerInvariant()],
321+
Margin = labelUpdateMode.Margin,
322+
Left = spacing.Width + 30, // to leave room for HelpIcon
323+
Top = top + spacing.Height + 15, // Offset to place below radio button
324+
Width = tabPageSystem.ClientSize.Width - indent - spacing.Width * 2,
325+
AutoSize = true,
326+
};
327+
tabPageSystem.Controls.Add(label);
328+
top += (label.Height + spacing.Height) * 2 - 5; // -3 to close them up a bit
329+
}
330+
}
331+
326332
static string ParseCategoryFrom(string name)
327333
{
328334
var len = name.IndexOf(' ');

Source/Menu/Options.resx

-3
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,4 @@
120120
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121121
<value>17, 17</value>
122122
</metadata>
123-
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124-
<value>17, 17</value>
125-
</metadata>
126123
</root>

0 commit comments

Comments
 (0)