public FloatMenuOption CommFloatMenuOption(Building_CommsConsole console, Pawn negotiator) { string label = "CallOnRadio".Translate(GetCallLabel()); Action action = null; AcceptanceReport canCommunicate = CanCommunicateWith_NewTemp(negotiator); if (!canCommunicate.Accepted) { if (!canCommunicate.Reason.NullOrEmpty()) { action = delegate { Messages.Message(canCommunicate.Reason, console, MessageTypeDefOf.RejectInput, historical: false); }; } } else { action = delegate { if (!Building_OrbitalTradeBeacon.AllPowered(Map).Any()) { Messages.Message("MessageNeedBeaconToTradeWithShip".Translate(), console, MessageTypeDefOf.RejectInput, historical: false); } else { console.GiveUseCommsJob(negotiator, this); } }; } return(FloatMenuUtility.DecoratePrioritizedTask(new FloatMenuOption(label, action, MenuOptionPriority.InitiateSocial), negotiator, console)); }
public FloatMenuOption CommFloatMenuOption(Building_CommsConsole console, Pawn negotiator) { string label = "CallOnRadio".Translate(this.GetCallLabel()); Action action = delegate { if (!Building_OrbitalTradeBeacon.AllPowered(this.Map).Any <Building_OrbitalTradeBeacon>()) { Messages.Message("MessageNeedBeaconToTradeWithShip".Translate(), console, MessageTypeDefOf.RejectInput, false); return; } console.GiveUseCommsJob(negotiator, this); }; return(FloatMenuUtility.DecoratePrioritizedTask(new FloatMenuOption(label, action, MenuOptionPriority.InitiateSocial, null, null, 0f, null, null), negotiator, console, "ReservedBy")); }
public FloatMenuOption CommFloatMenuOption(Building_CommsConsole console, Pawn negotiator) { if (IsPlayer) { return(null); } string text = "CallOnRadio".Translate(GetCallLabel()); text = text + " (" + PlayerRelationKind.GetLabel() + ", " + PlayerGoodwill.ToStringWithSign() + ")"; if (!LeaderIsAvailableToTalk()) { string str = (leader == null) ? ((string)"LeaderUnavailableNoLeader".Translate()) : ((string)"LeaderUnavailable".Translate(leader.LabelShort, leader)); return(new FloatMenuOption(text + " (" + str + ")", null, def.FactionIcon, Color)); } return(FloatMenuUtility.DecoratePrioritizedTask(new FloatMenuOption(text, delegate { console.GiveUseCommsJob(negotiator, this); }, def.FactionIcon, Color, MenuOptionPriority.InitiateSocial), negotiator, console)); }
public FloatMenuOption CommFloatMenuOption(Building_CommsConsole console, Pawn negotiator) { if (this.IsPlayer) { return(null); } string text = "CallOnRadio".Translate(new object[] { this.GetCallLabel() }); string text2 = text; text = string.Concat(new string[] { text2, " (", this.PlayerRelationKind.GetLabel(), ", ", this.PlayerGoodwill.ToStringWithSign(), ")" }); if (!this.LeaderIsAvailableToTalk()) { string str; if (this.leader != null) { str = "LeaderUnavailable".Translate(new object[] { this.leader.LabelShort }); } else { str = "LeaderUnavailableNoLeader".Translate(); } return(new FloatMenuOption(text + " (" + str + ")", null, MenuOptionPriority.Default, null, null, 0f, null, null)); } return(FloatMenuUtility.DecoratePrioritizedTask(new FloatMenuOption(text, delegate { console.GiveUseCommsJob(negotiator, this); }, MenuOptionPriority.InitiateSocial, null, null, 0f, null, null), negotiator, console, "ReservedBy")); }