Example #1
0
        private void FinishCapture()
        {
            if (_activeSettings.UseScaling)
            {
                int num = 0;
                do
                {
                    if (!SaveImage(_outputImageSize.Width, _outputImageSize.Height, ImageFormat.Png, "Data\\Captures" + Path.DirectorySeparatorChar +
                                   _activeSettings.OutputName + ".png"))
                    {
                        GC.Collect();
                        Thread.Sleep(5);
                        ++num;
                        Console.WriteLine("An error occured while saving the capture. Attempting again...");
                    }
                } while (num <= 5);

                Console.WriteLine("Unable to capture.");
                _outputData            = null;
                _scaledFrameData       = null;
                Main.GlobalTimerPaused = false;
                CaptureInterface.EndCamera();
                if (_scaledFrameBuffer != null)
                {
                    _scaledFrameBuffer.Dispose();
                    _scaledFrameBuffer = null;
                }
                _activeSettings = null;
            }
        }
Example #2
0
        private void FinishCapture()
        {
            if (this._activeSettings.UseScaling)
            {
                int num = 0;
                do
                {
                    if (!this.SaveImage(this._outputImageSize.Width, this._outputImageSize.Height, ImageFormat.Png, Main.SavePath + (object)Path.DirectorySeparatorChar + "Captures" + (object)Path.DirectorySeparatorChar + this._activeSettings.OutputName + ".png"))
                    {
                        GC.Collect();
                        Thread.Sleep(5);
                        ++num;
                        Console.WriteLine(Language.GetTextValue("Error.CaptureError"));
                    }
                    else
                    {
                        goto label_5;
                    }
                }while (num <= 5);
                Console.WriteLine(Language.GetTextValue("Error.UnableToCapture"));
            }
label_5:
            this._outputData       = (byte[])null;
            this._scaledFrameData  = (byte[])null;
            Main.GlobalTimerPaused = false;
            CaptureInterface.EndCamera();
            if (this._scaledFrameBuffer != null)
            {
                ((GraphicsResource)this._scaledFrameBuffer).Dispose();
                this._scaledFrameBuffer = (RenderTarget2D)null;
            }
            this._activeSettings = (CaptureSettings)null;
        }
Example #3
0
 private void FinishCapture()
 {
     if (_activeSettings.UseScaling)
     {
         int num = 0;
         while (!SaveImage(_outputImageSize.Width, _outputImageSize.Height, ImageFormat.Png, Main.SavePath + Path.DirectorySeparatorChar.ToString() + "Captures" + Path.DirectorySeparatorChar.ToString() + _activeSettings.OutputName + ".png"))
         {
             GC.Collect();
             Thread.Sleep(5);
             num++;
             Console.WriteLine(Language.GetTextValue("Error.CaptureError"));
             if (num > 5)
             {
                 Console.WriteLine(Language.GetTextValue("Error.UnableToCapture"));
                 break;
             }
         }
     }
     _outputData            = null;
     _scaledFrameData       = null;
     Main.GlobalTimerPaused = false;
     CaptureInterface.EndCamera();
     if (_scaledFrameBuffer != null)
     {
         _scaledFrameBuffer.Dispose();
         _scaledFrameBuffer = null;
     }
     _activeSettings = null;
 }
Example #4
0
 public static void StartCamera(CaptureSettings settings)
 {
     Main.PlaySound(40, -1, -1, 1);
     CaptureInterface.CameraSettings = settings;
     CaptureInterface.CameraLock = true;
     CaptureInterface.CameraWaiting = 0f;
 }
        public void Capture()
        {
            CaptureSettings captureSettings = new CaptureSettings();

            captureSettings.Area       = new Rectangle(2660, 100, 1000, 1000);
            captureSettings.UseScaling = false;
            Capture(captureSettings);
        }
