Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
Made R&D mod to test GSL features
Browse files Browse the repository at this point in the history
  • Loading branch information
REHERC committed Mar 14, 2021
1 parent ca01557 commit 535b2a5
Show file tree
Hide file tree
Showing 9 changed files with 311 additions and 2 deletions.
22 changes: 22 additions & 0 deletions Centrifuge.Mods.Distance.sln
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Solution.Task.PostBuild", "
{5AA5A388-EB90-4280-BB32-4496138DD00E} = {5AA5A388-EB90-4280-BB32-4496138DD00E}
{5C9E788B-C9B8-462D-A561-431EBA706C0F} = {5C9E788B-C9B8-462D-A561-431EBA706C0F}
{83C8F38B-07E9-4A9B-8E5C-37981A28136E} = {83C8F38B-07E9-4A9B-8E5C-37981A28136E}
{004F8E95-36D7-400D-873F-60288E533802} = {004F8E95-36D7-400D-873F-60288E533802}
{06A78A9A-7A66-431F-8023-36EAA5D0FBAF} = {06A78A9A-7A66-431F-8023-36EAA5D0FBAF}
{AEE4B99D-C164-4495-AEE2-94CE4DBAAFDD} = {AEE4B99D-C164-4495-AEE2-94CE4DBAAFDD}
{0AD5BDA8-85AB-4163-BA40-CF49F769BADF} = {0AD5BDA8-85AB-4163-BA40-CF49F769BADF}
Expand Down Expand Up @@ -276,6 +277,15 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Centrifuge.Distance.Shared"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Wiki", "Wiki", "{B278157B-15FE-472F-A7DC-79C8217A0F3B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ResearchAndDevelopment", "ResearchAndDevelopment", "{2474388E-8D7C-4287-8A9E-7878D89E989A}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Distance.ResearchAndDevelopment.Content", "Distance.ResearchAndDevelopment.Content\Distance.ResearchAndDevelopment.Content.shproj", "{F6C2C5DD-2F7C-4423-A3BD-D54F3FA8E6C9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Distance.ResearchAndDevelopment", "Distance.ResearchAndDevelopment\Distance.ResearchAndDevelopment.csproj", "{004F8E95-36D7-400D-873F-60288E533802}"
ProjectSection(ProjectDependencies) = postProject
{F9FB724F-6555-4B6B-8D51-3140CA47D2FE} = {F9FB724F-6555-4B6B-8D51-3140CA47D2FE}
EndProjectSection
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Distance.NoServerLimit.Content\Distance.NoServerLimit.Content.projitems*{02cd7385-b155-4974-843d-9d0dd6bbfbe5}*SharedItemsImports = 13
Expand Down Expand Up @@ -313,6 +323,7 @@ Global
Distance.EditorAdditions.Content\Distance.EditorAdditions.Content.projitems*{e2e4ac75-d500-4d5d-a706-613a3df688e3}*SharedItemsImports = 13
Centrifuge.Distance\Centrifuge.GameSupport.Distance.Shared\Centrifuge.Distance.Shared.projitems*{e4ac586e-ad6d-43a8-a0cb-aa4d2d6fe578}*SharedItemsImports = 13
Distance.SceneDumper.Content\Distance.SceneDumper.Content.projitems*{e84718c2-200c-415f-ad1d-0cc133c38e70}*SharedItemsImports = 13
Distance.ResearchAndDevelopment.Content\Distance.ResearchAndDevelopment.Content.projitems*{f6c2c5dd-2f7c-4423-a3bd-d54f3fa8e6c9}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -537,6 +548,14 @@ Global
{C0573B40-FE3F-4E65-BB05-CC143A10A700}.Release|Any CPU.Build.0 = Release|Any CPU
{C0573B40-FE3F-4E65-BB05-CC143A10A700}.Release|x86.ActiveCfg = Release|Any CPU
{C0573B40-FE3F-4E65-BB05-CC143A10A700}.Release|x86.Build.0 = Release|Any CPU
{004F8E95-36D7-400D-873F-60288E533802}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{004F8E95-36D7-400D-873F-60288E533802}.Debug|Any CPU.Build.0 = Debug|Any CPU
{004F8E95-36D7-400D-873F-60288E533802}.Debug|x86.ActiveCfg = Debug|Any CPU
{004F8E95-36D7-400D-873F-60288E533802}.Debug|x86.Build.0 = Debug|Any CPU
{004F8E95-36D7-400D-873F-60288E533802}.Release|Any CPU.ActiveCfg = Release|Any CPU
{004F8E95-36D7-400D-873F-60288E533802}.Release|Any CPU.Build.0 = Release|Any CPU
{004F8E95-36D7-400D-873F-60288E533802}.Release|x86.ActiveCfg = Release|Any CPU
{004F8E95-36D7-400D-873F-60288E533802}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -614,6 +633,9 @@ Global
{0F2C2BE7-27A2-408A-841F-643B3549A55E} = {23D64D48-DA47-4121-9E52-978C85687AC5}
{27ADDC41-184A-417C-ABD0-13264475C380} = {C6C7A7A2-BAE8-4C15-9BC6-61BAB6A42006}
{E4AC586E-AD6D-43A8-A0CB-AA4D2D6FE578} = {4DA6AF01-8F55-48AF-8044-9C0C10E8F797}
{2474388E-8D7C-4287-8A9E-7878D89E989A} = {0FC121F4-6F94-4C7D-A2B5-D92AC9CC91A6}
{F6C2C5DD-2F7C-4423-A3BD-D54F3FA8E6C9} = {2474388E-8D7C-4287-8A9E-7878D89E989A}
{004F8E95-36D7-400D-873F-60288E533802} = {2474388E-8D7C-4287-8A9E-7878D89E989A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C475AB02-6F97-4575-9527-2F31F5AF847C}
Expand Down
3 changes: 1 addition & 2 deletions Distance.AdventureMaker/Entry.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Centrifuge.Distance.Game;
using Events.MainMenu;
using Events.MainMenu;
using Reactor.API.Attributes;
using Reactor.API.Interfaces.Systems;
using Reactor.API.Logging;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' &lt; '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>f6c2c5dd-2f7c-4423-a3bd-d54f3fa8e6c9</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>Distance.ResearchAndDevelopment.Content</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)Mod\mod.json" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>f6c2c5dd-2f7c-4423-a3bd-d54f3fa8e6c9</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="Distance.ResearchAndDevelopment.Content.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
13 changes: 13 additions & 0 deletions Distance.ResearchAndDevelopment.Content/Mod/mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"FriendlyName": "Research and Development",
"Description": "Testing grounds for potential GSL features.",
"Author": "Reherc",
"Contact": "Github: @REHERC",
"ModuleFileName": "Distance.ResearchAndDevelopment.dll",
"Priority": 10,
"SkipLoad": false,
"Dependencies": [],
"RequiredGSLs": [
"com.github.reherc/Centrifuge.Distance"
]
}
141 changes: 141 additions & 0 deletions Distance.ResearchAndDevelopment/Distance.ResearchAndDevelopment.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{004F8E95-36D7-400D-873F-60288E533802}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Distance.ResearchAndDevelopment</RootNamespace>
<AssemblyName>Distance.ResearchAndDevelopment</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony, Version=2.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\HarmonyX.2.4.0\lib\net35\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp, Version=9.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Centrifuge.Distance\Centrifuge.GameSupport.Distance.Shared\Binaries\Distance\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil, Version=0.10.4.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.10.4\lib\net35\Mono.Cecil.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil.Mdb, Version=0.10.4.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.10.4\lib\net35\Mono.Cecil.Mdb.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil.Pdb, Version=0.10.4.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.10.4\lib\net35\Mono.Cecil.Pdb.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil.Rocks, Version=0.10.4.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.10.4\lib\net35\Mono.Cecil.Rocks.dll</HintPath>
</Reference>
<Reference Include="MonoMod.RuntimeDetour, Version=21.3.1.1, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MonoMod.RuntimeDetour.21.3.1.1\lib\net35\MonoMod.RuntimeDetour.dll</HintPath>
</Reference>
<Reference Include="MonoMod.Utils, Version=21.3.1.1, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MonoMod.Utils.21.3.1.1\lib\net35\MonoMod.Utils.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Json.Net.Unity3D.9.0.1\lib\net35\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Reactor.API, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Centrifuge.Mod.SDK.3.2.0\lib\net35\Reactor.API.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Centrifuge.Distance\Centrifuge.GameSupport.Distance.Shared\Binaries\UnityEngine\UnityEngine.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Entry.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Centrifuge.Distance\Centrifuge.GameSupport.Distance\Centrifuge.Distance.csproj">
<Project>{c0573b40-fe3f-4e65-bb05-cc143a10a700}</Project>
<Name>Centrifuge.Distance</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>SET MODNAME=Distance Research And Development
SET INCLUDE=$(SolutionDir)Distance.ResearchAndDevelopment.Content

