Example #1
0
    public void Pick(Dialogue.Choice choice = null)
    {
        if (finished)
        {
            window.gameObject.SetActive(false);
            return;
        }

        if (choice != null)
        {
            currentDialogue.PickChoice(choice);
            currentChoice = choice;
            UpdateChoices();
        }
        else
        {
            currentChoice = currentDialogue.GetChoices()[0];
            currentDialogue.PickChoice(currentChoice);
        }

        if (currentDialogue.GetChoices().Length == 0)
        {
            window.next.GetComponentInChildren <Text>().text = "Leave.";
            finished = true;
        }
        UpdateWindow();
        CheckUserdata();
    }
Example #2
0
        private void Start()
        {
            inventoryManager = InventoryManager.I;
            // inventory = null;

            if (inventoryType == InventoryType.Craft)
            {
                inventory = inventoryManager.GetOrRegisterInventory(gameObject.scene.name + transform.parent.position.ToString(), 4, 1, false, gameObject);
                InventoryManager.I.craftManager.OnLoadStation(inventory);
            }
            if (inventoryType == InventoryType.Storage)
            {
                inventory = inventoryManager.GetOrRegisterInventory(gameObject.scene.name + transform.parent.position.ToString(), 16, 0, false, gameObject);
            }
            if (!dialogue)
            {
                dialogue = GetComponentInParent <Dialogue>();
            }
            if (!dialogue)
            {
                return;
            }
            choice              = new Dialogue.Choice();
            choice.text         = choiceText;
            choice.key          = choiceText;
            choiceAction        = new KeyAction();
            choiceAction.key    = choiceText;
            choiceAction.action = new UnityEngine.Events.UnityEvent();
            choiceAction.action.AddListener(Interact);
            dialogue.RegisterInteractionChoice(choice, choiceAction);
        }
Example #3
0
 void Start()
 {
     manager         = DialogueManager.LoadDialogueFile(dialogueFile);
     currentDialogue = manager.GetDialogue("TutorialStart");
     currentChoice   = currentDialogue.GetChoices()[0];
     currentDialogue.PickChoice(currentChoice);
 }
Example #4
0
 public void nextChoice(int choice)
 {
     print(choice);
     currentChoice = currentDialogue.GetChoices()[choice];
     currentDialogue.PickChoice(currentChoice);
     nextDialogue();
 }
Example #5
0
    // Use this for initialization
    protected virtual void OnEnable()
    {
        DialogueManager manager = DialogueManager.LoadDialogueFile(dialogFile);

        currentDialogue = manager.GetDialogue(dialogName);
        currentDialogue.Start();
        Dialogue.Choice[] choices = currentDialogue.GetChoices();
        Debug.Log(choices.Length);
        if (choices.Length > 0)
        {
            if (choices.Length == 1)
            {
                currentChoice = choices[0];
                currentDialogue.PickChoice(currentChoice);
                nextChoices = currentDialogue.GetChoices();
            }
            else
            {
                currentChoice = null;
                nextChoices   = choices;
            }
            LevelManager.Instance().clickLocked = true;
            SetupDialogueBox();

            this.gameObject.SetActive(false);
        }
    }
Example #6
0
 void Start()
 {
     manager = DialogueManager.LoadDialogueFile(dialogueFile);
     currentDialogue = manager.GetDialogue("TutorialStart");
     currentChoice = currentDialogue.GetChoices()[0];
     currentDialogue.PickChoice(currentChoice);
 }
Example #7
0
    public void SetDialogue()
    {
        List <Dialogue.Choice> aviableChoices = GetAviableChoices();

        if (aviableChoices.Count == 1)
        {
            Dialogue.Choice choice = aviableChoices.First();

            clickFeedback.GetComponentInChildren <Text>().text = "Next...";
            SetContent(choice.dialogue);
            textAnimator.ChangeText(contentGO.GetComponent <Text>().text);
            clickFeedback.SetActive(false);
            UpdateCharacterData(choice);
            SetImage(choice);
            dialogue.PickChoice(choice);
        }
        else
        {
            GenerateChoiceList(aviableChoices);
        }

        if (dialogue.GetChoices() == null || dialogue.GetChoices().Length == 0 || aviableChoices.Count == 0)
        {
            clickFeedback.GetComponentInChildren <Text>().text = "Fin";
            fin = true;
        }
    }
