Skip to content

Commit f84bddd

Browse files
committed
Added start for BZ
1 parent 0a322c0 commit f84bddd

File tree

87 files changed

+622
-67
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+622
-67
lines changed

Directory.Build.props

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
<PropertyGroup Condition="'$(MSBuildProjectName)' == 'Nitrox.Test'">
3232
<TestLibrary>true</TestLibrary>
3333
</PropertyGroup>
34+
<PropertyGroup Condition=" '$(Configuration)' == 'BelowZero' ">
35+
<DefineConstants>DEBUG;BELOWZERO</DefineConstants>
36+
<OutputPath>bin\BelowZero\</OutputPath>
37+
</PropertyGroup>
38+
3439

3540
<!-- Shared dependencies for all Nitrox.* projects -->
3641
<Choose>

Nitrox.BuildTool/Nitrox.BuildTool.csproj

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
<Nullable>disable</Nullable>
77
<OutputPath>bin\</OutputPath>
88
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
9+
<Configurations>Debug;Release;BelowZero;Subnautica</Configurations>
910
</PropertyGroup>
1011

1112
<ItemGroup>
12-
<PackageReference Include="Mono.Cecil" Version="0.11.4"/>
13+
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
1314
</ItemGroup>
1415

1516
<ItemGroup>
16-
<ProjectReference Include="..\NitroxModel\NitroxModel.csproj"/>
17+
<ProjectReference Include="..\NitroxModel\NitroxModel.csproj" />
1718
</ItemGroup>
1819

1920
</Project>

Nitrox.Test/Nitrox.Test.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<TargetFramework>net472</TargetFramework>
55
<Nullable>disable</Nullable>
66
<IsPackable>false</IsPackable>
7+
<Configurations>Debug;Release;BelowZero;Subnautica</Configurations>
78
</PropertyGroup>
89

910
<ItemGroup>

Nitrox.Test/Server/Serialization/WorldPersistenceTest.cs

