This repository was archived by the owner on Aug 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMenu.cs
More file actions
384 lines (349 loc) · 16.4 KB
/
Copy pathMenu.cs
File metadata and controls
384 lines (349 loc) · 16.4 KB
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
using MelonLoader;
using Photon.Pun;
using Photon.Realtime;
using System;
using UnityEngine;
using UnityEngine.AI;
namespace PhasmophobiaPotatoGUI
{
public class Menu : MelonMod
{
public static void drawMenu()
{
if (!PhotonNetwork.InRoom)
{
RoomGUI();
}
if (Main.levelController == null)
{
lobbyActions();
}
if (Main.levelController != null)
{
hudToggles();
ghostActions();
}
if (showItemList)
{
spawnItemMenu();
}
}
private static void ghostActions()
{
GUI.Label(new Rect(520f, 95f, 200f, 20f), "Ghost:");
if (GUI.Button(new Rect(520f, 120f, 200f, 20f), "Random Event") && Main.ghostAI != null)
{
Main.ghostAI.field_Public_GhostActivity_0.InteractWithARandomDoor();
Main.ghostAI.field_Public_GhostActivity_0.InteractWithARandomProp();
Main.ghostAI.field_Public_GhostActivity_0.Interact();
Main.ghostAI.RandomEvent();
}
//if (GUI.Button(new Rect(520f, 120f, 200f, 20f), "Sound"))
//{
// Main.ghostAudio.PlaySound(1, false, false);
// Main.ghostAudio.PlaySound(0, false, false);
// Main.ghostInteraction.GetComponent<PhotonView>().RPC("SpawnFootstepNetworked", 0, new Il2CppSystem.Object[]
// {
// ghostAI.transform.position,
// ghostAI.transform.rotation,
// new Il2CppSystem.Int32(){ m_value = UnityEngine.Random.Range(0, 3) }.BoxIl2CppObject()
// });
//}
if (GUI.Button(new Rect(520f, 145f, 200f, 20f), "Wander"))
{
Main.ghostAI.field_Public_Boolean_6 = true;
Main.ghostAI.field_Public_Animator_0.SetBool("isIdle", false);
Vector3 destination = Vector3.zero;
NavMeshHit navMeshHit;
if (NavMesh.SamplePosition(UnityEngine.Random.insideUnitSphere * 3f + Main.ghostAI.transform.position, out navMeshHit, 3f, 1))
{
destination = navMeshHit.position;
}
Main.ghostAI.field_Public_NavMeshAgent_0.destination = destination;
Main.ghostAI.ChangeState((GhostAI.EnumNPublicSealedvaidwahufalidothfuapUnique)1, null, null);
Main.ghostAI.field_Public_PhotonView_0.RPC("Hunting", 0, new Il2CppSystem.Object[]
{
new Il2CppSystem.Boolean().BoxIl2CppObject()
});
Main.ghostAI.field_Public_PhotonView_0.RPC("SyncChasingPlayer", 0, new Il2CppSystem.Object[]
{
new Il2CppSystem.Boolean().BoxIl2CppObject()
});
}
if (GUI.Button(new Rect(520f, 170f, 200f, 20f), "Hunt"))
{
SetupPhaseController.field_Public_Static_SetupPhaseController_0.field_Public_Boolean_0 = false;
Main.ghostAI.field_Public_Boolean_4 = true;
Main.ghostAI.field_Public_Boolean_2 = true;
Main.ghostAI.field_Public_Animator_0.SetBool("isIdle", false);
Main.ghostAI.field_Public_Animator_0.SetInteger("WalkType", 1);
Main.ghostAI.field_Public_NavMeshAgent_0.speed = Main.ghostAI.field_Public_Single_0;
Main.ghostAI.field_Public_GhostInteraction_0.CreateAppearedEMF(Main.ghostAI.transform.position);
Vector3 destination2 = Vector3.zero;
float num = UnityEngine.Random.Range(2f, 15f);
NavMeshHit navMeshHit2;
if (NavMesh.SamplePosition(UnityEngine.Random.insideUnitSphere * num + Main.ghostAI.transform.position, out navMeshHit2, num, 1))
{
destination2 = navMeshHit2.position;
}
else
{
destination2 = Vector3.zero;
}
Main.ghostAI.field_Public_NavMeshAgent_0.SetDestination(destination2);
SetupPhaseController.field_Public_Static_SetupPhaseController_0.ForceEnterHuntingPhase();
Main.ghostAI.ChangeState((GhostAI.EnumNPublicSealedvaidwahufalidothfuapUnique)2, null, null);
Main.ghostAI.field_Public_PhotonView_0.RPC("Hunting", 0, new Il2CppSystem.Object[]
{
new Il2CppSystem.Boolean(){ m_value = true}.BoxIl2CppObject()
});
Main.ghostAI.field_Public_PhotonView_0.RPC("SyncChasingPlayer", 0, new Il2CppSystem.Object[]
{
new Il2CppSystem.Boolean(){ m_value = true}.BoxIl2CppObject()
});
}
if (GUI.Button(new Rect(520f, 195f, 200f, 20f), "Idle"))
{
Main.ghostAI.field_Public_Animator_0.SetInteger("IdleNumber", UnityEngine.Random.Range(0, 2));
Main.ghostAI.field_Public_Animator_0.SetBool("isIdle", true);
Main.ghostAI.UnAppear(false);
Main.ghostAI.field_Public_GhostAudio_0.TurnOnOrOffAppearSource(false);
Main.ghostAI.field_Public_GhostAudio_0.PlayOrStopAppearSource(false);
Main.ghostAI.ChangeState(0, null, null);
Main.ghostAI.field_Public_PhotonView_0.RPC("Hunting", 0, new Il2CppSystem.Object[]
{
new Il2CppSystem.Boolean().BoxIl2CppObject()
});
Main.ghostAI.field_Public_PhotonView_0.RPC("SyncChasingPlayer", 0, new Il2CppSystem.Object[]
{
new Il2CppSystem.Boolean().BoxIl2CppObject()
});
}
Il2CppSystem.Int32 appearRand = new Il2CppSystem.Int32
{
m_value = UnityEngine.Random.Range(0, 3)
};
if (GUI.Button(new Rect(520f, 220f, 200f, 20f), "Appear"))
{
Main.ghostAI.field_Public_PhotonView_0.RPC("MakeGhostAppear", 0, new Il2CppSystem.Object[]
{
new Il2CppSystem.Boolean(){ m_value = true}.BoxIl2CppObject(),
new Il2CppSystem.Int32(){ m_value = UnityEngine.Random.Range(0, 3) }.BoxIl2CppObject()
});
}
if (GUI.Button(new Rect(520f, 245f, 200f, 20f), "Unappear"))
{
Main.ghostAI.field_Public_PhotonView_0.RPC("MakeGhostAppear", 0, new Il2CppSystem.Object[]
{
new Il2CppSystem.Boolean().BoxIl2CppObject(),
new Il2CppSystem.Int32(){ m_value = UnityEngine.Random.Range(0, 3) }.BoxIl2CppObject()
});
}
}
private static string playerNickName;
private static Player MyPlayer;
private static float playerReach;
private static void anywhereActions()
{
if (GUI.Toggle(new Rect(1120f, 325f, 200f, 20f), showItemList, "Show Item Spawner") != showItemList)
{
showItemList = !showItemList;
}
}
private static bool isPrivateServer;
private static string serverName;
private static float serverSlots;
private static void RoomGUI()
{
if (!PhotonNetwork.InRoom)
{
GUI.Label(new Rect(720f, 0f, 200f, 20f), "Custom Room Creator:");
serverName = GUI.TextArea(new Rect(720f, 25f, 200f, 20f), serverName);
serverSlots = GUI.HorizontalSlider(new Rect(720f, 50f, 200f, 20f), (float)((int)serverSlots), 4f, 90f);
GUI.Label(new Rect(720f, 65f, 200f, 20f), "Slots: " + ((int)serverSlots).ToString());
if (GUI.Toggle(new Rect(720f, 80f, 200f, 20f), isPrivateServer, "Private Room") != isPrivateServer)
{
isPrivateServer = !isPrivateServer;
}
if (GUI.Button(new Rect(720f, 105f, 200f, 20f), "Create Custom Room"))
{
if (isPrivateServer)
{
PlayerPrefs.SetInt("isPublicServer", 0);
RoomOptions roomOptions = new RoomOptions
{
IsOpen = true,
IsVisible = false,
MaxPlayers = Convert.ToByte((int)serverSlots),
PlayerTtl = 2000
};
PhotonNetwork.CreateRoom(UnityEngine.Random.Range(0, 999999).ToString("000000"), roomOptions, TypedLobby.Default);
}
if (!isPrivateServer)
{
PlayerPrefs.SetInt("isPublicServer", 1);
RoomOptions roomOptions2 = new RoomOptions
{
IsOpen = true,
IsVisible = true,
MaxPlayers = Convert.ToByte((int)serverSlots),
PlayerTtl = 2000
};
PhotonNetwork.CreateRoom(serverName + "#" + UnityEngine.Random.Range(0, 999999).ToString("000000"), roomOptions2, TypedLobby.Default);
}
}
}
}
private static void lobbyActions()
{
GUI.SetNextControlName("changename");
playerNickName = GUI.TextArea(new Rect(320f, 25f, 200f, 20f), playerNickName);
if (GUI.Button(new Rect(320f, 45f, 200f, 20f), "Change Name"))
{
GUI.FocusControl("changename");
PhotonNetwork.NickName = playerNickName;
}
if (GUI.Button(new Rect(320f, 145f, 200f, 20f), "Force Start"))
{
Main.serverManager.StartGame();
}
if (GUI.Button(new Rect(520f, 50f, 200f, 20f), "Add 100$"))
{
FileBasedPrefs.SetInt("PlayersMoney", FileBasedPrefs.GetInt("PlayersMoney", 0) + 100);
}
if (GUI.Button(new Rect(520f, 75f, 200f, 20f), "Add 1 Level"))
{
FileBasedPrefs.SetInt("myTotalExp", FileBasedPrefs.GetInt("myTotalExp", 0) + 100);
}
playerReach = GUI.HorizontalSlider(new Rect(320, 200f, 200f, 20f), (float)((int)playerReach), 1.6f, 16f);
GUI.Label(new Rect(10f, 160f, 200, 20f), "Reach: " + (int)playerReach);
if (GUI.Button(new Rect(320f, 225f, 200f, 20f), "Click to change reach"))
{
MyPlayer = Main.GetLocalPlayer();
MyPlayer.field_Public_PCPropGrab_0.field_Private_Single_0 = playerReach;
}
//GUI.Label(new Rect(920f, 0f, 200f, 20f), "Join Room:");
//roomName = GUI.TextArea(new Rect(920f, 25f, 200f, 20f), roomName);
//steamID = GUI.TextArea(new Rect(920f, 50f, 200f, 20f), steamID);
//if (GUI.Button(new Rect(920f, 75f, 200f, 20f), "Join Room by Name"))
//{
// PhotonNetwork.JoinRoom(roomName);
//}
//if (GUI.Button(new Rect(920f, 100f, 200f, 20f), "Join Room by ID"))
//{
// object[] FriendIDList;
// bool test = PhotonNetwork.FindFriends(new string[]
// {
// steamID
// });
// MelonLogger.Log("steamID = " + steamID);
// //foreach (FriendInfo friendInfo in PhotonNetwork.Friends)
// //{
// //PhotonNetwork.JoinRoom(friendInfo.Room);
// //}
//}
}
public static bool GhostESP = true;
public static bool PlayerESP = true;
public static bool KeyESP = true;
public static bool OuijaESP = true;
public static bool EvidenceESP = true;
public static bool FuseboxESP = true;
public static bool ShowInfoGhost = true;
public static bool ShowInfoPlayer = true;
public static bool showMissionInfo = true;
public static bool SpeedHack = true;
public static bool fullbrighttoggle = true;
private static void hudToggles()
{
GUI.Label(new Rect(920f, 295f, 200f, 20f), "ESP:");
if (GUI.Toggle(new Rect(920f, 320f, 200f, 20f), GhostESP, "Ghost") != GhostESP)
{
GhostESP = !GhostESP;
}
if (GUI.Toggle(new Rect(920f, 370f, 200f, 20f), PlayerESP, "Player") != PlayerESP)
{
PlayerESP = !PlayerESP;
}
if (GUI.Toggle(new Rect(920f, 395f, 200f, 20f), OuijaESP, "Ouija Board") != OuijaESP)
{
OuijaESP = !OuijaESP;
}
if (GUI.Toggle(new Rect(920f, 420f, 200f, 20f), KeyESP, "Key") != KeyESP)
{
KeyESP = !KeyESP;
}
if (GUI.Toggle(new Rect(920f, 445f, 200f, 20f), EvidenceESP, "Evidence") != EvidenceESP)
{
EvidenceESP = !EvidenceESP;
}
if (GUI.Toggle(new Rect(1120f, 400f, 200f, 20f), SpeedHack, "Speedhack") != SpeedHack)
{
SpeedHack = !SpeedHack;
}
if (GUI.Toggle(new Rect(1120, 415f, 200f, 20f), fullbrighttoggle, "FullBright") != fullbrighttoggle)
{
fullbrighttoggle = !fullbrighttoggle;
FullBright.changeBright();
}
GUI.Label(new Rect(740f, 145f, 200f, 20f), "Lights:");
if (GUI.Button(new Rect(740f, 175f, 200f, 20f), "All Lights On"))
{
foreach (LightSwitch lightSwitch1 in Main.lightSwitches)
{
lightSwitch1.TurnOn(true);
lightSwitch1.TurnOnNetworked(true);
}
}
if (GUI.Button(new Rect(740f, 195f, 200f, 20f), "All Lights Off"))
{
foreach (LightSwitch lightSwitch2 in Main.lightSwitches)
{
lightSwitch2.TurnOff();
lightSwitch2.TurnOffNetworked(true);
}
}
if (GUI.Toggle(new Rect(1120f, 300f, 200f, 20f), ShowInfoGhost, "Show Ghost Info") != ShowInfoGhost)
{
ShowInfoGhost = !ShowInfoGhost;
}
if (GUI.Toggle(new Rect(1120f, 250f, 200f, 20f), ShowInfoPlayer, "Show Player Info") != ShowInfoPlayer)
{
ShowInfoPlayer = !ShowInfoPlayer;
}
if (GUI.Toggle(new Rect(1120f, 200f, 200f, 20f), showMissionInfo, "Show Player Info") != showMissionInfo)
{
showMissionInfo = !showMissionInfo;
}
}
public static Rect dropDownRect2 = new Rect(820f, 0f, 200f, 300f);
private static bool showItemList;
private static int selectedItem;
private static Vector2 scrollViewVector;
private static void spawnItemMenu()
{
if (showItemList)
{
string[] allitems = Constants.allitems;
GUI.Label(new Rect(520f, 225f, 200f, 20f), "Item Spawner:");
scrollViewVector = GUI.BeginScrollView(new Rect(dropDownRect2.x - 100f, dropDownRect2.y + 25f, dropDownRect2.width, dropDownRect2.height), scrollViewVector, new Rect(0f, 0f, dropDownRect2.width, Mathf.Max(dropDownRect2.height, (float)(allitems.Length * 25))));
GUI.Box(new Rect(0f, 0f, dropDownRect2.width, Mathf.Max(dropDownRect2.height, (float)(allitems.Length * 25))), "");
for (int l = 0; l < allitems.Length; l++)
{
if (GUI.Button(new Rect(0f, (float)(l * 25), dropDownRect2.height, 25f), ""))
{
selectedItem = l;
if (PhotonNetwork.InRoom)
{
MyPlayer = Main.GetLocalPlayer();
MelonLogger.Log(allitems[selectedItem].ToString());
PhotonNetwork.Instantiate(allitems[selectedItem], MyPlayer.transform.position, Quaternion.identity, 0, null);
}
}
GUI.Label(new Rect(5f, (float)(l * 25), dropDownRect2.height, 25f), allitems[l]);
}
GUI.EndScrollView();
}
}
}
}