SET BUILD=$(ProjectDir)$(OutDir)
SET PACKAGES=$(SolutionDir)Build\%25MODNAME%25\Centrifuge

SET MOD=%25PACKAGES%25\Mods\%25MODNAME%25

REM ===== COPY MOD FILES =====

CALL :MAKEDIR "%25MOD%25"

CALL :COPYDIR "%25INCLUDE%25\Mod" "%25MOD%25"
CALL :COPY "%25BUILD%25Distance.ResearchAndDevelopment.dll" "%25MOD%25"

CALL :INCLUDEGSL Centrifuge.Distance

EXIT 0

REM ===== BUILD SUBROUTINES =====

:MAKEDIR
IF NOT EXIST %251 MKDIR %251
GOTO :EOF

:COPY
XCOPY /s /Y /v %251 %252
GOTO :EOF

:COPYDIR
XCOPY /i /s /Y /v %251 %252
GOTO :EOF

:INCLUDEGSL
CALL :MAKEDIR "%25PACKAGES%25\GameSupport"
CALL :COPY "%25BUILD%25%251.dll" "%25PACKAGES%25\GameSupport"
GOTO :EOF

:INCLUDEDEPENDENCY
CALL :MAKEDIR "%25MOD%25\Dependencies"
CALL :COPY "%25BUILD%25%251.dll" "%25MOD%25\Dependencies"
GOTO :EOF

