public void DisplayNodesRelatedToDialogue() { DisplayComponents(); Dialogue currentDialogue = (dialogueUI.GetSelectedItemFromGroup(dialogueUI.selectedDialogue) as Dialogue); FillDisplayFromDb(DbQueries.GetDialogueNodeDisplayQry(currentDialogue.MyID), dialogueNodesList, BuildDialogueNodeTextOnly); AppendDisplayFromDb(DbQueries.GetDialogueNodeVocabDisplayQry(currentDialogue.MyID), dialogueNodesList, BuildDialogueNodeVocabTest); Debugging.PrintDbQryResults(DbQueries.GetDialogueNodeVocabDisplayQry(currentDialogue.MyID)); Debugging.PrintDbTable("DialogueNodesVocabTests"); Debugging.PrintDbTable("DialogueNodes"); }
private string GetDialogueID(Character character) { string qry = "SELECT CharacterDialogues.DialogueIDs FROM CharacterDialogues " + "INNER JOIN ActivatedDialogues ON CharacterDialogues.DialogueIDs = ActivatedDialogues.DialogueIDs " + "WHERE CharacterDialogues.CharacterNames = " + DbCommands.GetParameterNameFromValue(character.CharacterName) + " AND ActivatedDialogues.Completed = 0" + " AND ActivatedDialogues.SaveIDs = 0"; string dialogueID = DbCommands.GetFieldValueFromQry(qry, "DialogueIDs", character.CharacterName); Debugging.PrintDbQryResults(qry, character.CharacterName); //Debugging.PrintDbTable("ActivatedDialogues"); return(dialogueID); }
public void CompleteDefeatEnemyTagTaskPart(string tagName) { Debugging.PrintDbQryResults(DbQueries.GetDefeatEnemyTagTasksData(tagName, "0"), tagName); List <string[]> partsToComplete = new List <string[]>(); DbCommands.GetDataStringsFromQry(DbQueries.GetDefeatEnemyTagTasksData(tagName, "0"), out partsToComplete, tagName); if (partsToComplete.Count > 0) { foreach (string[] tuple in partsToComplete) { print("completing task part " + tagName); CompleteTaskPart(tuple[0], tuple[1], tuple[2]); print("task part completed"); } } }
public void CompleteEquipItemTaskPart(string itemName) { print("Complete equip item task part"); Debugging.PrintDbQryResults(DbQueries.GetEquipItemTasksData(itemName, "0"), itemName); List <string[]> partsToComplete = new List <string[]>(); DbCommands.GetDataStringsFromQry(DbQueries.GetEquipItemTasksData(itemName, "0"), out partsToComplete, itemName); if (partsToComplete.Count > 0) { foreach (string[] tuple in partsToComplete) { print("completing task part " + itemName); CompleteTaskPart(tuple[0], tuple[1], tuple[2]); print("task part completed"); } } }
public Transform BuildQuest(string[] questData) { Debugging.PrintDbQryResults(DbQueries.GetActivatedQuestsInCurrentGame()); string questName = questData[0]; bool completed = Convert.ToBoolean(int.Parse(questData[2])); print(questName); GameObject quest = Instantiate(questPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject; //print(quest); if (completed) { quest.GetComponent <Quest>().SetCompleted(); } quest.GetComponent <Quest>().MyName = questName; quest.GetComponentInChildren <Text>().text = questName; return(quest.transform); }
public void ActivateNewDialogue(string choiceID) { Debugging.PrintDbTable("ActivatedDialogues"); int countDialogueActivateResults = DbCommands.GetCountFromQry(DbQueries.GetDialogueActivateCountFromChoiceIDqry(choiceID)); if (countDialogueActivateResults > 0) { print("Dialogue ACTIVATING!!!!"); List <string[]> dialogueActivatedList; DbCommands.GetDataStringsFromQry(DbQueries.GetCurrentActivateDialoguePlayerChoiceResultQry(choiceID), out dialogueActivatedList); foreach (string[] activatedDialogue in dialogueActivatedList) { //get characters related to activated dialogue. Set active dialogues related to each character to completed List <string[]> charactersRelatedToDialogue; DbCommands.GetDataStringsFromQry(DbQueries.GetCharsRelatedToDialogue(activatedDialogue[1]), out charactersRelatedToDialogue); foreach (string[] characterName in charactersRelatedToDialogue) { List <string[]> activeDialoguesWithCharacter; string charname = characterName[0]; DbCommands.GetDataStringsFromQry(DbQueries.GetActiveDialoguesWithCharacter(charname), out activeDialoguesWithCharacter, characterName[0]); foreach (string[] dialogueWithChar in activeDialoguesWithCharacter) { string dialogueID = dialogueWithChar[0]; print("printing active dialogues with " + charname); Debugging.PrintDbQryResults(DbQueries.GetActiveDialoguesWithCharacter(charname), charname); DbCommands.UpdateTableField("ActivatedDialogues", "Completed", "1", "DialogueIDs = " + dialogueID + " AND SaveIDs = 0"); Debugging.PrintDbTable("ActivatedDialogues"); } } DbCommands.InsertTupleToTable("ActivatedDialogues", activatedDialogue[1], "0", "0"); //activate dialogues in dialogue activated list } } }
public void DisplayRelatedGrammar() { List <string[]> grammarData = new List <string[]>(); print(DbQueries.GetGrammarRelatedToVocab(enVocab, cyVocab)); Debugging.PrintDbQryResults(DbQueries.GetGrammarRelatedToVocab(enVocab, cyVocab), enVocab, cyVocab); DbCommands.GetDataStringsFromQry(DbQueries.GetGrammarRelatedToVocab(enVocab, cyVocab), out grammarData, enVocab, cyVocab); GameObject grammarList = Instantiate(grammarListPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject; grammarList.transform.SetParent(gameObject.transform, false); foreach (string[] grammarRuleData in grammarData) { GameObject grammarRule = Instantiate(relatedGrammarPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject; grammarRule.transform.Find("GrammarIntro").GetComponent <Text>().text = grammarRuleData[0]; grammarRule.transform.Find("GrammarBody").GetComponent <Text>().text = grammarRuleData[1]; grammarRule.transform.SetParent(grammarList.transform, false); } GetComponentInChildren <Button>().GetComponentInChildren <Image>().GetComponent <Transform>().Rotate(0, 0, -90); myGrammarList = grammarList; Canvas.ForceUpdateCanvases(); Debugging.PrintDbTable("DiscoveredVocabGrammar"); }
public void DisplayStartDialogueResultRelatedToTask(string taskID) { print("THIS IS GETTING CALLED"); Debugging.PrintDbQryResults(DbQueries.GetStartDialogueResultsRelatedToTaskQry(taskID), taskID); FillDisplayFromDb(DbQueries.GetStartDialogueResultsRelatedToTaskQry(taskID), taskResultsList.transform, BuildCurrentStartDialogueTaskResult, taskID); }