|
4 | 4 | using System.Text; |
5 | 5 | using System.Threading; |
6 | 6 | using System.Threading.Tasks; |
7 | | -using System.Windows.Forms; |
8 | 7 |
|
9 | 8 | namespace GenshinWoodmen.Core |
10 | 9 | { |
@@ -88,21 +87,24 @@ public static async Task<bool> Logout() |
88 | 87 | UserSimulator.Input.Keyboard.KeyPress(VirtualKeyCode.ESCAPE); |
89 | 88 | await JiggingProcessor.Delay(950); |
90 | 89 | RECT rect = NativeMethods.GetWindowRECT(hwnd); |
91 | | - NativeMethods.SetCursorPos(rect.Left + 20, rect.Bottom - SystemInformation.CaptionHeight - 10); |
| 90 | + NativeMethods.SetCursorPos(rect.Left + 20, rect.Bottom - 30); |
92 | 91 | await JiggingProcessor.Delay(100); |
93 | | - UserSimulator.Input.Mouse.LeftButtonClick(); // ExitButton |
| 92 | + UserSimulator.Input.Mouse.LeftButtonClick(); // Exit |
94 | 93 | await JiggingProcessor.Delay(800); |
95 | 94 | (double cx, double cy) = ((rect.Right - rect.Left) / 2d, (rect.Bottom - rect.Top) / 2d); |
96 | 95 | double ratio = (rect.Right - rect.Left) / (double)(rect.Bottom - rect.Top); |
97 | 96 | (double xfactor, double yfactor) = (1.1d, new Func<double>(() => |
98 | 97 | { |
| 98 | + // Inspected from ratio (such as 1.33, 1.5, 1.6, 1.78), calced without `SystemInformation.CaptionHeight` actually. |
| 99 | + // TODO: Calc with `SystemInformation.CaptionHeight`. |
99 | 100 | if (ratio >= 1.6d) return 1.4d; |
100 | 101 | else if (ratio >= 1.5d) return 1.35d; |
| 102 | + else if (ratio >= 1.4d) return 1.33d; |
101 | 103 | else return 1.3d; |
102 | 104 | }).Invoke()); |
103 | 105 | NativeMethods.SetCursorPos(rect.Left + (int)(cx * xfactor), rect.Top + (int)(cy * yfactor)); |
104 | 106 | await JiggingProcessor.Delay(100); |
105 | | - UserSimulator.Input.Mouse.LeftButtonClick(); // OKButton |
| 107 | + UserSimulator.Input.Mouse.LeftButtonClick(); // OK |
106 | 108 | }); |
107 | 109 | } |
108 | 110 |
|
|
0 commit comments