static void Postfix(HUDStallWarning __instance) { if (CustomBetty.instance.currentProfile != null) { CustomBetty.Profile voiceProfile = CustomBetty.instance.currentProfile; Debug.Log("Replacing stall warning"); if (voiceProfile.stallWarning != null) { __instance.warningClip = voiceProfile.stallWarning; } } }
public static string GetStall(GameObject vehicle) { try { HUDStallWarning warning = vehicle.GetComponentInChildren <HUDStallWarning>(); //Nullable boolean allows it to get "stalling" if it doesn't exist? and sets it as false? I think. Boolean?stalling = Traverse.Create(warning).Field("stalling").GetValue() as Boolean?; return(stalling.ToString()); } catch (Exception ex) { support.WriteErrorLog("unable to get stall status: " + ex.ToString()); return("False"); } }