Exemple #1
0
        /// <summary>
        /// Find the paths (.pat files) belonging to the current route, and update the menu
        /// </summary>
        private void findPaths()
        {
            List <Path> newPaths = Path.GetPaths(CurrentRoute, true).OrderBy(r => r.Name).ToList();

            Paths = new Collection <Path>(newPaths);
            menuControl.PopulatePaths();
            SetPath(null);
            DrawMultiplePaths = new DrawMultiplePaths(this.RouteData, Paths);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="drawMultiPaths">The object containing the information on the available and selected paths</param>
        public OtherPathsWindow(DrawMultiplePaths drawMultiPaths)
        {
            InitializeComponent();
            multiPaths = drawMultiPaths;
            listOfPaths.Items.Clear();

            string[] pathNames = multiPaths.PathNames();
            foreach (string pathName in pathNames)
            {
                CheckBox checkBox = new CheckBox();
                checkBox.Content = pathName;
                checkBox.Click  += new RoutedEventHandler(CheckBox_Click);
                listOfPaths.Items.Add(checkBox);
            }

            RecolorAll();
        }
Exemple #3
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            // Even if there is nothing new to draw for main window, we might still need to draw for the shadow textures.
            if (DrawTrackDB != null && Properties.Settings.Default.showInset)
            {
                drawAreaInset.DrawShadowTextures(DrawTrackDB.DrawTracks, DrawColors.colorsNormal.ClearWindowInset);
            }

            // if there is nothing to draw, be done.
            if (--skipDrawAmount > 0)
            {
                return;
            }

            GraphicsDevice.Clear(DrawColors.colorsNormal.ClearWindow);
            if (DrawTrackDB == null)
            {
                return;
            }

            spriteBatch.Begin();
            if (drawTerrain != null)
            {
                drawTerrain.Draw(DrawArea);
            }
            drawWorldTiles.Draw(DrawArea);
            DrawArea.DrawTileGrid();
            if (drawTerrain != null)
            {
                drawTerrain.DrawPatchLines(DrawArea);
            }

            DrawTrackDB.DrawRoads(DrawArea);
            DrawTrackDB.DrawTracks(DrawArea);
            DrawTrackDB.DrawTrackHighlights(DrawArea, true);

            DrawTrackDB.DrawJunctionAndEndNodes(DrawArea);

            if (Properties.Settings.Default.showInset)
            {
                drawAreaInset.DrawBackground(DrawColors.colorsNormal.ClearWindowInset);
                //drawTrackDB.DrawTracks(drawAreaInset); //replaced by next line
                drawAreaInset.DrawShadowedTextures();
                DrawTrackDB.DrawTrackHighlights(drawAreaInset, false);
                drawAreaInset.DrawBorder(Color.Red, DrawArea);
                drawAreaInset.DrawBorder(Color.Black);
            }

            if (DrawMultiplePaths != null)
            {
                DrawMultiplePaths.Draw(DrawArea);
            }
            if (DrawPATfile != null && Properties.Settings.Default.showPATfile)
            {
                DrawPATfile.Draw(DrawArea);
            }
            if (PathEditor != null && Properties.Settings.Default.showTrainpath)
            {
                PathEditor.Draw(DrawArea);
            }

            DrawTrackDB.DrawRoadTrackItems(DrawArea);
            DrawTrackDB.DrawTrackItems(DrawArea);
            DrawTrackDB.DrawItemHighlights(DrawArea);

            CalculateFPS(gameTime);

            statusBarControl.Update(this, DrawArea.MouseLocation);

            drawScaleRuler.Draw();
            drawLongitudeLatitude.Draw(DrawArea.MouseLocation);

            DebugWindow.DrawAll();

            spriteBatch.End();

            base.Draw(gameTime);
            skipDrawAmount = maxSkipDrawAmount;
        }