Skip to content

Commit 04884b1

Browse files
committed
Automatic merge of T1.5.1-919-gf19642ebc and 15 pull requests
- Pull request #570 at 3539862: Experimental glTF 2.0 support with PBR lighting - 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 3ca0eb1: Blueprint/train car operations UI window - Pull request #885 at 753cba5: feat: Add notifications to Menu - Pull request #886 at 6c0785b: Scene viewer extension to TrackViewer - 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 #903 at 29f3d1a: Downloading route content (Github, zip) - Pull request #912 at f7b85e4: New Triple Valve Features Vol. 2 - Pull request #919 at 26cc6a8: Added mouse wheel support for controls which can be moved by pressing t… - Pull request #923 at e0f3c55: Add curve squeal to route - Pull request #924 at 6c2c3cd: Default Asset Improvements - Pull request #925 at e3b1688: Fix brakeshoe force bug - Pull request #926 at b20ca94: Lights Bugfixes
17 parents 4ee988b + f19642e + 3539862 + d00beb9 + f92de76 + 3ca0eb1 + 753cba5 + 6c0785b + 1f5ba4c + 5866028 + 29f3d1a + f7b85e4 + 26cc6a8 + e0f3c55 + 6c2c3cd + e3b1688 + b20ca94 commit 04884b1

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

Source/Menu/Notifications/NotificationManager.cs

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ private void AddItemToPage(NotificationPage page, Item item)
229229

230230
/// <summary>
231231
/// Returns any check that fails.
232-
/// (Could be extended to include other SystemInfo values.)
233232
/// </summary>
234233
/// <param name="check"></param>
235234
/// <returns></returns>
@@ -240,20 +239,26 @@ private Check CheckExcludes(Check check)
240239

241240
foreach (var c in check.ExcludesAllOf)
242241
{
243-
var lowerName = c.Name.ToLower();
244-
var lowerValue = c.Value.ToLower();
245242
if (c is Contains)
246243
{
247-
switch (lowerName)
244+
switch (c.Name)
248245
{
246+
case "direct3d":
247+
if (SystemInfo.Direct3DFeatureLevels.Contains(c.Value, StringComparer.OrdinalIgnoreCase))
248+
return check;
249+
break;
249250
case "installed_version":
250-
if (SystemInfo.Application.Version.Contains(lowerValue))
251+
if (SystemInfo.Application.Version.IndexOf(c.Value, StringComparison.OrdinalIgnoreCase) > 0)
251252
return check;
252253
break;
253-
default: // generic exclusion
254-
if (lowerName == lowerValue)
254+
case "system":
255+
var os = SystemInfo.OperatingSystem;
256+
var system = $"{os.Name} {os.Version} {os.Architecture} {os.Language} {os.Languages ?? new string[0]}";
257+
if (system.IndexOf(c.Value, StringComparison.OrdinalIgnoreCase) > 0)
255258
return check;
256259
break;
260+
default: // Any check that is not recognised fails.
261+
return check;
257262
}
258263
}
259264
}
@@ -262,7 +267,6 @@ private Check CheckExcludes(Check check)
262267

263268
/// <summary>
264269
/// Returns any check that succeeds.
265-
/// (Could be extended to include other SystemInfo values.)
266270
/// </summary>
267271
/// <param name="check"></param>
268272
/// <returns></returns>
@@ -273,20 +277,26 @@ private Check CheckIncludes(Check check)
273277

274278
foreach (var c in check.IncludesAnyOf)
275279
{
276-
var lowerName = c.Name.ToLower();
277-
var lowerValue = c.Value.ToLower();
278280
if (c is Contains)
279281
{
280-
switch (lowerName)
282+
switch (c.Name)
281283
{
282284
case "direct3d":
283-
if (SystemInfo.Direct3DFeatureLevels.Contains(lowerValue))
285+
if (SystemInfo.Direct3DFeatureLevels.Contains(c.Value, StringComparer.OrdinalIgnoreCase))
286+
return check;
287+
break;
288+
case "installed_version":
289+
if (SystemInfo.Application.Version.IndexOf(c.Value, StringComparison.OrdinalIgnoreCase) > 0)
284290
return check;
285291
break;
286-
default: // generic inclusion
287-
if (lowerName == lowerValue)
292+
case "system":
293+
var os = SystemInfo.OperatingSystem;
294+
var system = $"{os.Name} {os.Version} {os.Architecture} {os.Language} {os.Languages ?? new string[0]}";
295+
if (system.IndexOf(c.Value, StringComparison.OrdinalIgnoreCase) > 0)
288296
return check;
289297
break;
298+
default: // Any check that is not recognised fails.
299+
return null;
290300
}
291301
}
292302
}

0 commit comments

Comments
 (0)