Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Source/Client/Syncing/Game/SyncFields.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public static partial class SyncFields
public static ISyncField SyncActivityCompSuppression;

public static ISyncField SyncCompRefuelableValue;
public static ISyncField SyncCompRefuelableTargetFuelLevel;

public static void Init()
{
Expand Down Expand Up @@ -239,6 +240,7 @@ public static void Init()
SyncActivityCompSuppression = Sync.Field(typeof(CompActivity), nameof(CompActivity.suppressionEnabled));

SyncCompRefuelableValue = Sync.Field(typeof(CompRefuelable), nameof(CompRefuelable.allowAutoRefuel)).SetBufferChanges();
SyncCompRefuelableTargetFuelLevel = Sync.Field(typeof(CompRefuelable), nameof(CompRefuelable.TargetFuelLevel)).SetBufferChanges();

InitFishingZone();
}
Expand Down Expand Up @@ -618,7 +620,7 @@ static void WatchAwaitingExecution(Pawn pawn)
}

[MpPrefix(typeof(Gizmo_Slider), nameof(Gizmo_Slider.GizmoOnGUI))]
static void SyncGeneResourceChange(Gizmo_Slider __instance)
static void SyncGizmoSlider(Gizmo_Slider __instance)
{
if (__instance is GeneGizmo_Resource geneGizmo)
{
Expand All @@ -640,6 +642,7 @@ static void SyncGeneResourceChange(Gizmo_Slider __instance)
{
var refuelable = fuelGizmo.refuelable;
SyncCompRefuelableValue.Watch(refuelable);
SyncCompRefuelableTargetFuelLevel.Watch(refuelable);
}
}

Expand Down
3 changes: 2 additions & 1 deletion Source/Client/Syncing/Game/SyncMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ public static void Init()
SyncMethod.Register(typeof(CompTransporter), nameof(CompTransporter.CancelLoad), Array.Empty<SyncType>());
SyncMethod.Register(typeof(MapPortal), nameof(MapPortal.CancelLoad));
SyncMethod.Register(typeof(StorageSettings), nameof(StorageSettings.CopyFrom)).ExposeParameter(0);
SyncMethod.Lambda(typeof(Command_SetTargetFuelLevel), nameof(Command_SetTargetFuelLevel.ProcessInput), 2); // Set target fuel level from Dialog_Slider
// Set target fuel level from Dialog_Slider. This only handles changing the fuel level for multiple buildings at once (by shift-clicking to select multiple)
SyncMethod.Lambda(typeof(Command_SetTargetFuelLevel), nameof(Command_SetTargetFuelLevel.ProcessInput), 2);
SyncMethod.Register(typeof(ITab_Pawn_Gear), nameof(ITab_Pawn_Gear.InterfaceDrop)).SetContext(SyncContext.MapSelected | SyncContext.QueueOrder_Down).CancelIfAnyArgNull().CancelIfNoSelectedMapObjects();
SyncMethod.Register(typeof(FoodUtility), nameof(FoodUtility.IngestFromInventoryNow)).SetContext(SyncContext.MapSelected | SyncContext.QueueOrder_Down).CancelIfAnyArgNull().CancelIfNoSelectedMapObjects();

Expand Down
Loading