Skip to content

Commit

Permalink
SRB's will now post Messages to the Messaging App
Browse files Browse the repository at this point in the history
  • Loading branch information
severedsolo committed Sep 20, 2019
1 parent 972615b commit 1255b01
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion OhScrap/SRBFailureModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Text;
using UnityEngine;
using System.Runtime.CompilerServices;
using KSP.UI.Screens;

namespace OhScrap
{
Expand Down Expand Up @@ -43,8 +44,16 @@ public override void FailPart()
if(vessel.vesselType != VesselType.Debris) ScreenMessages.PostScreenMessage(part.partInfo.title + " has failed to ignite");
message = true;
}
StringBuilder msg = new StringBuilder();
msg.AppendLine(part.vessel.vesselName);
msg.AppendLine("");
msg.AppendLine(part.partInfo.title + " has suffered an " + failureType);
msg.AppendLine("");
MessageSystem.Message m = new MessageSystem.Message("OhScrap", msg.ToString(), MessageSystemButton.MessageButtonColor.ORANGE, MessageSystemButton.ButtonIcons.ALERT);
MessageSystem.Instance.AddMessage(m);
if (OhScrap.highlight) OhScrap.SetFailedHighlight();
CancelInvoke("FailPart");
Debug.Log("[OhScrap]: "+part.partInfo.title+" has failed to ignite");
}

//SRBs cant be repaired.
Expand All @@ -53,7 +62,6 @@ public override void RepairPart()
ScreenMessages.PostScreenMessage("Igniting an SRB manually doesn't seem like a good idea");
ModuleUPFMEvents UPFM = part.FindModuleImplementing<ModuleUPFMEvents>();
UPFM.customFailureEvent = true;
return;
}
}
}

0 comments on commit 1255b01

Please sign in to comment.