Example #6
0
        public void Capture(CaptureSettings settings)
        {
            Main.GlobalTimerPaused = true;
            Monitor.Enter(_captureLock);
            if (_activeSettings != null)
            {
                throw new InvalidOperationException("Capture called while another capture was already active.");
            }
            _activeSettings = settings;
            Microsoft.Xna.Framework.Rectangle rectangle = settings.Area;

            float num1 = 1f;

            if (settings.UseScaling)
            {
                if (rectangle.Width << 4 > 4096)
                {
                    num1 = 4096f / (float)(rectangle.Width << 4);
                }
                if (rectangle.Height << 4 > 4096)
                {
                    num1 = Math.Min(num1, 4096f / (float)(rectangle.Height << 4));
                }
                num1             = Math.Min(1f, num1);
                _outputImageSize = new Size((int)MathHelper.Clamp((float)(num1 * (rectangle.Width << 4)), 1f, 4096f), (int)MathHelper.Clamp((float)(num1 * (rectangle.Height << 4)), 1f, 4096f));
                _outputData      = new byte[4 * _outputImageSize.Width * _outputImageSize.Height];
                int num2 = (int)Math.Floor(num1 * 2048.0);
                _scaledFrameData   = new byte[4 * num2 * num2];
                _scaledFrameBuffer = new RenderTarget2D(_graphics, num2, num2, false, _graphics.PresentationParameters.BackBufferFormat, DepthFormat.Depth24);
            }
            else
            {
                _outputData = new byte[16777216];
            }

            _tilesProcessed = 0.0f;
            _totalTiles     = (float)(rectangle.Width * rectangle.Height);
            int x1 = rectangle.X;

            while (x1 < rectangle.X + rectangle.Width)
            {
                int y1 = rectangle.Y;
                while (y1 < rectangle.Y + rectangle.Height)
                {
                    int width1  = Math.Min(128, rectangle.X + rectangle.Width - x1);
                    int height1 = Math.Min(128, rectangle.Y + rectangle.Height - y1);
                    int width2  = (int)Math.Floor(num1 * (width1 << 4));
                    int height2 = (int)Math.Floor(num1 * (height1 << 4));
                    int x2      = (int)Math.Floor(num1 * (x1 - rectangle.X << 4));
                    int y2      = (int)Math.Floor(num1 * (y1 - rectangle.Y << 4));
                    _renderQueue.Enqueue(new CaptureChunk(new Microsoft.Xna.Framework.Rectangle(x1, y1, width1, height1), new Microsoft.Xna.Framework.Rectangle(x2, y2, width2, height2)));
                    y1 += 126;
                }
                x1 += 126;
            }
            Monitor.Exit(_captureLock);
        }
Example #7
0
        private void FinishCapture()
        {
            if (this._activeSettings.UseScaling)
            {
                int num = 0;
                do
                {
                    int         width    = this._outputImageSize.Width;
                    int         height   = this._outputImageSize.Height;
                    ImageFormat png      = ImageFormat.Png;
                    string[]    strArray = new string[6];
                    strArray[0] = Main.SavePath;
                    int    index1 = 1;
                    char   directorySeparatorChar = Path.DirectorySeparatorChar;
                    string str1 = directorySeparatorChar.ToString();
                    strArray[index1] = str1;
                    int    index2 = 2;
                    string str2   = "Captures";
                    strArray[index2] = str2;
                    int index3 = 3;
                    directorySeparatorChar = Path.DirectorySeparatorChar;
                    string str3 = directorySeparatorChar.ToString();
                    strArray[index3] = str3;
                    int    index4     = 4;
                    string outputName = this._activeSettings.OutputName;
                    strArray[index4] = outputName;
                    int    index5 = 5;
                    string str4   = ".png";
                    strArray[index5] = str4;
                    string filename = string.Concat(strArray);
                    if (!this.SaveImage(width, height, png, filename))
                    {
                        GC.Collect();
                        Thread.Sleep(5);
                        ++num;
                        Console.WriteLine(Language.GetTextValue("Error.CaptureError"));
                    }
                    else
                    {
                        goto label_5;
                    }
                }while (num <= 5);
                Console.WriteLine(Language.GetTextValue("Error.UnableToCapture"));
            }
label_5:
            this._outputData       = (byte[])null;
            this._scaledFrameData  = (byte[])null;
            Main.GlobalTimerPaused = false;
            CaptureInterface.EndCamera();
            if (this._scaledFrameBuffer != null)
            {
                ((GraphicsResource)this._scaledFrameBuffer).Dispose();
                this._scaledFrameBuffer = (RenderTarget2D)null;
            }
            this._activeSettings = (CaptureSettings)null;
        }
