Esempio n. 1
0
    //examplePlayer.cs calls this one to move forward in the conversation
    public void CallNext()
    {
        //Let's not go forward if text is currently being animated, but let's speed it up.
        if (animatingText)
        {
            CutTextAnim();; return;
        }

        if (!dialoguePaused) //Only if
        {
            //Sometimes, we might want to check the ExtraVariables before moving forward
            //We might want to modify the dialogue or perhaps go to another node
            //If so, we will return and will not call Next()
            if (PreCheckExtraVariables())
            {
                return;
            }

            VD.Next(); //We call the next node and populate nodeData with new data
            return;
        }

        //This will just disable the item popup if it is enabled
        if (itemPopUp.activeSelf)
        {
            dialoguePaused = false;
            itemPopUp.SetActive(false);
        }
    }
Esempio n. 2
0
    public void Begin(string dialog, Character character, bool isCharAlive, AudioClip audioClip)
    {
        characterImage.sprite = character.DialogSprite;
        if (character.Name == "")
        {
            nameBack.SetActive(false);
        }
        else
        {
            nameBack.SetActive(true);
        }
        CurentDialogBegin?.Invoke();
        characterImage.color = isCharAlive ? Color.white : Color.black;
        characterName.text   = character.Name;
        pushDialogNext.gameObject.SetActive(true);
        stopClicking.gameObject.SetActive(true);
        VD.OnNodeChange += UpdateUI;
        VD.OnEnd        += End;
        VD.BeginDialogue(dialog);

        if (audioClip != null && isCharAlive)
        {
            audioSource.clip = audioClip;
            audioSource.Play();
        }
    }
Esempio n. 3
0
 void UpdateUI(VD.NodeData data)
 {
     container_PLAYER.SetActive(false);
     if (data.isPlayer)
     {
         container_PLAYER.SetActive(true);
         pushDialogNext.gameObject.SetActive(false);
         for (int i = 0; i < text_Choices.Length; i++)
         {
             if (i < data.comments.Length)
             {
                 text_Choices[i].transform.parent.gameObject.SetActive(true);
                 text_Choices[i].text = data.comments[i];
             }
             else
             {
                 text_Choices[i].transform.parent.gameObject.SetActive(false);
             }
         }
         text_Choices[0].transform.parent.GetComponent <Button>().Select();
     }
     else
     {
         pushDialogNext.gameObject.SetActive(true);
         container_NPC.SetActive(true);
         text_NPC.text = data.comments[data.commentIndex];
         if (VD.GetNext(true, false).isPlayer)
         {
             VD.Next();
         }
     }
 }
Esempio n. 4
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.T))
     {
         VD.SetCurrentLanguage("English");
     }
 }
Esempio n. 5
0
 // Use this for initialization
 void Start()
 {
     VD.LoadDialogues();
     container_NPC.SetActive(false);
     container_PLAYER.SetActive(false);
     pushDialogNext.gameObject.SetActive(false);
 }
Esempio n. 6
0
 void End(VD.NodeData data)
 {
     DisableContainers();
     VD.OnNodeChange -= UpdateUI;
     VD.OnEnd        -= End;
     VD.EndDialogue();
 }
Esempio n. 7
0
 void Win()
 {
     VD.EndDialogue();
     audioManager.Play("Success");
     winDialogue.overrideStartNode = 8;
     diagUI.Begin(winDialogue);
 }
Esempio n. 8
0
 public void NextNode()
 {
     if (VD.isActive && !curNode.isPlayer)
     {
         VD.Next();  //Gonna need some checks on this to see if its possible when we do text roll and things.  Would also be nice to have a click to reveal all and stop roll - for speeding stuff.
     }
 }
 private void Begin()
 {
     VD.OnNodeChange += UpdateUI;
     VD.OnEnd        += End;
     VD.BeginDialogue(GetComponent <VIDE_Assign>());
     Debug.Log("ttt");
 }
Esempio n. 10
0
 public void ChangeLanguage(string language)
 {
     ResetDialogue();
     VD.SetCurrentLanguage(language);
     HandleNextAction();
     rest.ChangeLanguageOfTimeoutScreen(language);
 }
Esempio n. 11
0
    public void checkQuest()
    {
        if (checkReqs())
        {
            if (holder.completed)
            {
                //  VD.assigned.overrideStartNode = holder.endNode;
                VD.SetNode(holder.endNode);
                return;
            }

            if (holder.started)
            {
                //   VD.assigned.overrideStartNode = holder.nodeList[holder.stepNum];
                VD.SetNode(holder.nodeList[holder.stepNum]);
                //using holder step number and steplist..
            }
            else
            {
                //  VD.assigned.overrideStartNode = holder.startNode;
                VD.SetNode(holder.startNode);
                //VD.SetNode);
            }
        }
        else
        {
            VD.SetNode(holder.reqsNotMetNode);
        }
    }
