From c497dc7971bc9c100b0c6cc627c9fca0dd5db6ef Mon Sep 17 00:00:00 2001 From: Paul Sladen Date: Tue, 18 Aug 2009 00:20:34 +0100 Subject: [PATCH] reorder plugin loader warning messages again diff --git a/openBVE/OpenBve/PluginManager.cs b/openBVE/OpenBve/PluginManager.cs index 324a5e8..6938784 100644 --- a/openBVE/OpenBve/PluginManager.cs +++ b/openBVE/OpenBve/PluginManager.cs @@ -540,43 +540,42 @@ namespace OpenBve { // load ats config internal static bool LoadAtsConfig(string TrainPath, System.Text.Encoding Encoding, TrainManager.Train Train) { string atsConfigFile = Interface.GetCombinedFileName(TrainPath, "ats.cfg"); if (!System.IO.File.Exists(atsConfigFile)) { return false; } + if (Program.CurrentPlatform != Program.Platform.Windows) { + Interface.AddMessage(Interface.MessageType.Information, false, "Train plugins are not supported on operating systems other than Windows. The built-in safety systems will be used for this train, which might not be compatible with the route."); + return false; + } + if (IntPtr.Size != 4) { + Interface.AddMessage(Interface.MessageType.Information, false, "Train plugins are not supported in 64-bit environments. The built-in safety systems will be used for this train, which might not be compatible with the route."); + return false; + } string dllTitle = System.IO.File.ReadAllText(atsConfigFile, Encoding).Trim(); if (!dllTitle.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)) { Interface.AddMessage(Interface.MessageType.Error, false, "The train plugin " + dllTitle + " must have the extension .dll in " + atsConfigFile); return false; } string dllFile = Interface.GetCombinedFileName(TrainPath, dllTitle); if (!System.IO.File.Exists(dllFile)) { Interface.AddMessage(Interface.MessageType.Error, true, "The train plugin " + dllTitle + " could not be found in " + atsConfigFile); return false; } - if (Program.CurrentPlatform != Program.Platform.Windows) { - Interface.AddMessage(Interface.MessageType.Information, false, "Train plugins are not supported on operating systems other than Windows. The built-in safety systems will be used for this train, which might not be compatible with the route."); - return false; - } - if (IntPtr.Size != 4) { - Interface.AddMessage(Interface.MessageType.Information, false, "Train plugins are not supported in 64-bit environments. The built-in safety systems will be used for this train, which might not be compatible with the route."); - return false; - } if (!CheckDllHeader(dllFile)) { Interface.AddMessage(Interface.MessageType.Error, false, "The train plugin " + dllTitle + " is of an unsupported binary format or could not be read in " + atsConfigFile); return false; } PluginLoadState state = LoadPlugin(dllFile, Train); switch (state) { case PluginLoadState.CouldNotLoadDll: Interface.AddMessage(Interface.MessageType.Error, false, "The train plugin " + dllTitle + " could not be loaded in " + atsConfigFile); return false; case PluginLoadState.InvalidPluginVersion: Interface.AddMessage(Interface.MessageType.Error, false, "The train plugin " + dllTitle + " is of an unsupported version in " + atsConfigFile); return false; case PluginLoadState.Successful: return true; default: return false; } } -- 1.6.0.4