-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
374 lines (298 loc) · 12 KB
/
Plugin.cs
File metadata and controls
374 lines (298 loc) · 12 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
using System.Collections.Generic;
using BepInEx;
using BepInEx.Configuration;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace MapTweaks
{
[BepInPlugin(Constants.Guid, Constants.Name, Constants.Version)]
public class Plugin : BaseUnityPlugin
{
private const string _cityPath = "City_Pretty/CosmeticsRoomAnchor/outsidestores_prefab/";
private const string _stumpPath = "Environment Objects/LocalObjects_Prefab/TreeRoom/";
private const string _videoPath = "City_Pretty/CosmeticsRoomAnchor/nicegorillastore_prefab/VideoPlayer ";
private const string _superBtn = "GameModeSelector_SuperToggleButton (prefab)";
private void Start()
{
InitConfig();
SceneManager.sceneLoaded += OnSceneLoaded;
CosmeticsV2Spawner_Dirty.OnPostInstantiateAllPrefabs += OnCosmeticsLoaded;
}
// forest, but eh
private void OnCosmeticsLoaded()
{
// Add
/*ToggleObjects(true, new[]
{
});*/
// Remove
if (_removeVIMLobbies.Value)
ToggleObjects(false, new[]
{
$"{_stumpPath}TreeRoomInteractables/UI/GameModeSelector_JoinPublicSub_Forest",
$"{_stumpPath}GameModeSelector_JoinPublicSub_City",
});
if (_miscellaneousTweaks.Value)
ToggleObjects(false, new[]
{
$"{_stumpPath}SpectralGooPile (combined by EdMeshCombiner)",
});
// Move
if (_moveSuperBtns.Value)
{
GameObject stumpSuperBtn =
GameObject.Find($"{_stumpPath}TreeRoomInteractables/UI/GameModeSelector/{_superBtn}");
stumpSuperBtn.transform.position = new Vector3(-63.9072f, 12.0673f, -81.7115f);
stumpSuperBtn.transform.localRotation = Quaternion.Euler(328.3268f, 181.2001f, 0f);
GameObject monkeblockssharedSuperBtn = GameObject.Find(
$"Environment Objects/LocalObjects_Prefab/SharedBlocksMapSelectLobby/BuilderFactory_SelectLobby_GameModeSelector/GameModeSelector/{_superBtn}");
monkeblockssharedSuperBtn.transform.position = new Vector3(-279.4951f, 30.9917f, -223.6514f);
monkeblockssharedSuperBtn.transform.localRotation = Quaternion.Euler(318.6287f, 181.2003f, 0f);
}
if (_miscellaneousTweaks.Value)
{
GameObject drillOpenBtnB = GameObject.Find(
"Environment Objects/05Maze_PersistentObjects/GhostReactorElevatorManager/GhostReactorShuttles/HQ/GRShuttleAirLockStaging/OpenButtonB");
drillOpenBtnB.transform.position = new Vector3(-37.1827f, -27.7912f, -72.67f);
drillOpenBtnB.transform.localScale = new Vector3(0.1233f, 0.1145f, 0.0654f);
}
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
switch (scene.name)
{
case "Cave": CaveMineScene(); break;
//case "Canyon2": CanyonScene(); break;
case "City": CityScene(); break;
case "Mountain": MountainScene(); break;
case "Skyjungle": CloudsScene(); break;
case "Basement": BasementScene(); break;
case "Beach": BeachScene(); break;
case "Metropolis": MetroScene(); break;
//case "Bayou": BayouScene(); break;
//case "MonkeBlocks": MonkeBlocksScene(); break;
//case "Arena": ArenaScene(); break; // Blocked off
case "Hoverboard": HoverScene(); break;
case "Critters": CrittersScene(); break;
case "GhostReactor": GhostScene(); break;
//case "MonkeBlocksShared": MonkeBlocksSharedScene(); break;
//case "Ranked": RankedScene(); break;
}
}
private void CaveMineScene()
{
// Add
/*ToggleObjects(true, new[]
{
});
// Remove
ToggleObjects(false, new[]
{
});*/
// Move
if (_moveSuperBtns.Value)
{
GameObject supertoggleBtn =
GameObject.Find($"Cave_Main_Prefab/NewCave/CaveComputer/GameModeSelector/{_superBtn}");
supertoggleBtn.transform.position = new Vector3(-76.4814f, -19.3947f, -24.0923f);
supertoggleBtn.transform.localRotation = Quaternion.Euler(328.8175f, 180.9003f, 0f);
}
}
private void CityScene()
{
// Add
ToggleObjects(true, new[]
{
"City_Pretty/HowManyMonkeSignAnchor/HowManyMonkeSign",
});
// Remove
if (_removeTVs.Value)
ToggleObjects(false, new[]
{
$"{_cityPath}Top Layer/Huts/Hut_3D/Medical Hut/TV_Prefab (1)",
$"{_cityPath}Top Layer/Huts/Hut_3D/Medical Hut/TV_Prefab (2)",
$"{_cityPath}Top Layer/Huts/Hut_3D/Medical Hut/TV_Prefab (3)",
$"{_cityPath}Bottom Layer/OutsideBuildings/Hut_1C/TV_Prefab (4)",
$"{_cityPath}Bottom Layer/OutsideBuildings/TV_Prefab (5)",
"City_Pretty/Arcade_prefab/MainRoom/VRArea/NewMapsDisplay/TV_Prefab",
$"{_videoPath}(5)",
$"{_videoPath}(6)",
$"{_videoPath}(7)",
$"{_videoPath}(8)",
"City_Pretty/SuperCasual_City/SetDressing/VideoPlayer (9)",
});
if (_miscellaneousTweaks.Value)
ToggleObjects(false, new[]
{
"City_Pretty/HowManyMonkeSignAnchor/HowManyMonkeSign/Particle System",
"City_Pretty/CosmeticsRoomAnchor/nicegorillastore_prefab/SubscriptionKiosk_ScenePrefab Variant/SubscriptionKiosk_FBX (1)/ScreenTop/AttractVid",
});
// Move
// Currently None
}
private void MountainScene()
{
// Add
/*ToggleObjects(true, new[]
{
});
// Remove
ToggleObjects(false, new[]
{
});*/
// Move
if (_moveSuperBtns.Value)
{
GameObject supertoggleBtn =
GameObject.Find($"Mountain/Geometry/goodigloo/GameModeSelector/{_superBtn}");
supertoggleBtn.transform.position = new Vector3(-21.5196f, 18.0662f, -107.5614f);
supertoggleBtn.transform.localRotation = Quaternion.Euler(325.2207f, 181.3003f, 0f);
}
}
private void CloudsScene()
{
// Add
/*ToggleObjects(true, new[]
{
});
// Remove
ToggleObjects(false, new[]
{
});*/
// Move
if (_moveSuperBtns.Value)
{
GameObject supertoggleBtn = GameObject.Find($"skyjungle/UI/GameModeSelector/{_superBtn}");
supertoggleBtn.transform.position = new Vector3(-73.9753f, 162.7437f, -97.7961f);
supertoggleBtn.transform.localRotation = Quaternion.Euler(324.9999f, 182.0002f, 0f);
}
}
private void BasementScene()
{
// Add
/*ToggleObjects(true, new[]
{
});*/
// Remove
if (_removeTVs.Value)
ToggleObjects(false, new[]
{
"Basement/DungeonRoomAnchor/DungeonBasement/TV_Prefab",
});
// Move
// Currently None
}
private void BeachScene()
{
// Add
/*ToggleObjects(true, new[]
{
});
// Remove
ToggleObjects(false, new[]
{
});*/
// Move
if (_moveSuperBtns.Value)
{
GameObject supertoggleBtn = GameObject.Find($"Beach/BeachComputer (1)/GameModeSelector/{_superBtn}");
supertoggleBtn.transform.position = new Vector3(-19.9329f, 28.7041f, -23.1375f);
supertoggleBtn.transform.localRotation = Quaternion.Euler(328.9999f, 181.4003f, 0f);
}
}
private void MetroScene()
{
// Add
/*ToggleObjects(true, new[]
{
});
// Remove
ToggleObjects(false, new[]
{
});*/
// Move
if (_moveSuperBtns.Value)
{
GameObject supertoggleBtn = GameObject.Find($"MetroMain/ComputerArea/GameModeSelector/{_superBtn}");
supertoggleBtn.transform.position = new Vector3(65.847f, 4.0367f, -239.0603f);
supertoggleBtn.transform.localRotation = Quaternion.Euler(324.1577f, 181.2003f, 0f);
}
}
private void HoverScene()
{
// Add
/*ToggleObjects(true, new[]
{
});
// Remove
ToggleObjects(false, new[]
{
});*/
// Move
if (_moveSuperBtns.Value)
{
GameObject supertoggleBtn = GameObject.Find($"HoverboardLevel/UI (1)/GameModeSelector/{_superBtn}");
supertoggleBtn.transform.position = new Vector3(-92.7389f, -16.6623f, 29.0614f);
supertoggleBtn.transform.localRotation = Quaternion.Euler(324.9999f, 181.0002f, 0f);
}
}
private void CrittersScene()
{
// Add
/*ToggleObjects(true, new[]
{
});
// Remove
ToggleObjects(false, new[]
{
});*/
// Move
if (_moveSuperBtns.Value)
{
GameObject supertoggleBtn = GameObject.Find($"Critters/UI Elements/UI/GameModeSelector/{_superBtn}");
supertoggleBtn.transform.position = new Vector3(94.2255f, -92.911f, 48.3016f);
supertoggleBtn.transform.localRotation = Quaternion.Euler(327.5117f, 181.2003f, 0f);
}
}
private void GhostScene()
{
// Add
/*ToggleObjects(true, new[]
{
});
// Remove
ToggleObjects(false, new[]
{
});*/
// Move
// Currently None
}
private void ToggleObjects(bool state, IEnumerable<string> paths)
{
foreach (string path in paths)
{
GameObject obj = GameObject.Find(path);
if (obj != null)
obj.SetActive(state);
}
}
#region Configuration
// Added Objects
// Removed Objects
public ConfigEntry<bool> _removeVIMLobbies,
_removeTVs;
// Moved Objects
public ConfigEntry<bool> _moveSuperBtns,
_miscellaneousTweaks;
public void InitConfig()
{
_miscellaneousTweaks = Config.Bind("Miscellaneous Tweaks", "MiscellaneousTweaks", true,
"Non-categorized objects, added, removed, moved etc.");
//Added Objects
_removeTVs = Config.Bind("Removed Objects", "TVs", true, "Remove TVs");
_removeVIMLobbies = Config.Bind("Removed Objects", "VIMLobbyButtons", true, "Remove VIM Lobby Buttons");
_moveSuperBtns = Config.Bind("Moved Objects", "SuperButtons", true, "Moves Super Toggle Buttons");
}
#endregion
}
}