Beispiel #1
0
    public void skipTutorial()
    {
        if (textElement == false)
        {
            AutoText.stopTypeWriter(dialog);
        }
        else
        {
            AutoText.stopTypeWriter(charDialog);
        }

        string storyPlace = PlayerPrefs.GetString("Backdrop" + GameManager.num);

        PlayerPrefs.SetString("Backdrop" + GameManager.num, newStory);
        changeStory();
        id = 0;
        changeSpeaker();
        if (storyPlace == "Level1")
        {
            PlayerPrefs.SetInt("TutorialDone" + GameManager.num, 1);
            PlayerPrefs.SetString("Backdrop" + GameManager.num, "Bakeshop3");
            newStory = "Bakeshop3";
            Application.LoadLevel("LevelStage");
        }
        else if (storyPlace == "Bakeshop3" || storyPlace == "Bakeshop4" || storyPlace == "Bakeshop5" ||
                 storyPlace == "Bakeshop6" || storyPlace == "GameEnd")
        {
            Application.LoadLevel("Bakeshop");
        }
    }
Beispiel #2
0
        /// <summary>
        /// Updates the CommentType
        /// </summary>
        /// <param name="CommentType">AutoText</param>
        public void UpdateAutoText(AutoText autoText)
        {
            if (autoText == null)
            {
                throw new ArgumentNullException(nameof(autoText));
            }

            _autoTextRepository.Update(autoText);
        }
Beispiel #3
0
        /// <summary>
        /// Insert a AutoText
        /// </summary>
        /// <param name="AutoText">AutoText</param>
        public void InsertAutoText(AutoText autoText)
        {
            if (autoText == null)
            {
                throw new ArgumentNullException(nameof(autoText));
            }

            _autoTextRepository.Insert(autoText);
        }
Beispiel #4
0
        /// <summary>
        /// Gets a Diagnosis
        /// </summary>

        /// <returns>A Diagnosis</returns>
        public void DeleteAutoText(AutoText atoText)
        {
            if (atoText == null)
            {
                throw new ArgumentNullException(nameof(atoText));
            }

            atoText.Deleted = true;
            UpdateAutoText(atoText);
        }
        public ActionResult AutoTextCreate(AutoTextModel model)
        {
            try
            {//10/10/2019 aakansha
                ViewBag.FormName = "AutoText";
                if (model.Id == 0)
                {
                    //General Data
                    var data = new AutoText();

                    data.CreatedOn     = model.CreatedOn;
                    data.Deleted       = model.Deleted;
                    data.CommentTypeId = model.CommentTypeId;
                    data.Comment       = model.Comment;
                    data.AutoTextName  = model.AutoTextName;
                    data.IsActive      = model.IsActive;
                    data.LastUpdated   = model.LastUpdated;
                    _treatmentServices.InsertAutoText(data);
                    AddNotification(NotificationMessage.TitleSuccess, NotificationMessage.msgAddAutoText, NotificationMessage.TypeSuccess);
                    return(RedirectToAction("AutoTextIndex"));
                }
                else
                {
                    var data = _treatmentServices.GetAutoTextById((int)model.Id);

                    data.CreatedOn     = model.CreatedOn;
                    data.Deleted       = model.Deleted;
                    data.CommentTypeId = model.CommentTypeId;
                    data.Comment       = model.Comment;
                    data.AutoTextName  = model.AutoTextName;
                    data.IsActive      = model.IsActive;
                    data.LastUpdated   = model.LastUpdated;
                    data.Id            = model.Id;
                    _treatmentServices.UpdateAutoText(data);
                    AddNotification(NotificationMessage.TitleSuccess, NotificationMessage.msgAddAutoText, NotificationMessage.TypeSuccess);
                    return(RedirectToAction("AutoTextIndex"));
                }
            }
            catch
            {
                AddNotification(NotificationMessage.TitleError, NotificationMessage.ErrorMsg, NotificationMessage.TypeError);
                return(View());
            }
        }
Beispiel #6
0
 // Use this for initialization
 void Start()
 {
     autoText = GameObject.Find("TextManager").GetComponent <AutoText>();
 }
Beispiel #7
0
 public void AutoSay(AutoText text)
 {
     new AutoTextSendMessage(text)
     .SendIn(this.BotBits);
 }