:INCLUDEDEPENDENCYRENAME
CALL :MAKEDIR "%25MOD%25\Dependencies"
CALL :COPY "%25BUILD%25%251.dll" "%25MOD%25\Dependencies\%252.dll"
GOTO :EOF</PostBuildEvent>
</PropertyGroup>
</Project>
62 changes: 62 additions & 0 deletions Distance.ResearchAndDevelopment/Entry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using Centrifuge.Distance.Game;
using Events.MainMenu;
using Reactor.API.Attributes;
using Reactor.API.Interfaces.Systems;
using Reactor.API.Logging;
using Reactor.API.Runtime.Patching;
using System.Collections;
using UnityEngine;

namespace Distance.ResearchAndDevelopment
{
[ModEntryPoint("com.github.reherc/Distance.ResearchAndDevelopment")]
public class Mod : MonoBehaviour
{
public static Mod Instance;

public IManager Manager { get; set; }

public Log Logger { get; set; }

public void Initialize(IManager manager)
{
DontDestroyOnLoad(this);

Instance = this;
Manager = manager;
Logger = LogManager.GetForCurrentAssembly();

RuntimePatcher.AutoPatch();

Initialized.Subscribe(OnMainMenuInitialized);
}

private void OnMainMenuInitialized(Initialized.Data data)
{
Task.Run(MyTask);
}

private IEnumerator MyTask(Task.Status status)
{
const int max = 500;

status.SetText("Setting up...");
status.SetProgress(0, 1);

yield return Task.Wait(1.5f);

for (uint i = 1; i <= max; ++i)
{
status.SetText($"Running task {i} of {max}...");
status.SetProgress(i, max);

yield return Task.Wait(0.05f);
}

status.SetText("Finishing...");
status.SetProgress(1, 1);

yield return Task.Wait(2.0f);
}
}
}
36 changes: 36 additions & 0 deletions Distance.ResearchAndDevelopment/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Distance.ResearchAndDevelopment")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Distance.ResearchAndDevelopment")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("004f8e95-36d7-400d-873f-60288e533802")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
9 changes: 9 additions & 0 deletions Distance.ResearchAndDevelopment/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Centrifuge.Mod.SDK" version="3.2.0" targetFramework="net35" />
<package id="HarmonyX" version="2.4.0" targetFramework="net35" />
<package id="Json.Net.Unity3D" version="9.0.1" targetFramework="net35" />
<package id="Mono.Cecil" version="0.10.4" targetFramework="net35" />
<package id="MonoMod.RuntimeDetour" version="21.3.1.1" targetFramework="net35" />
<package id="MonoMod.Utils" version="21.3.1.1" targetFramework="net35" />
</packages>

0 comments on commit 535b2a5

Please sign in to comment.