Advertisement
SonOfABeach

Untitled

May 1st, 2015
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.58 KB | None | 0 0
  1. private void GameIndexChanged()
  2.         {
  3.             int i = -1;
  4.             for (int j = 0; j < GameBlocks.Length; j++)
  5.             {
  6.                 if (GameBlocks[j] == comboBox1.Items[comboBox1.SelectedIndex].ToString())
  7.                 {
  8.                     i = j;
  9.                     break;
  10.                 }
  11.             }
  12.  
  13.             if (i != -1)
  14.             {
  15.                 try
  16.                 {
  17.                     string GameName = GameBlocks[i];
  18.                     Console.WriteLine("Game: " + GameName);
  19.                     string RegionAddNameAdd = GameBlocks[i + 1];
  20.                     string[] SpecificGameAddresses = RegionAddNameAdd.Split(new char[] { '"' });
  21.                     string GameRegion = SpecificGameAddresses[0];
  22.                     Console.WriteLine("Region: " + GameRegion);
  23.                     for (int j = 1; j < SpecificGameAddresses.Length; j++)
  24.                     {
  25.                         string[] FinalAddress = SpecificGameAddresses[j].Split(Environment.NewLine.ToCharArray());
  26.                         string Address_Name = FinalAddress[0];
  27.                         string[] AddressBytes = FinalAddress[1].Split(new char[] { ' ' });
  28.                         string Address = AddressBytes[0];
  29.                         string Bytes = AddressBytes[1];
  30.  
  31.                         Console.WriteLine("Name: " + Address_Name + " Offset: 0x" + Address + " Bytes: " + Bytes);
  32.                     }
  33.                     Console.WriteLine();
  34.                 }
  35.                 catch
  36.                 {
  37.                     Console.WriteLine("Failed on block " + i.ToString());
  38.                     Console.WriteLine();
  39.                 }
  40.             }
  41.             else
  42.             {
  43.                 MessageBox.Show("Error: Game " + comboBox1.Items[comboBox1.SelectedIndex].ToString() + " not found.");
  44.             }            
  45.         }
  46.  
  47.         string[] GameBlocks;
  48.         private void OpenButtonShit()
  49.         {
  50.             string TextDoc = File.ReadAllText(@"codelist.inf");
  51.             GameBlocks = TextDoc.Split(new char[] { '#' });
  52.             comboBox1.Items.Clear();
  53.             for (int i = 0; i < GameBlocks.Length; i++)
  54.             {
  55.         if (GameBlocks[i] >= 2)
  56.         {
  57.                     if (GameBlocks[i][0] != 'S' && GameBlocks[i][1] != 'L')
  58.                             comboBox1.Items.Add(GameBlocks[i]);
  59.         }
  60.         else
  61.         {
  62.                         comboBox1.Items.Add(GameBlocks[i]);
  63.         }
  64.             }
  65.             comboBox1.SelectedIndex = 0;
  66.         }
  67.  
  68.         private void OnComboBoxIndexChangedThing()
  69.         {
  70.             GameIndexChanged();
  71.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement