Ejemplo n.º 1
0
    //  Send to the Modal Panel to set up the Buttons and functions to call
    public void TestC()
    {
        ModalPanelDetails modalPanelDetails = new ModalPanelDetails();

        modalPanelDetails.question                   = "This is an announcement!\nIf you don't like it, shove off!";
        modalPanelDetails.button1Details             = new EventButtonDetails();
        modalPanelDetails.button1Details.buttonTitle = "Gotcha!";
        modalPanelDetails.button1Details.action      = TestCancelFunction;

        modalPanel.NewChoice(modalPanelDetails);
    }
Ejemplo n.º 2
0
    public void TestC()
    {
        // modalPanel.Choice("Hello.", myCancelAction);
        ModalPanelDetails modalPanelDetails = new ModalPanelDetails {
            npc = "Hello."
        };

        modalPanelDetails.button1Details = new EventButtonDetails {
            buttonTitle = "Hey.", action = myCancelAction
        };
        modalPanel.NewChoice(modalPanelDetails);
    }
Ejemplo n.º 3
0
    /*
     * public void TestYNC()
     * {
     *  npcPanelObject.SetActive(true);
     * //    modalPanel.Choice("Would you like to answer?\n Maybe?", myYesAction, myNoAction, myCancelAction);
     * }
     * public void TestC()
     * {
     *  npcPanelObject.SetActive(true);
     *  // modalPanel.Choice("Hello.", myCancelAction);
     *  ModalPanelDetails modalPanelDetails = new ModalPanelDetails { npc = "Hello." };
     *  modalPanelDetails.button1Details = new EventButtonDetails { buttonTitle = "Hey.", action = myCancelAction };
     *  modalPanel.NewChoice(modalPanelDetails);
     * }
     */

    /// <summary>
    /// Something the npc says and what you can answer.
    /// Then sets the panel inactive.
    /// </summary>
    public void NPC2()
    {
        npcPanelObject.SetActive(true);

        //  modalPanel.Choice("Lol hey let's party!", myYesAction, myNoAction, myCancelAction);
        ModalPanelDetails modalPanelDetails = new ModalPanelDetails {
            npc = "Hey you."
        };

        modalPanelDetails.button1Details = new EventButtonDetails {
            buttonTitle = "Hey.", action = myYesAction
        };
        modalPanelDetails.button2Details = new EventButtonDetails {
            buttonTitle = "Bye.", action = myNoAction
        };
        modalPanelDetails.button3Details = new EventButtonDetails {
            buttonTitle = "Sup?", action = myCancelAction
        };
        Debug.Log("Button pressed / NPC3");
        if (movement.IsMoving() == false)
        {
            Debug.Log("Moving false");
            modalPanel.NewChoice(modalPanelDetails);
            //  npcPanelObject.SetActive(false);
        }
        else
        {
            Debug.Log("moving not false");
        }
    }
Ejemplo n.º 4
0
    //  Send to the Modal Panel to set up the Buttons and functions to call
    public void TestC(string useTitle)
    {
        ModalPanelDetails modalPanelDetails = new ModalPanelDetails();

        modalPanelDetails.panelLocation = Input.mousePosition;
        modalPanelDetails.question      = "This is an announcement!\nIf you don't like it, shove off!";

        modalPanelDetails.button1Details             = new EventButtonDetails();
        modalPanelDetails.button1Details.buttonTitle = useTitle;
        if (!objectClicked)
        {
            modalPanelDetails.button1Details.action = TestWalkFunction;
        }
        else
        {
            modalPanelDetails.button1Details.action = TestUseFunction;
        }

        modalPanelDetails.button2Details             = new EventButtonDetails();
        modalPanelDetails.button2Details.buttonTitle = "Examine";
        modalPanelDetails.button2Details.action      = TestExamineFunction;

        modalPanelDetails.button3Details             = new EventButtonDetails();
        modalPanelDetails.button3Details.buttonTitle = "Cancel";
        modalPanelDetails.button3Details.action      = TestCancelFunction;

        modalPanel.NewChoice(modalPanelDetails);
    }
Ejemplo n.º 5
0
    void Update()
    {
        if (interactable)
        {
            if (Input.GetKeyUp("e"))
            {
                if (modalPanel.modalPanelObject.activeInHierarchy)
                {
                    modalPanel.ClosePanel();
                    GameInformation.PlayerControllable = true;

                    interactions++;
                    GameInformation.AddInteraction(this.gameObject.name, interactions);

                    SendMessage("ResetFacing");
                }
                else
                {
                    GameInformation.PlayerControllable = false;

                    SendMessage("FaceThePlayer");

                    ModalPanelDetails modalPanelDetails = new ModalPanelDetails();

                    string temp = DialogueData.LoadFromXML(dialogID);
                    modalPanelDetails.text = temp.Replace("PlayerName", GameInformation.PlayerName);

                    modalPanelDetails.title     = this.gameObject.name;
                    modalPanelDetails.iconImage = spriteRenderer.sprite;
                    modalPanel.NewChoice(modalPanelDetails);
                }
            }
        }
    }