private void RenameStash_Click(object sender, EventArgs e) { InputBox input = new InputBox { Text = "Rename to?" }; input.ShowDialog(); if (string.IsNullOrEmpty(input.textBox1.Text)) { return; } var exc = Path.GetExtension(Application.StartupPath + @"\CorruptionStashList\" + StashList.GetItemText(StashList.SelectedItem)); File.Move(Application.StartupPath + @"\CorruptionStashList\" + StashList.GetItemText(StashList.SelectedItem), Application.StartupPath + "\\CorruptionStashList\\" + input.textBox1.Text + exc); StashList.Items.Clear(); DirectoryInfo di = new DirectoryInfo(Application.StartupPath + @"\CorruptionStashList\"); FileInfo[] diar1 = di.GetFiles(); // list the names of all files in the specified directory foreach (var dra in diar1) { StashList.Items.Add(dra); } input.Dispose(); }
private void StashList_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { StashList.SelectedIndex = StashList.IndexFromPoint(e.X, e.Y); contextStripStash.Show(Cursor.Position); } }
public static List <TabInfo> GetUserTabs(Account acc) { string json = WebTools.getPrivateStashJSON(acc, Uri.EscapeUriString(String.Format("https://pathofexile.com/character-window/get-stash-items?league={0}&tabs=1&tabIndex=1&accountName={1}", acc.League, acc.Name))); JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); jsonSerializer.MaxJsonLength = Int32.MaxValue; StashList ro = jsonSerializer.Deserialize <StashList>(json); List <TabInfo> userTabs = new List <TabInfo>(); foreach (var item in ro.tabs) { Dictionary <string, object> tabs = (Dictionary <string, object>)item; TabInfo newTab = new TabInfo(); foreach (var tabEntry in tabs) { switch (tabEntry.Key) { case "n": { newTab.caption = (string)tabEntry.Value; break; } case "i": { newTab.index = (Int32)tabEntry.Value; break; } case "id": { newTab.id = (string)tabEntry.Value; break; } case "type": { newTab.type = (string)tabEntry.Value; break; } case "selected": { newTab.selected = (bool)tabEntry.Value; break; } } } userTabs.Add(newTab); } return(userTabs); }
private void Corruptusingstash_Click(object sender, EventArgs e) { { try { ROM = File.ReadAllBytes(MainOpenFileDialog.FileName); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } foreach (var line in File.ReadAllLines(Application.StartupPath + "\\CorruptionStashList\\" + StashList.GetItemText(StashList.SelectedItem))) { Object[] splitStrings; Object[] Instructions; try { splitStrings = line.Split(new string[] { "(", ")" }, StringSplitOptions.None); Instructions = line.Split(new string[] { ".", "(" }, StringSplitOptions.None); } catch (Exception ex) { MessageBox.Show("Error while splitting important variables: " + ex.Message); return; } Object i; Object result; try { i = splitStrings[1]; } catch (Exception ex) { MessageBox.Show("Invaild Corruption Location: " + ex.ToString()); return; } try { result = splitStrings[3]; } catch (Exception ex) { MessageBox.Show("Invaild Result Location: " + ex.ToString()); return; } //if (Char.IsDigit((char)i) == false | Char.IsDigit((char)result) == false) //{ // MessageBox.Show("IsNumeric Location/Result Check Failed, File is most likely corrupted or is blank."); // return; //} //MessageBox.Show(i.ToString()); //MessageBox.Show(result.ToString()); //ROM[(int)i] = (byte)result; ROM[int.Parse(i.ToString())] = (byte)int.Parse(result.ToString()); } File.WriteAllBytes(SaveasTxt.Text, ROM); CorruptButton.BackColor = Color.Green; using (var soundPlayer = new SoundPlayer(Properties.Resources.success2)) { soundPlayer.Play(); } CorruptButtonColorChanger.Start(); if (Runemulatorchbox.Checked && string.IsNullOrEmpty(EmulatorLocationtxt.Text)) { StartEmulator(); } } }