Beispiel #1
0
        public static void OpenDialog(DiaNode node)
        {
            Dialog_Negotiation dialog_Negotiation = new Dialog_Negotiation(tempPawn, tempCaravan, node, true);

            dialog_Negotiation.soundAmbient = SoundDefOf.RadioComms_Ambience;
            Find.WindowStack.Add(dialog_Negotiation);
        }
Beispiel #2
0
        private static void TryOpenComms(Pawn actor)
        {
            var curJobCommTarget = actor.jobs.curJob.commTarget;

            if (curJobCommTarget is Faction f)
            {
                var dialog_Negotiation = new Dialog_Negotiation(actor, f,
                                                                JecsToolsFactionDialogMaker.FactionDialogFor(actor, f), true);
                dialog_Negotiation.soundAmbient = SoundDefOf.RadioComms_Ambience;
                Find.WindowStack.Add(dialog_Negotiation);
                return;
            }
            if (!(curJobCommTarget is TradeShip ts))
            {
                return;
            }
            if (!ts.CanTradeNow)
            {
                return;
            }
            Find.WindowStack.Add(new Dialog_Trade(actor, ts));
            LessonAutoActivator.TeachOpportunity(ConceptDefOf.BuildOrbitalTradeBeacon, OpportunityType.Critical);
            var empty  = string.Empty;
            var empty2 = string.Empty;

            PawnRelationUtility.Notify_PawnsSeenByPlayer_Letter(
                ts.Goods.OfType <Pawn>(), ref empty, ref empty2, "LetterRelatedPawnsTradeShip".Translate());
            if (!empty2.NullOrEmpty())
            {
                Find.LetterStack.ReceiveLetter(empty, empty2, LetterDefOf.PositiveEvent, null);
            }
            TutorUtility.DoModalDialogIfNotKnown(ConceptDefOf.TradeGoodsMustBeNearBeacon);
        }
Beispiel #3
0
        private void DrawInteractionButtons(Rect rect)
        {
            Text.Anchor = TextAnchor.MiddleCenter;

            Rect startRect = rect;

            startRect.height = Mathf.Max(25, Text.CalcHeight("CallOnRadio".Translate(currentFaction.Faction.Name), startRect.width));
            if (DrawCustomButton(startRect, "CallOnRadio".Translate(currentFaction.Faction.Name), Color.white))
            {
                Dialog_Negotiation dialog_Negotiation = new Dialog_Negotiation(speaker, currentFaction.Faction, FactionDialogMaker.FactionDialogFor(speaker, currentFaction.Faction), radioMode: true);
                dialog_Negotiation.soundAmbient = SoundDefOf.RadioComms_Ambience;
                Find.WindowStack.Add(dialog_Negotiation);
            }

            startRect.y     += startRect.height + 5;
            startRect.height = 25;
            foreach (var option in currentFaction.Options.OrderBy(o => o.SortOrder))
            {
                if (option.Enabled)
                {
                    if (DrawCustomButton(startRect, option.Label, option.TextColor))
                    {
                        option.DoAction(currentFaction, speaker, defendant);
                    }
                    startRect.y += 30;
                }
            }

            Text.Anchor = TextAnchor.UpperLeft;
        }
        public void OpenCommsWith(Pawn negotiator, Faction faction)
        {
            Dialog_Negotiation dialog_Negotiation = new Dialog_Negotiation(negotiator, faction, ReinforcementDialogMakerRC.FactionDialogFor(negotiator, faction), true);

            //dialog_Negotiation.soundAmbient = RCDefsOf.AmbientRequisitionRelayRH;
            SoundStarter.PlayOneShot(RCDefsOf.PickUpRequisitionRelayRH, SoundInfo.OnCamera());
            Find.WindowStack.Add(dialog_Negotiation);
        }