Example #8
0
 private string GetChoiceParameters(Dialogue.Choice choice)
 {
     if (choice.userData != null)
     {
         var splitData = choice.userData.Split('|');
         if (splitData.Length > 0)
         {
             return(splitData[0]);
         }
     }
     return(null);
 }
Example #9
0
 private string GetChoiceConstraints(Dialogue.Choice choice)
 {
     if (choice.userData != null)
     {
         var splitData = choice.userData.Split('|');
         if (splitData.Length > 1)
         {
             return(splitData[1]);
         }
     }
     return(null);
 }
Example #10
0
 void ButtonHandler(Dialogue.Choice choice)
 {
     fonduChoix.SetActive(false);
     foreach (Transform transform in choiceContainer.transform)
     {
         Destroy(transform.gameObject);
     }
     UpdateCharacterData(choice);
     dialogue.PickChoice(choice);
     choicePending = false;
     SetDialogue();
 }
Example #11
0
    // Use this for initialization
    void Start()
    {
        //DialogueFile dialogFile = ;

        DialogueManager manager = DialogueManager.LoadDialogueFile(pathToDialog);

        Dialogue currentDialogue = manager.GetDialogue("newDialogue");

        Dialogue.Choice currentChoice = currentDialogue.GetChoices()[0];

        currentDialogue.PickChoice(currentChoice);
    }
