Exemple #1
0
        protected void CreateDialogChoices()
        {
            if (Conv.Continues)
            {
                float           offset    = 0.0f;
                float           fadeDelay = 0.05f;
                List <Exchange> RunningOutgoingChoices = Conv.RunningOutgoingChoices;
                List <GUIConversationBubble> choices   = new List <GUIConversationBubble> ();
                foreach (Exchange outgoingChoice in RunningOutgoingChoices)
                {
                    GameObject            newPlayerDialogChoiceGameObject = NGUITools.AddChild(PlayerDialogChoicesParent, PlayerDialogChoicePrototype);
                    GUIPlayerDialogChoice playerDialogChoice = newPlayerDialogChoiceGameObject.GetComponent <GUIPlayerDialogChoice> ();

                    playerDialogChoice.Choice = outgoingChoice;
                    playerDialogChoice.ChoiceButtonMessage.target       = gameObject;
                    playerDialogChoice.ChoiceButtonMessage.functionName = "MakeDialogChoice";
                    playerDialogChoice.gameObject.name = "Choice_" + outgoingChoice.Name;

                    GUIConversationBubble bubble = playerDialogChoice.GetComponent <GUIConversationBubble> ();
                    bubble.FadedColor          = (outgoingChoice.NumTimesChosen > 0);
                    bubble.FadeDelay           = fadeDelay;
                    bubble.EnableAutomatically = false;
                    playerDialogChoice.Offset  = offset;
                    bubble.SetProps(outgoingChoice.CleanPlayerDialog, Colors.Get.ConversationPlayerBackground, Colors.Get.ConversationPlayerOption);
                    offset    -= bubble.Height;
                    fadeDelay += 0.05f;
                    choices.Add(bubble);
                }
                PlayerDialogChoicesScrollbar.scrollValue = 0.0f;
                PlayerDialogChoicesScrollbar.ForceUpdate();
                StartCoroutine(WaitForDialogChoicesToBeReady(choices));
            }
        }
Exemple #2
0
        public void ShowNextPage()
        {
            CurrentPageNumber++;
            string nextPage  = string.Empty;
            bool   continues = true;

            Conv.GetPage(out nextPage, CurrentPageNumber, ref continues, ref LastPageNumber);

            ResponseBubble.FadeDelay           = 0.05f;
            ResponseBubble.EnableAutomatically = true;
            ResponseBubble.SetProps(nextPage, Conv.SpeakingCharacter.worlditem.DisplayName, CharacterColor, CharacterTextColor, true, CharacterResponseScrollbar);
            ResponseBubble.Text.useDefaultLabelFont = true;

            if (continues)
            {
                mDialogChoicesReady = true;
                ClearDialogChoices();
                CreateNextPageChoice();
            }
            else
            {
                mDialogChoicesReady = false;
                LastPageNumber      = 0;
                ClearDialogChoices();
                CreateDialogChoices();
            }

            RefreshLeaveButton();
        }
Exemple #3
0
        protected void CreateNextPageChoice()
        {
            GameObject            newPlayerDialogChoiceGameObject = NGUITools.AddChild(PlayerDialogChoicesParent, PlayerDialogChoicePrototype);
            GUIPlayerDialogChoice playerDialogChoice = newPlayerDialogChoiceGameObject.GetComponent <GUIPlayerDialogChoice> ();

            playerDialogChoice.Choice = null;
            playerDialogChoice.ChoiceButtonMessage.target       = gameObject;
            playerDialogChoice.ChoiceButtonMessage.functionName = "MakeDialogChoice";
            playerDialogChoice.gameObject.name         = "Choice_" + (-1).ToString();
            playerDialogChoice.transform.localPosition = new Vector3(0f, -250f, 0f);

            GUIConversationBubble bubble = playerDialogChoice.GetComponent <GUIConversationBubble> ();

            bubble.EnableAutomatically = true;
            bubble.FadedColor          = false;
            bubble.FadeDelay           = 0.05f;
            bubble.SetProps("(More)", Colors.Get.ConversationPlayerBackground, Colors.Get.ConversationPlayerOption);
            playerDialogChoice.Offset = 0.0f;
        }