public static void Message(string text, LookTargets lookTargets, MessageTypeDef def, bool historical = true) { if (AcceptsMessage(text, lookTargets)) { Message(new Message(text.CapitalizeFirst(), def, lookTargets), historical); } }
public static bool SameTargets(LookTargets a, LookTargets b) { bool result; if (a == null) { result = (b == null || !b.Any); } else if (b == null) { result = (a == null || !a.Any); } else if (a.targets.Count != b.targets.Count) { result = false; } else { for (int i = 0; i < a.targets.Count; i++) { if (a.targets[i] != b.targets[i]) { return(false); } } result = true; } return(result); }
public static bool SameTargets(LookTargets a, LookTargets b) { if (a == null) { if (b != null) { return(!b.Any); } return(true); } if (b == null) { if (a != null) { return(!a.Any); } return(true); } if (a.targets.Count != b.targets.Count) { return(false); } for (int i = 0; i < a.targets.Count; i++) { if (a.targets[i] != b.targets[i]) { return(false); } } return(true); }
public static void TryHighlight(this LookTargets lookTargets, bool arrow = true, bool colonistBar = true, bool circleOverlay = false) { if (lookTargets != null) { lookTargets.Highlight(arrow, colonistBar, circleOverlay); } }
public static GlobalTargetInfo TryGetPrimaryTarget(this LookTargets lookTargets) { if (lookTargets == null) { return(GlobalTargetInfo.Invalid); } return(lookTargets.PrimaryTarget); }
public static void Message(string text, LookTargets lookTargets, MessageTypeDef def, bool historical = true) { if (Messages.AcceptsMessage(text, lookTargets)) { Message msg = new Message(text, def, lookTargets); Messages.Message(msg, historical); } }
public static GlobalTargetInfo TryGetPrimaryTarget(this LookTargets lookTargets) { GlobalTargetInfo result; if (lookTargets == null) { result = GlobalTargetInfo.Invalid; } else { result = lookTargets.PrimaryTarget; } return(result); }
private static bool AcceptsMessage(string text, LookTargets lookTargets) { if (text.NullOrEmpty()) { return(false); } for (int i = 0; i < liveMessages.Count; i++) { if (liveMessages[i].text == text && liveMessages[i].startingFrame == RealTime.frameCount && LookTargets.SameTargets(liveMessages[i].lookTargets, lookTargets)) { return(false); } } return(true); }
private static bool AcceptsMessage(string text, LookTargets lookTargets) { bool result; if (text.NullOrEmpty()) { result = false; } else { for (int i = 0; i < Messages.liveMessages.Count; i++) { if (Messages.liveMessages[i].text == text && Messages.liveMessages[i].startingFrame == RealTime.frameCount && LookTargets.SameTargets(Messages.liveMessages[i].lookTargets, lookTargets)) { return(false); } } result = true; } return(result); }
public Message(string text, MessageTypeDef def, LookTargets lookTargets, Quest quest) : this(text, def, lookTargets) { this.quest = quest; }
public Message(string text, MessageTypeDef def, LookTargets lookTargets) : this(text, def) { this.lookTargets = lookTargets; }
public static bool IsValid(this LookTargets lookTargets) { return(lookTargets?.IsValid ?? false); }
public void ReceiveLetter(string label, string text, LetterDef textLetterDef, LookTargets lookTargets, Faction relatedFaction = null, string debugInfo = null) { ChoiceLetter let = LetterMaker.MakeLetter(label, text, textLetterDef, lookTargets, relatedFaction); this.ReceiveLetter(let, debugInfo); }
public static ChoiceLetter MakeLetter(TaggedString label, TaggedString text, LetterDef def, LookTargets lookTargets, Faction relatedFaction = null, Quest quest = null, List <ThingDef> hyperlinkThingDefs = null) { ChoiceLetter choiceLetter = MakeLetter(label, text, def); choiceLetter.lookTargets = lookTargets; choiceLetter.relatedFaction = relatedFaction; choiceLetter.quest = quest; choiceLetter.hyperlinkThingDefs = hyperlinkThingDefs; return(choiceLetter); }
public void ReceiveLetter(TaggedString label, TaggedString text, LetterDef textLetterDef, LookTargets lookTargets, Faction relatedFaction = null, Quest quest = null, List <ThingDef> hyperlinkThingDefs = null, string debugInfo = null) { ChoiceLetter let = LetterMaker.MakeLetter(label, text, textLetterDef, lookTargets, relatedFaction, quest, hyperlinkThingDefs); ReceiveLetter(let, debugInfo); }
public static ChoiceLetter MakeLetter(string label, string text, LetterDef def, LookTargets lookTargets, Faction relatedFaction = null) { ChoiceLetter choiceLetter = LetterMaker.MakeLetter(label, text, def); choiceLetter.lookTargets = lookTargets; choiceLetter.relatedFaction = relatedFaction; return(choiceLetter); }
public static bool IsValid(this LookTargets lookTargets) { return(lookTargets != null && lookTargets.IsValid); }
public static GlobalTargetInfo TryGetPrimaryTarget(this LookTargets lookTargets) { return(lookTargets?.PrimaryTarget ?? GlobalTargetInfo.Invalid); }