Example #8
0
        public void Capture()
        {
            CaptureSettings settings = new CaptureSettings
            {
                Area       = new Rectangle(2660, 100, 1000, 1000),
                UseScaling = false
            };

            Capture(settings);
        }
Example #9
0
        public void Capture()
        {
            CaptureSettings settings = new CaptureSettings();

            settings.Area = new Rectangle(2660, 100, 1000, 1000);
            int num = 0;

            settings.UseScaling = num != 0;
            this.Capture(settings);
        }
Example #10
0
        public void Capture(CaptureSettings settings)
        {
            Main.GlobalTimerPaused = true;
            Monitor.Enter(this._captureLock);
            if (this._activeSettings != null)
            {
                throw new InvalidOperationException("Capture called while another capture was already active.");
            }
            this._activeSettings = settings;
            Rectangle area = settings.Area;
            float     num1 = 1f;

            if (settings.UseScaling)
            {
                if (area.Width << 4 > 4096)
                {
                    num1 = 4096f / (float)(area.Width << 4);
                }
                if (area.Height << 4 > 4096)
                {
                    num1 = Math.Min(num1, 4096f / (float)(area.Height << 4));
                }
                num1 = Math.Min(1f, num1);
                this._outputImageSize = new Size((int)MathHelper.Clamp((float)(int)((double)num1 * (double)(float)(area.Width << 4)), 1f, 4096f), (int)MathHelper.Clamp((float)(int)((double)num1 * (double)(float)(area.Height << 4)), 1f, 4096f));
                this._outputData      = new byte[4 * this._outputImageSize.Width * this._outputImageSize.Height];
                int num2 = (int)Math.Floor((double)num1 * 2048.0);
                this._scaledFrameData   = new byte[4 * num2 * num2];
                this._scaledFrameBuffer = new RenderTarget2D(this._graphics, num2, num2, false, this._graphics.get_PresentationParameters().get_BackBufferFormat(), (DepthFormat)2);
            }
            else
            {
                this._outputData = new byte[16777216];
            }
            this._tilesProcessed = 0.0f;
            this._totalTiles     = (float)(area.Width * area.Height);
            int x = (int)area.X;

            while (x < area.X + area.Width)
            {
                int y = (int)area.Y;
                while (y < area.Y + area.Height)
                {
                    int num2 = Math.Min(128, area.X + area.Width - x);
                    int num3 = Math.Min(128, area.Y + area.Height - y);
                    int num4 = (int)Math.Floor((double)num1 * (double)(num2 << 4));
                    int num5 = (int)Math.Floor((double)num1 * (double)(num3 << 4));
                    int num6 = (int)Math.Floor((double)num1 * (double)(x - area.X << 4));
                    int num7 = (int)Math.Floor((double)num1 * (double)(y - area.Y << 4));
                    this._renderQueue.Enqueue(new CaptureCamera.CaptureChunk(new Rectangle(x, y, num2, num3), new Rectangle(num6, num7, num4, num5)));
                    y += 126;
                }
                x += 126;
            }
            Monitor.Exit(this._captureLock);
        }
