private void editToolStripMenuItem_Click(object sender, EventArgs e) { this.Hide(); new FirstBoot().ShowDialog(); config = JObject.Parse(File.ReadAllText("config.json")).ToObject <GamePickerConfig>(); steamidInput.Text = config.UserId.ToString(); this.Show(); }
public SteamGamePicker() { // We're checking config before the form loads ;) // Preload Config if (!File.Exists("config.json")) { new FirstBoot().ShowDialog(); } config = JObject.Parse(File.ReadAllText("config.json")).ToObject <GamePickerConfig>(); File.Create("game.txt").Close(); InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { File.Create("config.json").Close(); GamePickerConfig cfg = new GamePickerConfig(); cfg.ApiKey = textBox1.Text; try { cfg.UserId = ulong.Parse(textBox2.Text); }catch (Exception) { MessageBox.Show("Failed topare your ID! please make sure it is a valid Steam ID64 (ulong)"); return; } File.WriteAllText("config.json", JObject.FromObject(cfg).ToString()); this.Close(); }