예제 #1
0
        /// <summary>
        /// Performs a choice after it's been selected by a user
        /// </summary>
        /// <param name="m">The user of the conversation</param>
        /// <param name="choice">The choice selected through the gump</param>
        public void PerformChoice(Mobile m, DialogChoice choice)
        {
            if (!Verify(m))
            {
                return;
            }

            if (choice.Invoke)
            {
                choice.PerformInvoke(m, this);
            }

            if (choice.EndDialog)
            {
                m_Users.Remove(m);
                return;
            }

            DialogSpeech speech = m_Dialog.GetSpeech(choice.ChoiceID);

            if (!VerifySpeech(m, speech))
            {
                m_Users.Remove(m);
                return;
            }

            SendSpeechGump(speech, m);
        }
예제 #2
0
 public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
 {
     if (info.ButtonID == 0)
     {
         m_NPC.EndConversation(sender.Mobile);
     }
     else
     {
         DialogChoice choice = m_Choices[info.ButtonID - 10] as DialogChoice;
         m_NPC.PerformChoice(sender.Mobile, choice);
     }
 }
예제 #3
0
        private void MakeGump()
        {
            this.Closable   = m_Dialog.AllowClose;
            this.Disposable = true;
            this.Dragable   = true;
            this.Resizable  = false;

            this.AddPage(0);
            this.AddBackground(54, 279, 339, 185, 9270);
            this.AddBackground(53, 67, 341, 222, 9270);
            this.AddAlphaRegion(65, 75, 316, 198);
            this.AddBackground(58, 0, 332, 75, 9270);
            this.AddAlphaRegion(68, 11, 309, 50);
            this.AddImage(7, 10, 10440);
            this.AddImage(358, 8, 10441);

            this.AddAlphaRegion(65, 286, 315, 165);

//			this.AddPage(0);
//			this.AddBackground(0, 0, 340, 470, 9270);
//			this.AddAlphaRegion(0, 0, 340, 470);

            // Dialog title
//			this.AddLabel(15, 15, GreenHue, m_Dialog.Title != null ? m_Dialog.Title : "" );
            this.AddLabel(92, 11, GreenHue, m_Dialog.Title != null ? m_Dialog.Title : "");

            // Speech title
//			this.AddLabel(15, 45, LabelHue, m_Speech.Text != null ? m_Speech.Title : "" );
            this.AddLabel(183, 28, LabelHue, m_Speech.Text != null ? m_Speech.Title : "");

//			this.AddImageTiled( 14, 69, 312, 202, 9384 );
//			this.AddImageTiled( 15, 70, 310, 200, 9274 );
//			this.AddAlphaRegion( 15, 70, 310, 200 );

            // Speech text
            this.AddHtml(73, 70, 310, 200, m_Speech.Text != null ? m_Speech.Text : "", (bool)false, (bool)true);

            for (int i = 0; i < 8 && i < m_Choices.Count; i++)
            {
                DialogChoice choice = m_Choices[i] as DialogChoice;

                this.AddButton(73, 285 + i * 20, 9702, 9703, 10 + i, GumpButtonType.Reply, 0);
                this.AddLabelCropped(93, 283 + i * 20, 310, 20, LabelHue, choice.Text);
            }

            if (m_Dialog.AllowClose)
            {
                this.AddButton(248, 442, 9702, 9703, 0, GumpButtonType.Reply, 0);
                this.AddLabel(268, 440, LabelHue, @"End Conversation");
            }
        }
예제 #4
0
        /// <summary>
        /// Sends the actual speech gump
        /// </summary>
        /// <param name="speech">The speech object being displayed</param>
        /// <param name="m">The player receiving the gump</param>
        private void SendSpeechGump(DialogSpeech speech, Mobile m)
        {
            ArrayList choices = new ArrayList();

            foreach (Guid id in speech.Choices)
            {
                DialogChoice c = m_Dialog.GetChoice(id);

                if (c != null)
                {
                    choices.Add(c);
                }
            }

            m.SendGump(new ConversationGump(m_Dialog, speech, choices, this, m));
        }
예제 #5
0
        private void MakeGump()
        {
            this.Closable   = m_Dialog.AllowClose;
            this.Disposable = true;
            this.Dragable   = true;
            this.Resizable  = false;

            this.AddPage(0);
            this.AddBackground(0, 0, 340, 470, 9270);
            this.AddAlphaRegion(0, 0, 340, 470);

            // Dialog title
            this.AddLabel(15, 15, GreenHue, m_Dialog.Title != null ? m_Dialog.Title : "");

            // Speech title
            this.AddLabel(15, 45, LabelHue, m_Speech.Text != null ? m_Speech.Title : "");

            this.AddImageTiled(14, 69, 312, 202, 9384);
            this.AddImageTiled(15, 70, 310, 200, 9274);
            this.AddAlphaRegion(15, 70, 310, 200);

            // Speech text
            this.AddHtml(15, 70, 310, 200, m_Speech.Text != null ? m_Speech.Text : "", (bool)false, (bool)true);

            for (int i = 0; i < 8 && i < m_Choices.Count; i++)
            {
                DialogChoice choice = m_Choices[i] as DialogChoice;

                this.AddButton(15, 282 + i * 20, 9702, 9703, 10 + i, GumpButtonType.Reply, 0);
                this.AddLabelCropped(35, 280 + i * 20, 310, 20, LabelHue, choice.Text);
            }

            if (m_Dialog.AllowClose)
            {
                this.AddButton(190, 442, 9702, 9703, 0, GumpButtonType.Reply, 0);
                this.AddLabel(210, 440, LabelHue, @"End Conversation");
            }
        }
예제 #6
0
		/// <summary>
		/// Performs a choice after it's been selected by a user
		/// </summary>
		/// <param name="m">The user of the conversation</param>
		/// <param name="choice">The choice selected through the gump</param>
		public void PerformChoice( Mobile m, DialogChoice choice )
		{
			if ( ! Verify( m ) )
				return;

			if ( choice.Invoke )
			{
				choice.PerformInvoke( m, this );
			}

			if ( choice.EndDialog )
			{
				m_Users.Remove( m );
				return;
			}

			DialogSpeech speech = m_Dialog.GetSpeech( choice.ChoiceID );

			if ( ! VerifySpeech( m, speech ) )
			{
				m_Users.Remove( m );
				return;
			}

			SendSpeechGump( speech, m );
		}