public void SelectQuest() { // In the build the content packs need to go into the build data dir, this is currently manual string contentLocation = Application.dataPath + "/valkyrie-contentpacks/"; if (Application.isEditor) { // If running through unity then we assume you are using the git content, with the project at the same level contentLocation = Application.dataPath + "/../../valkyrie-contentpacks/"; } // Find any content packs at the location cd = new ContentData(contentLocation); // Check if we found anything if (cd.GetPacks().Count == 0) { Debug.Log("Error: Failed to find any content packs, please check that you have them present in: " + contentLocation); } // In the future this is where you select which packs to load, for now we load everything. foreach (string pack in cd.GetPacks()) { cd.LoadContent(pack); } // Get a list of available quests Dictionary <string, QuestLoader.Quest> ql = QuestLoader.GetQuests(); // Pull up the quest selection page new QuestSelection(ql); }
// This is called by 'start quest' on the main menu public void SelectQuest() { // Find any content packs at the location cd = new ContentData(gameType.DataDirectory()); // Check if we found anything if (cd.GetPacks().Count == 0) { ValkyrieDebug.Log("Error: Failed to find any content packs, please check that you have them present in: " + gameType.DataDirectory() + System.Environment.NewLine); Application.Quit(); } // Load configured packs cd.LoadContentID(""); Dictionary <string, string> packs = config.data.Get(gameType.TypeName() + "Packs"); if (packs != null) { foreach (KeyValuePair <string, string> kv in packs) { cd.LoadContentID(kv.Key); } } // Get a list of available quests Dictionary <string, QuestData.Quest> ql = QuestLoader.GetQuests(); // Pull up the quest selection page new QuestSelectionScreen(ql); }
// This is called by editor on the main menu public void SelectEditQuest() { // Find any content packs at the location cd = new ContentData(gameType.DataDirectory()); // Check if we found anything if (cd.GetPacks().Count == 0) { Debug.Log("Error: Failed to find any content packs, please check that you have them present in: " + gameType.DataDirectory() + System.Environment.NewLine); Application.Quit(); } foreach (string pack in cd.GetPacks()) { cd.LoadContent(pack); } // Pull up the quest selection page new QuestEditSelection(); }
// This is called by editor on the main menu public void SelectEditQuest() { // We load all packs for the editor, not just those selected foreach (string pack in cd.GetPacks()) { cd.LoadContent(pack); } // Pull up the quest selection page new QuestEditSelection(); }
// This is called by 'start quest' on the main menu public void SelectQuest() { // Find any content packs at the location cd = new ContentData(gameType.DataDirectory()); // Check if we found anything if (cd.GetPacks().Count == 0) { Debug.Log("Error: Failed to find any content packs, please check that you have them present in: " + gameType.DataDirectory() + System.Environment.NewLine); Application.Quit(); } // Load selected packs foreach (string pack in cd.GetEnabledPacks()) { cd.LoadContent(pack); } // Get a list of available quests Dictionary <string, QuestLoader.Quest> ql = QuestLoader.GetQuests(); // Pull up the quest selection page new QuestSelection(ql); }