Esempio n. 12
0
 //This method is not necessary when using the Full version of the plugin
 //as Action Nodes have predefined actions that allow you to easily modify go to another node
 public void GoToNode(int newNode)
 {
     if (VD.isActive)
     {
         VD.SetNode(newNode);
     }
 }
Esempio n. 13
0
    private void UpdateDialogState()
    {
        bool isPlayerActionStage = getIsDialogActionCkicked() || actionsContainer.activeSelf;

        if (!getIsLeftMouseClick() || isPlayerActionStage)
        {
            return;
        }

        if (VD.isActive)
        {
            VD.Next();
            return;
        }

        VIDE_Assign vide = getTargetVide();

        if (vide == null)
        {
            return;
        }

        if (!GetIsPlayerInRange())
        {
            GoToDialogTriggerZone();
            return;
        }

        StartDialog(vide);
    }
Esempio n. 14
0
 //This will be called when we reach the end of the dialogue.
 //Very important that this gets called before we call BeginDialogue again!
 void End(VD.NodeData data)
 {
     VD.OnNodeChange -= UpdateUI;
     VD.OnEnd        -= End;
     VD.EndDialogue(); //Third most important method when using VIDE
     WipeAll();
 }
Esempio n. 15
0
    //Will start and end the assigned dialogue
    public void Interact()
    {
        if (!questChartContainer.activeSelf)
        {
            questChartContainer.SetActive(true);
            VD.NodeData nd = VD.BeginDialogue(assigned);
            LoadChart(nd);
        }
        else
        {
            for (int i = 0; i < peGameObject.transform.parent.childCount; i++)
            {
                if (i != 0)
                {
                    Destroy(peGameObject.transform.parent.GetChild(i).gameObject);
                }
            }

            for (int i = 0; i < ovGameObject.transform.parent.childCount; i++)
            {
                if (i != 0)
                {
                    Destroy(ovGameObject.transform.parent.GetChild(i).gameObject);
                }
            }

            questChartContainer.SetActive(false);
            VD.EndDialogue();
        }
    }
Esempio n. 16
0
 void Update()
 {
     if (VD.isActive && !VD.nodeData.isPlayer && Input.GetKeyDown(continueButton))
     {
         VD.Next();
     }
 }
Esempio n. 17
0
    //This begins the conversation
    void Begin(VIDE_Assign dialogue)
    {
        //Let's reset the NPC text variables
        NPC_Text.text    = "";
        NPC_label.text   = "";
        playerLabel.text = "";

        NPCPhotoFrame.transform.localEulerAngles    = new Vector3(0, 0, Random.Range(rotationMin, rotationMax));
        playerPhotoFrame.transform.localEulerAngles = new Vector3(0, 0, Random.Range(rotationMin, rotationMax));

        //First step is to call BeginDialogue, passing the required VIDE_Assign component
        //This will store the first Node data in VD.nodeData
        //But before we do so, let's subscribe to certain events that will allow us to easily
        //Handle the node-changes
        VD.OnActionNode += ActionHandler;
        VD.OnNodeChange += UpdateUI;
        VD.OnEnd        += EndDialogue;

        VD.BeginDialogue(dialogue); //Begins dialogue, will call the first OnNodeChange

        dialogueContainer.transform.DOKill();
        dialogueContainer.transform.localPosition = new Vector3(0, 300);
        dialogueContainer.transform.DOLocalMoveY(0, .5f).SetEase(Ease.OutExpo);

        dialogueContainer.SetActive(true); //Let's make our dialogue container visible
        CameraFollow.instance.target = dialogue.gameObject.transform;
        CameraFollow.instance.ChangeDefaultDistance(false, CameraFollow.instance.zoomDefaultDistance);
    }
Esempio n. 18
0
 void BeginDialogue()
 {
     VD.OnNodeChange += OnNodeChange;
     VD.OnEnd        += OnEnd;
     VD.BeginDialogue(GetComponent <VIDE_Assign>());
     dialogue_Background.SetActive(true);
 }
