This repository has been archived by the owner on Aug 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Window.cs
304 lines (278 loc) · 13.2 KB
/
Window.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
using HeroCameraName;
using System;
using System.Linq;
using UnhollowerBaseLib;
using UnityEngine;
namespace BmMod
{
public class Window : BmMod
{
public Window(IntPtr intPtr) : base(intPtr) { }
public static Rect MenuRect = new Rect(Screen.width - 250, 150, 200, 360); // 主菜单
public static Rect TipsRect = new Rect(Screen.width - 250, 550, 200, 350); // 提示窗口
public static Rect AimBotRect = new Rect(Screen.width - 460, 40, 200, 340); // 自瞄设置
public static Rect TestRect = new Rect(Screen.width - 460, 400, 200, 220); // 实验室窗口
public static Vector2 TipsScroll = Vector2.zero;
// 主菜单
public static void MenuWindow(int windowID)
{
GUILayout.Label("[Insert] 呼出/隐藏鼠标");
AmmoState = GUILayout.Toggle(AmmoState, AmmoState ? "[F1] 无限子弹 <color=lime>[开]</color>" : "[F1] 无限子弹 [关]");
GUILayout.BeginHorizontal();
if (GUILayout.Toggle(AimBotState, "[F2] 自瞄 " + AimBotKeyStr[AimBotKeyNum]) != AimBotState)
{
AimBotState = !AimBotState;
if (AimBotState)
{
MenuRect = new Rect(MenuRect.x, MenuRect.y, MenuRect.width, MenuRect.height + 45);
NextAimBotKey();
}
else
{
MenuRect = new Rect(MenuRect.x, MenuRect.y, MenuRect.width, MenuRect.height - 45);
AimBotKeyNum = 0;
}
}
if (GUILayout.Button("设置")) { AimBotWindowState = !AimBotWindowState; }
GUILayout.EndHorizontal();
if (AimBotState)
{
GUILayout.BeginHorizontal();
for (int i = 1, j = 0; i < AimBotKeyConfig.Length; i++)
{
if (AimBotKeyConfig[i])
{
j++;
if(GUILayout.Toggle(AimBotKeyNum == i, AimBotKeyStr[i]))
{
AimBotKeyNum = i;
}
}
if (j % 3 == 0)
{
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
}
}
GUILayout.EndHorizontal();
}
if (GUILayout.Toggle(SuperJumpState, "[F3] 起飞 " + SuperJumpStr[SuperJumpType]) != SuperJumpState)
{
SuperJumpState = !SuperJumpState;
if (SuperJumpState)
{
MenuRect = new Rect(MenuRect.x, MenuRect.y, MenuRect.width, MenuRect.height + 20);
SuperJumpType = 1;
}
else
{
MenuRect = new Rect(MenuRect.x, MenuRect.y, MenuRect.width, MenuRect.height - 20);
SuperJumpType = 0;
}
}
GUILayout.BeginHorizontal();
if (SuperJumpState)
{
for (int i = 1; i < SuperJumpStr.Length; i++)
{
if (GUILayout.Toggle(SuperJumpType == i, SuperJumpStr[i]))
{
SuperJumpType = i;
}
}
}
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
if (GUILayout.Toggle(SuperRunState, SuperRunState ? "[F4] 超级移速 <color=lime>[开]</color>" : "[F4] 超级移速 [关]") != SuperRunState)
{
SuperRunToggle();
}
if (GUILayout.Button("设置"))
{
SuperRunWindowState = !SuperRunWindowState;
if (SuperRunWindowState)
{
MenuRect = new Rect(MenuRect.x, MenuRect.y, MenuRect.width, MenuRect.height + 65);
}
else
{
MenuRect = new Rect(MenuRect.x, MenuRect.y, MenuRect.width, MenuRect.height - 65);
}
}
GUILayout.EndHorizontal();
if (SuperRunWindowState)
{
GUILayout.Label("移速 " + SuperRunSet);
SuperRunSet = (int)GUILayout.HorizontalSlider(SuperRunSet, 0, 3000);
if (GUILayout.Button("保存参数")) { MainMod.SaveConfig(); }
}
NoRecoilState = GUILayout.Toggle(NoRecoilState, NoRecoilState ? "[F5] 无后坐力 <color=lime>[开]</color>" : "[F5] 无后坐力 [关]");
NoBulletConsumeState = GUILayout.Toggle(NoBulletConsumeState, NoBulletConsumeState ? "[F6] 不耗子弹 <color=lime>[开]</color>" : "[F6] 不耗子弹 [关]");
AccuracyState = GUILayout.Toggle(AccuracyState, AccuracyState ? "[F7] 提高精度 <color=lime>[开]</color>" : "[F7] 提高精度 [关]");
AttDistanceState = GUILayout.Toggle(AttDistanceState, AttDistanceState ? "[F8] 近战距离 <color=lime>[开]</color>" : "[F8] 近战距离 [关]");
GUILayout.BeginHorizontal();
if(GUILayout.Toggle(WeaponSpeedState, WeaponSpeedState ? "[F9] 提高射速 <color=lime>[开]</color>" : "[F9] 提高射速 [关]") != WeaponSpeedState)
{
WeaponSpeedState = !WeaponSpeedState;
if (WeaponSpeedState)
{
MenuRect = new Rect(MenuRect.x, MenuRect.y, MenuRect.width, MenuRect.height + 110);
}
else
{
MenuRect = new Rect(MenuRect.x, MenuRect.y, MenuRect.width, MenuRect.height - 110);
}
}
GUILayout.EndHorizontal();
if (WeaponSpeedState)
{
AttSpeedState = GUILayout.Toggle(AttSpeedState, "射速(部分武器可用):" + AttSpeedNum);
AttSpeedNum = (int)GUILayout.HorizontalSlider(AttSpeedNum, 100f, 5000f);
BulletSpeedState = GUILayout.Toggle(BulletSpeedState, "弹速:" + BulletSpeedNum);
BulletSpeedNum = GUILayout.HorizontalSlider(BulletSpeedNum, 100f, 5000f);
if (GUILayout.Button("保存参数")) { MainMod.SaveConfig(); }
}
QuickReloadBulletState = GUILayout.Toggle(QuickReloadBulletState, QuickReloadBulletState ? "[F11] 快速换弹 <color=lime>[开]</color>" : "[F11] 快速换弹 [关]");
GUILayout.Label("[中键] 我吸!");
GUILayout.Label("[C/X] 地图信息");
GUILayout.Space(5);
GUILayout.BeginHorizontal();
if (GUILayout.Button("关闭窗口")) { MenuState = false; }
if (GUILayout.Button("实验室")) { TestWindowState = !TestWindowState; }
GUILayout.EndHorizontal();
GUI.DragWindow(new Rect(0, 0, 10000, 420));
}
// 提示窗口
public static void TipsWindow(int windowID)
{
Il2CppReferenceArray<GUILayoutOption> options = null;
TipsScroll = GUILayout.BeginScrollView(TipsScroll, options);
if (GUILayout.Button("储存当前位置")) { SaveHeroPosition = HeroCameraManager.HeroTran.position; }
GUILayout.BeginHorizontal();
GUILayout.Label("返回之前或储存的位置");
if (GUILayout.Button("Go")) { HeroCameraManager.HeroTran.position = SaveHeroPosition; }
GUILayout.EndHorizontal();
//玩家
foreach (var keyValuePair in NewPlayerManager.PlayerTeamerDict)
{
if (keyValuePair.Value.ObjectID == HeroCameraManager.HeroID) { continue; }
GUILayout.BeginHorizontal();
GUILayout.Label("<color=lime>" + keyValuePair.Value.playerProp.Name + "</color>");
if (GUILayout.Button("Go")) { SaveHeroPosition = HeroCameraManager.HeroTran.position; HeroCameraManager.HeroTran.position = keyValuePair.Value.centerPointTrans.position; }
GUILayout.EndHorizontal();
}
// 下一关门口
if (NewPlayerManager.NextDoor != null)
{
GUILayout.BeginHorizontal();
GUILayout.Label("下一关入口");
if (GUILayout.Button("Go")) { SaveHeroPosition = HeroCameraManager.HeroTran.position; HeroCameraManager.HeroTran.position = NewPlayerManager.NextDoor.centerPointTrans.position; }
GUILayout.EndHorizontal();
}
//NPC
foreach (var keyValuePair in NewPlayerManager.PlayerDict)
{
var obj = keyValuePair.Value;
if (ShowObject(obj))
{
GUILayout.BeginHorizontal();
GUILayout.Label(ShowObjectName(obj));
if (GUILayout.Button("Go")) { SaveHeroPosition = HeroCameraManager.HeroTran.position; HeroCameraManager.HeroTran.position = obj.centerPointTrans.position; }
GUILayout.EndHorizontal();
}
}
GUILayout.EndScrollView();
GUI.DragWindow(new Rect(0, 0, 10000, 400));
}
// 自瞄设置
public static void AimBotWindow(int windowID)
{
GUILayout.Space(5);
GUILayout.Label("自瞄按键筛选");
GUILayout.BeginHorizontal();
for (int i = 1; i < AimBotKeyStr.Length; i++)
{
AimBotKeyConfig[i] = GUILayout.Toggle(AimBotKeyConfig[i], AimBotKeyStr[i]);
//至少保留一个按钮
if(AimBotKeyConfig.Where(x => x == true).Count() == 1)
{
AimBotKeyConfig[i] = true;
}
if (i % 3 == 0)
{
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
}
}
GUILayout.EndHorizontal();
GUILayout.Space(5);
if (GUILayout.Toggle(AimBotMagneticState, "磁吸自瞄(微自瞄)"))
{
AimBotMagneticState = true;
AimBotForceState = false;
}
if (GUILayout.Toggle(AimBotForceState, "暴力自瞄"))
{
AimBotForceState = true;
AimBotMagneticState = false;
}
GUILayout.Space(5);
GUILayout.Label("自瞄范围 " + AimBotSightRange);
AimBotSightRange = GUILayout.HorizontalSlider(AimBotSightRange, 0.0f, 0.5f);
GUILayout.Space(5);
GUILayout.Label("强制优先距离最近的敌人\n优先距离范围: " + AimBotForceDistance);
AimBotForceDistance = (float)Math.Round(GUILayout.HorizontalSlider(AimBotForceDistance, 0.0f, 100f), 1);
GUILayout.Space(5);
AimBotShieldState = GUILayout.Toggle(AimBotShieldState, "干掉盾牌(恶心的马头锐士)");
GUILayout.Space(5);
AimBotPlusState = GUILayout.Toggle(AimBotPlusState, "管他喵的,转起来");
GUILayout.Space(5);
GUILayout.BeginHorizontal();
if (GUILayout.Button("关闭窗口")) { AimBotWindowState = false; }
if (GUILayout.Button("保存参数")) { MainMod.SaveConfig(); }
GUILayout.EndHorizontal();
GUI.DragWindow(new Rect(0, 0, 10000, 250));
}
// 实验室窗口
public static void TestWindow(int windowID)
{
GUILayout.Space(10);
if (GUILayout.Button("查看物品ID")) { ShowAllIdState = !ShowAllIdState; }
GUILayout.BeginHorizontal();
GUILayout.Label("敌人模型大小");
if (GUILayout.Button("+")) { MonstersModelState = 1; }
if (GUILayout.Button("-")) { MonstersModelState = 2; }
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
GUILayout.Label("自己模型大小");
if (GUILayout.Button("+")) { MyModelState = 1; }
if (GUILayout.Button("-")) { MyModelState = 2; }
if (GUILayout.Button("还原")) { MyModelState = 3; }
GUILayout.EndHorizontal();
GUILayout.Space(5);
if (GUILayout.Button(ShowBloodBarState ? "始终显示怪物血条[开]" : "始终显示怪物血条[关]")) { ShowBloodBarState = !ShowBloodBarState; }
GUILayout.Space(5);
if (GUILayout.Button(ZoomWeakState ? "下雨不愁[开]" : "大头大头[关]"))
{
ZoomWeakState = !ZoomWeakState;
if (ZoomWeakState)
{
TestRect = new Rect(TestRect.x, TestRect.y, TestRect.width, TestRect.height + 50);
}
else
{
TestRect = new Rect(TestRect.x, TestRect.y, TestRect.width, TestRect.height - 50);
}
}
if (ZoomWeakState)
{
GUILayout.Label("你想多大? " + ZoomWeakNum);
ZoomWeakNum = GUILayout.HorizontalSlider(ZoomWeakNum, 0.0f, 10f);
}
GUILayout.Space(5);
if (GUILayout.Button("退出游戏")) { System.Diagnostics.Process.GetCurrentProcess().Kill(); }
if (GUILayout.Button("关闭窗口")) { TestWindowState = false; }
GUI.DragWindow(new Rect(0, 0, 10000, 200));
}
}
}