Ejemplo n.º 1
0
        protected override void Setup()
        {
            if (IsSetup)
            {
                return;
            }

            // Initialise the video panel.
            playerPanel = new FLCPlayer()
            {
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Middle,
                Size         = new Vector2(320, 200),
                BottomMargin = 13
            };
            NativePanel.Components.Add(playerPanel);

            // Start video playing.
            playerPanel.Load(daedraSummoned.vidFile);
            if (playerPanel.FLCFile.ReadyToPlay)
            {
                playerPanel.Start();
            }

            // Add text message area.
            messageLabel = new MultiFormatTextLabel()
            {
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Bottom,
                ExtraLeading        = 3,
            };
            playerPanel.Components.Add(messageLabel);
            playerPanel.OnMouseClick += PlayerPanel_OnMouseClick;

            textCursor         = new TextCursor();
            textCursor.Enabled = false;
            playerPanel.Components.Add(textCursor);

            // Initialise message to display,
            if (daedraQuest != null)
            {   // with the quest offer message.
                Message message = daedraQuest.GetMessage((int)QuestMachine.QuestMessages.QuestorOffer);
                messageTokens = message.GetTextTokens();
            }
            else
            {   // with the textId message evaluated with mcp provided.
                messageTokens = DaggerfallUnity.Instance.TextProvider.GetRSCTokens(textId);
                MacroHelper.ExpandMacros(ref messageTokens, mcp);
            }
            idx = 0;
            DisplayNextTextChunk();
        }
Ejemplo n.º 2
0
        private void AnswerAndPlayAnim(int choice)
        {
            if (animPlaying || questionsAnswered == questionCount)
            {
                return;
            }

            int weightIndex = GetWeightIndex(questionsAnswered, choice);

            weights[weightIndex]++;
            Debug.Log("CreateCharClassQuestions: Warrior: " + weights[0] + " Rogue: " + weights[1] + " Mage: " + weights[2]);
            if (questionsAnswered == questionCount - 1) // Final question was answered
            {
                // Compute class index
                FileProxy classFile = new FileProxy(Path.Combine(DaggerfallUnity.Instance.Arena2Path, classesFileName), FileUsage.UseDisk, true);
                if (classFile == null)
                {
                    throw new Exception("CreateCharClassQuestions: Could not load CLASSES.DAT.");
                }
                byte[] classData   = classFile.GetBytes();
                int    headerIndex = GetHeaderIndex(classData);
                if (headerIndex == -1)
                {
                    throw new Exception("CreateCharClassQuestions: Error reading CLASSES.DAT - could not find a results match. Warrior: " + weights[0] + " Rogue: " + weights[1] + " Mage: " + weights[2]);
                }
                classIndex = GetClassIndex(headerIndex, classData);
            }

            questionsAnswered++;
            switch (weightIndex)
            {
            case 0:
                warriorBlue += constellationBrightnessIncrement;
                warriorAnim.Start();
                break;

            case 1:
                rogueBlue += constellationBrightnessIncrement;
                rogueAnim.Start();
                break;

            case 2:
                mageBlue += constellationBrightnessIncrement;
                mageAnim.Start();
                break;
            }

            animPlaying = true;
            DaggerfallUI.Instance.PlayOneShot(SoundClips.Ignite);
        }
Ejemplo n.º 3
0
        void StartPlaying()
        {
            if (playerPanel == null || string.IsNullOrEmpty(Filename))
            {
                return;
            }

            playerPanel.Load(Filename);
            if (!playerPanel.FLCFile.ReadyToPlay)
            {
                return;
            }

            playerPanel.Start();
        }