コード例 #1
0
        /// <summary>
        /// Handle check hint event from event driver
        /// </summary>
        /// <param name="sender">Who sent this event?</param>
        /// <param name="e">Hint checker event arguments</param>
        private void HintDriver_CheckHint(object sender, CheckHintArgs e)
        {
            if (e.Npc == null)
            {
                return;
            }

            // Show dialogue icon hint (NPC can speak bubble) if:
            // - cursor is on our companion
            // - and they can resolve our dialogue requests
            // - and has'nt any dialogues in queue
            // - and we can ask this companion for following (recruit)
            if (this.PossibleCompanions.TryGetValue(e.Npc.Name, out CompanionStateMachine csm) &&
                this.CanRecruit() &&
                csm.Name == e.Npc?.Name &&
                csm.CanPerformAction() &&
                !this.Config.RequestsWithShift &&
                e.Npc.CurrentDialogue.Count == 0 &&
                Helper.CanRequestDialog(this.Farmer, e.Npc, csm.CurrentStateFlag == StateFlag.RECRUITED))
            {
                this.hintDriver.ShowHint(
                    this.Config.UseAsk2FollowCursor
                        ? HintDriver.Hint.ASK2FOLLOW
                        : HintDriver.Hint.DIALOGUE);
            }
        }
コード例 #2
0
        private void HintDriver_CheckHint(object sender, CheckHintArgs e)
        {
            if (e.Npc == null)
            {
                return;
            }

            if (this.PossibleCompanions.TryGetValue(e.Npc.Name, out CompanionStateMachine csm) &&
                csm.Name == e.Npc?.Name &&
                csm.CanDialogueRequestResolve() &&
                e.Npc.CurrentDialogue.Count == 0 &&
                Helper.CanRequestDialog(this.Farmer, e.Npc))
            {
                this.hintDriver.ShowHint(HintDriver.Hint.DIALOGUE);
            }
        }
コード例 #3
0
        /// <summary>
        /// Handle check hint event from event driver
        /// </summary>
        /// <param name="sender">Who sent this event?</param>
        /// <param name="e">Hint checker event arguments</param>
        private void HintDriver_CheckHint(object sender, CheckHintArgs e)
        {
            if (e.Npc == null)
            {
                return;
            }

            // Show dialogue icon hint (NPC can speak bubble) if:
            // - cursor is on our companion
            // - and they can resolve our dialogue requests
            // - and has'nt any dialogues in queue
            // - and we can ask this companion for following (recruit)
            if (this.PossibleCompanions.TryGetValue(e.Npc.Name, out CompanionStateMachine csm) &&
                csm.Name == e.Npc?.Name &&
                csm.CanDialogueRequestResolve() &&
                e.Npc.CurrentDialogue.Count == 0 &&
                Helper.CanRequestDialog(this.Farmer, e.Npc))
            {
                this.hintDriver.ShowHint(HintDriver.Hint.DIALOGUE);
            }
        }