Ejemplo n.º 1
0
        /// <summary>
        /// Handles the finished subtitle event. If the current conversation state has an NPC
        /// response, the conversation proceeds to that response. Otherwise, if the current
        /// state has PC responses, then the response menu is shown (or if it has a single
        /// auto-response, the conversation proceeds directly to that response). If there are no
        /// responses, the conversation ends.
        /// </summary>
        /// <param name='sender'>
        /// Sender.
        /// </param>
        /// <param name='e'>
        /// Event args.
        /// </param>
        public void OnFinishedSubtitle(object sender, EventArgs e)
        {
            var randomize = randomizeNextEntry;

            randomizeNextEntry = false;
            if (m_state.hasNPCResponse)
            {
                GotoState(m_model.GetState(randomize ? m_state.GetRandomNPCEntry() : m_state.firstNPCResponse.destinationEntry));
            }
            else if (m_state.hasPCResponses)
            {
                bool isPCResponseMenuNext, isPCAutoResponseNext;
                AnalyzePCResponses(m_state, out isPCResponseMenuNext, out isPCAutoResponseNext);
                if (isPCAutoResponseNext)
                {
                    GotoState(m_model.GetState(m_state.pcAutoResponse.destinationEntry));
                }
                else
                {
                    m_view.StartResponses(m_state.subtitle, m_state.pcResponses);
                }
            }
            else
            {
                Close();
            }
        }