Esempio n. 19
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (VD.IsNull(txtDesig))
            {
                return;
            }

            try
            {
                Desig des = new Desig();
                des.DesigId     = Convert.ToInt32(txtdesigId.Text);
                des.DesigNm     = txtDesig.Text;
                des.DesigTypeID = Convert.ToInt32(ddlDesignType.SelectedValue.ToString());

                if (flag == true)
                {
                    Desig.Save(des, "I");
                }
                else if (flag == false)
                {
                    Desig.Save(des, "U");
                }

                CtrlState(false, 421);
                Display();
                GenerateSerialNo();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 20
0
 void OnEnable()
 {
     //Sends preloaded data
     if (preload)
     {
         VD.LoadFromVA(this);
     }
 }
Esempio n. 21
0
 public void SetPlayerChoice(int choice)
 {
     VD.nodeData.commentIndex = choice;
     VD.Next();
     //if (Input.GetMouseButtonDown(0)) {
     //    VD.Next();
     //}
 }
Esempio n. 22
0
 public void SetPlayerChoice(int choice)
 {
     VD.nodeData.commentIndex = choice;
     if (InputManager.GetButtonUp("UI_Submit"))
     {
         VD.Next();
     }
 }
Esempio n. 23
0
 public void SetPlayerChoice(int choice)
 {
     VD.nodeData.commentIndex = choice;
     if (Input.GetMouseButtonUp(0))
     {
         VD.Next();
     }
 }
    public void SaveGame()
    {
        //GLOBAL
        SaveSystem.SaveGlobalProgress(GlobalProgressChecker.instance);

        //DIALOGUE
        VD.SaveState("Garden", true);
    }
Esempio n. 25
0
 private void End(VD.NodeData data)
 {
     containerNPC.SetActive(false);
     containerPlayer.SetActive(false);
     VD.OnNodeChange -= UpdateUI;
     VD.OnEnd        -= End;
     VD.EndDialogue();
 }
Esempio n. 26
0
 public void Begin(VIDE_Assign videAssign)
 {
     VD.OnNodeChange += UpdateUI;
     VD.OnEnd        += End;
     // This loads the VIDE_Assign into the VD.
     //If you want to play other dialogs, you would have to select a different VIDE_Assign here.
     VD.BeginDialogue(videAssign);
 }
Esempio n. 27
0
    // Will Use the SetVisible method to switch the visibility of a comment
    // When a comment is not visible, its content will not be included in the nodeData arrays
    // The method will also add info to an ExtraVariables key to mark the completion of a quest
    public static void SetQuest(int quest, bool visible)
    {
        VD.SetVisible(assigned.assignedDialogue, 0, quest, visible);
        Dictionary <string, object> newEV = VD.GetExtraVariables(assigned.assignedDialogue, 1);

        newEV["complete"] += "[" + quest.ToString() + "]";
        VD.SetExtraVariables(assigned.assignedDialogue, 1, newEV);
    }
Esempio n. 28
0
 //This will be called when we reach the end of the dialogue.
 //Very important that this gets called before we call BeginDialogue again!
 void End(VD.NodeData data)
 {
     canvas.GetComponent <CanvasGroup>().alpha = 0.0f;
     VD.OnNodeChange -= UpdateUI;
     VD.OnEnd        -= End;
     VD.EndDialogue();     //Third most important method when using VIDE
     WipeAll();
 }
Esempio n. 29
0
 public void SetPlayerChoice(int choiceIndex)
 {
     VD.nodeData.commentIndex = choiceIndex;
     if (getIsLeftMouseClick())
     {
         VD.Next();
     }
 }
Esempio n. 30
0
    void Awake()
    {
        VD.LoadDialogues(); //Load all dialogues to memory so that we dont spend time doing so later
        //An alternative to this can be preloading dialogues from the VIDE_Assign component!

        //Loads the saved state of VIDE_Assigns and dialogues.
        VD.LoadState("VIDEDEMOScene1", true);
    }
Esempio n. 31
0
        private void NewCommand_Execute(object sender, ExecutedRoutedEventArgs e)
        {
            ellipses.Clear();
            vd = null;
            triple = null;
            triples.Clear();

            gg_triples.Children.Clear();
            gg_others.Children.Clear();
        }
Esempio n. 32
0
        private void InitializeVD()
        {
            Circle circle_i = new Circle() { X = this.rand.Next(this.ClientSize.Width), Y = this.rand.Next(this.ClientSize.Height) };
            Circle circle_j = new Circle() { X = this.rand.Next(this.ClientSize.Width), Y = this.rand.Next(this.ClientSize.Height) };
            Vector2d distanceVector = circle_j.Pole - circle_i.Pole;
            double distance = Math.Sqrt(distanceVector * distanceVector);
            circle_i.R = this.rand.NextDouble() * distance / 2;
            circle_j.R = this.rand.NextDouble() * distance / 2;
            this.circles.Add(circle_i);
            this.circles.Add(circle_j);

            this.vd = new VD<Circle, DeloneCircle>(circles[0], null, circles[1]);
        }
Esempio n. 33
0
            public static List<Point2d> Точки_плотного_размещения(VD<Circle, DeloneCircle> vd, Circle data)
            {
                List<Point2d> points = new List<Point2d>();

                Triple<Circle, DeloneCircle> triple = vd.NextTriple(vd.NullTriple);
                while (triple != vd.NullTriple)
                {
                    points.AddRange(Точки_плотного_размещения(triple, data));
                    triple = vd.NextTriple(triple);
                }

                return points;
            }
Esempio n. 34
0
        public MainWindow()
        {
            InitializeComponent();

            this.vd = new VD<Circle, DeloneCircle>(new Circle() { R = 100, X = 150, Y = 200 }, null, new Circle() { R = 50, X = 300, Y = 300 });

            GeometryGroup gg = gVD as GeometryGroup;
            gg.Children.Add(new EllipseGeometry(new System.Windows.Point(300, 300), 50, 50));
            gg.Children.Add(new EllipseGeometry(new System.Windows.Point(150, 200), 100, 100));

            CreateDeloneCirclesGeometric();

            this.vertex = vd.NextTriple(vd.NullTriple).Vertex;
        }
Esempio n. 35
0
            public static Triple<Circle, DeloneCircle> Минимальновозможная_тройка(VD<Circle, DeloneCircle> vd, Circle data)
            {
                Triple<Circle, DeloneCircle> temp_triple = vd.NextTriple(vd.NullTriple);
                while (temp_triple.Delone_Circle.R < data.R)
                    temp_triple = vd.NextTriple(temp_triple);

                Triple<Circle, DeloneCircle> minimal_triple = temp_triple;
                while (temp_triple != vd.NullTriple)
                {
                    if (minimal_triple.Delone_Circle.R > temp_triple.Delone_Circle.R && temp_triple.Delone_Circle.R > data.R)
                        minimal_triple = temp_triple;
                    temp_triple = vd.NextTriple(temp_triple);
                }
                return minimal_triple;
            }
Esempio n. 36
0
        private void открытьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                circles.Clear();

                StreamReader sr = new StreamReader(ofd.FileName);
                while (!sr.EndOfStream)
                {
                    String[] g = sr.ReadLine().Split(' ');
                    Circle circle = new Circle() { R = double.Parse(g[0]), X = double.Parse(g[1]), Y = double.Parse(g[2]) };
                    circles.Add(circle);
                }
                sr.Close();

                vd = new VD<Circle, DeloneCircle>(circles[0], circles[1], null);
                for (int i = 2; i < circles.Count; i++)
                    vd.Insert(circles[i]);

                Invalidate();
            }
        }