Example #11
0
        public void Capture(CaptureSettings settings)
        {
            Main.GlobalTimerPaused = true;
            Monitor.Enter(_captureLock);
            if (_activeSettings != null)
            {
                throw new InvalidOperationException("Capture called while another capture was already active.");
            }
            _activeSettings = settings;
            Microsoft.Xna.Framework.Rectangle area = settings.Area;
            float num = 1f;

            if (settings.UseScaling)
            {
                if (area.Width * 16 > 4096)
                {
                    num = 4096f / (float)(area.Width * 16);
                }
                if (area.Height * 16 > 4096)
                {
                    num = Math.Min(num, 4096f / (float)(area.Height * 16));
                }
                num = Math.Min(1f, num);
                _outputImageSize = new Size((int)MathHelper.Clamp((int)(num * (float)(area.Width * 16)), 1f, 4096f), (int)MathHelper.Clamp((int)(num * (float)(area.Height * 16)), 1f, 4096f));
                _outputData      = new byte[4 * _outputImageSize.Width * _outputImageSize.Height];
                int num2 = (int)Math.Floor(num * 2048f);
                _scaledFrameData   = new byte[4 * num2 * num2];
                _scaledFrameBuffer = new RenderTarget2D(_graphics, num2, num2, mipMap: false, _graphics.PresentationParameters.BackBufferFormat, DepthFormat.None);
            }
            else
            {
                _outputData = new byte[16777216];
            }
            _tilesProcessed = 0f;
            _totalTiles     = area.Width * area.Height;
            for (int i = area.X; i < area.X + area.Width; i += 126)
            {
                for (int j = area.Y; j < area.Y + area.Height; j += 126)
                {
                    int num3   = Math.Min(128, area.X + area.Width - i);
                    int num4   = Math.Min(128, area.Y + area.Height - j);
                    int width  = (int)Math.Floor(num * (float)(num3 * 16));
                    int height = (int)Math.Floor(num * (float)(num4 * 16));
                    int x      = (int)Math.Floor(num * (float)((i - area.X) * 16));
                    int y      = (int)Math.Floor(num * (float)((j - area.Y) * 16));
                    _renderQueue.Enqueue(new CaptureChunk(new Microsoft.Xna.Framework.Rectangle(i, j, num3, num4), new Microsoft.Xna.Framework.Rectangle(x, y, width, height)));
                }
            }
            Monitor.Exit(_captureLock);
        }
