public static void Postfix(LocoKeyboardInputShunter __instance) { if (__instance.currentInputSpeedThrottle == 0.0f && __instance.throttleVelo == 0.0f) { __instance.setThrottleDelegate(ThrottleNotching.Notched(__instance.control.targetThrottle)); } }
public static bool Prefix(LocoControllerShunter __instance) { var sim = __instance.sim; sim.throttle.SetValue(sim.engineOn ? ThrottleNotching.Notched(__instance.targetThrottle) : 0.0f); return(false); }
// Notches 0 and 1 are idle, so 7 distinct RPM settings possible public static float TargetRPM(float targetThrottle) => Mathf.Max(0f, (ThrottleNotching.GetNotch(targetThrottle) - 1) / (NumNotches - 1));