Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     dialogueNodesListUI = FindObjectOfType <DialogueNodesListUI>();
     playerChoicesListUI = FindObjectOfType <PlayerChoicesListUI>();
     print(playerChoicesListUI);
     choiceDropdown = GetPanel().GetComponentInChildren <Dropdown>();
     displayPlayerChoiceDetailsBtn = transform.Find("DisplayPlayerChoiceDetailsBtn").gameObject;
     inputChoiceText = GetPanel().transform.GetComponentInChildren <InputField>();
     NodeType        = "NodeType";
     CreateSelectionToggleGroup(NodeType);
 }
 // Use this for initialization
 void Start()
 {
     dialogueUI              = FindObjectOfType <DialogueUI>();
     dialogueNodesListUI     = FindObjectOfType <DialogueNodesListUI>();
     endDialogueOptionToggle = GetPanel().transform.GetComponentInChildren <Toggle>();
     //dialogueNodesList = transform.parent.Find("ScrollView").GetComponentInChildren<VerticalLayoutGroup>().gameObject;
     nodeTypeDropdown = GetPanel().GetComponentInChildren <Dropdown>();
     displayDialogueNodeDetailsBtn = transform.Find("ActivateNodeDetailsBtn").gameObject;
     inputNodeText = GetPanel().transform.GetComponentInChildren <InputField>();
     NodeType      = "NodeType";
     CreateSelectionToggleGroup(NodeType);
     playerChoicesListUI  = FindObjectOfType <PlayerChoicesListUI>();
     nodeSpeakerBtn       = GetPanel().transform.Find("NodeSpeakerBtn").gameObject;
     selectNodeSpeakersUI = GetPanel().transform.Find("SelectNodeSpeakersUI").gameObject;
     charOverrideList     = selectNodeSpeakersUI.transform.Find("Panel").GetComponentInChildren <VerticalLayoutGroup>().gameObject;
 }
Exemplo n.º 3
0
        void Start()
        {
            playerChoicesListUI = FindObjectOfType <PlayerChoicesListUI>();
            dialogueNodesListUI = GetPanel().GetComponentInChildren <DialogueNodesListUI>();

            //choiceResultOptions = new ChoiceResultOptions();

            //DIALOGUE COMPONENTS
            dialoguesListUI          = GetPanel().transform.Find("DialoguesListUI").gameObject;
            dialoguesPanel           = dialoguesListUI.transform.Find("Panel").gameObject;
            dialogueList             = dialoguesPanel.transform.Find("ScrollView").Find("DialoguesList").gameObject;
            mainDialogueListSearcher = dialoguesPanel.GetComponentInChildren <ListSearcher>();
            //add
            submitNewDialogue         = dialoguesPanel.transform.Find("SubmitNewDialog").gameObject;
            newDialoguePanel          = submitNewDialogue.transform.Find("NewDialogPanel").gameObject;
            activateNewDialogueBtn    = submitNewDialogue.transform.Find("ActivateNewDialogBtn").gameObject;
            inputShortDescriptionText = newDialoguePanel.transform.Find("InputShortDescriptionText").GetComponent <InputField>();
            dialogueActive            = newDialoguePanel.transform.GetComponentInChildren <Toggle>();

            //CHARACTER DIALOGUES COMPONENTS
            charDialoguesListUI = GetPanel().transform.Find("CharDialoguesListUI").gameObject;
            charDialoguesPanel  = charDialoguesListUI.transform.Find("Panel").gameObject;
            characterList       = charDialoguesPanel.transform.Find("CharDialoguesList").gameObject;
            //add
            addCharDialoguesUI    = charDialoguesPanel.transform.Find("AddCharDialoguesUI").gameObject;
            addCharDialoguesPanel = addCharDialoguesUI.transform.Find("AddCharDialoguesPanel").gameObject;
            addCharDialogueList   = addCharDialoguesPanel.transform.Find("CharacterList").gameObject;
            activateAddCharBtn    = addCharDialoguesUI.transform.Find("ActivateAddCharBtn").gameObject;

            //PLAYER CHOICE RESULTS COMPONENTS
            playerChoiceResultsListUI = GetPanel().transform.Find("PlayerChoiceResultsListUI").gameObject;
            playerChoiceResultsPanel  = playerChoiceResultsListUI.transform.Find("Panel").gameObject;
            playerChoicesResultsList  = playerChoiceResultsPanel.GetComponentInChildren <VerticalLayoutGroup>().gameObject;
            //add
            newChoiceResultUI             = playerChoiceResultsPanel.transform.Find("NewChoiceResultUI").gameObject;
            displayNewChoiceResultBtn     = newChoiceResultUI.transform.Find("DisplayNewChoiceResultBtn").gameObject;
            newChoiceResultPanel          = newChoiceResultUI.transform.Find("Panel").gameObject;
            choiceResultOptionsScrollView = newChoiceResultPanel.GetComponentInChildren <ScrollRect>();
            selectedResultTypeList        = choiceResultOptionsScrollView.transform.Find("SelectedResultTypeList").gameObject;
            newChoiceResultListSearcher   = newChoiceResultPanel.GetComponentInChildren <ListSearcher>();



            newActivateWelshVocabListInfo = new ListDisplayInfo(
                DbQueries.GetNewActivateVocabPlayerChoiceResultQry,
                BuildNewChoiceResultActivateVocabBtn);
            newActivateGrammarListInfo = new ListDisplayInfo(
                DbQueries.GetNewActivateGrammarPlayerChoiceResultQry,
                BuildNewChoiceResultActivateGrammarBtn);
            newActivateDialogueListInfo = new ListDisplayInfo(
                DbQueries.GetNewActivateDialoguePlayerChoiceResultQry,
                BuildNewChoiceResultActivateDialogueBtn);

            mainDialogueListInfo = new ListDisplayInfo(
                DbQueries.GetDialogueDisplayQry,
                BuildDialogue);

            //display dialogue list
            FillDisplayFromDb(mainDialogueListInfo.GetMyDefaultQuery(), dialogueList.transform, mainDialogueListInfo.GetMyBuildMethod());
            mainDialogueListSearcher.SetSearchInfo(mainDialogueListInfo);

            selectedDialogue     = "selectedDialogue";
            selectedNode         = "selectedNode";
            selectedChoiceResult = "selectedChoiceResult";
            CreateSelectionToggleGroup(selectedDialogue);
            CreateSelectionToggleGroup(selectedChoiceResult);
            CreateSelectionToggleGroup(selectedNode);
        }