Example #12
0
        public void Capture(CaptureSettings settings)
        {
            Main.GlobalTimerPaused = true;
            Monitor.Enter(this._captureLock);
            if (this._activeSettings != null)
            {
                throw new InvalidOperationException("Capture called while another capture was already active.");
            }
            this._activeSettings = settings;
            Microsoft.Xna.Framework.Rectangle area = settings.Area;
            float num1 = 1f;

            if (settings.UseScaling)
            {
                if (area.Width * 16 > 4096)
                {
                    num1 = 4096f / (float)(area.Width * 16);
                }
                if (area.Height * 16 > 4096)
                {
                    num1 = Math.Min(num1, 4096f / (float)(area.Height * 16));
                }
                num1 = Math.Min(1f, num1);
                this._outputImageSize = new Size((int)MathHelper.Clamp((float)(int)((double)num1 * (double)(area.Width * 16)), 1f, 4096f), (int)MathHelper.Clamp((float)(int)((double)num1 * (double)(area.Height * 16)), 1f, 4096f));
                this._outputData      = new byte[4 * this._outputImageSize.Width * this._outputImageSize.Height];
                int num2 = (int)Math.Floor((double)num1 * 2048.0);
                this._scaledFrameData   = new byte[4 * num2 * num2];
                this._scaledFrameBuffer = new RenderTarget2D(this._graphics, num2, num2, false, this._graphics.PresentationParameters.BackBufferFormat, DepthFormat.None);
            }
            else
            {
                this._outputData = new byte[16777216];
            }
            this._tilesProcessed = 0.0f;
            this._totalTiles     = (float)(area.Width * area.Height);
            for (int x1 = area.X; x1 < area.X + area.Width; x1 += 126)
            {
                for (int y1 = area.Y; y1 < area.Y + area.Height; y1 += 126)
                {
                    int width1  = Math.Min(128, area.X + area.Width - x1);
                    int height1 = Math.Min(128, area.Y + area.Height - y1);
                    int width2  = (int)Math.Floor((double)num1 * (double)(width1 * 16));
                    int height2 = (int)Math.Floor((double)num1 * (double)(height1 * 16));
                    int x2      = (int)Math.Floor((double)num1 * (double)((x1 - area.X) * 16));
                    int y2      = (int)Math.Floor((double)num1 * (double)((y1 - area.Y) * 16));
                    this._renderQueue.Enqueue(new CaptureCamera.CaptureChunk(new Microsoft.Xna.Framework.Rectangle(x1, y1, width1, height1), new Microsoft.Xna.Framework.Rectangle(x2, y2, width2, height2)));
                }
            }
            Monitor.Exit(this._captureLock);
        }
		public void Capture(CaptureSettings settings)
		{
			Main.GlobalTimerPaused = true;
			Monitor.Enter(this._captureLock);
			if (this._activeSettings != null)
			{
				throw new InvalidOperationException("Capture called while another capture was already active.");
			}
			this._activeSettings = settings;
			Microsoft.Xna.Framework.Rectangle area = settings.Area;
			float num = 1f;
			if (settings.UseScaling)
			{
				if (area.Width << 4 > 4096)
				{
					num = 4096f / (float)(area.Width << 4);
				}
				if (area.Height << 4 > 4096)
				{
					num = Math.Min(num, 4096f / (float)(area.Height << 4));
				}
				num = Math.Min(1f, num);
				this._outputImageSize = new Size((int)MathHelper.Clamp((float)((int)(num * (float)(area.Width << 4))), 1f, 4096f), (int)MathHelper.Clamp((float)((int)(num * (float)(area.Height << 4))), 1f, 4096f));
				this._outputData = new byte[4 * this._outputImageSize.Width * this._outputImageSize.Height];
				int num2 = (int)Math.Floor((double)(num * 2048f));
				this._scaledFrameData = new byte[4 * num2 * num2];
				this._scaledFrameBuffer = new RenderTarget2D(this._graphics, num2, num2, false, this._graphics.PresentationParameters.BackBufferFormat, DepthFormat.Depth24);
			}
			else
			{
				this._outputData = new byte[16777216];
			}
			this._tilesProcessed = 0f;
			this._totalTiles = (float)(area.Width * area.Height);
			for (int i = area.X; i < area.X + area.Width; i += 126)
			{
				for (int j = area.Y; j < area.Y + area.Height; j += 126)
				{
					int num3 = Math.Min(128, area.X + area.Width - i);
					int num4 = Math.Min(128, area.Y + area.Height - j);
					int width = (int)Math.Floor((double)(num * (float)(num3 << 4)));
					int height = (int)Math.Floor((double)(num * (float)(num4 << 4)));
					int x = (int)Math.Floor((double)(num * (float)(i - area.X << 4)));
					int y = (int)Math.Floor((double)(num * (float)(j - area.Y << 4)));
					this._renderQueue.Enqueue(new CaptureCamera.CaptureChunk(new Microsoft.Xna.Framework.Rectangle(i, j, num3, num4), new Microsoft.Xna.Framework.Rectangle(x, y, width, height)));
				}
			}
			Monitor.Exit(this._captureLock);
		}
