diff --git a/Source/Vehicles/.idea/.idea.Vehicles/.idea/workspace.xml b/Source/Vehicles/.idea/.idea.Vehicles/.idea/workspace.xml new file mode 100644 index 00000000..5b240b2d --- /dev/null +++ b/Source/Vehicles/.idea/.idea.Vehicles/.idea/workspace.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + 1773284924984 + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/Vehicles/Components/Vehicles/VehiclePawn/VehiclePawn_Rendering.cs b/Source/Vehicles/Components/Vehicles/VehiclePawn/VehiclePawn_Rendering.cs index 335b806e..7c966d0c 100644 --- a/Source/Vehicles/Components/Vehicles/VehiclePawn/VehiclePawn_Rendering.cs +++ b/Source/Vehicles/Components/Vehicles/VehiclePawn/VehiclePawn_Rendering.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using JetBrains.Annotations; +using Multiplayer.API; using RimWorld; using RimWorld.Planet; using SmashTools; @@ -1075,16 +1076,23 @@ public bool IdeoAllowsBoarding(Pawn selPawn) public void ChangeColor() { - Dialog_VehiclePainter.OpenColorPicker(this, delegate(Color colorOne, Color colorTwo, + var godMode = DebugSettings.godMode; + Dialog_VehiclePainter.OpenColorPicker(this, delegate (Color colorOne, Color colorTwo, Color colorThree, PatternDef patternDef, Vector2 displacement, float tiles) { - patternToPaint = - new PatternData(colorOne, colorTwo, colorThree, patternDef, displacement, tiles); - if (DebugSettings.godMode) + + [SyncMethod] void SyncColor(VehiclePawn self, bool godMode, Color colorOne, Color colorTwo, + Color colorThree, + PatternDef patternDef, Vector2 displacement, float tiles) { - SetColor(); + self.patternToPaint = + new PatternData(colorOne, colorTwo, colorThree, patternDef, displacement, tiles); + if (godMode) + { + self.SetColor(); } } + SyncColor(this, godMode, colorOne, colorTwo, colorThree, patternDef, displacement, tiles); }); } diff --git a/Source/Vehicles/Multiplayer.cs b/Source/Vehicles/Multiplayer.cs new file mode 100644 index 00000000..4d6ee757 --- /dev/null +++ b/Source/Vehicles/Multiplayer.cs @@ -0,0 +1,25 @@ +using Multiplayer.API; +using Verse; +using System; + +namespace VehicleFramework.MultiplayerCompatibility; + + +[StaticConstructorOnStartup] +public static class Multiplayer +{ + static Multiplayer() + { + try + { + + if (!MP.enabled) return; + MP.RegisterAll(); + + } + catch (Exception ex) + { + Log.Warning($"Failed to initialize Multiplayer support for Vehicle Framework in Multiplayer.cs: {ex.Message}"); + } + } +} \ No newline at end of file diff --git a/Source/Vehicles/Vehicles.csproj b/Source/Vehicles/Vehicles.csproj index dbdb136b..b99bf792 100644 --- a/Source/Vehicles/Vehicles.csproj +++ b/Source/Vehicles/Vehicles.csproj @@ -89,6 +89,8 @@ + + False