示例#1
0
                public override ListViewItem GetListViewItem()
                {
                    ListViewItem m = new ListViewItem("");

                    m.SubItems.Add(Position.X.ToString("#####0.############"));
                    m.SubItems.Add(Position.Y.ToString("#####0.############"));
                    m.SubItems.Add(Position.Z.ToString("#####0.############"));

                    m.SubItems.Add(Rotation.X.ToString("#####0.############"));
                    m.SubItems.Add(Rotation.Y.ToString("#####0.############"));
                    m.SubItems.Add(Rotation.Z.ToString("#####0.############"));

                    m.SubItems.Add(Scale.X.ToString("#####0.############"));
                    m.SubItems.Add(Scale.Y.ToString("#####0.############"));
                    m.SubItems.Add(Scale.Z.ToString("#####0.############"));

                    //ObjectDb.Object ob = MKDS_Const.ObjectDatabase.GetObject(o.ObjectID);
                    //if (ob != null) i.SubItems.Add(ob.ToString());
                    /*else */
                    m.SubItems.Add(GetHexReverse(ObjectID));
                    m.SubItems.Add(RouteID.ToString());

                    m.SubItems.Add(GetHexReverse(Settings[0]));
                    m.SubItems.Add(GetHexReverse(Settings[1]));
                    m.SubItems.Add(GetHexReverse(Settings[2]));
                    m.SubItems.Add(GetHexReverse(Settings[3]));
                    m.SubItems.Add(GetHexReverse(Settings[4]));
                    m.SubItems.Add(GetHexReverse(Settings[5]));
                    m.SubItems.Add(GetHexReverse(Settings[6]));
                    m.SubItems.Add(GetHexReverse(Settings[7]));

                    m.SubItems.Add(TTVisible.ToString());
                    return(m);
                }
示例#2
0
            public override ListViewItem GetListViewItem()
            {
                ListViewItem m = new ListViewItem("");

                m.SubItems.Add(ToString());
                m.SubItems.Add(HexUtil.GetHexReverse(Unknown1));
                m.SubItems.Add(Position.X.ToString());
                m.SubItems.Add(Position.Y.ToString());
                m.SubItems.Add(Position.Z.ToString());

                m.SubItems.Add(Rotation.X.ToString());
                m.SubItems.Add(Rotation.Y.ToString());
                m.SubItems.Add(Rotation.Z.ToString());

                m.SubItems.Add(Scale.X.ToString());
                m.SubItems.Add(Scale.Y.ToString());
                m.SubItems.Add(Scale.Z.ToString());

                m.SubItems.Add(RouteID.ToString());

                m.SubItems.Add(HexUtil.GetHexReverse(Settings[0]));
                m.SubItems.Add(HexUtil.GetHexReverse(Settings[1]));
                m.SubItems.Add(HexUtil.GetHexReverse(Settings[2]));
                m.SubItems.Add(HexUtil.GetHexReverse(Settings[3]));
                m.SubItems.Add(HexUtil.GetHexReverse(Settings[4]));
                m.SubItems.Add(HexUtil.GetHexReverse(Settings[5]));
                m.SubItems.Add(HexUtil.GetHexReverse(Settings[6]));
                m.SubItems.Add(HexUtil.GetHexReverse(Settings[7]));

                m.SubItems.Add(HexUtil.GetHexReverse(Visibility));

                m.SubItems.Add(HexUtil.GetHexReverse(Unknown2));
                m.SubItems.Add(HexUtil.GetHexReverse(Unknown3));
                return(m);
            }
        private void saveChanges_Click(object sender, EventArgs e)
        {
            if (!changesSaved)
            {
                try
                {
                    if (CheckInput())
                    {
                        RouteID routeID         = (RouteID)routesIDList.SelectedItem;
                        string  company         = carCompanyIn.Text.Trim();
                        int     fuelCapacity    = Convert.ToInt32(fuelCapacityIn.Text);
                        int     fuelConsumption = Convert.ToInt32(fuelConsumptionIn.Text);

                        if (Car == null)
                        {
                            CarID carID = new CarID(Convert.ToInt32(carIDIn.Text));
                            Car = new RouteTaxi(carID, company, routeID, fuelCapacity, fuelConsumption);
                        }
                        else
                        {
                            Car.Company = company;
                            Car.RouteID = routeID;
                        }

                        IsHandled           = true;
                        changesSaved        = true;
                        saveChanges.Enabled = false;
                    }
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.Message);
                }
            }
        }
 private void createRoute_Click(object sender, EventArgs e)
 {
     if (routeIdIn.Text != string.Empty)
     {
         RouteID routeID  = new RouteID(Convert.ToInt32(routeIdIn.Text));
         Route   newRoute = new Route(routeID);
         if (!Routes.Contains(newRoute))
         {
             Routes.Add(newRoute);
             routeIdIn.Text           = string.Empty;
             routesList.SelectedIndex = routesList.Items.Count - 1;
             changesSaved             = false;
             EnableRouteSelectionLayout(false);
             EnableRouteEditLayout(true);
             EnableSave(false);
         }
         else
         {
             MessageBox.Show("Route with that ID already exists!");
         }
     }
 }
示例#5
0
            public override ListViewItem GetListViewItem()
            {
                ListViewItem m = new ListViewItem("");

                m.SubItems.Add(Type.ToString());
                m.SubItems.Add(Next.ToString());
                m.SubItems.Add(Unknown1.ToString());
                m.SubItems.Add(RouteID.ToString());

                m.SubItems.Add(RouteSpeed.ToString());
                m.SubItems.Add(FOVSpeed.ToString());
                m.SubItems.Add(ViewpointSpeed.ToString());

                m.SubItems.Add(Unknown2.ToString());
                m.SubItems.Add(Unknown3.ToString());

                m.SubItems.Add(Position.X.ToString());
                m.SubItems.Add(Position.Y.ToString());
                m.SubItems.Add(Position.Z.ToString());

                m.SubItems.Add(Rotation.X.ToString());
                m.SubItems.Add(Rotation.Y.ToString());
                m.SubItems.Add(Rotation.Z.ToString());

                m.SubItems.Add(FOVBegin.ToString());
                m.SubItems.Add(FOVEnd.ToString());

                m.SubItems.Add(Viewpoint1.X.ToString());
                m.SubItems.Add(Viewpoint1.Y.ToString());
                m.SubItems.Add(Viewpoint1.Z.ToString());

                m.SubItems.Add(Viewpoint2.X.ToString());
                m.SubItems.Add(Viewpoint2.Y.ToString());
                m.SubItems.Add(Viewpoint2.Z.ToString());

                m.SubItems.Add(Duration.ToString());
                return(m);
            }