Example #14
0
        public void Capture(CaptureSettings settings)
        {
            Main.GlobalTimerPaused = true;
            Monitor.Enter(_captureLock);
            if (_activeSettings != null)
                throw new InvalidOperationException("Capture called while another capture was already active.");
            _activeSettings = settings;
            Microsoft.Xna.Framework.Rectangle rectangle = settings.Area;

            float num1 = 1f;
            if (settings.UseScaling)
            {
                if (rectangle.Width << 4 > 4096)
                    num1 = 4096f / (float)(rectangle.Width << 4);
                if (rectangle.Height << 4 > 4096)
                    num1 = Math.Min(num1, 4096f / (float)(rectangle.Height << 4));
                num1 = Math.Min(1f, num1);
                _outputImageSize = new Size((int)MathHelper.Clamp((float)(num1 * (rectangle.Width << 4)), 1f, 4096f), (int)MathHelper.Clamp((float)(num1 * (rectangle.Height << 4)), 1f, 4096f));
                _outputData = new byte[4 * _outputImageSize.Width * _outputImageSize.Height];
                int num2 = (int)Math.Floor(num1 * 2048.0);
                _scaledFrameData = new byte[4 * num2 * num2];
                _scaledFrameBuffer = new RenderTarget2D(_graphics, num2, num2, false, _graphics.PresentationParameters.BackBufferFormat, DepthFormat.Depth24);
            }
            else
                _outputData = new byte[16777216];

            _tilesProcessed = 0.0f;
            _totalTiles = (float)(rectangle.Width * rectangle.Height);
            int x1 = rectangle.X;
            while (x1 < rectangle.X + rectangle.Width)
            {
                int y1 = rectangle.Y;
                while (y1 < rectangle.Y + rectangle.Height)
                {
                    int width1 = Math.Min(128, rectangle.X + rectangle.Width - x1);
                    int height1 = Math.Min(128, rectangle.Y + rectangle.Height - y1);
                    int width2 = (int)Math.Floor(num1 * (width1 << 4));
                    int height2 = (int)Math.Floor(num1 * (height1 << 4));
                    int x2 = (int)Math.Floor(num1 * (x1 - rectangle.X << 4));
                    int y2 = (int)Math.Floor(num1 * (y1 - rectangle.Y << 4));
                    _renderQueue.Enqueue(new CaptureChunk(new Microsoft.Xna.Framework.Rectangle(x1, y1, width1, height1), new Microsoft.Xna.Framework.Rectangle(x2, y2, width2, height2)));
                    y1 += 126;
                }
                x1 += 126;
            }
            Monitor.Exit(_captureLock);
        }
		private void FinishCapture()
		{
			if (this._activeSettings.UseScaling)
			{
				int num = 0;
				while (!this.SaveImage(this._outputImageSize.Width, this._outputImageSize.Height, ImageFormat.Png, string.Concat(new object[]
				{
					Main.SavePath,
					Path.DirectorySeparatorChar,
					"Captures",
					Path.DirectorySeparatorChar,
					this._activeSettings.OutputName,
					".png"
				})))
				{
					GC.Collect();
					Thread.Sleep(5);
					num++;
					Console.WriteLine("An error occured while saving the capture. Attempting again...");
					if (num > 5)
					{
						Console.WriteLine("Unable to capture.");
						break;
					}
				}
			}
			this._outputData = null;
			this._scaledFrameData = null;
			Main.GlobalTimerPaused = false;
			CaptureInterface.EndCamera();
			if (this._scaledFrameBuffer != null)
			{
				this._scaledFrameBuffer.Dispose();
				this._scaledFrameBuffer = null;
			}
			this._activeSettings = null;
		}
