Example #1
0
        public QuestQuestionGump(QuestionDefinition[] questions, int currentQuestion, QuestQuestionEvent onPassed, QuestQuestionEvent onFailed)
            : base(160, 100)
        {
            m_Questions       = questions;
            m_CurrentQuestion = currentQuestion;
            m_OnPassed        = onPassed;
            m_OnFailed        = onFailed;

            QuestionDefinition question = m_Questions[m_CurrentQuestion];

            AnswerDefinition[] answers = Utility.Shuffle(question.Answers);

            Disposable = false;
            Closable   = false;

            AddImage(0, 0, 0x4CC);
            AddImage(40, 58, 0x5F);
            AddImageTiled(49, 67, 301, 3, 0x60);
            AddImage(350, 58, 0x61);
            AddImage(50, 85, 0x8B0);
            AddImage(50, 125, 0x8B0);
            AddImage(50, 165, 0x8B0);
            AddImage(50, 205, 0x8B0);

            AddHtmlLocalized(30, 40, 340, 30, question.QuestionCliloc, 0x0, false, false);

            for (int i = 0; i < answers.Length; i++)
            {
                AnswerDefinition answer = answers[i];

                AddButton(49, 84 + (i * 40), 0x845, 0x846, answer.Correct ? 1 : 0, GumpButtonType.Reply, 0);
                AddHtmlLocalized(80, 82 + (i * 40), 275, 36, answer.Cliloc, 0x0, false, false);
            }
        }
Example #2
0
        public QuestQuestionGump( QuestionDefinition[] questions, int currentQuestion, QuestQuestionEvent onPassed, QuestQuestionEvent onFailed )
            : base(160, 100)
        {
            m_Questions = questions;
            m_CurrentQuestion = currentQuestion;
            m_OnPassed = onPassed;
            m_OnFailed = onFailed;

            QuestionDefinition question = m_Questions[m_CurrentQuestion];
            AnswerDefinition[] answers = Utility.Shuffle( question.Answers );

            Disposable = false;
            Closable = false;

            AddImage( 0, 0, 0x4CC );
            AddImage( 40, 58, 0x5F );
            AddImageTiled( 49, 67, 301, 3, 0x60 );
            AddImage( 350, 58, 0x61 );
            AddImage( 50, 85, 0x8B0 );
            AddImage( 50, 125, 0x8B0 );
            AddImage( 50, 165, 0x8B0 );
            AddImage( 50, 205, 0x8B0 );

            AddHtmlLocalized( 30, 40, 340, 30, question.QuestionCliloc, 0x0, false, false );

            for ( int i = 0; i < answers.Length; i++ )
            {
                AnswerDefinition answer = answers[i];

                AddButton( 49, 84 + ( i * 40 ), 0x845, 0x846, answer.Correct ? 1 : 0, GumpButtonType.Reply, 0 );
                AddHtmlLocalized( 80, 82 + ( i * 40 ), 275, 36, answer.Cliloc, 0x0, false, false );
            }
        }