Exemplo n.º 1
0
 //Creates a map modification object
 public MapMod(String name)
 {
     mapModType = (MapMods)Enum.Parse(typeof(MapMods), name);
     mapModList.Add(this);
     mapModID = mapModList.Count;
     ClassModifiedNotification(typeof(MapMod));
 }
Exemplo n.º 2
0
        //Set the map modification object type
        internal void setMapModObjectType()
        {
            if (mapModName.Equals("rectangle"))
            {
                mapModObject = new System.Windows.Shapes.Rectangle();
                mapModObject.StrokeThickness = 3;
            }

            if (mapModName.Equals("circle"))
            {
                mapModObject = new System.Windows.Shapes.Ellipse();
                mapModObject.StrokeThickness = 3;
            }

            if (mapModName.Equals("ramp") || mapModName.Equals("camp") || mapModName.Equals("stairs"))
            {
                mapModObject = new System.Windows.Shapes.Rectangle();
                ImageBrush mapModImg = new ImageBrush();
                MapMods    mapModi   = (MapMods)Enum.Parse(typeof(MapMods), mapModName);
                mapModImg.ImageSource = TechnicalServices.getImage(mapModi);
                mapModObject.Fill     = mapModImg;
            }

            if (mapModName.Equals("text"))
            {
                textInput = MainWindow.getAdditionalTextInput();

                if (textInput == null || textInput.Equals(""))
                {
                    textInput = "Enter text";
                }
                else
                {
                    textInput = MainWindow.getAdditionalTextInput();
                }

                System.Drawing.Font   font   = new System.Drawing.Font("Times New Roman", 35.0f);
                System.Drawing.Bitmap bitmap = DrawText(textInput, font, System.Drawing.Color.Black, System.Drawing.Color.Transparent);

                ToBitmapImage(bitmap);
                BitmapImage bitmapimg = ToBitmapImage(bitmap);
                mapModObject = new System.Windows.Shapes.Rectangle();
                ImageBrush mapModImg = new ImageBrush();
                mapModImg.ImageSource = bitmapimg;
                mapModObject.Fill     = mapModImg;
            }

            if (mapModName.Equals("line"))
            {
                return;
            }
        }
        public static RecomendMod ConvertToRecomendMod(MapMods mapMods)
        {
            RecomendMod result = 0;

            if ((mapMods & MapMods.NoodleExtensions) != 0)
            {
                result |= RecomendMod.NoodleExtensions;
            }
            if ((mapMods & MapMods.MappingExtensions) != 0)
            {
                result |= RecomendMod.MappingExtensions;
            }
            if ((mapMods & MapMods.Chroma) != 0)
            {
                result |= RecomendMod.Chroma;
            }
            if ((mapMods & MapMods.Cinema) != 0)
            {
                result |= RecomendMod.Cinema;
            }
            return(result);
        }
Exemplo n.º 4
0
        //Returns the image of the map modification item
        public static BitmapImage getImage(MapMods AI)
        {
            BitmapImage img = new BitmapImage(new Uri(AbsolutePath + MapModPath[AI]));

            return(img);
        }