Esempio n. 37
0
        private void Canvas_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (item != null)
            {
                stack_panel.Children.Remove(item);
                System.Windows.Point p = e.GetPosition(canvas);
                Circle t_circle = new Circle() { R = item.Width / 2, X = p.X, Y = p.Y };
                ellipses.Add(t_circle);
                moves.Add(new Vector2d() { X = 100 * rand.NextDouble(), Y = 100 * rand.NextDouble() });
                if (ellipses.Count == 2)
                {
                    vd = new VD<Circle, DeloneCircle>(ellipses[0], ellipses[1], null);
                    triple = vd.NextTriple(vd.NullTriple);
                }
                if (ellipses.Count > 2)
                {
                    Triple<Circle, DeloneCircle> temp_triple = TestAlgorithms.Минимальновозможная_тройка(vd, t_circle);
                    //TestAlgorithms.Placing(temp_triple.Vertex.Next.Data, t_circle, temp_triple.Vertex.Prev.Data);

                    vd.Insert(t_circle);
                }

                if (vd != null)
                    BuildTriples(vd.NextTriple(vd.NullTriple), gg_triples, true);
                else
                    gg_triples.Children.Clear();

                item = null;
            }
        }
Esempio n. 38
0
 public static Vertex<Circle, DeloneCircle> Близжайшая_вершина(VD<Circle, DeloneCircle> vd, Circle data)
 {
     return Близжайшая_вершина(vd.Близжайшая_тройка(data, false)[0], data);
 }
Esempio n. 39
0
        private void OpenCommand_Execute(object sender, ExecutedRoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            if (ofd.ShowDialog() == true)
            {
                ellipses.Clear();

                StreamReader sr = new StreamReader(ofd.FileName);
                while (!sr.EndOfStream)
                {
                    String[] g = sr.ReadLine().Split(' ');
                    Circle circle = new Circle() { R = double.Parse(g[0]), X = double.Parse(g[1]), Y = double.Parse(g[2]) };
                    ellipses.Add(circle);
                }
                sr.Close();

                vd = new VD<Circle, DeloneCircle>(ellipses[0], ellipses[1], null);
                for (int i = 2; i < ellipses.Count; i++)
                    vd.Insert(ellipses[i]);

                if (vd != null)
                    BuildTriples(vd.NextTriple(vd.NullTriple), gg_triples, true);
                else
                    gg_triples.Children.Clear();
                triple = vd.NextTriple(vd.NullTriple);
            }
        }