Example #12
0
    private bool isChoiceSelectable(Dialogue.Choice choice)
    {
        var constraintData = this.GetChoiceConstraints(choice);

        if (constraintData != null)
        {
            var constraints = constraintData.Split(' ');
            foreach (var constraint in constraints)
            {
                if (constraint.StartsWith("E:"))
                {
                    var trimData = constraint.TrimStart('E', ':');
                    if (GameLogicManager.currentCharacter.emotion.ToString() != trimData)
                    {
                        return(false);
                    }
                }
                else if (constraint.StartsWith("R:"))
                {
                    int relationConstraint;
                    var trimData = constraint.TrimStart('R', ':');
                    if (trimData.StartsWith(">"))
                    {
                        var processedTrimData = trimData.Trim('>');
                        //Debug.Log(">" + processedTrimData + " "+ GameLogicManager.currentCharacter.relation);
                        if (!Int32.TryParse(processedTrimData, out relationConstraint))
                        {
                            Debug.Log("DIALOG CONTROLLER :: Error in relation constraint value (" + GameLogicManager.currentCharacter.characterName + ")");
                        }
                        if (GameLogicManager.currentCharacter.relation <= relationConstraint)
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        var processedTrimData = trimData.Trim('<');
                        //Debug.Log("< "+ processedTrimData+" "+GameLogicManager.currentCharacter.relation);
                        if (!Int32.TryParse(processedTrimData, out relationConstraint))
                        {
                            Debug.Log("DIALOG CONTROLLER :: Error in relation constraint value (" + GameLogicManager.currentCharacter.characterName + ")");
                        }
                        if (GameLogicManager.currentCharacter.relation >= relationConstraint)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        return(true);
    }
Example #13
0
 void UpdateCharacterData(Dialogue.Choice choice)
 {
     if (!this.IsItAnEnd(choice))
     {
         TriggerTransitionFade(choice);
         GameLogicManager.currentCharacter.emotion   = this.GetChoiceEmotionParameter(choice);
         GameLogicManager.currentCharacter.relation += this.GetChoiceRelationParameter(choice);
     }
     else
     {
         this.TriggerEnd();
     }
 }
Example #14
0
 private bool IsItAnEnd(Dialogue.Choice choice)
 {
     if (choice.userData != null)
     {
         var parametersData = this.GetChoiceParameters(choice);
         if (parametersData.Contains("End:"))
         {
             Debug.Log("End");
             return(this.SetEndNumber(choice));
         }
     }
     return(false);
 }
Example #15
0
    private bool SetEndNumber(Dialogue.Choice choice)
    {
        var parametersData = this.GetChoiceParameters(choice);
        int endNumber      = 0;
        var trimParameter  = parametersData.TrimStart('E', 'n', 'd', ':');

        if (!Int32.TryParse(trimParameter, out endNumber))
        {
            Debug.Log("DIALOG CONTROLLER :: Error in relation parameter value (" + GameLogicManager.currentCharacter.characterName + ")");
        }
        GameLogicManager.endResult = endNumber;
        return(true);
    }
Example #16
0
    public void SetImage(Dialogue.Choice choice)
    {
        //Debug.Log(choice.speaker);
        if (choice.speaker == "Moi")
        {
            dateImage.sprite = meSprite;
            SetName(GameLogicManager.playerName);
        }

        else
        {
            SetName(GameLogicManager.currentCharacter.characterName + "-" + GameLogicManager.currentCharacter.titre);
            dateImage.sprite = GameLogicManager.currentCharacter.dateCard;
        }
    }
Example #17
0
 public void AnswerQuestion(int yesno)
 {
     Line = System.String.Empty;
     StopCoroutine(UpdateLine());
     Line = System.String.Empty;
     for (int i = 0; i < Buttons.Count; i++)
     {
         Buttons[i].transform.parent.gameObject.SetActive(false);
     }
     ContinueBtn.interactable = true;
     ActiveChoice             = ActiveLine.GetChoices() [yesno];
     ActiveLine.PickChoice(ActiveChoice);
     StartCoroutine(UpdateLine());
     ParseArguments();
 }
Example #18
0
 public void AnswerQuestion(int id)
 {
     TextBox.text = System.String.Empty;
     StopCoroutine(UpdateLine());
     for (int i = 0; i < Buttons.Count; i++)
     {
         Buttons[i].transform.parent.gameObject.SetActive(false);
     }
     ContinueBtn.interactable = true;
     ActiveChoice             = ActiveLine.GetChoices() [id];
     ActiveLine.PickChoice(ActiveChoice);
     //ActiveLine.PickChoice (ActiveLine.GetChoices()[0]); //For skipping the Asnwer
     StopCoroutine(UpdateLine());
     StartCoroutine(UpdateLine());
     ParseArguments();
 }
Example #19
0
    void Start()
    {
        DcText  = Dc.GetComponent <Text>();
        VcImage = Vc.GetComponent <Image>();

        for (int i = 0; i < Bc.Count; i++)
        {
            BcButton.Add(Bc[i].GetComponentInChildren <Text>());
        }

        manager         = DialogueManager.LoadDialogueFile(dialogueFile);
        currentDialogue = manager.GetDialogue(diagloguePart);
        currentChoice   = currentDialogue.GetChoices()[0];
        currentDialogue.PickChoice(currentChoice);

        nextDialogue();
    }
Example #20
0
    void OnGUI()
    {
        GUILayout.BeginArea(new Rect(10, 10, 680, 560));
        GUILayout.Label(currentChoice.dialogue);
        if (currentDialogue.GetChoices().Count > 1)
        {
            // sort list
            List <Dialogue.Choice> list = currentDialogue.GetChoices();
            System.Array.Sort(list.ToArray(), (o1, o2) => o1.userData.CompareTo(o2.userData));

            GUILayout.BeginVertical();
            foreach (Dialogue.Choice choice in list)
            {
                if (GUILayout.Button(choice.dialogue))
                {
                    currentDialogue.PickChoice(choice);
                    currentChoice = choice;
                }
            }
            GUILayout.EndVertical();
        }
        else if (currentDialogue.GetChoices().Count == 1)
        {
            if (GUILayout.Button("Next"))
            {
                currentChoice = currentDialogue.GetChoices()[0];
                currentDialogue.PickChoice(currentChoice);
            }

            // check if we need to display an image
            if (currentChoice.userData.IndexOf("image:") == 0)
            {
                Debug.Log(currentChoice.userData.Substring(6));
                int       imageIndex = int.Parse(currentChoice.userData.Substring(6));
                Texture2D tex        = images[imageIndex];
                GUI.DrawTexture(new Rect(0, 100, tex.width, tex.height), tex);
            }
        }
        else
        {
            // end of tutorial
        }

        GUILayout.EndArea();
    }
Example #21
0
    void OnGUI()
    {
        GUILayout.BeginArea(new Rect(10, 10, 680, 560));
        GUILayout.Label(currentChoice.dialogue);
        if (currentDialogue.GetChoices().Length > 1)
        {
            // sort list
            Dialogue.Choice[] list = currentDialogue.GetChoices();
            System.Array.Sort(list, (o1, o2) => o1.userData.CompareTo(o2.userData));

            GUILayout.BeginVertical();
            foreach (Dialogue.Choice choice in list)
            {
                if (GUILayout.Button(choice.dialogue))
                {
                    currentDialogue.PickChoice(choice);
                    currentChoice = choice;
                }
            }
            GUILayout.EndVertical();
        }
        else if (currentDialogue.GetChoices().Length == 1)
        {
            if (GUILayout.Button("Next"))
            {
                currentChoice = currentDialogue.GetChoices()[0];
                currentDialogue.PickChoice(currentChoice);
            }

            // check if we need to display an image
            if (currentChoice.userData.IndexOf("image:") == 0)
            {
                Debug.Log(currentChoice.userData.Substring(6));
                int imageIndex = int.Parse(currentChoice.userData.Substring(6));
                Texture2D tex = images[imageIndex];
                GUI.DrawTexture(new Rect(0, 100, tex.width, tex.height), tex);
            }
        }
        else
        {
            // end of tutorial
        }

        GUILayout.EndArea();
    }
Example #22
0
    public void DisplayNextSentence()
    {
        if (m_Sentences.Count == 0)
        {
            EndDialogue();
            return;
        }
        StopAllCoroutines();
        Dialogue.ITextInterface sentence = m_Sentences.Dequeue();
        string speakerName = sentence.GetName();

        if (speakerName == "Choice")
        {
            m_IsWaitingChoice  = true;
            m_DialogeText.text = "";
            Dialogue.Choice choice = (Dialogue.Choice)sentence;
            Assert.IsTrue(choice.m_Choices.Count <= m_ChoicesButton.Count);

            for (int i = 0; i < choice.m_Choices.Count; ++i)
            {
                KeyValuePair <string, string> pair = choice.m_Choices[i];
                Button button = m_ChoicesButton[i];
                button.gameObject.SetActive(true);
                button.GetComponentInChildren <Text> ().text = pair.Key;
                button.onClick.AddListener(delegate
                {
                    m_IsWaitingChoice = false;
                    Dialogue d        = FindSubdialogue(pair.Value);
                    if (d != null)
                    {
                        StartDialogue(d);
                    }
                });
            }
        }
        else
        {
            if (m_NameText.text != speakerName)
            {
                m_NameText.text    = speakerName;
                m_Thumbnail.sprite = RessourceManager.LoadSprite("Models/" + m_SpeakerClass[speakerName].ToString(), 0);
            }
            StartCoroutine(TypeSentence(sentence.GetText()));
        }
    }
Example #23
0
    private bool TriggerTransitionFade(Dialogue.Choice choice)
    {
        //Debug.Log("trasision fade");
        if (choice.userData != null)
        {
            var parametersData = this.GetChoiceParameters(choice);

            if (parametersData.Contains('F'))
            {
                Debug.Log("fade");
                FadeManager startOptions = GameObject.Find("Canvas").GetComponent <FadeManager>();
                startOptions.fadeOutImage.raycastTarget = true;
                StartCoroutine(startOptions.FadeCanvasGroupAlpha(0f, 1f));
                return(true);
            }
        }
        return(false);
    }
Example #24
0
    void RawDebug()
    {
        Dialogue.Choice choice = dialogue.GetChoices()[0];
        Debug.Log(choice.dialogue + " count choices" + dialogue.GetChoices().Length);
        dialogue.PickChoice(dialogue.GetChoices()[0]);

        choice = dialogue.GetChoices()[0];
        Debug.Log(choice.dialogue + " count choices" + dialogue.GetChoices().Length);
        dialogue.PickChoice(dialogue.GetChoices()[0]);

        choice = dialogue.GetChoices()[0];
        Debug.Log(choice.dialogue + " count choices" + dialogue.GetChoices().Length);
        dialogue.PickChoice(dialogue.GetChoices()[0]);

        choice = dialogue.GetChoices()[0];
        Debug.Log(choice.dialogue + " count choices" + dialogue.GetChoices().Length);
        dialogue.PickChoice(dialogue.GetChoices()[0]);
    }
Example #25
0
 public void NextChoice(Dialogue.Choice nextChoice)
 {
     currentDialogue.PickChoice(nextChoice);
     nextChoices = currentDialogue.GetChoices();
     Debug.Log(nextChoices.Length);
     if(nextChoices.Length > 0){
         currentChoice = null;
         if(nextChoices.Length == 1) {
             currentChoice = nextChoices[0];
             currentDialogue.PickChoice(currentChoice);
             nextChoices = currentDialogue.GetChoices();
         }
         SetupDialogueBox();
     }
     else {
         dialogueBox.Dismiss();
         LevelManager.Instance().clickLocked = false;
     }
 }
Example #26
0
 public void Continue()
 {
     if (ActiveLine.GetChoices().Count == 1)
     {
         ContinueBtn.interactable = false;
         StopCoroutine(UpdateLine());
         ActiveChoice = ActiveLine.GetChoices() [0];
         ActiveLine.PickChoice(ActiveChoice);
         StartCoroutine(UpdateLine());
         ParseArguments();
     }
     if (ActiveLine.GetChoices().Count == 0)
     {
         SceneIn = false;
         fade    = true;
         //Exit Command
         ExitEvent.Invoke();
     }
 }
Example #27
0
    public void AddChoice(Dialogue.Choice choice)
    {
        GameObject choiceButton = GameObject.Instantiate(buttonPrefab);

        choiceButton.transform.SetParent(content.transform, false);
        choiceButton.transform.localScale = new Vector3(1, 1, 1);

        Text btnText = choiceButton.transform.GetChild(0).GetComponent <Text>();

        btnText.text = choice.dialogue;

        this.choices.Add(choice);
        int count = this.choices.Count - 1;

        choiceButton.GetComponent <Button>().onClick.AddListener(() => {
            OnChoiceClicked(count);
        });

        AdjustChoiceButtonHeight(choiceButton, btnText);
    }
Example #28
0
    public void StartDialouge(string dialogName)
    {
        manager         = DialogueManager.LoadDialogueFile(dialogueFile);
        currentDialogue = manager.GetDialogue(dialogName);
        currentChoice   = currentDialogue.GetChoices()[0];
        currentDialogue.PickChoice(currentChoice);


        window.gameObject.SetActive(true);

        for (int i = 0; i < window.choices.Length; i++)
        {
            window.choices[i].GetComponent <DialogueButton>().dialog = this;
        }
        window.next.GetComponent <DialogueButton>().dialog = this;

        UpdateWindow();

        finished = false;
        active   = true;
    }
Example #29
0
 public void NextChoice(Dialogue.Choice nextChoice)
 {
     currentDialogue.PickChoice(nextChoice);
     nextChoices = currentDialogue.GetChoices();
     Debug.Log(nextChoices.Length);
     if (nextChoices.Length > 0)
     {
         currentChoice = null;
         if (nextChoices.Length == 1)
         {
             currentChoice = nextChoices[0];
             currentDialogue.PickChoice(currentChoice);
             nextChoices = currentDialogue.GetChoices();
         }
         SetupDialogueBox();
     }
     else
     {
         dialogueBox.Dismiss();
         LevelManager.Instance().clickLocked = false;
     }
 }
Example #30
0
    private Emotion GetChoiceEmotionParameter(Dialogue.Choice choice)
    {
        var emotion = GameLogicManager.currentCharacter.emotion;

        if (choice.userData != null)
        {
            var parametersData = this.GetChoiceParameters(choice);
            var parameters     = parametersData.Split(' ');
            foreach (var parameter in parameters)
            {
                if (parameter.StartsWith("E:"))
                {
                    var trimParameter = parameter.TrimStart('E', ':');
                    if (GameConstant.StringToEmotion(trimParameter) != Emotion.none)
                    {
                        emotion = GameConstant.StringToEmotion(trimParameter);
                    }
                }
            }
        }
        return(emotion);
    }
Example #31
0
    // Use this for initialization
    protected virtual void OnEnable()
    {
        DialogueManager manager = DialogueManager.LoadDialogueFile(dialogFile);
        currentDialogue = manager.GetDialogue(dialogName);
        currentDialogue.Start();
        Dialogue.Choice[] choices = currentDialogue.GetChoices();
        Debug.Log(choices.Length);
        if(choices.Length > 0 ){
            if(choices.Length == 1) {
                currentChoice = choices[0];
                currentDialogue.PickChoice(currentChoice);
                nextChoices = currentDialogue.GetChoices();
            }
            else {
                currentChoice = null;
                nextChoices = choices;
            }
            LevelManager.Instance().clickLocked = true;
            SetupDialogueBox();

            this.gameObject.SetActive(false);
        }
    }
Example #32
0
    private int GetChoiceRelationParameter(Dialogue.Choice choice)
    {
        var relation = 0;

        if (choice.userData != null)
        {
            var parametersData = this.GetChoiceParameters(choice);
            var parameters     = parametersData.Split(' ');
            foreach (var parameter in parameters)
            {
                if (parameter.StartsWith("R:"))
                {
                    int relationParameter;
                    var trimParameter = parameter.TrimStart('R', ':');
                    if (!Int32.TryParse(trimParameter, out relationParameter))
                    {
                        Debug.Log("DIALOG CONTROLLER :: Error in relation parameter value (" + GameLogicManager.currentCharacter.characterName + ")");
                    }
                    relation += relationParameter;
                }
            }
        }
        return(relation);
    }
Example #33
0
 public void OnChoiceClicked(int choiceIndex)
 {
     Debug.Log("Button clicked = " + choiceIndex);
     Dialogue.Choice nextChoice = choices[choiceIndex];
     parentAction.NextChoice(nextChoice);
 }
    void DrawNode(Vector2 Pos, int Index)
    {
        bool RemoveAtEnd = false;

        Pos += OffsetVector;

        if (Index == D.Conversation.Count)
        {
            Dialogue.Choice C = new Dialogue.Choice();
            C.Text        = "New Choice";
            C.ReturnValue = -1;
            Dialogue.Talk T = new Dialogue.Talk();
            T.Reply = new List <string>();
            T.Reply.Add("New Reply");
            T.Choices = new List <Dialogue.Choice>();
            T.Choices.Add(C);
            D.Conversation.Add(T);
        }

        //GUI.DrawTexture(new Rect(Pos.x, Pos.y - 50, 200, 75 + (D.Conversation[Index].Choices.Count * 25)), NodeTexture);
        GUI.DrawTexture(new Rect(Pos.x, Pos.y - 50, 200, 50), NodeTop);
        GUI.DrawTexture(new Rect(Pos.x, Pos.y, 200, 25), NodeMid);

        /*if(GUI.Button(new Rect(Pos.x, Pos.y - 40, 200, 20), AddChoice, ButtonStyle)) draggable window
         * {
         *
         * }*/

        if (GUI.Button(new Rect(75 + Pos.x, Pos.y - 25, 25, 25), AddChoice, ButtonStyle))
        {
            Dialogue.Choice C = new Dialogue.Choice();
            C.Text        = "New Choice";
            C.ReturnValue = -1;
            D.Conversation[Index].Choices.Add(C);
        }

        if (GUI.Button(new Rect(75 + Pos.x + 25, Pos.y - 25, 25, 25), RemoveChoice, ButtonStyle))
        {
            if (D.Conversation[Index].Choices.Count >= 1)
            {
                D.Conversation[Index].Choices.RemoveAt(D.Conversation[Index].Choices.Count - 1);
            }
        }

        if (Index != 0)
        {
            if (GUI.Button(new Rect(75 + Pos.x + 75, Pos.y - 25, 25, 25), DeleteButton, ButtonStyle))
            {
                RemoveAtEnd = true;
            }
        }

        //GUI.DrawTexture(new Rect(Pos.x - 15, Pos.y, 25, 25), ConnectorTexture);
        if (GUI.Button(new Rect(Pos.x - 15, Pos.y, 25, 25), ConnectorTexture, ButtonStyle))
        {
            if (InConnectMode)
            {
                ConnectEnd    = Index;
                InConnectMode = false;

                Dialogue.Choice C = new Dialogue.Choice();
                C.Text        = D.Conversation[ConnectStart.x].Choices[ConnectStart.y].Text;
                C.ReturnValue = ConnectEnd;
                D.Conversation[ConnectStart.x].Choices[ConnectStart.y] = C;
            }
        }

        //GUI.Label(new Rect(Pos.x + 15f, Pos.y - 45f, 100, 100), D.Conversation[Index].Reply[0]);
        GUI.DrawTexture(new Rect(Pos.x + 25, Pos.y, 150f, 25f), TextBackground);                                                               //Max length
        D.Conversation[Index].Reply[0] = GUI.TextField(new Rect(Pos.x + 25, Pos.y, 150f, 25f), D.Conversation[Index].Reply[0], 25, TextStyle); //Max length

        for (int i = 0; i < D.Conversation[Index].Choices.Count; i++)
        {
            GUI.DrawTexture(new Rect(Pos.x, Pos.y + ((i + 1) * 25f), 200f, 25f), NodeMid);
            Dialogue.Choice C = new Dialogue.Choice();
            GUI.DrawTexture(new Rect(Pos.x + 25, Pos.y + ((i + 1) * 25f), 150f, 25f), TextBackground);
            C.Text        = GUI.TextField(new Rect(Pos.x + 25, Pos.y + ((i + 1) * 25f), 150f, 25f), D.Conversation[Index].Choices[i].Text, 25, TextStyle);
            C.ReturnValue = D.Conversation[Index].Choices[i].ReturnValue;

            D.Conversation[Index].Choices[i] = C;
            //GUI.DrawTexture(new Rect(Pos.x + 190, Pos.y + ((i + 1) * 25f), 25, 25), ConnectorTexture, ScaleMode.StretchToFill);
            if (GUI.Button(new Rect(Pos.x + 190, Pos.y + ((i + 1) * 25f), 25, 25), ConnectorTexture, ButtonStyle))
            {
                ConnectStart  = new Vector2Int(Index, i);
                InConnectMode = true;
            }
        }

        GUI.DrawTexture(new Rect(Pos.x, Pos.y + ((D.Conversation[Index].Choices.Count + 1) * 25f), 200, 25), NodeBottom);

        if (RemoveAtEnd)
        {
            D.NodePositions.RemoveAt(Index);
            D.Conversation.RemoveAt(Index);

            for (int x = 0; x < D.Conversation.Count; x++)           //Re shuffles lines if node is removed
            {
                for (int y = 0; y < D.Conversation[x].Choices.Count; y++)
                {
                    if (D.Conversation[x].Choices[y].ReturnValue == Index)
                    {
                        Dialogue.Choice C = new Dialogue.Choice();
                        C.Text        = D.Conversation[x].Choices[y].Text;
                        C.ReturnValue = -1;
                        D.Conversation[x].Choices[y] = C;
                    }

                    if (D.Conversation[x].Choices[y].ReturnValue > Index)
                    {
                        Dialogue.Choice C = new Dialogue.Choice();
                        C.Text        = D.Conversation[x].Choices[y].Text;
                        C.ReturnValue = D.Conversation[x].Choices[y].ReturnValue - 1;
                        D.Conversation[x].Choices[y] = C;
                    }
                }
            }
        }
    }