Exemplo n.º 4
0
        public void DisplayResultsRelatedToChoices()
        {
            playerChoiceResultsPanel.SetActive(true);
            EmptyDisplay(playerChoicesResultsList.transform);
            print(playerChoicesListUI);
            playerChoicesListUI = FindObjectOfType <PlayerChoicesListUI>();
            string selectedChoiceID = (playerChoicesListUI.GetSelectedItemFromGroup(playerChoicesListUI.SelectedChoice) as PlayerChoice).MyID;

            if (DbCommands.GetFieldValueFromTable("PlayerChoices", "MarkDialogueCompleted", " ChoiceIDs = " + selectedChoiceID) != "0")
            {
                AppendDisplayFromDb((DbQueries.GetChoiceCompleteDialogueQry(selectedChoiceID)), playerChoicesResultsList.transform, BuildExistingResultCompleteDialogue);
            }
            if (DbCommands.GetFieldValueFromTable("PlayerChoices", "NextNodes", " ChoiceIDs = " + selectedChoiceID) != "")
            {
                GameObject pChoiceResultsTitle = Instantiate(existingResultTitlePrefab, new Vector2(0f, 0f), Quaternion.identity) as GameObject;
                AppendDisplayWithTitle(playerChoicesResultsList.transform, pChoiceResultsTitle.transform, "Goes to dialogue node... ");
                PlayerChoice currentPlayerChoice = playerChoicesListUI.GetSelectedItemFromGroup(playerChoicesListUI.SelectedChoice) as PlayerChoice;
                AppendDisplayFromDb(DbQueries.GetNextNodeResultQry(currentPlayerChoice.MyNextNode), playerChoicesResultsList.transform, BuildExistingResultNode);
            }
            int resultsCount = DbCommands.GetCountFromTable("PlayerChoiceResults", "ChoiceIDs = " + selectedChoiceID);

            if (resultsCount > 0)
            {
                int questActivateCount = DbCommands.GetCountFromQry(DbQueries.GetQuestActivateCountFromChoiceIDqry(selectedChoiceID));
                if (questActivateCount > 0)
                {
                    GameObject existingResultsTitle = Instantiate(existingResultTitlePrefab, new Vector2(0f, 0f), Quaternion.identity) as GameObject;
                    AppendDisplayWithTitle(playerChoicesResultsList.transform, existingResultsTitle.transform, "Activates quest... ");
                    AppendDisplayFromDb(DbQueries.GetCurrentActivateQuestsPlayerChoiceResultQry(selectedChoiceID),
                                        playerChoicesResultsList.transform,
                                        BuildExistingResultActivateQuest);
                }

                int taskActivateCount = DbCommands.GetCountFromQry(DbQueries.GetTaskActivateCountFromChoiceIDqry(selectedChoiceID));
                if (taskActivateCount > 0)
                {
                    GameObject existingResultsTitle = Instantiate(existingResultTitlePrefab, new Vector2(0f, 0f), Quaternion.identity) as GameObject;
                    AppendDisplayWithTitle(playerChoicesResultsList.transform, existingResultsTitle.transform, "Activates tasks... ");
                    AppendDisplayFromDb(DbQueries.GetCurrentActivateTasksPlayerChoiceResultQry(selectedChoiceID),
                                        playerChoicesResultsList.transform,
                                        BuildExistingResultActivateTask);
                }

                int taskCompleteCount = DbCommands.GetCountFromQry(DbQueries.GetTaskCompleteCountFromChoiceIDqry(selectedChoiceID));
                if (taskCompleteCount > 0)
                {
                    GameObject existingResultsTitle = Instantiate(existingResultTitlePrefab, new Vector2(0f, 0f), Quaternion.identity) as GameObject;
                    AppendDisplayWithTitle(playerChoicesResultsList.transform, existingResultsTitle.transform, "Completes tasks... ");
                    AppendDisplayFromDb(DbQueries.GetCurrentCompleteTasksPlayerChoiceResultQry(selectedChoiceID),
                                        playerChoicesResultsList.transform,
                                        BuildExistingResultCompleteTask);
                }

                int grammarActivateCount = DbCommands.GetCountFromQry(DbQueries.GetGrammarActivateCountFromChoiceIDqry(selectedChoiceID));
                if (grammarActivateCount > 0)
                {
                    GameObject existingResultsTitle = Instantiate(existingResultTitlePrefab, new Vector2(0f, 0f), Quaternion.identity) as GameObject;
                    AppendDisplayWithTitle(playerChoicesResultsList.transform, existingResultsTitle.transform, "Activates new grammar... ");
                    AppendDisplayFromDb(DbQueries.GetCurrentActivateGrammarPlayerChoiceResultQry(selectedChoiceID),
                                        playerChoicesResultsList.transform,
                                        BuildExistingResultActivateGrammar);
                }

                int vocabActivateCount = DbCommands.GetCountFromQry(DbQueries.GetVocabActivateCountFromChoiceIDqry(selectedChoiceID));
                if (vocabActivateCount > 0)
                {
                    GameObject existingResultsTitle = Instantiate(existingResultTitlePrefab, new Vector2(0f, 0f), Quaternion.identity) as GameObject;
                    AppendDisplayWithTitle(playerChoicesResultsList.transform, existingResultsTitle.transform, "Activates new vocab... ");
                    AppendDisplayFromDb(DbQueries.GetCurrentActivateVocabPlayerChoiceResultQry(selectedChoiceID),
                                        playerChoicesResultsList.transform,
                                        BuildExistingResultActivateVocab);
                }

                int dialogueActivateCount = DbCommands.GetCountFromQry(DbQueries.GetDialogueActivateCountFromChoiceIDqry(selectedChoiceID));
                if (dialogueActivateCount > 0)
                {
                    GameObject existingResultsTitle = Instantiate(existingResultTitlePrefab, new Vector2(0f, 0f), Quaternion.identity) as GameObject;
                    AppendDisplayWithTitle(playerChoicesResultsList.transform, existingResultsTitle.transform, "Activates new dialogue(s)... ");
                    AppendDisplayFromDb(DbQueries.GetCurrentActivateDialoguePlayerChoiceResultQry(selectedChoiceID),
                                        playerChoicesResultsList.transform,
                                        BuildExistingResultActivateDialogue);
                }
            }
        }