Beispiel #8
0
 public void AutoSay(AutoText text)
 {
     this.Events.Raise(new AutoSaySendEvent(text));
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="AutoTextSendMessage" /> class.
 /// </summary>
 /// <param name="text">The text.</param>
 public AutoTextSendMessage(AutoText text)
 {
     this.Text = text;
 }
Beispiel #10
0
    public void changeSpeaker()
    {
        if (names [id] == playerName)
        {
            typeSpeed = 0.5f;
        }
        else
        {
            typeSpeed = 2f;
        }

        string storyPlace = PlayerPrefs.GetString("Backdrop" + GameManager.num);

        Debug.Log(storyPlace);
        if (storyPlace == "Level1")
        {
            charImg.SetActive(false);
            dialogBox.SetActive(false);
            charPopUp.SetActive(true);

            charDialog.text = "";
            updatedText     = dialogs[id];
            AutoText.TypeText(charDialog, updatedText, 2f);
            textElement = true;

            if (id == 1)
            {
                itemArrow.SetActive(true);
            }
            else if (id == 3)
            {
                itemArrow.SetActive(false);
            }
            else if (id == 5)
            {
                hintArrow.SetActive(true);
            }
            else if (id == 6)
            {
                hintArrow.SetActive(false);
                zoom.Play("zoom");
            }
        }         /*else if(storyPlace == "Bakeshop2") {
                   *    charImg.SetActive(false);
                   *    dialogBox.SetActive(false);
                   *    charPopUp.SetActive(true);
                   *
                   *    charDialog.text = "";
                   *    updatedText = dialogs[id];
                   *    AutoText.TypeText(charDialog, updatedText, 2f);
                   *    textElement = true;
                   *
                   *    if(id == 2) {
                   *            specialItem.SetActive(true);
                   *            sItemArrow.SetActive(true);
                   *    } else if(id == 3) {
                   *            sItemArrow.SetActive(false);
                   *            navButtons.SetActive(true);
                   *            storeArrow.SetActive(true);
                   *    } else if(id == 4) {
                   *            navButtons.SetActive(false);
                   *            storeArrow.SetActive(false);
                   *            store.SetActive(true);
                   *            wpArrow.SetActive(true);
                   *    } else if(id == 6) {
                   *            store.SetActive(false);
                   *            wpArrow.SetActive(false);
                   *            purchase.SetActive(true);
                   *            purchaseArrow.SetActive(true);
                   *    } else if(id == 7) {
                   *            purchase.SetActive(false);
                   *            purchaseArrow.SetActive(false);
                   *            navButtons.SetActive(true);
                   *            playArrow.SetActive(true);
                   *    }
                   * }*/
        else
        {
            dialog.text = "";
            updatedText = dialogs [id];
            if (dialog.IsActive())
            {
                AutoText.TypeText(dialog, updatedText, 2f);
            }
            textElement = false;
        }
        name.text = names [id];
    }
Beispiel #11
0
    public void setDialog()
    {
        if (textElement == false)
        {
            AutoText.stopTypeWriter(dialog);
        }
        else
        {
            AutoText.stopTypeWriter(charDialog);
        }

        string storyPlace = PlayerPrefs.GetString("Backdrop" + GameManager.num);

        if (id == dialogs.Length - 1 && !typing)
        {
            PlayerPrefs.SetString("Backdrop" + GameManager.num, newStory);
            changeStory();
            id = 0;
            changeSpeaker();
            if (storyPlace == "Level1")
            {
                PlayerPrefs.SetInt("TutorialDone" + GameManager.num, 1);
                PlayerPrefs.SetString("Backdrop" + GameManager.num, "Bakeshop3");
                newStory = "Bakeshop3";
                Application.LoadLevel("LevelStage");
            }
            else if (storyPlace == "Bakeshop3" || storyPlace == "Bakeshop4" || storyPlace == "Bakeshop5" ||
                     storyPlace == "Bakeshop6" || storyPlace == "GameEnd")
            {
                Application.LoadLevel("Bakeshop");
            }
        }
        else
        {
            if (typing)
            {
                displayDialog();
                typing = false;
            }
            else
            {
                id++;
                changeSpeaker();
            }
        }

        storyPlace = PlayerPrefs.GetString("Backdrop" + GameManager.num);

        if (storyPlace == "" || storyPlace == "Bakeshop1")
        {
            if (names [id] == "Felicia")
            {
                charImg.SetActive(true);
                Debug.Log("Runned");
            }
        }
        else if (storyPlace == "Bakeshop3")
        {
            if (names [id] == "Felicia")
            {
                charImg.SetActive(true);
            }
            else if (id == 13)
            {
                charImg.SetActive(false);
                backdrop.sprite = (Sprite)Resources.Load("Tutorial/newBakeshop", typeof(Sprite));
            }
        }
        else if (storyPlace == "Bakeshop4")
        {
            if (names [id] == "Felicia")
            {
                charImg.SetActive(true);
            }
            else if (id == 8)
            {
                charImg.SetActive(false);
                backdrop.sprite = (Sprite)Resources.Load("Tutorial/newBakeshop", typeof(Sprite));
            }
        }
        else if (storyPlace == "Bakeshop5")
        {
            if (names [id] == "Felicia")
            {
                charImg.SetActive(true);
            }
            else if (id == 8)
            {
                charImg.SetActive(false);
                backdrop.sprite = (Sprite)Resources.Load("Tutorial/newBakeshop", typeof(Sprite));
            }
        }
        else if (storyPlace == "Bakeshop6")
        {
            if (names [id] == "Felicia")
            {
                charImg.SetActive(true);
            }
            else if (id == 8)
            {
                charImg.SetActive(false);
                backdrop.sprite = (Sprite)Resources.Load("Tutorial/newBakeshop", typeof(Sprite));
            }
        }
        else if (storyPlace == "GameEnd")
        {
            if (names [id] == "Felicia")
            {
                charImg.SetActive(true);
            }
        }
    }