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);
}
}

View File

@@ -1,36 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net48</TargetFramework>
<OutputType>WinExe</OutputType>
<TargetFramework>net481</TargetFramework>
<Configurations>Release;Debug</Configurations>
<Platforms>x64</Platforms>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>latest</LangVersion>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<InvariantGlobalization>true</InvariantGlobalization>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>..\UplinkSE_logo.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DTLib.Demystifier" Version="1.1.1" />
<PackageReference Include="Lib.Harmony" Version="2.4.2" />
<PackageReference Include="Lib.Harmony" Version="2.4.2">
<TreatAsUsed>true</TreatAsUsed>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Reference Include="..\Bin64\Sandbox.Game.dll">
<Private>false</Private>
</Reference>
<Reference Include="..\Bin64\SpaceEngineers.exe">
<Private>false</Private>
</Reference>
<Reference Include="..\Bin64\SpaceEngineers.Game.dll">
<Private>false</Private>
</Reference>
<Reference Include="..\Bin64\VRage.dll">
<Private>false</Private>
</Reference>