Example #16
0
        private void FinishCapture()
        {
            if (_activeSettings.UseScaling)
            {
                int num = 0;
                do
                {
                    if (!SaveImage(_outputImageSize.Width, _outputImageSize.Height, ImageFormat.Png, "Data\\Captures" + Path.DirectorySeparatorChar +
                        _activeSettings.OutputName + ".png"))
                    {
                        GC.Collect();
                        Thread.Sleep(5);
                        ++num;
                        Console.WriteLine("An error occured while saving the capture. Attempting again...");
                    }
                } while (num <= 5);

                Console.WriteLine("Unable to capture.");
                _outputData = null;
                _scaledFrameData = null;
                Main.GlobalTimerPaused = false;
                CaptureInterface.EndCamera();
                if (_scaledFrameBuffer != null)
                {
                    _scaledFrameBuffer.Dispose();
                    _scaledFrameBuffer = null;
                }
                _activeSettings = null;
            }
        }
		private bool UpdateButtons(Vector2 mouse)
		{
			this.HoveredMode = -1;
			bool flag = !Main.graphics.IsFullScreen;
			int num = 9;
			for (int i = 0; i < num; i++)
			{
				Rectangle rectangle = new Rectangle(24 + 46 * i, 24, 42, 42);
				if (rectangle.Contains(mouse.ToPoint()))
				{
					this.HoveredMode = i;
					bool flag2 = Main.mouseLeft && Main.mouseLeftRelease;
					int num2 = 0;
					if (i == num2++ && flag2)
					{
						CaptureSettings captureSettings = new CaptureSettings();
						Point point = Main.screenPosition.ToTileCoordinates();
						Point point2 = (Main.screenPosition + new Vector2((float)Main.screenWidth, (float)Main.screenHeight)).ToTileCoordinates();
						captureSettings.Area = new Rectangle(point.X, point.Y, point2.X - point.X + 1, point2.Y - point.Y + 1);
						captureSettings.Biome = CaptureBiome.Biomes[CaptureInterface.Settings.BiomeChoice];
						captureSettings.CaptureBackground = !CaptureInterface.Settings.TransparentBackground;
						captureSettings.CaptureEntities = CaptureInterface.Settings.IncludeEntities;
						captureSettings.UseScaling = CaptureInterface.Settings.PackImage;
						captureSettings.CaptureMech = Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].mech;
						CaptureInterface.StartCamera(captureSettings);
					}
					if (i == num2++ && flag2 && CaptureInterface.EdgeAPinned && CaptureInterface.EdgeBPinned)
					{
						CaptureInterface.StartCamera(new CaptureSettings
						{
							Area = CaptureInterface.GetArea(),
							Biome = CaptureBiome.Biomes[CaptureInterface.Settings.BiomeChoice],
							CaptureBackground = !CaptureInterface.Settings.TransparentBackground,
							CaptureEntities = CaptureInterface.Settings.IncludeEntities,
							UseScaling = CaptureInterface.Settings.PackImage,
							CaptureMech = Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].mech
						});
					}
					if (i == num2++ && flag2 && this.SelectedMode != 0)
					{
						this.SelectedMode = 0;
						this.ToggleCamera(true);
					}
					if (i == num2++ && flag2 && this.SelectedMode != 1)
					{
						this.SelectedMode = 1;
						this.ToggleCamera(true);
					}
					if (i == num2++ && flag2)
					{
						CaptureInterface.ResetFocus();
					}
					if (i == num2++ && flag2 && Main.mapEnabled)
					{
						Main.mapFullscreen = !Main.mapFullscreen;
					}
					if (i == num2++ && flag2 && this.SelectedMode != 2)
					{
						this.SelectedMode = 2;
						this.ToggleCamera(true);
					}
					if (i == num2++ && flag2 && flag)
					{
						string fileName = Path.Combine(Main.SavePath, "Captures");
						Process.Start(fileName);
					}
					if (i == num2++ && flag2)
					{
						this.ToggleCamera(false);
						Main.blockMouse = true;
						Main.mouseLeftRelease = false;
					}
					return true;
				}
			}
			return false;
		}
Example #18
0
 public void Capture(CaptureSettings settings)
 {
     this._camera.Capture(settings);
 }
Example #19
0
 public void Capture(CaptureSettings settings)
 {
     this._camera.Capture(settings);
 }
