// This is called by a user action public void SetMode(QuestListMode qlm) { quest_list_mode = qlm; if (qlm == QuestListMode.ONLINE) { force_local_quest = false; } else { force_local_quest = true; } }
private void QuestsDownload_callback(string data, bool error, System.Uri uri) { if (error) { error_download = true; error_download_description = data; // Callback to display screen if (cb_download != null) { cb_download(false); } quest_list_mode = QuestListMode.ERROR_DOWNLOAD; return; } if (!force_local_quest) { quest_list_mode = QuestListMode.ONLINE; } // Parse ini IniData remoteManifest = IniRead.ReadFromString(data); foreach (KeyValuePair <string, Dictionary <string, string> > quest_kv in remoteManifest.data) { remote_quests_data.Add(quest_kv.Key, new QuestData.Quest(quest_kv.Key, quest_kv.Value)); } if (remote_quests_data.Count == 0) { Debug.Log("ERROR: Quest list is empty\n"); error_download = true; error_download_description = "ERROR: Quest list is empty"; if (cb_download != null) { cb_download(false); } return; } CheckLocalAvailability(); if (cb_download != null) { cb_download(true); } }
public QuestsManager() { remote_quests_data = new Dictionary <string, QuestData.Quest>(); Game game = Game.Get(); // -- Download remote quests list INI file -- if (game.gameType.TypeName() == "MoM") { HTTPManager.Get("https://drive.google.com/uc?id=13JEtzRQ1LcCAAhKluxii0tgKDW71XODV&export=download", QuestsDownload_callback); quest_list_mode = QuestListMode.DOWNLOADING; } else if (game.gameType.TypeName() == "D2E") { HTTPManager.Get("https://drive.google.com/uc?id=1oa6NhKLUFn61RH1niPJzpFT4fG9iQFas&export=download", QuestsDownload_callback); quest_list_mode = QuestListMode.DOWNLOADING; } else { ValkyrieTools.ValkyrieDebug.Log("ERROR: DownloadQuests is called when no game type has been selected"); return; } }