Removed console and unnecessary dependencies

This commit is contained in:
2026-02-02 12:42:16 +01:00
parent d8a50f4dbc
commit 36e2b6cec5
6 changed files with 77 additions and 36 deletions

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using VRage.Plugins;
using SpaceEngineers;
using System.IO;
using DTLib.Demystifier;
using System.Reflection;
namespace UplinkLauncher;
@@ -14,11 +14,8 @@ internal static class UplinkLauncher
{
try
{
Console.WriteLine("Starting Uplink SE");
Console.WriteLine(new string('-', Console.WindowWidth));
List<string> plugins = new List<string>();
if (!Directory.Exists(PluginsLocalDir))
Directory.CreateDirectory(PluginsLocalDir);
string[] localPlugins = Directory.GetFiles(
@@ -26,30 +23,35 @@ internal static class UplinkLauncher
foreach (string plugin in localPlugins)
{
Console.WriteLine("Adding plugin: " + plugin);
plugins.Add(Path.GetFullPath(plugin));
}
MyPlugins.RegisterUserAssemblyFiles(plugins);
// why this file isn't created automatically?
// how game handles this without this magnificent launcher???
string appIdFile = "steam_appid.txt";
if (!File.Exists(appIdFile))
{
Console.WriteLine($"Could not find '{appIdFile}', creating new file");
File.WriteAllText(appIdFile, "244850");
}
// finally start ze game!!!
MyProgram.Main(args);
//Абсолютно великий код который делает чтобы Аплинк скопировал себе .config от инжей. Я не знаю, что такое .config, но там какие-то зависимости некие и настройки
string UplinkConfig = Path.GetFileName(Assembly.GetExecutingAssembly().Location) + ".config";
if (File.Exists("SpaceEngineers.exe.config"))
{
File.Copy("SpaceEngineers.exe.config", UplinkConfig, true);
}
StartSpaceEngineers(args);
}
catch (Exception e)
{
Console.WriteLine("Crashed with exception:");
Console.WriteLine(e.ToStringDemystified());
Console.WriteLine("\nPress enter to exit...");
Console.ReadLine();
}
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private static void StartSpaceEngineers(string[] args)
{
MyProgram.Main(args);
}
}