Skip to content

Commit

Permalink
Introduce SporeModManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Jul 13, 2022
1 parent da39423 commit d8002f3
Show file tree
Hide file tree
Showing 12 changed files with 489 additions and 1 deletion.
2 changes: 2 additions & 0 deletions BuildRelease.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ mkdir "%OBJ_DIR%\SporeModLoader\CoreLibs"
mkdir "%OBJ_DIR%\SporeModLoader\CoreLibs\disk"
mkdir "%OBJ_DIR%\SporeModLoader\CoreLibs\march2017"
mkdir "%OBJ_DIR%\SporeModLoader\ModLibs"
mkdir "%OBJ_DIR%\SporeModLoader\SporeModManager"

msbuild "Spore-ModAPI\Spore ModAPI" ^
/t:BuildDlls ^
Expand All @@ -31,6 +32,7 @@ msbuild SporeModLoader ^
copy Spore-ModAPI\dll\Release\SporeModAPI.disk.dll "%OBJ_DIR%\SporeModLoader\CoreLibs\disk\SporeModAPI.dll"
copy Spore-ModAPI\dll\Release\SporeModAPI.march2017.dll "%OBJ_DIR%\SporeModLoader\CoreLibs\march2017\SporeModAPI.dll"
copy SporeModLoader\Bin\Release\dinput8.dll "%OBJ_DIR%\SporebinEP1\dinput8.dll"
copy SporeModManager\Bin\Release\SporeModManager.exe "%OBJ_DIR%\SporeModLoader\SporeModManager"

cd "%OBJ_DIR%"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ archive into the game directory.

## Installation of mods

