public void ActivateEditNewChoice() { GetPanel().SetActive(true); displayPlayerChoiceDetailsBtn.GetComponent <Button>().interactable = false; //indicate to user that button no longer functions. if (editingChoice) { string[] choiceDesc = DbCommands.GetTupleFromTable("PlayerChoices", "ChoiceIDs = " + (playerChoicesListUI.GetSelectedItemFromGroup(playerChoicesListUI.SelectedChoice) as PlayerChoice).GetComponent <PlayerChoice>().MyID + ";"); inputChoiceText.text = choiceDesc[1]; } }
public void InsertDialogueNodeResult(GameObject selectedBtn) { NewNodeChoiceResultBtn dialogueNodeChoiceResultBtn = selectedBtn.GetComponent <NewNodeChoiceResultBtn>(); //(GetSelectedItemFromGroup(selectedChoice) as PlayerChoice).MyNextNode = dialogueNodeChoiceResultBtn.MyID; string[,] fieldVals = new string[, ] { { "NextNodes", dialogueNodeChoiceResultBtn.MyID } }; PlayerChoice selectedChoiceObj = playerChoicesListUI.GetSelectedItemFromGroup(playerChoicesListUI.SelectedChoice) as PlayerChoice; selectedChoiceObj.MyNextNode = dialogueNodeChoiceResultBtn.MyID; DbCommands.UpdateTableTuple("PlayerChoices", "ChoiceIDs = " + selectedChoiceObj.MyID, fieldVals); DisplayResultsRelatedToChoices(); DeactivateNewChoiceResult(); }
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); } } }