예제 #1
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Box.Deleted || !m_Box.IsOwner(from))
                {
                    return;
                }

                if (m_IsChoice)
                {
                    m_Box.AddLineToChoices(text.TrimEnd());
                    if (m_Box.Choices.Length < MaxChoices)
                    {
                        from.SendLocalizedMessage(500377, "", 0x35); // Next line or ESC to finish:
                        from.Prompt = new TopicPrompt(m_Box, true);
                    }
                    else
                    {
                        from.SendLocalizedMessage(500376, "", 0x35); // Ballot entry complete.
                        from.SendGump(new InternalGump(m_Box, true));
                    }
                }
                else
                {
                    m_Box.AddLineToTopic(text.TrimEnd());
                    if (m_Box.Topic.Length < MaxTopicLines)
                    {
                        from.SendLocalizedMessage(500377, "", 0x35); // Next line or ESC to finish:
                        from.Prompt = new TopicPrompt(m_Box, false);
                    }
                    else
                    {
                        from.SendLocalizedMessage(500376, "", 0x35); // Ballot entry complete.
                        from.SendGump(new InternalGump(m_Box, true));
                    }
                }
            }