Place mods (only dlls are supported) in `SporeModLoader/ModLibs/`
See the commandline utility `SporeModLoader/SporeModManager/SporeModManager.exe`
62 changes: 62 additions & 0 deletions SporeModLoader.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,34 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SporeModLoader", "SporeModL
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Detours", "Detours\vc\Detours.vcxproj", "{37489709-8054-4903-9C49-A79846049FC9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SporeModManager", "SporeModManager\SporeModManager.csproj", "{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
DebugMDd|Any CPU = DebugMDd|Any CPU
DebugMDd|ARM = DebugMDd|ARM
DebugMDd|ARM64 = DebugMDd|ARM64
DebugMDd|x64 = DebugMDd|x64
DebugMDd|x86 = DebugMDd|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
ReleaseMD|Any CPU = ReleaseMD|Any CPU
ReleaseMD|ARM = ReleaseMD|ARM
ReleaseMD|ARM64 = ReleaseMD|ARM64
ReleaseMD|x64 = ReleaseMD|x64
ReleaseMD|x86 = ReleaseMD|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Debug|Any CPU.ActiveCfg = Debug|x64
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Debug|Any CPU.Build.0 = Debug|x64
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Debug|ARM.ActiveCfg = Debug|x64
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Debug|ARM.Build.0 = Debug|x64
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Debug|ARM64.ActiveCfg = Debug|x64
Expand All @@ -38,6 +46,8 @@ Global
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Debug|x64.Build.0 = Debug|x64
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Debug|x86.ActiveCfg = Debug|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Debug|x86.Build.0 = Debug|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.DebugMDd|Any CPU.ActiveCfg = Release|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.DebugMDd|Any CPU.Build.0 = Release|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.DebugMDd|ARM.ActiveCfg = Debug|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.DebugMDd|ARM.Build.0 = Debug|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.DebugMDd|ARM64.ActiveCfg = Debug|Win32
Expand All @@ -46,6 +56,8 @@ Global
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.DebugMDd|x64.Build.0 = Debug|x64
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.DebugMDd|x86.ActiveCfg = Debug|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.DebugMDd|x86.Build.0 = Debug|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Release|Any CPU.ActiveCfg = Release|x64
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Release|Any CPU.Build.0 = Release|x64
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Release|ARM.ActiveCfg = Release|x64
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Release|ARM.Build.0 = Release|x64
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Release|ARM64.ActiveCfg = Release|x64
Expand All @@ -54,6 +66,8 @@ Global
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Release|x64.Build.0 = Release|x64
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Release|x86.ActiveCfg = Release|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.Release|x86.Build.0 = Release|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.ReleaseMD|Any CPU.ActiveCfg = Release|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.ReleaseMD|Any CPU.Build.0 = Release|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.ReleaseMD|ARM.ActiveCfg = Debug|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.ReleaseMD|ARM.Build.0 = Debug|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.ReleaseMD|ARM64.ActiveCfg = Debug|Win32
Expand All @@ -62,6 +76,8 @@ Global
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.ReleaseMD|x64.Build.0 = Release|x64
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.ReleaseMD|x86.ActiveCfg = Release|Win32
{AD9120DA-E42B-4563-A307-B5A155CC25C0}.ReleaseMD|x86.Build.0 = Release|Win32
{37489709-8054-4903-9C49-A79846049FC9}.Debug|Any CPU.ActiveCfg = ReleaseMD|Win32
{37489709-8054-4903-9C49-A79846049FC9}.Debug|Any CPU.Build.0 = ReleaseMD|Win32
{37489709-8054-4903-9C49-A79846049FC9}.Debug|ARM.ActiveCfg = DebugMDd|ARM
{37489709-8054-4903-9C49-A79846049FC9}.Debug|ARM.Build.0 = DebugMDd|ARM
{37489709-8054-4903-9C49-A79846049FC9}.Debug|ARM64.ActiveCfg = DebugMDd|ARM64
Expand All @@ -70,6 +86,8 @@ Global
{37489709-8054-4903-9C49-A79846049FC9}.Debug|x64.Build.0 = DebugMDd|x64
{37489709-8054-4903-9C49-A79846049FC9}.Debug|x86.ActiveCfg = DebugMDd|Win32
{37489709-8054-4903-9C49-A79846049FC9}.Debug|x86.Build.0 = DebugMDd|Win32
{37489709-8054-4903-9C49-A79846049FC9}.DebugMDd|Any CPU.ActiveCfg = DebugMDd|x64
{37489709-8054-4903-9C49-A79846049FC9}.DebugMDd|Any CPU.Build.0 = DebugMDd|x64
{37489709-8054-4903-9C49-A79846049FC9}.DebugMDd|ARM.ActiveCfg = DebugMDd|ARM
{37489709-8054-4903-9C49-A79846049FC9}.DebugMDd|ARM.Build.0 = DebugMDd|ARM
{37489709-8054-4903-9C49-A79846049FC9}.DebugMDd|ARM64.ActiveCfg = DebugMDd|ARM64
Expand All @@ -78,6 +96,8 @@ Global
{37489709-8054-4903-9C49-A79846049FC9}.DebugMDd|x64.Build.0 = DebugMDd|x64
{37489709-8054-4903-9C49-A79846049FC9}.DebugMDd|x86.ActiveCfg = DebugMDd|Win32
{37489709-8054-4903-9C49-A79846049FC9}.DebugMDd|x86.Build.0 = DebugMDd|Win32
{37489709-8054-4903-9C49-A79846049FC9}.Release|Any CPU.ActiveCfg = ReleaseMD|Win32
{37489709-8054-4903-9C49-A79846049FC9}.Release|Any CPU.Build.0 = ReleaseMD|Win32
{37489709-8054-4903-9C49-A79846049FC9}.Release|ARM.ActiveCfg = ReleaseMD|ARM
{37489709-8054-4903-9C49-A79846049FC9}.Release|ARM.Build.0 = ReleaseMD|ARM
{37489709-8054-4903-9C49-A79846049FC9}.Release|ARM64.ActiveCfg = ReleaseMD|ARM64
Expand All @@ -86,6 +106,8 @@ Global
{37489709-8054-4903-9C49-A79846049FC9}.Release|x64.Build.0 = ReleaseMD|x64
{37489709-8054-4903-9C49-A79846049FC9}.Release|x86.ActiveCfg = ReleaseMD|Win32
{37489709-8054-4903-9C49-A79846049FC9}.Release|x86.Build.0 = ReleaseMD|Win32
{37489709-8054-4903-9C49-A79846049FC9}.ReleaseMD|Any CPU.ActiveCfg = ReleaseMD|x64
{37489709-8054-4903-9C49-A79846049FC9}.ReleaseMD|Any CPU.Build.0 = ReleaseMD|x64
{37489709-8054-4903-9C49-A79846049FC9}.ReleaseMD|ARM.ActiveCfg = ReleaseMD|ARM
{37489709-8054-4903-9C49-A79846049FC9}.ReleaseMD|ARM.Build.0 = ReleaseMD|ARM
{37489709-8054-4903-9C49-A79846049FC9}.ReleaseMD|ARM64.ActiveCfg = ReleaseMD|ARM64
Expand All @@ -94,6 +116,46 @@ Global
{37489709-8054-4903-9C49-A79846049FC9}.ReleaseMD|x64.Build.0 = ReleaseMD|x64
{37489709-8054-4903-9C49-A79846049FC9}.ReleaseMD|x86.ActiveCfg = ReleaseMD|Win32
{37489709-8054-4903-9C49-A79846049FC9}.ReleaseMD|x86.Build.0 = ReleaseMD|Win32
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Debug|ARM.ActiveCfg = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Debug|ARM.Build.0 = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Debug|ARM64.Build.0 = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Debug|x64.ActiveCfg = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Debug|x64.Build.0 = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Debug|x86.ActiveCfg = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Debug|x86.Build.0 = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.DebugMDd|Any CPU.ActiveCfg = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.DebugMDd|Any CPU.Build.0 = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.DebugMDd|ARM.ActiveCfg = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.DebugMDd|ARM.Build.0 = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.DebugMDd|ARM64.ActiveCfg = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.DebugMDd|ARM64.Build.0 = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.DebugMDd|x64.ActiveCfg = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.DebugMDd|x64.Build.0 = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.DebugMDd|x86.ActiveCfg = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.DebugMDd|x86.Build.0 = Debug|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Release|Any CPU.Build.0 = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Release|ARM.ActiveCfg = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Release|ARM.Build.0 = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Release|ARM64.ActiveCfg = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Release|ARM64.Build.0 = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Release|x64.ActiveCfg = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Release|x64.Build.0 = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Release|x86.ActiveCfg = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.Release|x86.Build.0 = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.ReleaseMD|Any CPU.ActiveCfg = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.ReleaseMD|Any CPU.Build.0 = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.ReleaseMD|ARM.ActiveCfg = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.ReleaseMD|ARM.Build.0 = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.ReleaseMD|ARM64.ActiveCfg = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.ReleaseMD|ARM64.Build.0 = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.ReleaseMD|x64.ActiveCfg = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.ReleaseMD|x64.Build.0 = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.ReleaseMD|x86.ActiveCfg = Release|Any CPU
{79DE9382-1D2D-4D7C-B1C3-4AAA0B8FD3FC}.ReleaseMD|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
50 changes: 50 additions & 0 deletions SporeModManager/SporeMods/Xml/DirectoryConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* SporeModLoader - https://github.com/Rosalie241/SporeModLoader
* Copyright (C) 2022 Rosalie Wanders <rosalie@mailbox.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System.IO;
using System.Xml.Serialization;

namespace SporeModManager.SporeMods.Xml
{
public class DirectoryConfig
{
public string ModLibsDirectory { get; set; }
public string GalacticAdventuresDataDirectory { get; set; }
public string CoreSporeDataDirectory { get; set; }

public static DirectoryConfig ReadFromXml()
{
var directoryConfig = new DirectoryConfig();

if (File.Exists("DirectoryConfig.xml"))
{
using (var fileStream = File.OpenRead("DirectoryConfig.xml"))
{
var xmlSerializer = new XmlSerializer(typeof(DirectoryConfig));
directoryConfig = (DirectoryConfig)xmlSerializer.Deserialize(fileStream);
fileStream.Close();
}
}
else
{
directoryConfig.ModLibsDirectory = @"..\ModLibs";
directoryConfig.GalacticAdventuresDataDirectory = @"..\..\DataEP1";
directoryConfig.CoreSporeDataDirectory = @"..\..\Data";

using (var textWriter = new StreamWriter("DirectoryConfig.xml"))
{
var serializer = new XmlSerializer(typeof(DirectoryConfig));
serializer.Serialize(textWriter, directoryConfig);
}
}

return directoryConfig;
}
}
}
21 changes: 21 additions & 0 deletions SporeModManager/SporeMods/Xml/InstalledMod.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* SporeModLoader - https://github.com/Rosalie241/SporeModLoader
* Copyright (C) 2022 Rosalie Wanders <rosalie@mailbox.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System.Collections.Generic;

namespace SporeModManager.SporeMods.Xml
{
public class InstalledMod
{
public string Name { get; set; }
public string UniqueName { get; set; }
public string Description { get; set; }
public List<InstalledModFile> Files { get; set; }
}
}
17 changes: 17 additions & 0 deletions SporeModManager/SporeMods/Xml/InstalledModFile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* SporeModLoader - https://github.com/Rosalie241/SporeModLoader
* Copyright (C) 2022 Rosalie Wanders <rosalie@mailbox.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace SporeModManager.SporeMods.Xml
{
public class InstalledModFile
{
public string FileName { get; set; }
public ModInfoInstallLocation InstallLocation { get; set; }
}
}
49 changes: 49 additions & 0 deletions SporeModManager/SporeMods/Xml/InstalledMods.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* SporeModLoader - https://github.com/Rosalie241/SporeModLoader
* Copyright (C) 2022 Rosalie Wanders <rosalie@mailbox.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;

namespace SporeModManager.SporeMods.Xml
{
public class InstalledMods
{
public List<InstalledMod> InstalledModList { get; set; }

public static InstalledMods ReadFromXml()
{
var installedMods = new InstalledMods();

if (File.Exists("InstalledMods.xml"))
{
using (var fileStream = File.OpenRead("InstalledMods.xml"))
{
var xmlSerializer = new XmlSerializer(typeof(InstalledMods));
installedMods = (InstalledMods)xmlSerializer.Deserialize(fileStream);
}
}
else
{
installedMods.InstalledModList = new List<InstalledMod>();
}

return installedMods;
}

public static void SaveToXml(InstalledMods installedMods)
{
using (var textWriter = new StreamWriter("InstalledMods.xml"))
{
var serializer = new XmlSerializer(typeof(InstalledMods));
serializer.Serialize(textWriter, installedMods);
}
}
}
}
Loading

0 comments on commit d8002f3

Please sign in to comment.