Example #1
0
 public ITravel(string zFile)
 {
     this.InitializeComponent();
     this.Text           = Program.CurrentName;
     this._hTravelRecord = new ITravel.TravelRecorder(this);
     AionInterface.TravelList travelList = new AionInterface.TravelList(zFile);
     this.TravelType.SelectedIndex = travelList.IsReverse() ? 1 : 0;
     foreach (Travel travel in travelList.GetList())
     {
         this.Add(travel.GetName(), travel.GetPosition().X, travel.GetPosition().Y, travel.GetPosition().Z, travel.IsFlying(), travel.GetType(), travel.GetParam());
     }
     this.Text          = this.Text + " (" + zFile.Substring(zFile.LastIndexOf("\\") + 1) + ")";
     this._zFile        = zFile;
     this._bInitialized = true;
 }
Example #2
0
 private void _OnClick(object sender, EventArgs e)
 {
     if (sender == this.ButtonAdd)
     {
         if (Game.Player != null)
         {
             Vector3D position = Game.Player.GetPosition();
             this.Add((string)null, position.X, position.Y, position.Z, Game.Player.IsFlying(), "Move", (string)null);
             this._Changed();
         }
     }
     else if (sender == this.ButtonDelete)
     {
         if (this.TravelList.SelectedRows != null)
         {
             this.TravelList.Rows.RemoveAt(this.TravelList.SelectedRows[0].Index);
             this._Changed();
         }
     }
     else if (sender == this.ButtonDown)
     {
         if (this.TravelList.SelectedRows != null && this.TravelList.SelectedRows[0].Index < this.TravelList.Rows.Count - 1)
         {
             DataGridViewRow dataGridViewRow = this.TravelList.SelectedRows[0];
             int             count           = this.TravelList.Rows.Count;
             int             index           = dataGridViewRow.Index;
             this.TravelList.Rows.RemoveAt(index);
             this.TravelList.Rows.Insert(index + 1, dataGridViewRow);
             dataGridViewRow.Selected = true;
             this._Changed();
         }
     }
     else if (sender == this.ButtonRecord)
     {
         if (!this._hTravelRecord.Running())
         {
             this.ButtonRecord.Text = "Stop";
             this._hTravelRecord.Start();
         }
         else
         {
             this.ButtonRecord.Text = "Record";
             this._hTravelRecord.Stop();
         }
     }
     else if (sender == this.ButtonRun)
     {
         if (this.TravelList.SelectedRows != null && Game.Player != null)
         {
             AionInterface.TravelList travelList = new AionInterface.TravelList((string)null);
             for (int index = 0; index < this.TravelList.Rows.Count; ++index)
             {
                 float X       = float.Parse((string)this.TravelList.Rows[index].Cells[1].Value);
                 float Y       = float.Parse((string)this.TravelList.Rows[index].Cells[2].Value);
                 float Z       = float.Parse((string)this.TravelList.Rows[index].Cells[3].Value);
                 bool  bFlying = bool.Parse((string)this.TravelList.Rows[index].Cells[4].Value);
                 travelList.Modify(new Travel((string)null, new Vector3D(X, Y, Z), bFlying, (string)null, (string)null), -1);
             }
             for (int index = 0; index < this.TravelList.SelectedRows[0].Index; ++index)
             {
                 travelList.GetNext();
             }
             travelList.Move();
         }
     }
     else if (sender == this.ButtonUp && this.TravelList.SelectedRows != null && this.TravelList.SelectedRows[0].Index > 0)
     {
         DataGridViewRow dataGridViewRow = this.TravelList.SelectedRows[0];
         int             index           = dataGridViewRow.Index;
         this.TravelList.Rows.RemoveAt(index);
         this.TravelList.Rows.Insert(index - 1, dataGridViewRow);
         dataGridViewRow.Selected = true;
         this._Changed();
     }
     this.Label.Focus();
 }