mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-28 03:40:01 +00:00
add patcher
This commit is contained in:
parent
5256b8a726
commit
7b7f8fe48e
6
QSB.sln
6
QSB.sln
@ -18,6 +18,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MirrorWeaver", "MirrorWeave
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FizzyFacepunch", "FizzyFacepunch\FizzyFacepunch.csproj", "{C533C95D-F634-4221-99F6-3E59C2A45F90}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QSBPatcher", "QSBPatcher\QSBPatcher.csproj", "{86CE49AB-487A-466A-98F3-3DCAF9BE66D3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -40,6 +42,10 @@ Global
|
||||
{C533C95D-F634-4221-99F6-3E59C2A45F90}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C533C95D-F634-4221-99F6-3E59C2A45F90}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C533C95D-F634-4221-99F6-3E59C2A45F90}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{86CE49AB-487A-466A-98F3-3DCAF9BE66D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{86CE49AB-487A-466A-98F3-3DCAF9BE66D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{86CE49AB-487A-466A-98F3-3DCAF9BE66D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{86CE49AB-487A-466A-98F3-3DCAF9BE66D3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"filename": "QSB.dll",
|
||||
"patcher": "QSBPatcher.dll",
|
||||
"author": "Nebula, John, Alek, & Rai",
|
||||
"name": "Quantum Space Buddies",
|
||||
"warning": {
|
||||
|
49
QSBPatcher/PatchSteamFiles.cs
Normal file
49
QSBPatcher/PatchSteamFiles.cs
Normal file
@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace QSBPatcher
|
||||
{
|
||||
public static class PatchSteamFiles
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var basePath = args.Length > 0 ? args[0] : ".";
|
||||
var gamePath = AppDomain.CurrentDomain.BaseDirectory;
|
||||
|
||||
var dataPath = GetDataPath(gamePath);
|
||||
var pluginsPath = Path.Combine(dataPath, @"Plugins\x86_64");
|
||||
|
||||
var dir = new DirectoryInfo(Path.Combine(basePath, "SteamAPI"));
|
||||
var files = dir.GetFiles();
|
||||
foreach (var file in files)
|
||||
{
|
||||
var tempPath = Path.Combine(pluginsPath, file.Name);
|
||||
file.CopyTo(tempPath, true);
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetExecutableName(string gamePath)
|
||||
{
|
||||
var executableNames = new[] { "Outer Wilds.exe", "OuterWilds.exe" };
|
||||
foreach (var executableName in executableNames)
|
||||
{
|
||||
var executablePath = Path.Combine(gamePath, executableName);
|
||||
if (File.Exists(executablePath))
|
||||
{
|
||||
return Path.GetFileNameWithoutExtension(executablePath);
|
||||
}
|
||||
}
|
||||
|
||||
throw new FileNotFoundException($"Outer Wilds exe file not found in {gamePath}");
|
||||
}
|
||||
|
||||
private static string GetDataDirectoryName()
|
||||
{
|
||||
var gamePath = AppDomain.CurrentDomain.BaseDirectory;
|
||||
return $"{GetExecutableName(gamePath)}_Data";
|
||||
}
|
||||
|
||||
private static string GetDataPath(string gamePath)
|
||||
=> Path.Combine(gamePath, $"{GetDataDirectoryName()}");
|
||||
}
|
||||
}
|
16
QSBPatcher/QSBPatcher.csproj
Normal file
16
QSBPatcher/QSBPatcher.csproj
Normal file
@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Update="SteamAPI\steam_api64.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="SteamAPI\steam_api64.lib">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="copy /y "$(TargetPath)" "$(OwmlDir)\Mods\QSB\$(TargetName).dll"
md "$(OwmlDir)\Mods\QSB\SteamAPI"
copy /y "$(ProjectDir)\SteamAPI\steam_api64.dll" "$(OwmlDir)\Mods\QSB\SteamAPI"
copy /y "$(ProjectDir)\SteamAPI\steam_api64.lib" "$(OwmlDir)\Mods\QSB\SteamAPI"" />
|
||||
</Target>
|
||||
</Project>
|
BIN
QSBPatcher/SteamAPI/steam_api64.dll
Normal file
BIN
QSBPatcher/SteamAPI/steam_api64.dll
Normal file
Binary file not shown.
BIN
QSBPatcher/SteamAPI/steam_api64.lib
Normal file
BIN
QSBPatcher/SteamAPI/steam_api64.lib
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user