From 223ab7138f2759c42e4a584b7e05bf50ed494fc2 Mon Sep 17 00:00:00 2001 From: sagirilover <32457153+sagirilover@users.noreply.github.com> Date: Tue, 12 May 2020 08:30:51 +0300 Subject: [PATCH] Add files via upload --- AnimeSoftware/AlphaColorDialog.cs | 830 +++++++++--------- AnimeSoftware/AlphaColorPanel.cs | 398 ++++----- AnimeSoftware/AnimeForm.Designer.cs | 96 +- AnimeSoftware/AnimeForm.cs | 30 +- AnimeSoftware/Checks.cs | 2 +- AnimeSoftware/Hacks/BlockBot.cs | 9 +- AnimeSoftware/Hacks/DoorSpam.cs | 12 +- AnimeSoftware/Hotkey.cs | 34 +- AnimeSoftware/Math.cs | 34 +- AnimeSoftware/Memory.cs | 6 + AnimeSoftware/Objects/LocalPlayer.cs | 14 +- AnimeSoftware/Offsets/Offsets.cs | 74 +- AnimeSoftware/Offsets/ScannedOffsets.cs | 15 +- AnimeSoftware/Program.cs | 44 +- AnimeSoftware/Properties/AssemblyInfo.cs | 72 +- AnimeSoftware/Properties/Hotkey.Designer.cs | 124 +-- AnimeSoftware/Properties/Hotkey.settings | 28 +- .../Properties/Resources.Designer.cs | 142 +-- AnimeSoftware/Properties/Resources.resx | 232 ++--- 19 files changed, 1147 insertions(+), 1049 deletions(-) diff --git a/AnimeSoftware/AlphaColorDialog.cs b/AnimeSoftware/AlphaColorDialog.cs index 6f3a29e..ca9b4ba 100644 --- a/AnimeSoftware/AlphaColorDialog.cs +++ b/AnimeSoftware/AlphaColorDialog.cs @@ -1,416 +1,416 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Data; -using System.Runtime.InteropServices; -using System.Text; - -namespace Opulos.Core.UI { -public class AlphaColorDialog : ColorDialog { - - ///Event is fired after the color or alpha value are changed via any of the possible user-interface controls. - public event EventHandler ColorChanged; - - private Color _color = Color.Black; // currently selected color - private AlphaDialog dialogAlpha = null; - private AlphaColorPanel panelAlpha = null; - private Button btnAlpha = new Button { Text = "Alpha" }; - private IntPtr handle = IntPtr.Zero; // handle of this ColorDialog - private IntPtr hWndRed = IntPtr.Zero; // handles to TextBoxes - private IntPtr hWndGreen = IntPtr.Zero; - private IntPtr hWndBlue = IntPtr.Zero; - - public AlphaColorDialog() { - btnAlpha.Click += btnAlpha_Click; - } - - ///The handle for the ColorDialog window. - public IntPtr Handle { - get { - return handle; - } - } - - void btnAlpha_Click(object sender, EventArgs e) { - if (dialogAlpha == null) { - dialogAlpha = new AlphaDialog(this); - panelAlpha = new AlphaColorPanel(); - panelAlpha.AlphaChanged += panelAlpha_AlphaChanged; - dialogAlpha.Controls.Add(panelAlpha); - dialogAlpha.Text = "Alpha"; - //dialogAlpha.StartPosition = FormStartPosition.CenterParent; // doesn't work - dialogAlpha.StartPosition = FormStartPosition.Manual; - dialogAlpha.ClientSize = panelAlpha.PreferredSize; - Size sz = dialogAlpha.Size; - RECT r = new RECT(); - GetWindowRect(handle, ref r); - dialogAlpha.Location = new Point(r.Left + ((r.Right - r.Left) - sz.Width) / 2, r.Top + ((r.Bottom - r.Top) - sz.Height) / 2); - } - - panelAlpha.Color = _color; - - if (!dialogAlpha.IsHandleCreated || !dialogAlpha.Visible) { - dialogAlpha.Visible = false; // sometimes IsHandleCreated is reset, so Visible must be reset - dialogAlpha.Show(new SimpleWindow { Handle = handle }); - } - else { - if (dialogAlpha.WindowState == FormWindowState.Minimized) - dialogAlpha.WindowState = FormWindowState.Normal; - - dialogAlpha.Activate(); - dialogAlpha.BringToFront(); - dialogAlpha.Focus(); - } - } - - void panelAlpha_AlphaChanged(object sender, EventArgs e) { - SetColorInternal(panelAlpha.Color); - } - - private static String GetWindowText(IntPtr hWnd) { - StringBuilder sb = new StringBuilder(256); - GetWindowText(hWnd, sb, sb.Capacity); - return sb.ToString(); - } - - private class SimpleWindow : IWin32Window { - public IntPtr Handle { get; set; } - } - - private static Bitmap ConvertToBitmap(IntPtr hWnd) { - RECT r = new RECT(); - GetWindowRect(hWnd, ref r); - int w = r.Right - r.Left; - int h = r.Bottom - r.Top; - - Graphics g = Graphics.FromHwnd(hWnd); - Bitmap bmp = new Bitmap(w, h); - Graphics g2 = Graphics.FromImage(bmp); - IntPtr g2_hdc = g2.GetHdc(); - IntPtr g_hdc = g.GetHdc(); - BitBlt(g2_hdc, 0, 0, w, h, g_hdc, 0, 0, SRC); - g.ReleaseHdc(g_hdc); - g2.ReleaseHdc(g2_hdc); - g.Dispose(); - g2.Dispose(); - - return bmp; - } - - private struct IJL { - public int i; - public int j; - public int len; - - public override String ToString() { - return i + " " + j + " " + len; - } - } - - private static Color? FindSelectedColor(IntPtr hWnd) { - // This method assumes there is a bounding rectangle around a color swatch. - // The rectangle can be any color, but must be a single color. Since - // the rectangle surrounds the swatch, it must have a run of pixels that - // is longer than the run of pixels inside the swatch. Since it is - // a rectangle, and we are scanning from top to bottom (left to right would also work), - // then there must be exactly two runs that tie for longest. If two runs cannot - // be found, then there is no bounding rectangle. - - Bitmap bmp = ConvertToBitmap(hWnd); - int w = bmp.Width; - int h = bmp.Height; - Color bg = bmp.GetPixel(0, 0); - - IJL ijl = new IJL(); - IJL ijl0 = new IJL(); - IJL ijl1 = new IJL(); - int k = 0; - - for (int i = 0; i < w; i++) { - Color lastColor = Color.Empty; - for (int j = 0; j <= h; j++) { - Color c = (j == h ? Color.Empty : bmp.GetPixel(i, j)); - if (c == lastColor) { - ijl.len++; - } - else { - if (ijl.len < h) { - if (ijl.len > 1 && bg != lastColor) { - if (ijl.len > ijl0.len) { - ijl0 = ijl; - k = 0; - } - else if (ijl.len == ijl0.len) { - ijl1 = ijl; - k++; - } - } - } - - ijl = new IJL(); - ijl.i = i; - ijl.j = j; - ijl.len = 1; - lastColor = c; - } - } - } - - if (k != 1) { - bmp.Dispose(); - return null; - } - - // k == 1 means there are exactly two runs of maximum length - int x = ijl0.i + (ijl1.i - ijl0.i) / 2; - int y = ijl0.j + ijl0.len / 2; - Color c1 = bmp.GetPixel(x, y); - bmp.Dispose(); - return c1; - } - - private Color GetColorInternal() { - int a = (panelAlpha != null ? panelAlpha.Alpha : 255); - String _r = GetWindowText(hWndRed); - if (_r.Length > 0) { - // Define Custom Colors UI is visible. - int r = int.Parse(_r); - int g = int.Parse(GetWindowText(hWndGreen)); - int b = int.Parse(GetWindowText(hWndBlue)); - return Color.FromArgb(a, r, g, b); - } - else { - // if the RGB text boxes aren't visible, then resort to trying to find - // the selected color by looking for the solid line rectangle that indicates the - // currently selected color. - Color? c = FindSelectedColor(GetDlgItem(handle, 0x02d0)); // Basic colors - if (!c.HasValue) - c = FindSelectedColor(GetDlgItem(handle, 0x02d1)); // Custom colors - - return c.HasValue ? Color.FromArgb(a, c.Value) : Color.FromArgb(a, Color.Black); - } - } - - private static bool AreEqual(Color c1, Color c2) { - // Color.Black != (255, 0, 0, 0) - return c1.A == c2.A && c1.R == c2.R && c1.G == c2.G && c1.B == c2.B; - } - - private void SetColorInternal(Color c) { - if (AreEqual(c, _color)) - return; - - _color = c; - if (ColorChanged != null) - ColorChanged(this, EventArgs.Empty); - } - - public new Color Color { - get { - return _color; - } - - set { - SetColorInternal(value); - if (panelAlpha != null) - panelAlpha.Alpha = value.A; - - base.Color = value; - } - } - - protected override IntPtr HookProc(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam) { - //System.Diagnostics.Debug.WriteLine((Opulos.Core.Win32.WM) msg); - if (msg == WM_INITDIALOG) { - IntPtr hWndOK = GetDlgItem(hWnd, 0x1); // 0x1 == OK button - RECT rOK = new RECT(); - GetWindowRect(hWndOK, ref rOK); - - IntPtr hWndDefineCustomColors = GetDlgItem(hWnd, 0x02cf); - RECT rDefineCustomColors = new RECT(); - GetWindowRect(hWndDefineCustomColors, ref rDefineCustomColors); - - IntPtr hWndCancel = GetDlgItem(hWnd, 0x2); // 0x2 == Cancel button - RECT rCancel = new RECT(); - GetWindowRect(hWndCancel, ref rCancel); - // Convert the cancel button's screen coordinates to client coordinates - POINT pt = new POINT(); - pt.X = rCancel.Right; - pt.Y = rCancel.Top; - ScreenToClient(hWnd, ref pt); - IntPtr hWndParent = GetParent(hWndCancel); - int w = rCancel.Right - rCancel.Left; - int h = rCancel.Bottom - rCancel.Top; - int gap = (rCancel.Left - rOK.Right); - - // the "Define Custom Colors >>" button is slightly less wide than the total width of the - // OK, Cancel and Alpha buttons. Options: - // 1) Increase the width of the define button so it right aligns with the alpha button - // 2) Make the alpha button smaller in width - // 3) Decrease the widths of all three button and decrease the gap between them. - // Option 1 looks better than option 2. Didn't try option 3. - if (rCancel.Right + gap + w > rDefineCustomColors.Right) { // screen coordinates - int diff = (rCancel.Right + gap + w) - rDefineCustomColors.Right; - // Option 2: //w = w - diff; - // Option 1: - int w2 = rDefineCustomColors.Right - rDefineCustomColors.Left; - int h2 = rDefineCustomColors.Bottom - rDefineCustomColors.Top; - SetWindowPos(hWndDefineCustomColors, IntPtr.Zero, 0, 0, w2 + diff, h2, SWP_NOMOVE | SWP_NOZORDER); - } - - var hWndAlpha = btnAlpha.Handle; // creates the handle - btnAlpha.Bounds = new Rectangle(pt.X + gap, pt.Y, w, h); - SetParent(hWndAlpha, hWndParent); - int hWndFont = SendMessage(hWndCancel, WM_GETFONT, 0, 0); - SendMessage(hWndAlpha, WM_SETFONT, hWndFont, 0); - - // Alternative way to create the Alpha button, but would have to handle the WM_NOTIFY messages for the button click events. - //hWndAlpha = CreateWindowEx(0, "Button", "alphabutton", WS_VISIBLE | WS_CHILD | WS_TABSTOP, pt.X + gap, pt.Y, w, h, hWndParent, 0, 0, 0); - //SetWindowText(hWndAlpha, "Alpha"); - //int hWndFont = SendMessage(hWndCancel, WM_GETFONT, 0, 0); - //SendMessage(hWndAlpha, WM_SETFONT, hWndFont, 0); - - // calling ColorDialog.Color does not return the currently selected color until after the OK button - // is clicked. So the values from the textboxes are used. To find the controlIDs, use Spy++. - hWndRed = GetDlgItem(hWnd, 0x02c2); // red text box - hWndGreen = GetDlgItem(hWnd, 0x02c3); - hWndBlue = GetDlgItem(hWnd, 0x02c4); - } - else if (msg == WM_SHOWWINDOW) { - //center the dialog on the parent window: - RECT cr = new RECT(); - RECT r0 = new RECT(); - IntPtr parent = GetParent(hWnd); - GetWindowRect(hWnd, ref r0); - GetWindowRect(parent, ref cr); - handle = hWnd; - - int x = cr.Left + ((cr.Right - cr.Left) - (r0.Right - r0.Left)) / 2; - int y = cr.Top + ((cr.Bottom - cr.Top) - (r0.Bottom - r0.Top)) / 2; - SetWindowPos(hWnd, IntPtr.Zero, x, y, 0, 0, SWP_NOZORDER | SWP_NOSIZE); - } - else if (msg == ACD_COLORCHANGED) { - Color c = GetColorInternal(); - SetColorInternal(c); - if (panelAlpha != null) - panelAlpha.Color = c; - } - else if (msg == WM_COMMAND || msg == WM_CHAR || msg == WM_LBUTTONDOWN) { - PostMessage(hWnd, ACD_COLORCHANGED, 0, 0); - } - - return base.HookProc(hWnd, msg, wparam, lparam); - } - - protected override void Dispose(bool disposing) { - base.Dispose(disposing); - if (disposing) { - if (btnAlpha != null) - btnAlpha.Dispose(); - - if (dialogAlpha != null) - dialogAlpha.Dispose(); - - btnAlpha = null; - dialogAlpha = null; - } - } - - private class AlphaDialog : Form { - - AlphaColorDialog AOwner; - public AlphaDialog(AlphaColorDialog owner) { - AOwner = owner; - ShowIcon = false; - } - - protected override void OnFormClosing(FormClosingEventArgs e) { - if (e.CloseReason == CloseReason.None || e.CloseReason == CloseReason.UserClosing) { - e.Cancel = true; - Hide(); - SetForegroundWindow(AOwner.handle); - } - base.OnFormClosing(e); - } - } - - private struct RECT { - public int Left; - public int Top; - public int Right; - public int Bottom; - } - - private struct POINT { - public int X; - public int Y; - } - - [DllImport("user32.dll")] - private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); - - [DllImport("user32.dll")] - private static extern bool GetWindowRect(IntPtr hWnd, ref RECT lpRect); - - [DllImport("user32.dll")] - private static extern IntPtr GetParent(IntPtr hWnd); - - [DllImport("user32.dll")] - private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); - - [DllImport("user32.dll")] - private static extern int PostMessage(IntPtr hWnd, int Msg, int wParam, int lParam); - - [DllImport("user32.dll")] - private static extern IntPtr GetDlgItem(IntPtr hDlg, int nIDDlgItem); - - [DllImport("user32.dll")] - private static extern bool ScreenToClient(IntPtr hWnd, ref POINT lpPoint); - - [DllImport("user32.dll")] - private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); - - [DllImport("user32.dll")] - private static extern bool SetForegroundWindow(IntPtr hWnd); - - [DllImport("user32.dll", CharSet = CharSet.Auto)] - private static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount); - - [DllImport("gdi32.dll", ExactSpelling=true, CharSet=CharSet.Auto, SetLastError=true)] - private static extern bool BitBlt(IntPtr pHdc, int iX, int iY, int iWidth, int iHeight, IntPtr pHdcSource, int iXSource, int iYSource, System.Int32 dw); - - //[DllImport("user32.dll", CharSet = CharSet.Auto)] - //private static extern IntPtr CreateWindowEx(int dwExStyle, string lpClassName, string lpWindowName, uint dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hWndParent, int hMenu, int hInstance, int lpParam); - - //[DllImport("user32.dll", CharSet = CharSet.Auto)] - //private static extern bool SetWindowText(IntPtr hWnd, String lpString); - - //[DllImport("user32.dll")] - //private static extern bool DestroyWindow(IntPtr hwnd); - - private const int ACD_COLORCHANGED = 0x0400; // custom message - private const int SRC = 0xCC0020; - - private const int SWP_NOSIZE = 0x0001; - private const int SWP_NOMOVE = 0x0002; - private const int SWP_NOZORDER = 0x0004; - - private const int WM_INITDIALOG = 0x110; - private const int WM_SETFONT = 0x0030; - private const int WM_GETFONT = 0x0031; - private const int WM_SHOWWINDOW = 0x18; - //private const int WM_NOTIFY; - // messages that indicate a color change: - private const int WM_COMMAND = 0x111; - private const int WM_CHAR = 0x102; - private const int WM_LBUTTONDOWN = 0x201; - - //private const uint WS_VISIBLE = 0x10000000; - //private const uint WS_CHILD = 0x40000000; - //private const uint WS_TABSTOP = 0x00010000; - -} +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; +using System.Data; +using System.Runtime.InteropServices; +using System.Text; + +namespace Opulos.Core.UI { +public class AlphaColorDialog : ColorDialog { + + ///Event is fired after the color or alpha value are changed via any of the possible user-interface controls. + public event EventHandler ColorChanged; + + private Color _color = Color.Black; // currently selected color + private AlphaDialog dialogAlpha = null; + private AlphaColorPanel panelAlpha = null; + private Button btnAlpha = new Button { Text = "Alpha" }; + private IntPtr handle = IntPtr.Zero; // handle of this ColorDialog + private IntPtr hWndRed = IntPtr.Zero; // handles to TextBoxes + private IntPtr hWndGreen = IntPtr.Zero; + private IntPtr hWndBlue = IntPtr.Zero; + + public AlphaColorDialog() { + btnAlpha.Click += btnAlpha_Click; + } + + ///The handle for the ColorDialog window. + public IntPtr Handle { + get { + return handle; + } + } + + void btnAlpha_Click(object sender, EventArgs e) { + if (dialogAlpha == null) { + dialogAlpha = new AlphaDialog(this); + panelAlpha = new AlphaColorPanel(); + panelAlpha.AlphaChanged += panelAlpha_AlphaChanged; + dialogAlpha.Controls.Add(panelAlpha); + dialogAlpha.Text = "Alpha"; + //dialogAlpha.StartPosition = FormStartPosition.CenterParent; // doesn't work + dialogAlpha.StartPosition = FormStartPosition.Manual; + dialogAlpha.ClientSize = panelAlpha.PreferredSize; + Size sz = dialogAlpha.Size; + RECT r = new RECT(); + GetWindowRect(handle, ref r); + dialogAlpha.Location = new Point(r.Left + ((r.Right - r.Left) - sz.Width) / 2, r.Top + ((r.Bottom - r.Top) - sz.Height) / 2); + } + + panelAlpha.Color = _color; + + if (!dialogAlpha.IsHandleCreated || !dialogAlpha.Visible) { + dialogAlpha.Visible = false; // sometimes IsHandleCreated is reset, so Visible must be reset + dialogAlpha.Show(new SimpleWindow { Handle = handle }); + } + else { + if (dialogAlpha.WindowState == FormWindowState.Minimized) + dialogAlpha.WindowState = FormWindowState.Normal; + + dialogAlpha.Activate(); + dialogAlpha.BringToFront(); + dialogAlpha.Focus(); + } + } + + void panelAlpha_AlphaChanged(object sender, EventArgs e) { + SetColorInternal(panelAlpha.Color); + } + + private static String GetWindowText(IntPtr hWnd) { + StringBuilder sb = new StringBuilder(256); + GetWindowText(hWnd, sb, sb.Capacity); + return sb.ToString(); + } + + private class SimpleWindow : IWin32Window { + public IntPtr Handle { get; set; } + } + + private static Bitmap ConvertToBitmap(IntPtr hWnd) { + RECT r = new RECT(); + GetWindowRect(hWnd, ref r); + int w = r.Right - r.Left; + int h = r.Bottom - r.Top; + + Graphics g = Graphics.FromHwnd(hWnd); + Bitmap bmp = new Bitmap(w, h); + Graphics g2 = Graphics.FromImage(bmp); + IntPtr g2_hdc = g2.GetHdc(); + IntPtr g_hdc = g.GetHdc(); + BitBlt(g2_hdc, 0, 0, w, h, g_hdc, 0, 0, SRC); + g.ReleaseHdc(g_hdc); + g2.ReleaseHdc(g2_hdc); + g.Dispose(); + g2.Dispose(); + + return bmp; + } + + private struct IJL { + public int i; + public int j; + public int len; + + public override String ToString() { + return i + " " + j + " " + len; + } + } + + private static Color? FindSelectedColor(IntPtr hWnd) { + // This method assumes there is a bounding rectangle around a color swatch. + // The rectangle can be any color, but must be a single color. Since + // the rectangle surrounds the swatch, it must have a run of pixels that + // is longer than the run of pixels inside the swatch. Since it is + // a rectangle, and we are scanning from top to bottom (left to right would also work), + // then there must be exactly two runs that tie for longest. If two runs cannot + // be found, then there is no bounding rectangle. + + Bitmap bmp = ConvertToBitmap(hWnd); + int w = bmp.Width; + int h = bmp.Height; + Color bg = bmp.GetPixel(0, 0); + + IJL ijl = new IJL(); + IJL ijl0 = new IJL(); + IJL ijl1 = new IJL(); + int k = 0; + + for (int i = 0; i < w; i++) { + Color lastColor = Color.Empty; + for (int j = 0; j <= h; j++) { + Color c = (j == h ? Color.Empty : bmp.GetPixel(i, j)); + if (c == lastColor) { + ijl.len++; + } + else { + if (ijl.len < h) { + if (ijl.len > 1 && bg != lastColor) { + if (ijl.len > ijl0.len) { + ijl0 = ijl; + k = 0; + } + else if (ijl.len == ijl0.len) { + ijl1 = ijl; + k++; + } + } + } + + ijl = new IJL(); + ijl.i = i; + ijl.j = j; + ijl.len = 1; + lastColor = c; + } + } + } + + if (k != 1) { + bmp.Dispose(); + return null; + } + + // k == 1 means there are exactly two runs of maximum length + int x = ijl0.i + (ijl1.i - ijl0.i) / 2; + int y = ijl0.j + ijl0.len / 2; + Color c1 = bmp.GetPixel(x, y); + bmp.Dispose(); + return c1; + } + + private Color GetColorInternal() { + int a = (panelAlpha != null ? panelAlpha.Alpha : 255); + String _r = GetWindowText(hWndRed); + if (_r.Length > 0) { + // Define Custom Colors UI is visible. + int r = int.Parse(_r); + int g = int.Parse(GetWindowText(hWndGreen)); + int b = int.Parse(GetWindowText(hWndBlue)); + return Color.FromArgb(a, r, g, b); + } + else { + // if the RGB text boxes aren't visible, then resort to trying to find + // the selected color by looking for the solid line rectangle that indicates the + // currently selected color. + Color? c = FindSelectedColor(GetDlgItem(handle, 0x02d0)); // Basic colors + if (!c.HasValue) + c = FindSelectedColor(GetDlgItem(handle, 0x02d1)); // Custom colors + + return c.HasValue ? Color.FromArgb(a, c.Value) : Color.FromArgb(a, Color.Black); + } + } + + private static bool AreEqual(Color c1, Color c2) { + // Color.Black != (255, 0, 0, 0) + return c1.A == c2.A && c1.R == c2.R && c1.G == c2.G && c1.B == c2.B; + } + + private void SetColorInternal(Color c) { + if (AreEqual(c, _color)) + return; + + _color = c; + if (ColorChanged != null) + ColorChanged(this, EventArgs.Empty); + } + + public new Color Color { + get { + return _color; + } + + set { + SetColorInternal(value); + if (panelAlpha != null) + panelAlpha.Alpha = value.A; + + base.Color = value; + } + } + + protected override IntPtr HookProc(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam) { + //System.Diagnostics.Debug.WriteLine((Opulos.Core.Win32.WM) msg); + if (msg == WM_INITDIALOG) { + IntPtr hWndOK = GetDlgItem(hWnd, 0x1); // 0x1 == OK button + RECT rOK = new RECT(); + GetWindowRect(hWndOK, ref rOK); + + IntPtr hWndDefineCustomColors = GetDlgItem(hWnd, 0x02cf); + RECT rDefineCustomColors = new RECT(); + GetWindowRect(hWndDefineCustomColors, ref rDefineCustomColors); + + IntPtr hWndCancel = GetDlgItem(hWnd, 0x2); // 0x2 == Cancel button + RECT rCancel = new RECT(); + GetWindowRect(hWndCancel, ref rCancel); + // Convert the cancel button's screen coordinates to client coordinates + POINT pt = new POINT(); + pt.X = rCancel.Right; + pt.Y = rCancel.Top; + ScreenToClient(hWnd, ref pt); + IntPtr hWndParent = GetParent(hWndCancel); + int w = rCancel.Right - rCancel.Left; + int h = rCancel.Bottom - rCancel.Top; + int gap = (rCancel.Left - rOK.Right); + + // the "Define Custom Colors >>" button is slightly less wide than the total width of the + // OK, Cancel and Alpha buttons. Options: + // 1) Increase the width of the define button so it right aligns with the alpha button + // 2) Make the alpha button smaller in width + // 3) Decrease the widths of all three button and decrease the gap between them. + // Option 1 looks better than option 2. Didn't try option 3. + if (rCancel.Right + gap + w > rDefineCustomColors.Right) { // screen coordinates + int diff = (rCancel.Right + gap + w) - rDefineCustomColors.Right; + // Option 2: //w = w - diff; + // Option 1: + int w2 = rDefineCustomColors.Right - rDefineCustomColors.Left; + int h2 = rDefineCustomColors.Bottom - rDefineCustomColors.Top; + SetWindowPos(hWndDefineCustomColors, IntPtr.Zero, 0, 0, w2 + diff, h2, SWP_NOMOVE | SWP_NOZORDER); + } + + var hWndAlpha = btnAlpha.Handle; // creates the handle + btnAlpha.Bounds = new Rectangle(pt.X + gap, pt.Y, w, h); + SetParent(hWndAlpha, hWndParent); + int hWndFont = SendMessage(hWndCancel, WM_GETFONT, 0, 0); + SendMessage(hWndAlpha, WM_SETFONT, hWndFont, 0); + + // Alternative way to create the Alpha button, but would have to handle the WM_NOTIFY messages for the button click events. + //hWndAlpha = CreateWindowEx(0, "Button", "alphabutton", WS_VISIBLE | WS_CHILD | WS_TABSTOP, pt.X + gap, pt.Y, w, h, hWndParent, 0, 0, 0); + //SetWindowText(hWndAlpha, "Alpha"); + //int hWndFont = SendMessage(hWndCancel, WM_GETFONT, 0, 0); + //SendMessage(hWndAlpha, WM_SETFONT, hWndFont, 0); + + // calling ColorDialog.Color does not return the currently selected color until after the OK button + // is clicked. So the values from the textboxes are used. To find the controlIDs, use Spy++. + hWndRed = GetDlgItem(hWnd, 0x02c2); // red text box + hWndGreen = GetDlgItem(hWnd, 0x02c3); + hWndBlue = GetDlgItem(hWnd, 0x02c4); + } + else if (msg == WM_SHOWWINDOW) { + //center the dialog on the parent window: + RECT cr = new RECT(); + RECT r0 = new RECT(); + IntPtr parent = GetParent(hWnd); + GetWindowRect(hWnd, ref r0); + GetWindowRect(parent, ref cr); + handle = hWnd; + + int x = cr.Left + ((cr.Right - cr.Left) - (r0.Right - r0.Left)) / 2; + int y = cr.Top + ((cr.Bottom - cr.Top) - (r0.Bottom - r0.Top)) / 2; + SetWindowPos(hWnd, IntPtr.Zero, x, y, 0, 0, SWP_NOZORDER | SWP_NOSIZE); + } + else if (msg == ACD_COLORCHANGED) { + Color c = GetColorInternal(); + SetColorInternal(c); + if (panelAlpha != null) + panelAlpha.Color = c; + } + else if (msg == WM_COMMAND || msg == WM_CHAR || msg == WM_LBUTTONDOWN) { + PostMessage(hWnd, ACD_COLORCHANGED, 0, 0); + } + + return base.HookProc(hWnd, msg, wparam, lparam); + } + + protected override void Dispose(bool disposing) { + base.Dispose(disposing); + if (disposing) { + if (btnAlpha != null) + btnAlpha.Dispose(); + + if (dialogAlpha != null) + dialogAlpha.Dispose(); + + btnAlpha = null; + dialogAlpha = null; + } + } + + private class AlphaDialog : Form { + + AlphaColorDialog AOwner; + public AlphaDialog(AlphaColorDialog owner) { + AOwner = owner; + ShowIcon = false; + } + + protected override void OnFormClosing(FormClosingEventArgs e) { + if (e.CloseReason == CloseReason.None || e.CloseReason == CloseReason.UserClosing) { + e.Cancel = true; + Hide(); + SetForegroundWindow(AOwner.handle); + } + base.OnFormClosing(e); + } + } + + private struct RECT { + public int Left; + public int Top; + public int Right; + public int Bottom; + } + + private struct POINT { + public int X; + public int Y; + } + + [DllImport("user32.dll")] + private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); + + [DllImport("user32.dll")] + private static extern bool GetWindowRect(IntPtr hWnd, ref RECT lpRect); + + [DllImport("user32.dll")] + private static extern IntPtr GetParent(IntPtr hWnd); + + [DllImport("user32.dll")] + private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); + + [DllImport("user32.dll")] + private static extern int PostMessage(IntPtr hWnd, int Msg, int wParam, int lParam); + + [DllImport("user32.dll")] + private static extern IntPtr GetDlgItem(IntPtr hDlg, int nIDDlgItem); + + [DllImport("user32.dll")] + private static extern bool ScreenToClient(IntPtr hWnd, ref POINT lpPoint); + + [DllImport("user32.dll")] + private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); + + [DllImport("user32.dll")] + private static extern bool SetForegroundWindow(IntPtr hWnd); + + [DllImport("user32.dll", CharSet = CharSet.Auto)] + private static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount); + + [DllImport("gdi32.dll", ExactSpelling=true, CharSet=CharSet.Auto, SetLastError=true)] + private static extern bool BitBlt(IntPtr pHdc, int iX, int iY, int iWidth, int iHeight, IntPtr pHdcSource, int iXSource, int iYSource, System.Int32 dw); + + //[DllImport("user32.dll", CharSet = CharSet.Auto)] + //private static extern IntPtr CreateWindowEx(int dwExStyle, string lpClassName, string lpWindowName, uint dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hWndParent, int hMenu, int hInstance, int lpParam); + + //[DllImport("user32.dll", CharSet = CharSet.Auto)] + //private static extern bool SetWindowText(IntPtr hWnd, String lpString); + + //[DllImport("user32.dll")] + //private static extern bool DestroyWindow(IntPtr hwnd); + + private const int ACD_COLORCHANGED = 0x0400; // custom message + private const int SRC = 0xCC0020; + + private const int SWP_NOSIZE = 0x0001; + private const int SWP_NOMOVE = 0x0002; + private const int SWP_NOZORDER = 0x0004; + + private const int WM_INITDIALOG = 0x110; + private const int WM_SETFONT = 0x0030; + private const int WM_GETFONT = 0x0031; + private const int WM_SHOWWINDOW = 0x18; + //private const int WM_NOTIFY; + // messages that indicate a color change: + private const int WM_COMMAND = 0x111; + private const int WM_CHAR = 0x102; + private const int WM_LBUTTONDOWN = 0x201; + + //private const uint WS_VISIBLE = 0x10000000; + //private const uint WS_CHILD = 0x40000000; + //private const uint WS_TABSTOP = 0x00010000; + +} } \ No newline at end of file diff --git a/AnimeSoftware/AlphaColorPanel.cs b/AnimeSoftware/AlphaColorPanel.cs index 0242ae9..0b888d1 100644 --- a/AnimeSoftware/AlphaColorPanel.cs +++ b/AnimeSoftware/AlphaColorPanel.cs @@ -1,200 +1,200 @@ -using System; -using System.Drawing; -using System.Runtime.InteropServices; -using System.Windows.Forms; - -namespace Opulos.Core.UI { - -public class AlphaColorPanel : Panel { - - public event EventHandler AlphaChanged; - - NumericUpDown nudAlpha = new NumericUpDown { AutoSize = true, Minimum = 0, Maximum = 255, DecimalPlaces = 0, Increment = 1, Value = 255, Anchor = AnchorStyles.Top }; - TrackBar trackBar = new TrackBar2 { Minimum = 0, Maximum = 255, TickFrequency = 5, TickStyle = TickStyle.None, Orientation = Orientation.Horizontal, Value = 255, Anchor = AnchorStyles.Left | AnchorStyles.Right }; - Color[] colors = new Color[] { Color.White, Color.Black, Color.Green, Color.Blue, Color.Red, Color.Yellow }; - public int Cols { get; set; } - public int SwatchSize { get; set; } - - private Color color = Color.Empty; - - public AlphaColorPanel() : base() { - Dock = DockStyle.Fill; - AutoSize = true; - AutoSizeMode = AutoSizeMode.GrowAndShrink; - DoubleBuffered = true; - //TabStop = true; - //SetStyle(ControlStyles.Selectable, true); - ResizeRedraw = true; - - Cols = 3; - SwatchSize = 100; - trackBar.ValueChanged += trackBar_ValueChanged; - nudAlpha.ValueChanged += nudAlpha_ValueChanged; - Alpha = 255; - - TableLayoutPanel p = new TableLayoutPanel { Dock = DockStyle.Bottom }; - p.AutoSize = true; - p.AutoSizeMode = AutoSizeMode.GrowAndShrink; - p.Controls.Add(nudAlpha, 0, 0); - p.Controls.Add(trackBar, 1, 0); - p.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); - p.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1)); - Controls.Add(p); - - nudAlpha.KeyDown += nudAlpha_KeyDown; - trackBar.KeyDown += trackBar_KeyDown; - } - - void trackBar_KeyDown(object sender, KeyEventArgs e) { - HandleKeyEvent((Control) sender, e); - } - - void nudAlpha_KeyDown(object sender, KeyEventArgs e) { - HandleKeyEvent((Control) sender, e); - } - - private void HandleKeyEvent(Control sender, KeyEventArgs e) { - if (e.KeyCode == Keys.Enter) { - e.SuppressKeyPress = true; // stop beep - e.Handled = true; - } - else if (e.KeyCode == Keys.Escape) { - e.SuppressKeyPress = true; - e.Handled = true; - Form f = FindForm(); - if (f != null) - f.Close(); - } - else if (e.KeyCode == Keys.Tab) { - // seems like because the Form is displays with Show(Window) but - // it is not modal, that stops tabs from working correctly, so - // it is handled manually: - sender.Parent.SelectNextControl(sender, true, true, true, true); - e.SuppressKeyPress = true; - e.Handled = true; - } - } - - void nudAlpha_ValueChanged(object sender, EventArgs e) { - trackBar.Value = Convert.ToInt32(nudAlpha.Value); - } - - public override Size GetPreferredSize(Size proposedSize) { - int w = SwatchSize * Cols; - int h = SwatchSize * (((Colors.Length - 1) / Cols) + 1); - h += Math.Max(trackBar.Height, nudAlpha.Height); - return new Size(w, h); - } - - public Color Color { - get { - return color; - } - set { - var c = value; - color = Color.FromArgb(Alpha, c.R, c.G, c.B); - Invalidate(); //Refresh(); - } - } - - public int Alpha { - get { - return trackBar.Value; - } - set { - trackBar.Value = value; - } - } - - public Color[] Colors { - get { - return colors; - } - set { - colors = value; - } - } - - void trackBar_ValueChanged(object sender, EventArgs e) { - nudAlpha.Value = trackBar.Value; - Color c = Color; - Color = Color.FromArgb(trackBar.Value, c.R, c.G, c.B); - Refresh(); - if (AlphaChanged != null) - AlphaChanged(this, EventArgs.Empty); - } - - protected override void OnPaint(PaintEventArgs e) { - base.OnPaint(e); - - int rows = ((Colors.Length - 1) / Cols) + 1; - int r1 = Width / Cols; - int r2 = Height / Cols; - int r = Math.Min(r1, r2); - if (r < SwatchSize) - r = SwatchSize; - - int offsetX = (Width - r * Cols) / 2; - int offsetY = ((Height - Math.Max(nudAlpha.Height, trackBar.Height)) - r * rows) / 2; - - var g = e.Graphics; - int x = 0; - int y = 0; - for (int i = 0, j = 1; i < colors.Length; i++, j++) { - Color c = colors[i]; - - using (var b = new SolidBrush(c)) - g.FillRectangle(b, x + offsetX, y + offsetY, r, r); - - if (j == Cols) { - j = 0; - x = 0; - y += r; - } - else { - x += r; - } - } - - using (var b = new SolidBrush(Color)) - g.FillRectangle(b, r / 2 + offsetX, r / 2 + offsetY, 2 * r, r); - } -} - - -class TrackBar2 : TrackBar { - - public TrackBar2() : base() { - AutoSize = false; - RECT r = GetThumbRect(this); - Height = r.Bottom - r.Top; - } - - public override Size GetPreferredSize(Size proposedSize) { - Size sz = base.GetPreferredSize(proposedSize); - RECT r = GetThumbRect(this); - sz.Height = r.Bottom - r.Top; - return sz; - } - - [StructLayout(LayoutKind.Sequential)] - private struct RECT { - public int Left; - public int Top; - public int Right; - public int Bottom; - } - - [DllImport("user32.dll")] - private static extern void SendMessage(IntPtr hwnd, uint msg, IntPtr wp, ref RECT lp); - - private const uint TBM_GETTHUMBRECT = 0x419; - private static RECT GetThumbRect(TrackBar trackBar) { - RECT rc = new RECT(); - SendMessage(trackBar.Handle, TBM_GETTHUMBRECT, IntPtr.Zero, ref rc); - return rc; - } -} - - +using System; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace Opulos.Core.UI { + +public class AlphaColorPanel : Panel { + + public event EventHandler AlphaChanged; + + NumericUpDown nudAlpha = new NumericUpDown { AutoSize = true, Minimum = 0, Maximum = 255, DecimalPlaces = 0, Increment = 1, Value = 255, Anchor = AnchorStyles.Top }; + TrackBar trackBar = new TrackBar2 { Minimum = 0, Maximum = 255, TickFrequency = 5, TickStyle = TickStyle.None, Orientation = Orientation.Horizontal, Value = 255, Anchor = AnchorStyles.Left | AnchorStyles.Right }; + Color[] colors = new Color[] { Color.White, Color.Black, Color.Green, Color.Blue, Color.Red, Color.Yellow }; + public int Cols { get; set; } + public int SwatchSize { get; set; } + + private Color color = Color.Empty; + + public AlphaColorPanel() : base() { + Dock = DockStyle.Fill; + AutoSize = true; + AutoSizeMode = AutoSizeMode.GrowAndShrink; + DoubleBuffered = true; + //TabStop = true; + //SetStyle(ControlStyles.Selectable, true); + ResizeRedraw = true; + + Cols = 3; + SwatchSize = 100; + trackBar.ValueChanged += trackBar_ValueChanged; + nudAlpha.ValueChanged += nudAlpha_ValueChanged; + Alpha = 255; + + TableLayoutPanel p = new TableLayoutPanel { Dock = DockStyle.Bottom }; + p.AutoSize = true; + p.AutoSizeMode = AutoSizeMode.GrowAndShrink; + p.Controls.Add(nudAlpha, 0, 0); + p.Controls.Add(trackBar, 1, 0); + p.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); + p.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1)); + Controls.Add(p); + + nudAlpha.KeyDown += nudAlpha_KeyDown; + trackBar.KeyDown += trackBar_KeyDown; + } + + void trackBar_KeyDown(object sender, KeyEventArgs e) { + HandleKeyEvent((Control) sender, e); + } + + void nudAlpha_KeyDown(object sender, KeyEventArgs e) { + HandleKeyEvent((Control) sender, e); + } + + private void HandleKeyEvent(Control sender, KeyEventArgs e) { + if (e.KeyCode == Keys.Enter) { + e.SuppressKeyPress = true; // stop beep + e.Handled = true; + } + else if (e.KeyCode == Keys.Escape) { + e.SuppressKeyPress = true; + e.Handled = true; + Form f = FindForm(); + if (f != null) + f.Close(); + } + else if (e.KeyCode == Keys.Tab) { + // seems like because the Form is displays with Show(Window) but + // it is not modal, that stops tabs from working correctly, so + // it is handled manually: + sender.Parent.SelectNextControl(sender, true, true, true, true); + e.SuppressKeyPress = true; + e.Handled = true; + } + } + + void nudAlpha_ValueChanged(object sender, EventArgs e) { + trackBar.Value = Convert.ToInt32(nudAlpha.Value); + } + + public override Size GetPreferredSize(Size proposedSize) { + int w = SwatchSize * Cols; + int h = SwatchSize * (((Colors.Length - 1) / Cols) + 1); + h += Math.Max(trackBar.Height, nudAlpha.Height); + return new Size(w, h); + } + + public Color Color { + get { + return color; + } + set { + var c = value; + color = Color.FromArgb(Alpha, c.R, c.G, c.B); + Invalidate(); //Refresh(); + } + } + + public int Alpha { + get { + return trackBar.Value; + } + set { + trackBar.Value = value; + } + } + + public Color[] Colors { + get { + return colors; + } + set { + colors = value; + } + } + + void trackBar_ValueChanged(object sender, EventArgs e) { + nudAlpha.Value = trackBar.Value; + Color c = Color; + Color = Color.FromArgb(trackBar.Value, c.R, c.G, c.B); + Refresh(); + if (AlphaChanged != null) + AlphaChanged(this, EventArgs.Empty); + } + + protected override void OnPaint(PaintEventArgs e) { + base.OnPaint(e); + + int rows = ((Colors.Length - 1) / Cols) + 1; + int r1 = Width / Cols; + int r2 = Height / Cols; + int r = Math.Min(r1, r2); + if (r < SwatchSize) + r = SwatchSize; + + int offsetX = (Width - r * Cols) / 2; + int offsetY = ((Height - Math.Max(nudAlpha.Height, trackBar.Height)) - r * rows) / 2; + + var g = e.Graphics; + int x = 0; + int y = 0; + for (int i = 0, j = 1; i < colors.Length; i++, j++) { + Color c = colors[i]; + + using (var b = new SolidBrush(c)) + g.FillRectangle(b, x + offsetX, y + offsetY, r, r); + + if (j == Cols) { + j = 0; + x = 0; + y += r; + } + else { + x += r; + } + } + + using (var b = new SolidBrush(Color)) + g.FillRectangle(b, r / 2 + offsetX, r / 2 + offsetY, 2 * r, r); + } +} + + +class TrackBar2 : TrackBar { + + public TrackBar2() : base() { + AutoSize = false; + RECT r = GetThumbRect(this); + Height = r.Bottom - r.Top; + } + + public override Size GetPreferredSize(Size proposedSize) { + Size sz = base.GetPreferredSize(proposedSize); + RECT r = GetThumbRect(this); + sz.Height = r.Bottom - r.Top; + return sz; + } + + [StructLayout(LayoutKind.Sequential)] + private struct RECT { + public int Left; + public int Top; + public int Right; + public int Bottom; + } + + [DllImport("user32.dll")] + private static extern void SendMessage(IntPtr hwnd, uint msg, IntPtr wp, ref RECT lp); + + private const uint TBM_GETTHUMBRECT = 0x419; + private static RECT GetThumbRect(TrackBar trackBar) { + RECT rc = new RECT(); + SendMessage(trackBar.Handle, TBM_GETTHUMBRECT, IntPtr.Zero, ref rc); + return rc; + } +} + + } \ No newline at end of file diff --git a/AnimeSoftware/AnimeForm.Designer.cs b/AnimeSoftware/AnimeForm.Designer.cs index 94c15d4..3225658 100644 --- a/AnimeSoftware/AnimeForm.Designer.cs +++ b/AnimeSoftware/AnimeForm.Designer.cs @@ -81,7 +81,12 @@ this.velnameCheckBox = new System.Windows.Forms.CheckBox(); this.clanTextBox = new System.Windows.Forms.TextBox(); this.clanButton = new System.Windows.Forms.Button(); - this.button1 = new System.Windows.Forms.Button(); + this.trackBar1 = new System.Windows.Forms.TrackBar(); + this.trackBar2 = new System.Windows.Forms.TrackBar(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.nickBox)).BeginInit(); this.nickBoxContextMenuStrip.SuspendLayout(); this.trashControl.SuspendLayout(); @@ -89,6 +94,8 @@ ((System.ComponentModel.ISupportInitialize)(this.smoothTrackBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.fovTrackBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.chokeTrackBar)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).BeginInit(); this.SuspendLayout(); // // refreshButton @@ -368,7 +375,7 @@ // trashControl // this.trashControl.Controls.Add(this.aimTab); - this.trashControl.Location = new System.Drawing.Point(476, 55); + this.trashControl.Location = new System.Drawing.Point(476, 35); this.trashControl.Name = "trashControl"; this.trashControl.SelectedIndex = 0; this.trashControl.Size = new System.Drawing.Size(145, 371); @@ -608,22 +615,76 @@ this.clanButton.UseVisualStyleBackColor = true; this.clanButton.Click += new System.EventHandler(this.clanButton_Click); // - // button1 - // - this.button1.Location = new System.Drawing.Point(364, 277); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 44; - this.button1.Text = "button1"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click_1); + // trackBar1 + // + this.trackBar1.Location = new System.Drawing.Point(658, 74); + this.trackBar1.Maximum = 300; + this.trackBar1.Name = "trackBar1"; + this.trackBar1.Size = new System.Drawing.Size(104, 45); + this.trackBar1.TabIndex = 44; + this.trackBar1.Value = 1; + this.trackBar1.Scroll += new System.EventHandler(this.trackBar1_Scroll); + // + // trackBar2 + // + this.trackBar2.Location = new System.Drawing.Point(658, 144); + this.trackBar2.Maximum = 100; + this.trackBar2.Minimum = 1; + this.trackBar2.Name = "trackBar2"; + this.trackBar2.Size = new System.Drawing.Size(104, 45); + this.trackBar2.TabIndex = 45; + this.trackBar2.Value = 1; + this.trackBar2.Scroll += new System.EventHandler(this.trackBar2_Scroll); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(655, 125); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(82, 13); + this.label1.TabIndex = 46; + this.label1.Text = "Distance Factor"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(655, 55); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(87, 13); + this.label2.TabIndex = 47; + this.label2.Text = "Trajectory Factor"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(691, 171); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(35, 13); + this.label7.TabIndex = 48; + this.label7.Text = "label7"; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(691, 101); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(35, 13); + this.label8.TabIndex = 49; + this.label8.Text = "label8"; + this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // AnimeForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(476, 414); - this.Controls.Add(this.button1); + this.ClientSize = new System.Drawing.Size(468, 414); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.trackBar2); + this.Controls.Add(this.trackBar1); this.Controls.Add(this.clanButton); this.Controls.Add(this.clanTextBox); this.Controls.Add(this.velnameCheckBox); @@ -664,6 +725,8 @@ ((System.ComponentModel.ISupportInitialize)(this.smoothTrackBar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.fovTrackBar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.chokeTrackBar)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -722,7 +785,12 @@ private System.Windows.Forms.CheckBox velnameCheckBox; private System.Windows.Forms.TextBox clanTextBox; private System.Windows.Forms.Button clanButton; - private System.Windows.Forms.Button button1; + private System.Windows.Forms.TrackBar trackBar1; + private System.Windows.Forms.TrackBar trackBar2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; } } diff --git a/AnimeSoftware/AnimeForm.cs b/AnimeSoftware/AnimeForm.cs index db03b02..b9b1598 100644 --- a/AnimeSoftware/AnimeForm.cs +++ b/AnimeSoftware/AnimeForm.cs @@ -1,6 +1,7 @@ using AnimeSoftware.Hacks; using AnimeSoftware.Injections; using AnimeSoftware.Objects; +using hazedumper; using Opulos.Core.UI; using System; using System.Collections.Generic; @@ -24,7 +25,11 @@ namespace AnimeSoftware private void Form1_Load(object sender, EventArgs e) { + trackBar1.Value = (int)(BlockBot.trajFactor * 100); + label8.Text = BlockBot.trajFactor.ToString(); + trackBar2.Value = (int)(BlockBot.distanceFactor * 10); + label7.Text = BlockBot.distanceFactor.ToString(); while (!Init()) { @@ -595,20 +600,25 @@ namespace AnimeSoftware ClanTag.Set(clanTextBox.Text); } - private void button1_Click(object sender, EventArgs e) + + + private void trackBar1_Scroll(object sender, EventArgs e) { - while (true) - { - Thread.Sleep(100); - Console.WriteLine(LocalPlayer.InGame); - Console.WriteLine(LocalPlayer.Health); - } + label8.Text = (trackBar1.Value / 100f).ToString(); + BlockBot.trajFactor = trackBar1.Value / 100f; + Console.WriteLine(BlockBot.trajFactor); } - private void button1_Click_1(object sender, EventArgs e) + private void trackBar2_Scroll(object sender, EventArgs e) + { + label7.Text = (trackBar2.Value / 10f).ToString(); + BlockBot.distanceFactor = trackBar2.Value / 10f; + Console.WriteLine(BlockBot.distanceFactor); + } + + private void button1_Click(object sender, EventArgs e) { - Overlay overlay = new Overlay(); - overlay.Show(); + LocalPlayer.Use = 6; } } } diff --git a/AnimeSoftware/Checks.cs b/AnimeSoftware/Checks.cs index dd51be3..a1937fd 100644 --- a/AnimeSoftware/Checks.cs +++ b/AnimeSoftware/Checks.cs @@ -54,7 +54,7 @@ namespace AnimeSoftware } } - public static string version = "v2.90"; + public static string version = "v2.91"; } } diff --git a/AnimeSoftware/Hacks/BlockBot.cs b/AnimeSoftware/Hacks/BlockBot.cs index c0aa264..4fc348b 100644 --- a/AnimeSoftware/Hacks/BlockBot.cs +++ b/AnimeSoftware/Hacks/BlockBot.cs @@ -15,6 +15,10 @@ namespace AnimeSoftware.Hacks public static bool blocking = false; public static bool bb = false; public static bool hb = false; + public static float distanceFactor = 1.5f; + public static float trajFactor = 0.3f; + + public static void Start() { while (true) @@ -53,7 +57,7 @@ namespace AnimeSoftware.Hacks bb = false; } - hb = true; + hb = true; if (target.Speed == 0 && (LocalPlayer.Position - target.ViewPosition).Length < 10) { @@ -63,6 +67,7 @@ namespace AnimeSoftware.Hacks LocalPlayer.ViewAngleY = Aimbot.NormalizedAngle(Aimbot.CalcAngle(LocalPlayer.ViewPosition, target.Position)).y; + LocalPlayer.MoveForward(); } @@ -93,7 +98,7 @@ namespace AnimeSoftware.Hacks } } - + } if (blocking || hb || bb) { diff --git a/AnimeSoftware/Hacks/DoorSpam.cs b/AnimeSoftware/Hacks/DoorSpam.cs index 55a11b8..6b1765a 100644 --- a/AnimeSoftware/Hacks/DoorSpam.cs +++ b/AnimeSoftware/Hacks/DoorSpam.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; +using System.Windows.Forms; namespace AnimeSoftware.Hacks { @@ -26,12 +27,13 @@ namespace AnimeSoftware.Hacks while ((DllImport.GetAsyncKeyState(Properties.Hotkey.Default.doorspammerKey) & 0x8000) != 0) { - ClientCMD.Exec("+use"); // I did not add this to LocalPlayer to avoid delay. But i dont try, maybe this will not happen lol - Thread.Sleep(15); - ClientCMD.Exec("-use"); - Thread.Sleep(15); + + LocalPlayer.Use = 5; + Thread.Sleep(13); + LocalPlayer.Use = 4; + Thread.Sleep(13); } - + } } } diff --git a/AnimeSoftware/Hotkey.cs b/AnimeSoftware/Hotkey.cs index 37dd3de..a368e06 100644 --- a/AnimeSoftware/Hotkey.cs +++ b/AnimeSoftware/Hotkey.cs @@ -1,17 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace AnimeSoftware -{ - class Hotkey - { - public static void Start() - { - - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace AnimeSoftware +{ + class Hotkey + { + public static void Start() + { + + } + } +} diff --git a/AnimeSoftware/Math.cs b/AnimeSoftware/Math.cs index 9370b73..3f112fa 100644 --- a/AnimeSoftware/Math.cs +++ b/AnimeSoftware/Math.cs @@ -1,17 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AnimeSoftware -{ - class VectorMath - { - public static float Distance(Vector3 src, Vector3 dst) - { - float result = (float)Math.Sqrt((dst.x-src.x) * (dst.x-src.x) + (dst.y-src.y) * (dst.y-src.y) + (dst.z-src.z) * (dst.z-src.z)); - return result; - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AnimeSoftware +{ + class VectorMath + { + public static float Distance(Vector3 src, Vector3 dst) + { + float result = (float)Math.Sqrt((dst.x-src.x) * (dst.x-src.x) + (dst.y-src.y) * (dst.y-src.y) + (dst.z-src.z) * (dst.z-src.z)); + return result; + } + } +} diff --git a/AnimeSoftware/Memory.cs b/AnimeSoftware/Memory.cs index 6fb4e18..b780341 100644 --- a/AnimeSoftware/Memory.cs +++ b/AnimeSoftware/Memory.cs @@ -136,6 +136,12 @@ namespace AnimeSoftware return GetStructure(buffer); } + public static void WriteBytes(Int32 address, byte[] value) + { + UInt32 nBytesRead = UInt32.MinValue; + WriteProcessMemory(pHandle, (IntPtr)address, value, (IntPtr)value.Length, ref nBytesRead); + } + public static void Write(Int32 address, T value) { int length = Marshal.SizeOf(typeof(T)); diff --git a/AnimeSoftware/Objects/LocalPlayer.cs b/AnimeSoftware/Objects/LocalPlayer.cs index 3789883..b32a6fb 100644 --- a/AnimeSoftware/Objects/LocalPlayer.cs +++ b/AnimeSoftware/Objects/LocalPlayer.cs @@ -117,12 +117,6 @@ namespace AnimeSoftware.Objects { ClientCMD.Exec("-forward"); } - public static void Use() - { - Memory.Write(Memory.Client + ScannedOffsets.dwUse, 5); - Thread.Sleep(20); - Memory.Write(Memory.Client + ScannedOffsets.dwUse, 4); - } public static void Jump() { Memory.Write(Memory.Client + signatures.dwForceJump, 5); @@ -166,6 +160,13 @@ namespace AnimeSoftware.Objects return info; } } + public static int Use + { + set + { + Memory.Write(Memory.Read(Memory.Client + ScannedOffsets.dwUse), value); + } + } public static bool InGame { get @@ -175,6 +176,7 @@ namespace AnimeSoftware.Objects } } + public static int CrossHair { get diff --git a/AnimeSoftware/Offsets/Offsets.cs b/AnimeSoftware/Offsets/Offsets.cs index 231d1dd..8cc5d8a 100644 --- a/AnimeSoftware/Offsets/Offsets.cs +++ b/AnimeSoftware/Offsets/Offsets.cs @@ -1,6 +1,6 @@ using System; -// 2020-04-26 13:02:18.172054700 UTC +// 2020-05-12 01:35:30.947642700 UTC namespace hazedumper { @@ -95,7 +95,7 @@ namespace hazedumper public static class signatures { public const Int32 anim_overlays = 0x2980; - public const Int32 clientstate_choked_commands = 0x10680006; + public const Int32 clientstate_choked_commands = 0x4D28; public const Int32 clientstate_delta_ticks = 0x174; public const Int32 clientstate_last_outgoing_command = 0x4D24; public const Int32 clientstate_net_channel = 0x9C; @@ -109,47 +109,47 @@ namespace hazedumper public const Int32 dwClientState_PlayerInfo = 0x52B8; public const Int32 dwClientState_State = 0x108; public const Int32 dwClientState_ViewAngles = 0x4D88; - public const Int32 dwEntityList = 0x4D43AB4; - public const Int32 dwForceAttack = 0x3175088; - public const Int32 dwForceAttack2 = 0x3175094; - public const Int32 dwForceBackward = 0x31750DC; - public const Int32 dwForceForward = 0x31750B8; - public const Int32 dwForceJump = 0x51ED750; - public const Int32 dwForceLeft = 0x31750D0; - public const Int32 dwForceRight = 0x3175058; - public const Int32 dwGameDir = 0x6285F8; - public const Int32 dwGameRulesProxy = 0x5260A2C; - public const Int32 dwGetAllClasses = 0xD55F1C; + public const Int32 dwEntityList = 0x4D43AC4; + public const Int32 dwForceAttack = 0x3175068; + public const Int32 dwForceAttack2 = 0x3175074; + public const Int32 dwForceBackward = 0x31750A4; + public const Int32 dwForceForward = 0x3175080; + public const Int32 dwForceJump = 0x51ED760; + public const Int32 dwForceLeft = 0x3175098; + public const Int32 dwForceRight = 0x31750BC; + public const Int32 dwGameDir = 0x6286F8; + public const Int32 dwGameRulesProxy = 0x5260A3C; + public const Int32 dwGetAllClasses = 0xD55F2C; public const Int32 dwGlobalVars = 0x589AD0; - public const Int32 dwGlowObjectManager = 0x528B880; - public const Int32 dwInput = 0x5195060; - public const Int32 dwInterfaceLinkList = 0x8F9AF4; - public const Int32 dwLocalPlayer = 0xD2FB84; - public const Int32 dwMouseEnable = 0xD35728; - public const Int32 dwMouseEnablePtr = 0xD356F8; - public const Int32 dwPlayerResource = 0x31733FC; - public const Int32 dwRadarBase = 0x5178824; - public const Int32 dwSensitivity = 0xD355C4; - public const Int32 dwSensitivityPtr = 0xD35598; - public const Int32 dwSetClanTag = 0x89E00; - public const Int32 dwViewMatrix = 0x4D353F4; - public const Int32 dwWeaponTable = 0x5195B24; + public const Int32 dwGlowObjectManager = 0x528B8A0; + public const Int32 dwInput = 0x5195070; + public const Int32 dwInterfaceLinkList = 0x8FA4A4; + public const Int32 dwLocalPlayer = 0xD2FB94; + public const Int32 dwMouseEnable = 0xD35738; + public const Int32 dwMouseEnablePtr = 0xD35708; + public const Int32 dwPlayerResource = 0x317340C; + public const Int32 dwRadarBase = 0x5178834; + public const Int32 dwSensitivity = 0xD355D4; + public const Int32 dwSensitivityPtr = 0xD355A8; + public const Int32 dwSetClanTag = 0x89ED0; + public const Int32 dwViewMatrix = 0x4D35404; + public const Int32 dwWeaponTable = 0x5195B34; public const Int32 dwWeaponTableIndex = 0x325C; - public const Int32 dwYawPtr = 0xD35388; - public const Int32 dwZoomSensitivityRatioPtr = 0xD3A5D0; - public const Int32 dwbSendPackets = 0xD3CEA; + public const Int32 dwYawPtr = 0xD35398; + public const Int32 dwZoomSensitivityRatioPtr = 0xD3A5E0; + public const Int32 dwbSendPackets = 0xD3ECA; public const Int32 dwppDirect3DDevice9 = 0xA7030; - public const Int32 find_hud_element = 0x30F8C270; - public const Int32 force_update_spectator_glow = 0x3990D2; + public const Int32 find_hud_element = 0x3059C3F0; + public const Int32 force_update_spectator_glow = 0x3991F2; public const Int32 interface_engine_cvar = 0x3E9EC; - public const Int32 is_c4_owner = 0x3A5890; + public const Int32 is_c4_owner = 0x3A59C0; public const Int32 m_bDormant = 0xED; public const Int32 m_flSpawnTime = 0xA360; public const Int32 m_pStudioHdr = 0x294C; - public const Int32 m_pitchClassPtr = 0x5178AC8; - public const Int32 m_yawClassPtr = 0xD35388; - public const Int32 model_ambient_min = 0x58CDEC; - public const Int32 set_abs_angles = 0x1CF130; - public const Int32 set_abs_origin = 0x1CEF70; + public const Int32 m_pitchClassPtr = 0x5178AD8; + public const Int32 m_yawClassPtr = 0xD35398; + public const Int32 model_ambient_min = 0x58CE44; + public const Int32 set_abs_angles = 0x1CF1D0; + public const Int32 set_abs_origin = 0x1CF010; } } // namespace hazedumper diff --git a/AnimeSoftware/Offsets/ScannedOffsets.cs b/AnimeSoftware/Offsets/ScannedOffsets.cs index 6542543..cc2b799 100644 --- a/AnimeSoftware/Offsets/ScannedOffsets.cs +++ b/AnimeSoftware/Offsets/ScannedOffsets.cs @@ -16,14 +16,19 @@ namespace AnimeSoftware public static int dwUse; public static int Console; + public static int cl_sidespeed; + public static int cl_forwardspeed; + + public static void Init() { - dwUse = Memory.FindPattern(new byte[] { 0x8B, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x8B, 0xF2, 0x8B, 0xC1, 0x83, 0xCE, 0x20 }, "xx????xxxxxxx", Memory.Client, Memory.ClientSize); ClientCMD = Memory.FindPattern(new byte[] { 0x55, 0x8B, 0xEC, 0x8B, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x81, 0xF9, 0x00, 0x00, 0x00, 0x00, 0x75, 0x0C, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x00, 0xEB, 0x05, 0x8B, 0x01, 0xFF, 0x50, 0x34, 0x50, 0xA1 }, "xxxxx????xx????xxx????x????xxxxxxxxx", Memory.Engine, Memory.EngineSize); - //UserInfoTable = Memory.FindPattern(new byte[] { 0x8B, 0x89, 0x00, 0x00, 0x00, 0x00, 0x85, 0xC9, 0x0F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x01 }, "xx????xxxx????xx", Memory.Engine, Memory.EngineSize); - //SetConVar = Memory.FindPattern(new byte[] { 0x8D, 0x4C, 0x24, 0x1C, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x56 }, "xxxxx????x", Memory.Engine, Memory.EngineSize); - //LvlBypass = Memory.FindPattern(new byte[] { 0x55, 0x8B, 0xEC, 0x8B, 0x55, 0x08, 0x8B, 0xCA, 0x53 }, "xxxxxxxxx", Memory.Client, Memory.ClientSize); //55 8B EC 8B 55 08 8B CA 53 - //Console = Memory.FindPattern(new byte[] { 0x58, 0x81, 0x00, 0x56, 0x00, 0x00, 0x00, 0x00 }, "xx?x????", Memory.Client, Memory.ClientSize); + + dwUse = Memory.FindPattern(new byte[] { 0x8B, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x8B, 0xF2, 0x8B, 0xC1, 0x83, 0xCE, 0x20 }, "xx????xxxxxxx", Memory.Client, Memory.ClientSize) + 2; + + } + + } } diff --git a/AnimeSoftware/Program.cs b/AnimeSoftware/Program.cs index b60e5b1..044877a 100644 --- a/AnimeSoftware/Program.cs +++ b/AnimeSoftware/Program.cs @@ -1,22 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace AnimeSoftware -{ - static class Program - { - /// - /// Главная точка входа для приложения. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new AnimeForm()); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace AnimeSoftware +{ + static class Program + { + /// + /// Главная точка входа для приложения. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new AnimeForm()); + } + } +} diff --git a/AnimeSoftware/Properties/AssemblyInfo.cs b/AnimeSoftware/Properties/AssemblyInfo.cs index b5caec0..bccf409 100644 --- a/AnimeSoftware/Properties/AssemblyInfo.cs +++ b/AnimeSoftware/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Общие сведения об этой сборке предоставляются следующим набором -// набора атрибутов. Измените значения этих атрибутов для изменения сведений, -// связанных со сборкой. -[assembly: AssemblyTitle("AnimeSoftware")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AnimeSoftware")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми -// для компонентов COM. Если необходимо обратиться к типу в этой сборке через -// COM, следует установить атрибут ComVisible в TRUE для этого типа. -[assembly: ComVisible(false)] - -// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM -[assembly: Guid("617f8f5f-8917-4843-aab3-66da09eb7db7")] - -// Сведения о версии сборки состоят из указанных ниже четырех значений: -// -// Основной номер версии -// Дополнительный номер версии -// Номер сборки -// Редакция -// -// Можно задать все значения или принять номера сборки и редакции по умолчанию -// используя "*", как показано ниже: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Общие сведения об этой сборке предоставляются следующим набором +// набора атрибутов. Измените значения этих атрибутов для изменения сведений, +// связанных со сборкой. +[assembly: AssemblyTitle("AnimeSoftware")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("AnimeSoftware")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми +// для компонентов COM. Если необходимо обратиться к типу в этой сборке через +// COM, следует установить атрибут ComVisible в TRUE для этого типа. +[assembly: ComVisible(false)] + +// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM +[assembly: Guid("617f8f5f-8917-4843-aab3-66da09eb7db7")] + +// Сведения о версии сборки состоят из указанных ниже четырех значений: +// +// Основной номер версии +// Дополнительный номер версии +// Номер сборки +// Редакция +// +// Можно задать все значения или принять номера сборки и редакции по умолчанию +// используя "*", как показано ниже: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AnimeSoftware/Properties/Hotkey.Designer.cs b/AnimeSoftware/Properties/Hotkey.Designer.cs index fcbdb13..6d5bc96 100644 --- a/AnimeSoftware/Properties/Hotkey.Designer.cs +++ b/AnimeSoftware/Properties/Hotkey.Designer.cs @@ -1,62 +1,62 @@ -//------------------------------------------------------------------------------ -// -// Этот код создан программой. -// Исполняемая версия:4.0.30319.42000 -// -// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае -// повторной генерации кода. -// -//------------------------------------------------------------------------------ - -namespace AnimeSoftware.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.3.0.0")] - internal sealed partial class Hotkey : global::System.Configuration.ApplicationSettingsBase { - - private static Hotkey defaultInstance = ((Hotkey)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Hotkey()))); - - public static Hotkey Default { - get { - return defaultInstance; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("18")] - public int blockbotKey { - get { - return ((int)(this["blockbotKey"])); - } - set { - this["blockbotKey"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("20")] - public int doorspammerKey { - get { - return ((int)(this["doorspammerKey"])); - } - set { - this["doorspammerKey"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("90")] - public int runboostbotKey { - get { - return ((int)(this["runboostbotKey"])); - } - set { - this["runboostbotKey"] = value; - } - } - } -} +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace AnimeSoftware.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.3.0.0")] + internal sealed partial class Hotkey : global::System.Configuration.ApplicationSettingsBase { + + private static Hotkey defaultInstance = ((Hotkey)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Hotkey()))); + + public static Hotkey Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("18")] + public int blockbotKey { + get { + return ((int)(this["blockbotKey"])); + } + set { + this["blockbotKey"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("20")] + public int doorspammerKey { + get { + return ((int)(this["doorspammerKey"])); + } + set { + this["doorspammerKey"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("90")] + public int runboostbotKey { + get { + return ((int)(this["runboostbotKey"])); + } + set { + this["runboostbotKey"] = value; + } + } + } +} diff --git a/AnimeSoftware/Properties/Hotkey.settings b/AnimeSoftware/Properties/Hotkey.settings index bbe6566..fe223ca 100644 --- a/AnimeSoftware/Properties/Hotkey.settings +++ b/AnimeSoftware/Properties/Hotkey.settings @@ -1,15 +1,15 @@ - - - - - - 18 - - - 20 - - - 90 - - + + + + + + 18 + + + 20 + + + 90 + + \ No newline at end of file diff --git a/AnimeSoftware/Properties/Resources.Designer.cs b/AnimeSoftware/Properties/Resources.Designer.cs index 7191f49..a1da255 100644 --- a/AnimeSoftware/Properties/Resources.Designer.cs +++ b/AnimeSoftware/Properties/Resources.Designer.cs @@ -1,71 +1,71 @@ -//------------------------------------------------------------------------------ -// -// Этот код создан программным средством. -// Версия среды выполнения: 4.0.30319.42000 -// -// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если -// код создан повторно. -// -//------------------------------------------------------------------------------ - -namespace AnimeSoftware.Properties -{ - - - /// - /// Класс ресурсов со строгим типом для поиска локализованных строк и пр. - /// - // Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder - // класс с помощью таких средств, как ResGen или Visual Studio. - // Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen - // с параметром /str или заново постройте свой VS-проект. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Возврат кэшированного экземпляра ResourceManager, используемого этим классом. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AnimeSoftware.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Переопределяет свойство CurrentUICulture текущего потока для всех - /// подстановки ресурсов с помощью этого класса ресурсов со строгим типом. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} +//------------------------------------------------------------------------------ +// +// Этот код создан программным средством. +// Версия среды выполнения: 4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если +// код создан повторно. +// +//------------------------------------------------------------------------------ + +namespace AnimeSoftware.Properties +{ + + + /// + /// Класс ресурсов со строгим типом для поиска локализованных строк и пр. + /// + // Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder + // класс с помощью таких средств, как ResGen или Visual Studio. + // Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen + // с параметром /str или заново постройте свой VS-проект. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Возврат кэшированного экземпляра ResourceManager, используемого этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AnimeSoftware.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Переопределяет свойство CurrentUICulture текущего потока для всех + /// подстановки ресурсов с помощью этого класса ресурсов со строгим типом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/AnimeSoftware/Properties/Resources.resx b/AnimeSoftware/Properties/Resources.resx index af7dbeb..ffecec8 100644 --- a/AnimeSoftware/Properties/Resources.resx +++ b/AnimeSoftware/Properties/Resources.resx @@ -1,117 +1,117 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file