Skip to content

Commit d06b8ec

Browse files
committed
refactor: move night-runners adapter out of main project
1 parent 408eb4b commit d06b8ec

File tree

12 files changed

+479
-386
lines changed

12 files changed

+479
-386
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<Import Project="../common.props" />
4+
5+
<PropertyGroup>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<RootNamespace>CinematicUnityExplorer.Adapters.NightRunners</RootNamespace>
9+
</PropertyGroup>
10+
11+
12+
<Choose>
13+
<When Condition="'$(IS_CI)'=='true'">
14+
<ItemGroup>
15+
<Reference Include="Assembly-CSharp">
16+
<HintPath>..\NR_INTEROP\Assembly-CSharp.dll</HintPath>
17+
</Reference>
18+
<Reference Include="Assembly-CSharp-firstpass">
19+
<HintPath>..\NR_INTEROP\Assembly-CSharp-firstpass.dll</HintPath>
20+
</Reference>
21+
<Reference Include="Rewired_Core">
22+
<HintPath>..\NR_INTEROP\Rewired_Core.dll</HintPath>
23+
</Reference>
24+
<Reference Include="Rewired_Windows">
25+
<HintPath>..\NR_INTEROP\Rewired_Windows.dll</HintPath>
26+
</Reference>
27+
</ItemGroup>
28+
</When>
29+
<Otherwise>
30+
<ItemGroup Condition="'$(Configuration)'=='BIE_Cpp_CoreCLR' or '$(Configuration)'=='BIE_Unity_Cpp_CoreCLR'">
31+
<Reference Include="Assembly-CSharp">
32+
<HintPath>..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Assembly-CSharp.dll</HintPath>
33+
</Reference>
34+
<Reference Include="Assembly-CSharp-firstpass">
35+
<HintPath>..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Assembly-CSharp-firstpass.dll</HintPath>
36+
</Reference>
37+
<Reference Include="Rewired_Core">
38+
<HintPath>..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Rewired_Core.dll</HintPath>
39+
</Reference>
40+
<Reference Include="Rewired_Windows">
41+
<HintPath>..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Rewired_Windows.dll</HintPath>
42+
</Reference>
43+
</ItemGroup>
44+
45+
<ItemGroup Condition="'$(Configuration)'=='ML_Cpp_CoreCLR'">
46+
<Reference Include="Assembly-CSharp">
47+
<HintPath>..\..\..\..\Steam\steamapps\common\NIGHT-RUNNERS PROLOGUE\MelonLoader\Il2CppAssemblies\Assembly-CSharp.dll</HintPath>
48+
</Reference>
49+
<Reference Include="Assembly-CSharp-firstpass">
50+
<HintPath>..\..\..\..\Steam\steamapps\common\NIGHT-RUNNERS PROLOGUE\MelonLoader\Il2CppAssemblies\Assembly-CSharp-firstpass.dll</HintPath>
51+
</Reference>
52+
<Reference Include="Rewired_Core">
53+
<HintPath>..\..\..\..\Steam\steamapps\common\NIGHT-RUNNERS PROLOGUE\MelonLoader\Il2CppAssemblies\Il2CppRewired_Core.dll</HintPath>
54+
</Reference>
55+
<Reference Include="Rewired_Windows">
56+
<HintPath>..\..\..\..\Steam\steamapps\common\NIGHT-RUNNERS PROLOGUE\MelonLoader\Il2CppAssemblies\Il2CppRewired_Windows.dll</HintPath>
57+
</Reference>
58+
</ItemGroup>
59+
</Otherwise>
60+
</Choose>
61+
62+
<ItemDefinitionGroup>
63+
<Reference>
64+
<Private>False</Private>
65+
</Reference>
66+
</ItemDefinitionGroup>
67+
</Project>

src/NightRunners/Extensions/GameObjectExtensions.cs renamed to UnityExplorer.Adapters.NightRunners/Extensions/GameObjectExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace CinematicUnityExplorer.NightRunners.Extensions
1+
namespace CinematicUnityExplorer.Adapters.NightRunners.Extensions
22
{
33
public static class GameObjectExtensions
44
{
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Global using directives
2+
3+
global using UnityEngine;
4+
5+
#if ML
6+
global using Il2Cpp;
7+
#endif
8+
9+
#if INTEROP
10+
global using Il2CppInterop.Runtime;
11+
#else
12+
global using UnhollowerRuntimeLib;
13+
global using UnhollowerBaseLib;
14+
#endif

src/NightRunners/Utils/RCCUtils.cs renamed to UnityExplorer.Adapters.NightRunners/Utils/RCCUtils.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
using CinematicUnityExplorer.NightRunners.Extensions;
1+
using CinematicUnityExplorer.Adapters.NightRunners.Extensions;
22

33
#if BIE
44
using Rewired;
5+
56
#else
67
using Il2CppRewired;
78
#endif
89

9-
namespace CinematicUnityExplorer.NightRunners.Utils
10+
namespace CinematicUnityExplorer.Adapters.NightRunners.Utils
1011
{
1112
public static class RCCUtils
1213
{
14+
public static GameObject GetPlayerCar()
15+
{
16+
return GodConstant.Instance.playerCar.gameObject;
17+
}
18+
1319
public static void ToggleCameraController(GameObject container, bool enable)
1420
{
1521
if (IsPlayerCameraScene())

src/NightRunners/Utils/RecordUtils.cs renamed to UnityExplorer.Adapters.NightRunners/Utils/RecordUtils.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
namespace CinematicUnityExplorer.NightRunners.Utils
1+
namespace CinematicUnityExplorer.Adapters.NightRunners.Utils
22
{
33
public static class RecordUtils
44
{
5-
public static RCC_Recorder.Mode GetMode()
5+
public static RecorderMode GetMode()
66
{
7-
return RCC_SceneManager.instance.recorder.mode;
7+
return (RecorderMode)RCC_SceneManager.instance.recorder.mode;
88
}
99

1010
public static void StartRecord()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace CinematicUnityExplorer.Adapters.NightRunners.Utils
2+
{
3+
public enum RecorderMode
4+
{
5+
Neutral,
6+
Play,
7+
Record
8+
}
9+
}

0 commit comments

Comments
 (0)