+4
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,10 @@ private static void StoryGoalTest(StoryGoalData storyGoal, StoryGoalData storyGo
122122
private static void StoryTimingTest(StoryTimingData storyTiming, StoryTimingData storyTimingAfter)
123123
{
124124
Assert.AreEqual(storyTiming.ElapsedSeconds, storyTimingAfter.ElapsedSeconds);
125+
#if SUBNAUTICA
125126
Assert.AreEqual(storyTiming.AuroraCountdownTime, storyTimingAfter.AuroraCountdownTime);
126127
Assert.AreEqual(storyTiming.AuroraWarningTime, storyTimingAfter.AuroraWarningTime);
128+
#endif
127129
}
128130

129131
[DataTestMethod, DynamicWorldDataAfter]
@@ -147,7 +149,9 @@ public void PlayerDataTest(PersistedWorldData worldDataAfter, string serializerN
147149
Assert.AreEqual(playerData.CurrentStats.Health, playerDataAfter.CurrentStats.Health);
148150
Assert.AreEqual(playerData.CurrentStats.Food, playerDataAfter.CurrentStats.Food);
149151
Assert.AreEqual(playerData.CurrentStats.Water, playerDataAfter.CurrentStats.Water);
152+
#if SUBNAUTICA
150153
Assert.AreEqual(playerData.CurrentStats.InfectionAmount, playerDataAfter.CurrentStats.InfectionAmount);
154+
#endif
151155

152156
Assert.AreEqual(playerData.SubRootId, playerDataAfter.SubRootId);
153157
Assert.AreEqual(playerData.Permissions, playerDataAfter.Permissions);

Nitrox.sln

+41-3
Original file line numberDiff line numberDiff line change
@@ -31,55 +31,93 @@ EndProject
3131
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Nitrox.Assets.Subnautica", "Nitrox.Assets.Subnautica\Nitrox.Assets.Subnautica.shproj", "{79E92B6D-5D25-4254-AC9F-FA9A1CD3CBC6}"
3232
EndProject
3333
Global
34-
GlobalSection(SharedMSBuildProjectFiles) = preSolution
35-
Nitrox.Assets.Subnautica\Nitrox.Assets.Subnautica.projitems*{79e92b6d-5d25-4254-ac9f-fa9a1cd3cbc6}*SharedItemsImports = 13
36-
EndGlobalSection
3734
GlobalSection(SolutionConfigurationPlatforms) = preSolution
35+
BelowZero|Any CPU = BelowZero|Any CPU
3836
Debug|Any CPU = Debug|Any CPU
3937
Release|Any CPU = Release|Any CPU
38+
Subnautica|Any CPU = Subnautica|Any CPU
4039
EndGlobalSection
4140
GlobalSection(ProjectConfigurationPlatforms) = postSolution
41+
{CB7FAEFC-D9C0-40B8-A6D5-8B284683E79E}.BelowZero|Any CPU.ActiveCfg = BelowZero|Any CPU
42+
{CB7FAEFC-D9C0-40B8-A6D5-8B284683E79E}.BelowZero|Any CPU.Build.0 = BelowZero|Any CPU
4243
{CB7FAEFC-D9C0-40B8-A6D5-8B284683E79E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4344
{CB7FAEFC-D9C0-40B8-A6D5-8B284683E79E}.Debug|Any CPU.Build.0 = Debug|Any CPU
4445
{CB7FAEFC-D9C0-40B8-A6D5-8B284683E79E}.Release|Any CPU.ActiveCfg = Release|Any CPU
4546
{CB7FAEFC-D9C0-40B8-A6D5-8B284683E79E}.Release|Any CPU.Build.0 = Release|Any CPU
47+
{CB7FAEFC-D9C0-40B8-A6D5-8B284683E79E}.Subnautica|Any CPU.ActiveCfg = Subnautica|Any CPU
48+
{CB7FAEFC-D9C0-40B8-A6D5-8B284683E79E}.Subnautica|Any CPU.Build.0 = Subnautica|Any CPU
49+
{EBEBC7DC-FAE3-4FBC-BDD3-38ED8FC072D9}.BelowZero|Any CPU.ActiveCfg = BelowZero|Any CPU
50+
{EBEBC7DC-FAE3-4FBC-BDD3-38ED8FC072D9}.BelowZero|Any CPU.Build.0 = BelowZero|Any CPU
4651
{EBEBC7DC-FAE3-4FBC-BDD3-38ED8FC072D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4752
{EBEBC7DC-FAE3-4FBC-BDD3-38ED8FC072D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
4853
{EBEBC7DC-FAE3-4FBC-BDD3-38ED8FC072D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
4954
{EBEBC7DC-FAE3-4FBC-BDD3-38ED8FC072D9}.Release|Any CPU.Build.0 = Release|Any CPU
55+
{EBEBC7DC-FAE3-4FBC-BDD3-38ED8FC072D9}.Subnautica|Any CPU.ActiveCfg = Subnautica|Any CPU
56+
{EBEBC7DC-FAE3-4FBC-BDD3-38ED8FC072D9}.Subnautica|Any CPU.Build.0 = Subnautica|Any CPU
57+
{59EB8953-864F-4147-A210-7FC97E1A5294}.BelowZero|Any CPU.ActiveCfg = BelowZero|Any CPU
58+
{59EB8953-864F-4147-A210-7FC97E1A5294}.BelowZero|Any CPU.Build.0 = BelowZero|Any CPU
5059
{59EB8953-864F-4147-A210-7FC97E1A5294}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5160
{59EB8953-864F-4147-A210-7FC97E1A5294}.Debug|Any CPU.Build.0 = Debug|Any CPU
5261
{59EB8953-864F-4147-A210-7FC97E1A5294}.Release|Any CPU.ActiveCfg = Release|Any CPU
5362
{59EB8953-864F-4147-A210-7FC97E1A5294}.Release|Any CPU.Build.0 = Release|Any CPU
63+
{59EB8953-864F-4147-A210-7FC97E1A5294}.Subnautica|Any CPU.ActiveCfg = Subnautica|Any CPU
64+
{59EB8953-864F-4147-A210-7FC97E1A5294}.Subnautica|Any CPU.Build.0 = Subnautica|Any CPU
65+
{39E377AD-2163-4428-952D-EBECD402C8F3}.BelowZero|Any CPU.ActiveCfg = BelowZero|Any CPU
66+
{39E377AD-2163-4428-952D-EBECD402C8F3}.BelowZero|Any CPU.Build.0 = BelowZero|Any CPU
5467
{39E377AD-2163-4428-952D-EBECD402C8F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5568
{39E377AD-2163-4428-952D-EBECD402C8F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
5669
{39E377AD-2163-4428-952D-EBECD402C8F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
5770
{39E377AD-2163-4428-952D-EBECD402C8F3}.Release|Any CPU.Build.0 = Release|Any CPU
71+
{39E377AD-2163-4428-952D-EBECD402C8F3}.Subnautica|Any CPU.ActiveCfg = Subnautica|Any CPU
72+
{39E377AD-2163-4428-952D-EBECD402C8F3}.Subnautica|Any CPU.Build.0 = Subnautica|Any CPU
73+
{47D774E0-750C-427B-8C38-F8F985114A2E}.BelowZero|Any CPU.ActiveCfg = BelowZero|Any CPU
74+
{47D774E0-750C-427B-8C38-F8F985114A2E}.BelowZero|Any CPU.Build.0 = BelowZero|Any CPU
5875
{47D774E0-750C-427B-8C38-F8F985114A2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5976
{47D774E0-750C-427B-8C38-F8F985114A2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
6077
{47D774E0-750C-427B-8C38-F8F985114A2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
6178
{47D774E0-750C-427B-8C38-F8F985114A2E}.Release|Any CPU.Build.0 = Release|Any CPU
79+
{47D774E0-750C-427B-8C38-F8F985114A2E}.Subnautica|Any CPU.ActiveCfg = Subnautica|Any CPU
80+
{47D774E0-750C-427B-8C38-F8F985114A2E}.Subnautica|Any CPU.Build.0 = Subnautica|Any CPU
81+
{5453E724-5A8B-46A4-850B-1F17FA2E938D}.BelowZero|Any CPU.ActiveCfg = BelowZero|Any CPU
82+
{5453E724-5A8B-46A4-850B-1F17FA2E938D}.BelowZero|Any CPU.Build.0 = BelowZero|Any CPU
6283
{5453E724-5A8B-46A4-850B-1F17FA2E938D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6384
{5453E724-5A8B-46A4-850B-1F17FA2E938D}.Debug|Any CPU.Build.0 = Debug|Any CPU
6485
{5453E724-5A8B-46A4-850B-1F17FA2E938D}.Release|Any CPU.ActiveCfg = Release|Any CPU
6586
{5453E724-5A8B-46A4-850B-1F17FA2E938D}.Release|Any CPU.Build.0 = Release|Any CPU
87+
{5453E724-5A8B-46A4-850B-1F17FA2E938D}.Subnautica|Any CPU.ActiveCfg = Subnautica|Any CPU
88+
{5453E724-5A8B-46A4-850B-1F17FA2E938D}.Subnautica|Any CPU.Build.0 = Subnautica|Any CPU
89+
{77692FDB-F713-41F1-B2AB-9019457B8909}.BelowZero|Any CPU.ActiveCfg = BelowZero|Any CPU
90+
{77692FDB-F713-41F1-B2AB-9019457B8909}.BelowZero|Any CPU.Build.0 = BelowZero|Any CPU
6691
{77692FDB-F713-41F1-B2AB-9019457B8909}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6792
{77692FDB-F713-41F1-B2AB-9019457B8909}.Debug|Any CPU.Build.0 = Debug|Any CPU
6893
{77692FDB-F713-41F1-B2AB-9019457B8909}.Release|Any CPU.ActiveCfg = Release|Any CPU
6994
{77692FDB-F713-41F1-B2AB-9019457B8909}.Release|Any CPU.Build.0 = Release|Any CPU
95+
{77692FDB-F713-41F1-B2AB-9019457B8909}.Subnautica|Any CPU.ActiveCfg = Subnautica|Any CPU
96+
{77692FDB-F713-41F1-B2AB-9019457B8909}.Subnautica|Any CPU.Build.0 = Subnautica|Any CPU
97+
{0CD6846B-EDA6-4FFD-A540-2A46CC1074BF}.BelowZero|Any CPU.ActiveCfg = BelowZero|Any CPU
98+
{0CD6846B-EDA6-4FFD-A540-2A46CC1074BF}.BelowZero|Any CPU.Build.0 = BelowZero|Any CPU
7099
{0CD6846B-EDA6-4FFD-A540-2A46CC1074BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
71100
{0CD6846B-EDA6-4FFD-A540-2A46CC1074BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
72101
{0CD6846B-EDA6-4FFD-A540-2A46CC1074BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
73102
{0CD6846B-EDA6-4FFD-A540-2A46CC1074BF}.Release|Any CPU.Build.0 = Release|Any CPU
103+
{0CD6846B-EDA6-4FFD-A540-2A46CC1074BF}.Subnautica|Any CPU.ActiveCfg = Subnautica|Any CPU
104+
{0CD6846B-EDA6-4FFD-A540-2A46CC1074BF}.Subnautica|Any CPU.Build.0 = Subnautica|Any CPU
105+
{E4D8C360-34E4-4BE6-909F-3791DD9169B5}.BelowZero|Any CPU.ActiveCfg = BelowZero|Any CPU
106+
{E4D8C360-34E4-4BE6-909F-3791DD9169B5}.BelowZero|Any CPU.Build.0 = BelowZero|Any CPU
74107
{E4D8C360-34E4-4BE6-909F-3791DD9169B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
75108
{E4D8C360-34E4-4BE6-909F-3791DD9169B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
76109
{E4D8C360-34E4-4BE6-909F-3791DD9169B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
77110
{E4D8C360-34E4-4BE6-909F-3791DD9169B5}.Release|Any CPU.Build.0 = Release|Any CPU
111+
{E4D8C360-34E4-4BE6-909F-3791DD9169B5}.Subnautica|Any CPU.ActiveCfg = Subnautica|Any CPU
112+
{E4D8C360-34E4-4BE6-909F-3791DD9169B5}.Subnautica|Any CPU.Build.0 = Subnautica|Any CPU
78113
EndGlobalSection
79114
GlobalSection(SolutionProperties) = preSolution
80115
HideSolutionNode = FALSE
81116
EndGlobalSection
82117
GlobalSection(ExtensibilityGlobals) = postSolution
83118
SolutionGuid = {AC56EA37-FBBC-4D19-8796-29A42A2331A2}
84119
EndGlobalSection
120+
GlobalSection(SharedMSBuildProjectFiles) = preSolution
121+
Nitrox.Assets.Subnautica\Nitrox.Assets.Subnautica.projitems*{79e92b6d-5d25-4254-ac9f-fa9a1cd3cbc6}*SharedItemsImports = 13
122+
EndGlobalSection
85123
EndGlobal

NitroxClient/Communication/Packets/Processors/AuroraAndTimeUpdateProcessor.cs

+2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ public AuroraAndTimeUpdateProcessor(TimeManager timeManager)
1616
public override void Process(AuroraAndTimeUpdate packet)
1717
{
1818
timeManager.ProcessUpdate(packet.TimeData.TimePacket);
19+
#if SUBNAUTICA
1920
StoryManager.UpdateAuroraData(packet.TimeData.AuroraEventData);
2021
timeManager.AuroraRealExplosionTime = packet.TimeData.AuroraEventData.AuroraRealExplosionTime;
2122
if (packet.Restore)
2223
{
2324
StoryManager.RestoreAurora();
2425
}
26+
#endif
2527
}
2628
}

NitroxClient/Communication/Packets/Processors/EscapePodChangedProcessor.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using NitroxClient.Communication.Packets.Processors.Abstract;
1+
#if SUBNAUTICA
2+
using NitroxClient.Communication.Packets.Processors.Abstract;
23
using NitroxClient.GameLogic;
34
using NitroxClient.MonoBehaviours;
45
using NitroxModel.DataStructures.Util;
@@ -35,5 +36,4 @@ public override void Process(EscapePodChanged packet)
3536
}
3637
}
3738
}
38-
39-
39+
#endif

NitroxClient/Communication/Packets/Processors/GameModeChangedProcessor.cs

+4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ public override void Process(GameModeChanged packet)
1919
{
2020
if (packet.AllPlayers || packet.PlayerId == localPlayer.PlayerId)
2121
{
22+
#if SUBNAUTICA
2223
GameModeUtils.SetGameMode((GameModeOption)(int)packet.GameMode, GameModeOption.None);
24+
#elif BELOWZERO
25+
GameModeManager.SetGameOptions((GameModePresetId)(int)packet.GameMode);
26+
#endif
2327
}
2428
if (packet.AllPlayers)
2529
{

NitroxClient/Communication/Packets/Processors/PDAEncyclopediaEntryAddProcessor.cs

+4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ public override void Process(PDAEncyclopediaEntryAdd packet)
1717
{
1818
using (PacketSuppressor<PDAEncyclopediaEntryAdd>.Suppress())
1919
{
20+
#if SUBNAUTICA
2021
PDAEncyclopedia.Add(packet.Key, packet.Verbose);
22+
#elif BELOWZERO
23+
PDAEncyclopedia.Add(packet.Key, packet.Verbose, packet.PostNotification);
24+
#endif
2125
}
2226
}
2327
}

NitroxClient/Communication/Packets/Processors/PDALogEntryAddProcessor.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using NitroxClient.Communication.Abstract;
1+
using NitroxClient.Communication.Abstract;
22
using NitroxClient.Communication.Packets.Processors.Abstract;
33
using NitroxModel.Packets;
44

@@ -17,7 +17,11 @@ public override void Process(PDALogEntryAdd packet)
1717
{
1818
using (PacketSuppressor<PDALogEntryAdd>.Suppress())
1919
{
20+
#if SUBNAUTICA
2021
PDALog.Add(packet.Key);
22+
#elif BELOWZERO
23+
PDALog.Add(packet.Key, true);
24+
#endif
2125
}
2226
}
2327
}

NitroxClient/Communication/Packets/Processors/VehicleDockingProcessor.cs

+22-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections;
1+
using System.Collections;
22
using NitroxClient.Communication.Abstract;
33
using NitroxClient.Communication.Packets.Processors.Abstract;
44
using NitroxClient.GameLogic;
@@ -25,7 +25,7 @@ public override void Process(VehicleDocking packet)
2525
{
2626
GameObject vehicleGo = NitroxEntity.RequireObjectFrom(packet.VehicleId);
2727
GameObject vehicleDockingBayGo = NitroxEntity.RequireObjectFrom(packet.DockId);
28-
28+
#if SUBNAUTICA
2929
Vehicle vehicle = vehicleGo.RequireComponent<Vehicle>();
3030
VehicleDockingBay vehicleDockingBay = vehicleDockingBayGo.RequireComponent<VehicleDockingBay>();
3131

@@ -36,15 +36,35 @@ public override void Process(VehicleDocking packet)
3636
vehicle.GetComponent<MultiplayerVehicleControl>().Exit();
3737
}
3838
vehicle.StartCoroutine(DelayAnimationAndDisablePiloting(vehicle, vehicleDockingBay, packet.VehicleId, packet.PlayerId));
39+
#elif BELOWZERO
40+
Dockable dockable = vehicleGo.RequireComponent<Dockable>();
41+
VehicleDockingBay vehicleDockingBay = vehicleDockingBayGo.RequireComponent<VehicleDockingBay>();
42+
43+
using (PacketSuppressor<VehicleDocking>.Suppress())
44+
{
45+
Log.Debug($"Set docked for {vehicleDockingBay.gameObject.name}");
46+
dockable.GetComponent<MultiplayerVehicleControl>().SetPositionVelocityRotation(dockable.transform.position, Vector3.zero, dockable.transform.rotation, Vector3.zero);
47+
dockable.GetComponent<MultiplayerVehicleControl>().Exit();
48+
}
49+
dockable.StartCoroutine(DelayAnimationAndDisablePiloting(dockable, vehicleDockingBay, packet.VehicleId, packet.PlayerId));
50+
#endif
3951
}
4052

53+
#if SUBNAUTICA
4154
IEnumerator DelayAnimationAndDisablePiloting(Vehicle vehicle, VehicleDockingBay vehicleDockingBay, NitroxId vehicleId, ushort playerId)
55+
#elif BELOWZERO
56+
IEnumerator DelayAnimationAndDisablePiloting(Dockable vehicle, VehicleDockingBay vehicleDockingBay, NitroxId vehicleId, ushort playerId)
57+
#endif
4258
{
4359
yield return Yielders.WaitFor1Second;
4460
// DockVehicle sets the rigid body kinematic of the vehicle to true, we don't want that behaviour
4561
// Therefore disable kinematic (again) to remove the bouncing behavior
62+
#if SUBNAUTICA
4663
vehicleDockingBay.DockVehicle(vehicle);
4764
vehicle.useRigidbody.isKinematic = false;
65+
#elif BELOWZERO
66+
vehicleDockingBay.Dock(vehicle);
67+
#endif
4868
yield return Yielders.WaitFor2Seconds;
4969
vehicles.SetOnPilotMode(vehicleId, playerId, false);
5070
if (!vehicle.docked)

NitroxClient/Communication/Packets/Processors/VehicleUndockingProcessor.cs

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections;
1+
using System.Collections;
22
using NitroxClient.Communication.Abstract;
33
using NitroxClient.Communication.Packets.Processors.Abstract;
44
using NitroxClient.GameLogic;
@@ -58,7 +58,9 @@ private void StartVehicleUndocking(VehicleUndocking packet, GameObject vehicleGo
5858
// It can happen that the player turns in circles around himself in the vehicle. This stops it.
5959
playerInstance.RigidBody.angularVelocity = Vector3.zero;
6060
playerInstance.ArmsController.SetWorldIKTarget(vehicle.leftHandPlug, vehicle.rightHandPlug);
61+
#if SUBNAUTICA
6162
playerInstance.AnimationController["in_seamoth"] = vehicle is SeaMoth;
63+
#endif
6264
playerInstance.AnimationController["in_exosuit"] = playerInstance.AnimationController["using_mechsuit"] = vehicle is Exosuit;
6365
vehicles.SetOnPilotMode(packet.VehicleId, packet.PlayerId, true);
6466
playerInstance.AnimationController.UpdatePlayerAnimations = false;
@@ -69,7 +71,11 @@ private void StartVehicleUndocking(VehicleUndocking packet, GameObject vehicleGo
6971
public IEnumerator StartUndockingAnimation(VehicleDockingBay vehicleDockingBay)
7072
{
7173
yield return Yielders.WaitFor2Seconds;
74+
#if SUBNAUTICA
7275
vehicleDockingBay.vehicle_docked_param = false;
76+
#elif BELOWZERO
77+
vehicleDockingBay.docked_param = false;
78+
#endif
7379
}
7480

7581
private void FinishVehicleUndocking(VehicleUndocking packet, Vehicle vehicle, VehicleDockingBay vehicleDockingBay)
@@ -78,7 +84,11 @@ private void FinishVehicleUndocking(VehicleUndocking packet, Vehicle vehicle, Ve
7884
{
7985
vehicleDockingBay.SetVehicleUndocked();
8086
}
87+
#if SUBNAUTICA
8188
vehicleDockingBay.dockedVehicle = null;
89+
#elif BELOWZERO
90+
vehicleDockingBay.dockedObject = null;
91+
#endif
8292
vehicleDockingBay.CancelInvoke("RepairVehicle");
8393
vehicle.docked = false;
8494
Optional<RemotePlayer> player = remotePlayerManager.Find(packet.PlayerId);

NitroxClient/GameLogic/HUD/NitroxPDATabManager.cs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
2+
using UnityEngine;
23

34
namespace NitroxClient.GameLogic.HUD;
45

56
public class NitroxPDATabManager
67
{
78
public readonly Dictionary<PDATab, NitroxPDATab> CustomTabs = new();
89

9-
private readonly Dictionary<string, Atlas.Sprite> tabSpritesByName = new();
10+
private readonly Dictionary<string, Sprite> tabSpritesByName = new();
1011
private readonly Dictionary<string, TabSpriteLoadedEvent> spriteLoadedCallbackByName = new();
1112

1213
public NitroxPDATabManager()
@@ -19,7 +20,7 @@ void RegisterTab(NitroxPDATab nitroxTab)
1920
RegisterTab(new PlayerListTab());
2021
}
2122

22-
public void AddTabSprite(string spriteName, Atlas.Sprite sprite)
23+
public void AddTabSprite(string spriteName, Sprite sprite)
2324
{
2425
tabSpritesByName.Add(spriteName, sprite);
2526
if (spriteLoadedCallbackByName.TryGetValue(spriteName, out TabSpriteLoadedEvent spriteLoadedEvent))
@@ -29,9 +30,9 @@ public void AddTabSprite(string spriteName, Atlas.Sprite sprite)
2930
}
3031
}
3132

32-
public bool TryGetTabSprite(string spriteName, out Atlas.Sprite sprite) => tabSpritesByName.TryGetValue(spriteName, out sprite);
33+
public bool TryGetTabSprite(string spriteName, out Sprite sprite) => tabSpritesByName.TryGetValue(spriteName, out sprite);
3334

34-
public delegate void TabSpriteLoadedEvent(Atlas.Sprite sprite);
35+
public delegate void TabSpriteLoadedEvent(Sprite sprite);
3536

3637
public void SetSpriteLoadedCallback(string tabName, TabSpriteLoadedEvent callback)
3738
{

NitroxClient/GameLogic/HUD/PdaTabs/uGUI_PlayerListTab.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public IEnumerator Start()
7575
{
7676
if (asset.name.Equals("player_list_tab@3x"))
7777
{
78-
nitroxPDATabManager.AddTabSprite(asset.name, new Atlas.Sprite(sprite));
78+
nitroxPDATabManager.AddTabSprite(asset.name, Sprite.Create(sprite.texture, sprite.rect, sprite.pivot, sprite.pixelsPerUnit));
7979
}
8080
assets.Add(asset.name, sprite);
8181
}

NitroxClient/GameLogic/InitialSync/PdaInitialSyncProcessor.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ private static IEnumerator RestoreEncyclopediaEntries(InitialPlayerSync packet)
6565
// We don't do as in PDAEncyclopedia.Deserialize because we don't persist the entry's fields which are useless
6666
foreach (string entry in entries)
6767
{
68-
PDAEncyclopedia.Add(entry, false);
68+
#if SUBNAUTICA
69+
PDAEncyclopedia.Add(entry, false);
70+
#elif BELOWZERO
71+
PDAEncyclopedia.Add(entry, false, false);
72+
#endif
6973
}
7074
}
7175
yield break;

0 commit comments

Comments
 (0)