public Editor() { dataBaseInterface = new FirebaseInterface(Application.StartupPath + "\\dbLocal.json"); var option = MessageBox.Show("Would you like to use the latest version of the databse?", "Startup", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (option.Equals(DialogResult.Yes)) { dataBaseInterface.downloadDB(); } else { MessageBox.Show("You're currently using the local copy of the databse, this may not contain the latest changes. Beware when uploading!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); dataBaseInterface.loadFromLocal(); } //onException?.Invoke(e); try { dbWorker = new Worker(dataBaseInterface.dbData); InitializeComponent(); SetVisibilityForHideableContent(false); WardensEnviroment.AvailableEnemies = dbWorker.GetEnemyNames(); ResetOwnedMaps(); } catch (JsonReaderException e) { MessageBox.Show("Database error!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.ExitThread(); this.Close(); } }
private void b_Import_Click(object sender, EventArgs e) { openFileDialog1 = new OpenFileDialog() { RestoreDirectory = true, Filter = "Json files (*.json)|*.json", FilterIndex = 1, Title = "Browse Database file", DefaultExt = "json", }; var result = openFileDialog1.ShowDialog(); if (result.Equals(DialogResult.OK)) { dataBaseInterface = new FirebaseInterface(openFileDialog1.FileName); dbWorker = new Worker(dataBaseInterface.dbData); MessageBox.Show("Database file imported successfully!", "Import operation", MessageBoxButtons.OK, MessageBoxIcon.Information); if (!HardReload()) { SoftReload(); } } }
void Awake() { if (store == null) { DontDestroyOnLoad(gameObject); store = this; } else if (store != this) { Destroy(gameObject); } }