Example #20
0
        private bool UpdateButtons(Vector2 mouse)
        {
            HoveredMode = -1;
            bool flag1 = !Main.graphics.IsFullScreen;
            int num1 = 9;
            for (int index = 0; index < num1; ++index)
            {
                if (new Rectangle(24 + 46 * index, 24, 42, 42).Contains(Utils.ToPoint(mouse)))
                {
                    HoveredMode = index;
                    bool flag2 = Main.mouseLeft && Main.mouseLeftRelease;
                    int num2 = 0;
                    int num3 = index;
                    int num4 = num2;
                    int num5 = 1;
                    int num6 = num4 + num5;
                    if (num3 == num4 && flag2)
                    {
                        CaptureSettings settings = new CaptureSettings();
                        Point point1 = Utils.ToTileCoordinates(Main.screenPosition);
                        Point point2 = Utils.ToTileCoordinates(Main.screenPosition + new Vector2((float)Main.screenWidth, (float)Main.screenHeight));
                        settings.Area = new Rectangle(point1.X, point1.Y, point2.X - point1.X + 1, point2.Y - point1.Y + 1);
                        settings.Biome = CaptureBiome.Biomes[Settings.BiomeChoice];
                        settings.CaptureBackground = !Settings.TransparentBackground;
                        settings.CaptureEntities = Settings.IncludeEntities;
                        settings.UseScaling = Settings.PackImage;
                        StartCamera(settings);
                    }

                    int num7 = index;
                    int num8 = num6;
                    int num9 = 1;
                    int num10 = num8 + num9;
                    if (num7 == num8 && flag2 && (EdgeAPinned && EdgeBPinned))
                        StartCamera(new CaptureSettings()
                        {
                            Area = GetArea(),
                            Biome = CaptureBiome.Biomes[Settings.BiomeChoice],
                            CaptureBackground = !Settings.TransparentBackground,
                            CaptureEntities = Settings.IncludeEntities,
                            UseScaling = Settings.PackImage
                        });

                    int num11 = index;
                    int num12 = num10;
                    int num13 = 1;
                    int num14 = num12 + num13;
                    if (num11 == num12 && flag2 && SelectedMode != 0)
                    {
                        SelectedMode = 0;
                        ToggleCamera(true);
                    }

                    int num15 = index;
                    int num16 = num14;
                    int num17 = 1;
                    int num18 = num16 + num17;
                    if (num15 == num16 && flag2 && SelectedMode != 1)
                    {
                        SelectedMode = 1;
                        ToggleCamera(true);
                    }

                    int num19 = index;
                    int num20 = num18;
                    int num21 = 1;
                    int num22 = num20 + num21;
                    if (num19 == num20 && flag2)
                        ResetFocus();
                    int num23 = index;
                    int num24 = num22;
                    int num25 = 1;
                    int num26 = num24 + num25;
                    if (num23 == num24 && flag2 && Main.mapEnabled)
                        Main.mapFullscreen = !Main.mapFullscreen;
                    int num27 = index;
                    int num28 = num26;
                    int num29 = 1;
                    int num30 = num28 + num29;
                    if (num27 == num28 && flag2 && SelectedMode != 2)
                    {
                        SelectedMode = 2;
                        ToggleCamera(true);
                    }

                    int num31 = index;
                    int num32 = num30;
                    int num33 = 1;
                    int num34 = num32 + num33;
                    if (num31 == num32 && flag2 && flag1)
                        Process.Start(string.Concat(new object[4] { "Data", Path.DirectorySeparatorChar, "Captures", Path.DirectorySeparatorChar }));

                    int num35 = index;
                    int num36 = num34;
                    int num37 = 1;
                    int num38 = num36 + num37;
                    if (num35 == num36 && flag2)
                    {
                        ToggleCamera(false);
                        Main.blockMouse = true;
                        Main.mouseLeftRelease = false;
                    }
                    return true;
                }
            }
            return false;
        }