Commit 0e98b666 authored by S520's avatar S520

Change: Move FileSystem completely to API

parent 06e99561
......@@ -102,7 +102,6 @@
<Compile Include="ProgramS.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RendererS.cs" />
<Compile Include="System\FileSystem.cs" />
<Compile Include="TextureManager.cs" />
<Compile Include="Textures.Texture.cs" />
<Compile Include="Textures.TextureOrigin.cs" />
......
......@@ -8,6 +8,7 @@
using System;
using System.Windows.Forms;
using OpenBveApi.World;
using OpenBveApi.FileSystem;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
......
This diff is collapsed.
......@@ -10,6 +10,7 @@ using System.Drawing;
using System.Drawing.Imaging;
using System.Globalization;
using System.Windows.Forms;
using OpenBveApi.FileSystem;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
......
......@@ -102,7 +102,6 @@
<Compile Include="Audio\Sounds.SoundOrigin.cs" />
<Compile Include="Audio\Sounds.SoundSource.cs" />
<Compile Include="Audio\Sounds.Update.cs" />
<Compile Include="System\FileSystem.cs" />
<Compile Include="System\Functions\Plugins.cs" />
<Compile Include="System\Gamewindow.cs" />
<Compile Include="System\Host.cs" />
......
This diff is collapsed.
using System;
using System.Windows.Forms;
using OpenBveApi.FileSystem;
namespace TrainEditor {
internal static class Program {
// --- members ---
/// <summary>Information about the file system organization.</summary>
internal static FileSystem FileSystem = null;
// --- functions ---
/// <summary>Is executed when the program starts.</summary>
/// <param name="args">The command-line arguments.</param>
[STAThread]
internal static void Main() {
private static void Main(string[] args) {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
try {
FileSystem = FileSystem.FromCommandLineArgs(args);
FileSystem.CreateFileSystem();
} catch (Exception ex) {
MessageBox.Show(OpenBveApi.Interface.Interface.GetInterfaceString("errors_filesystem_invalid") + Environment.NewLine + Environment.NewLine + ex.Message, "TrainEditor", MessageBoxButtons.OK, MessageBoxIcon.Hand);
return;
}
Application.Run(new formEditor());
}
......
......@@ -72,13 +72,10 @@ namespace TrainEditor {
LoadControlContent();
// language
{
string Exe = System.Reflection.Assembly.GetExecutingAssembly().Location;
string Folder = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Exe), "Data", "Languages");
Folder = Folder.Replace('/', System.IO.Path.DirectorySeparatorChar);
Folder = Folder.Replace('\\', System.IO.Path.DirectorySeparatorChar);
Interface.LoadLanguageFiles(Folder);
Interface.ListLanguages(Folder, ref LanguageFiles, comboboxLanguages);
if (Interface.InitLanguage(Folder, LanguageFiles, "en-US", comboboxLanguages)) {
string folder = Program.FileSystem.GetDataFolder("Languages");
Interface.LoadLanguageFiles(folder);
Interface.ListLanguages(folder, ref LanguageFiles, comboboxLanguages);
if (Interface.InitLanguage(folder, LanguageFiles, "en-US", comboboxLanguages)) {
ApplyLanguage();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment