private static void Update() { IDynamicWorldObject vehicle = null; IProtoVehicle protoVehicle = null; if (ClientHotbarSelectedItemManager.SelectedItem?.ProtoItem is IProtoItemVehicleRepairKit && ClientCurrentCharacterHelper.PublicState.CurrentPublicActionState is not VehicleRepairActionState.PublicState) { vehicle = VehicleRepairKitSystem.ClientGetObjectToRepairAtCurrentMousePosition(); protoVehicle = vehicle?.ProtoGameObject as IProtoVehicle; } if (currentTooltipVehicle != vehicle) { tooltip?.Destroy(); tooltip = null; currentTooltipVehicle = vehicle; } if (protoVehicle is null) { return; } tooltip ??= VehicleRepairKitTooltip.CreateAndAttach(vehicle); }
protected override void ClientItemUseStart(ClientItemData data) { VehicleRepairKitSystem.ClientTryStartAction(); }
protected override bool ClientItemUseFinish(ClientItemData data) { VehicleRepairKitSystem.ClientTryAbortAction(); // never play "use" sound return(false); }