This repository was archived by the owner on Nov 11, 2021. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathRubyButtonAPI.cs
More file actions
Latest commit
573 lines (485 loc) · 24.2 KB
/
Copy pathRubyButtonAPI.cs
File metadata and controls
573 lines (485 loc) · 24.2 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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
usingSystem;
usingIl2CppSystem.Reflection;
usingSystem.Collections;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingUnhollowerRuntimeLib;
usingUnityEngine;
usingUnityEngine.UI;
usingUnityEngine.Events;
usingVRC.UI;
namespaceRubyButtonAPI
{
//Credits:
//Emilia - Porting it to MelonLoader and helping to keep the git updated
//Tritn - Helping to keep the git updated
//This adds a couple of new functions compared to the old one, however,
//like the last one, I will not be providing any support as I will
//personally not be using melonloader/unhollower in the near future.
//Look here for a useful example guide:
//https://github.com/DubyaDude/RubyButtonAPI/blob/master/RubyButtonAPI_Old.cs
publicstaticclassQMButtonAPI
{
//REPLACE THIS STRING SO YOUR MENU DOESNT COLLIDE WITH OTHER MENUS
publicstaticstringidentifier="REPLACEME";
publicstaticColormBackground=Color.red;
publicstaticColormForeground=Color.white;
publicstaticColorbBackground=Color.red;
publicstaticColorbForeground=Color.yellow;
publicstaticList<QMSingleButton>allSingleButtons=newList<QMSingleButton>();
publicstaticList<QMToggleButton>allToggleButtons=newList<QMToggleButton>();
publicstaticList<QMNestedButton>allNestedButtons=newList<QMNestedButton>();
}
publicclassQMButtonBase
{
protectedGameObjectbutton;
protectedstringbtnQMLoc;
protectedstringbtnType;
protectedstringbtnTag;
protectedint[]initShift={0,0};
protectedColorOrigBackground;
protectedColorOrigText;
publicGameObjectgetGameObject()
{
returnbutton;
}
publicvoidsetActive(boolisActive)
{
button.gameObject.SetActive(isActive);
}
publicvoidsetIntractable(boolisIntractable)
{
if(isIntractable)
{
setBackgroundColor(OrigBackground,false);
setTextColor(OrigText,false);
}
else
{
setBackgroundColor(newColor(0.5f,0.5f,0.5f,1),false);
setTextColor(newColor(0.7f,0.7f,0.7f,1),false);;
}
button.gameObject.GetComponent<Button>().interactable=isIntractable;
}
publicvoidsetLocation(intbuttonXLoc,intbuttonYLoc)
{
button.GetComponent<RectTransform>().anchoredPosition+=Vector2.right*(420*(buttonXLoc+initShift[0]));
button.GetComponent<RectTransform>().anchoredPosition+=Vector2.down*(420*(buttonYLoc+initShift[1]));
btnTag="("+buttonXLoc+","+buttonYLoc+")";
button.name=btnQMLoc+"/"+btnType+btnTag;
button.GetComponent<Button>().name=btnType+btnTag;
}
publicvoidsetToolTip(stringbuttonToolTip)
{
button.GetComponent<UiTooltip>().field_Public_String_0=buttonToolTip;
button.GetComponent<UiTooltip>().field_Public_String_1=buttonToolTip;
}
publicvoidDestroyMe()
{
try
{
UnityEngine.Object.Destroy(button);
}
catch{}
}
publicvirtualvoidsetBackgroundColor(ColorbuttonBackgroundColor,boolsave=true){}
publicvirtualvoidsetTextColor(ColorbuttonTextColor,boolsave=true){}
}
publicclassQMSingleButton:QMButtonBase
{
publicQMSingleButton(QMNestedButtonbtnMenu,intbtnXLocation,intbtnYLocation,StringbtnText,System.ActionbtnAction,StringbtnToolTip,Color?btnBackgroundColor=null,Color?btnTextColor=null)
{
btnQMLoc=btnMenu.getMenuName();
initButton(btnXLocation,btnYLocation,btnText,btnAction,btnToolTip,btnBackgroundColor,btnTextColor);
}
publicQMSingleButton(stringbtnMenu,intbtnXLocation,intbtnYLocation,StringbtnText,System.ActionbtnAction,StringbtnToolTip,Color?btnBackgroundColor=null,Color?btnTextColor=null)
{
btnQMLoc=btnMenu;
initButton(btnXLocation,btnYLocation,btnText,btnAction,btnToolTip,btnBackgroundColor,btnTextColor);
}
privatevoidinitButton(intbtnXLocation,intbtnYLocation,StringbtnText,System.ActionbtnAction,StringbtnToolTip,Color?btnBackgroundColor=null,Color?btnTextColor=null)
{
btnType="SingleButton";
button=UnityEngine.Object.Instantiate(QMStuff.SingleButtonTemplate(),QMStuff.GetQuickMenuInstance().transform.Find(btnQMLoc),true);
initShift[0]=-1;
initShift[1]=0;
setLocation(btnXLocation,btnYLocation);
setButtonText(btnText);
setToolTip(btnToolTip);
setAction(btnAction);
if(btnBackgroundColor!=null)
setBackgroundColor((Color)btnBackgroundColor);
else
OrigBackground=button.GetComponentInChildren<UnityEngine.UI.Image>().color;
if(btnTextColor!=null)
setTextColor((Color)btnTextColor);
else
OrigText=button.GetComponentInChildren<Text>().color;
setActive(true);
QMButtonAPI.allSingleButtons.Add(this);
}
publicvoidsetButtonText(stringbuttonText)
{
button.GetComponentInChildren<Text>().text=buttonText;
}
publicvoidsetAction(System.ActionbuttonAction)
{
button.GetComponent<Button>().onClick=newButton.ButtonClickedEvent();
if(buttonAction!=null)
button.GetComponent<Button>().onClick.AddListener(UnhollowerRuntimeLib.DelegateSupport.ConvertDelegate<UnityAction>(buttonAction));
}
publicoverridevoidsetBackgroundColor(ColorbuttonBackgroundColor,boolsave=true)
{
//button.GetComponentInChildren<UnityEngine.UI.Image>().color = buttonBackgroundColor;
if(save)
OrigBackground=(Color)buttonBackgroundColor;
//UnityEngine.UI.Image[] btnBgColorList = ((btnOn.GetComponentsInChildren<UnityEngine.UI.Image>()).Concat(btnOff.GetComponentsInChildren<UnityEngine.UI.Image>()).ToArray()).Concat(button.GetComponentsInChildren<UnityEngine.UI.Image>()).ToArray();
//foreach (UnityEngine.UI.Image btnBackground in btnBgColorList) btnBackground.color = buttonBackgroundColor;
button.GetComponentInChildren<UnityEngine.UI.Button>().colors=newColorBlock()
{
colorMultiplier=1f,
disabledColor=Color.grey,
highlightedColor=buttonBackgroundColor*1.5f,
normalColor=buttonBackgroundColor/1.5f,
pressedColor=Color.grey*1.5f
};
}
publicoverridevoidsetTextColor(ColorbuttonTextColor,boolsave=true)
{
button.GetComponentInChildren<Text>().color=buttonTextColor;
if(save)
OrigText=(Color)buttonTextColor;
}
}
publicclassQMToggleButton:QMButtonBase
{
publicGameObjectbtnOn;
publicGameObjectbtnOff;
publicList<QMButtonBase>showWhenOn=newList<QMButtonBase>();
publicList<QMButtonBase>hideWhenOn=newList<QMButtonBase>();
publicboolshouldSaveInConfig=false;
System.ActionbtnOnAction=null;
System.ActionbtnOffAction=null;
publicQMToggleButton(QMNestedButtonbtnMenu,intbtnXLocation,intbtnYLocation,StringbtnTextOn,System.ActionbtnActionOn,StringbtnTextOff,System.ActionbtnActionOff,StringbtnToolTip,Color?btnBackgroundColor=null,Color?btnTextColor=null,boolshouldSaveInConfig=false,booldefaultPosition=false)
{
btnQMLoc=btnMenu.getMenuName();
initButton(btnXLocation,btnYLocation,btnTextOn,btnActionOn,btnTextOff,btnActionOff,btnToolTip,btnBackgroundColor,btnTextColor,shouldSaveInConfig,defaultPosition);
}
publicQMToggleButton(stringbtnMenu,intbtnXLocation,intbtnYLocation,StringbtnTextOn,System.ActionbtnActionOn,StringbtnTextOff,System.ActionbtnActionOff,StringbtnToolTip,Color?btnBackgroundColor=null,Color?btnTextColor=null,boolshouldSaveInConfig=false,booldefaultPosition=false)
{
btnQMLoc=btnMenu;
initButton(btnXLocation,btnYLocation,btnTextOn,btnActionOn,btnTextOff,btnActionOff,btnToolTip,btnBackgroundColor,btnTextColor,shouldSaveInConfig,defaultPosition);
}
privatevoidinitButton(intbtnXLocation,intbtnYLocation,StringbtnTextOn,System.ActionbtnActionOn,StringbtnTextOff,System.ActionbtnActionOff,StringbtnToolTip,Color?btnBackgroundColor=null,Color?btnTextColor=null,boolshouldSaveInConf=false,booldefaultPosition=false)
{
btnType="ToggleButton";
button=UnityEngine.Object.Instantiate<GameObject>(QMStuff.ToggleButtonTemplate(),QMStuff.GetQuickMenuInstance().transform.Find(btnQMLoc),true);
btnOn=button.transform.Find("Toggle_States_Visible/ON").gameObject;
btnOff=button.transform.Find("Toggle_States_Visible/OFF").gameObject;
initShift[0]=-3;
initShift[1]=-1;
setLocation(btnXLocation,btnYLocation);
setOnText(btnTextOn);
setOffText(btnTextOff);
Text[]btnTextsOn=btnOn.GetComponentsInChildren<Text>();
btnTextsOn[0].name="Text_ON";
btnTextsOn[0].resizeTextForBestFit=true;
btnTextsOn[1].name="Text_OFF";
btnTextsOn[1].resizeTextForBestFit=true;
Text[]btnTextsOff=btnOff.GetComponentsInChildren<Text>();
btnTextsOff[0].name="Text_ON";
btnTextsOff[0].resizeTextForBestFit=true;
btnTextsOff[1].name="Text_OFF";
btnTextsOff[1].resizeTextForBestFit=true;
setToolTip(btnToolTip);
//button.transform.GetComponentInChildren<UiTooltip>().SetToolTipBasedOnToggle();
setAction(btnActionOn,btnActionOff);
btnOn.SetActive(false);
btnOff.SetActive(true);
if(btnBackgroundColor!=null)
setBackgroundColor((Color)btnBackgroundColor);
else
OrigBackground=btnOn.GetComponentsInChildren<Text>().First().color;
if(btnTextColor!=null)
setTextColor((Color)btnTextColor);
else
OrigText=btnOn.GetComponentsInChildren<UnityEngine.UI.Image>().First().color;
setActive(true);
shouldSaveInConfig=shouldSaveInConf;
if(defaultPosition==true)// && !ButtonSettings.Contains(this))
{
setToggleState(true,false);
}
QMButtonAPI.allToggleButtons.Add(this);
//ButtonSettings.InitToggle(this);
}
publicoverridevoidsetBackgroundColor(ColorbuttonBackgroundColor,boolsave=true)
{
UnityEngine.UI.Image[]btnBgColorList=((btnOn.GetComponentsInChildren<UnityEngine.UI.Image>()).Concat(btnOff.GetComponentsInChildren<UnityEngine.UI.Image>()).ToArray()).Concat(button.GetComponentsInChildren<UnityEngine.UI.Image>()).ToArray();
foreach(UnityEngine.UI.ImagebtnBackgroundinbtnBgColorList)btnBackground.color=buttonBackgroundColor;
if(save)
OrigBackground=(Color)buttonBackgroundColor;
}
publicoverridevoidsetTextColor(ColorbuttonTextColor,boolsave=true)
{
Text[]btnTxtColorList=(btnOn.GetComponentsInChildren<Text>()).Concat(btnOff.GetComponentsInChildren<Text>()).ToArray();
foreach(TextbtnTextinbtnTxtColorList)btnText.color=buttonTextColor;
if(save)
OrigText=(Color)buttonTextColor;
}
publicvoidsetAction(System.ActionbuttonOnAction,System.ActionbuttonOffAction)
{
btnOnAction=buttonOnAction;
btnOffAction=buttonOffAction;
button.GetComponent<Button>().onClick=newButton.ButtonClickedEvent();
button.GetComponent<Button>().onClick.AddListener(UnhollowerRuntimeLib.DelegateSupport.ConvertDelegate<UnityAction>((System.Action)(()=>
{
if(btnOn.activeSelf)
{
setToggleState(false,true);
}
else
{
setToggleState(true,true);
}
})));
}
publicvoidsetToggleState(booltoggleOn,boolshouldInvoke=false)
{
btnOn.SetActive(toggleOn);
btnOff.SetActive(!toggleOn);
try
{
if(toggleOn&&shouldInvoke)
{
btnOnAction.Invoke();
showWhenOn.ForEach(x =>x.setActive(true));
hideWhenOn.ForEach(x =>x.setActive(false));
}
elseif(!toggleOn&&shouldInvoke)
{
btnOffAction.Invoke();
showWhenOn.ForEach(x =>x.setActive(false));
hideWhenOn.ForEach(x =>x.setActive(true));
}
}
catch{}
if(shouldSaveInConfig)
{
//ButtonSettings.UpdateToggle(this);
}
}
publicstringgetOnText()
{
returnbtnOn.GetComponentsInChildren<Text>()[0].text;
}
publicvoidsetOnText(stringbuttonOnText)
{
Text[]btnTextsOn=btnOn.GetComponentsInChildren<Text>();
btnTextsOn[0].text=buttonOnText;
Text[]btnTextsOff=btnOff.GetComponentsInChildren<Text>();
btnTextsOff[0].text=buttonOnText;
}
publicvoidsetOffText(stringbuttonOffText)
{
Text[]btnTextsOn=btnOn.GetComponentsInChildren<Text>();
btnTextsOn[1].text=buttonOffText;
Text[]btnTextsOff=btnOff.GetComponentsInChildren<Text>();
btnTextsOff[1].text=buttonOffText;
}
}
publicclassQMNestedButton
{
protectedQMSingleButtonmainButton;
protectedQMSingleButtonbackButton;
protectedstringmenuName;
protectedstringbtnQMLoc;
protectedstringbtnType;
publicQMNestedButton(QMNestedButtonbtnMenu,intbtnXLocation,intbtnYLocation,StringbtnText,StringbtnToolTip,Color?btnBackgroundColor=null,Color?btnTextColor=null,Color?backbtnBackgroundColor=null,Color?backbtnTextColor=null)
{
btnQMLoc=btnMenu.getMenuName();
initButton(btnXLocation,btnYLocation,btnText,btnToolTip,btnBackgroundColor,btnTextColor,backbtnBackgroundColor,backbtnTextColor);
}
publicQMNestedButton(stringbtnMenu,intbtnXLocation,intbtnYLocation,StringbtnText,StringbtnToolTip,Color?btnBackgroundColor=null,Color?btnTextColor=null,Color?backbtnBackgroundColor=null,Color?backbtnTextColor=null)
{
btnQMLoc=btnMenu;
initButton(btnXLocation,btnYLocation,btnText,btnToolTip,btnBackgroundColor,btnTextColor,backbtnBackgroundColor,backbtnTextColor);
}
publicvoidinitButton(intbtnXLocation,intbtnYLocation,StringbtnText,StringbtnToolTip,Color?btnBackgroundColor=null,Color?btnTextColor=null,Color?backbtnBackgroundColor=null,Color?backbtnTextColor=null)
{
btnType="NestedButton";
Transformmenu=UnityEngine.Object.Instantiate<Transform>(QMStuff.NestedMenuTemplate(),QMStuff.GetQuickMenuInstance().transform);
menuName=QMButtonAPI.identifier+btnQMLoc+"_"+btnXLocation+"_"+btnYLocation;
menu.name=menuName;
mainButton=newQMSingleButton(btnQMLoc,btnXLocation,btnYLocation,btnText,()=>{QMStuff.ShowQuickmenuPage(menuName);},btnToolTip,btnBackgroundColor,btnTextColor);
Il2CppSystem.Collections.IEnumeratorenumerator=menu.transform.GetEnumerator();
while(enumerator.MoveNext())
{
Il2CppSystem.Objectobj=enumerator.Current;
TransformbtnEnum=obj.Cast<Transform>();
if(btnEnum!=null)
{
UnityEngine.Object.Destroy(btnEnum.gameObject);
}
}
if(backbtnTextColor==null)
{
backbtnTextColor=Color.yellow;
}
QMButtonAPI.allNestedButtons.Add(this);
backButton=newQMSingleButton(this,5,2,"Back",()=>{QMStuff.ShowQuickmenuPage(btnQMLoc);},"Go Back",backbtnBackgroundColor,backbtnTextColor);
}
publicstringgetMenuName()
{
returnmenuName;
}
publicQMSingleButtongetMainButton()
{
returnmainButton;
}
publicQMSingleButtongetBackButton()
{
returnbackButton;
}
publicvoidDestroyMe()
{
mainButton.DestroyMe();
backButton.DestroyMe();
}
}
publicclassQMStuff
{
// Internal cache of the BoxCollider Background for the Quick Menu
privatestaticBoxColliderQuickMenuBackgroundReference;
// Internal cache of the Single Button Template for the Quick Menu
privatestaticGameObjectSingleButtonReference;
// Internal cache of the Toggle Button Template for the Quick Menu
privatestaticGameObjectToggleButtonReference;
// Internal cache of the Nested Menu Template for the Quick Menu
privatestaticTransformNestedButtonReference;
// Internal cache of the QuickMenu
privatestaticQuickMenuquickmenuInstance;
// Internal cache of the VRCUiManager
privatestaticVRCUiManagervrcuimInstance;
// Fetch the background from the Quick Menu
publicstaticBoxColliderQuickMenuBackground()
{
if(QuickMenuBackgroundReference==null)
QuickMenuBackgroundReference=GetQuickMenuInstance().GetComponent<BoxCollider>();
returnQuickMenuBackgroundReference;
}
// Fetch the Single Button Template from the Quick Menu
publicstaticGameObjectSingleButtonTemplate()
{
if(SingleButtonReference==null)
SingleButtonReference=GetQuickMenuInstance().transform.Find("ShortcutMenu/WorldsButton").gameObject;
returnSingleButtonReference;
}
// Fetch the Toggle Button Template from the Quick Menu
publicstaticGameObjectToggleButtonTemplate()
{
if(ToggleButtonReference==null)
{
ToggleButtonReference=GetQuickMenuInstance().transform.Find("UserInteractMenu/BlockButton").gameObject;
}
returnToggleButtonReference;
}
// Fetch the Nested Menu Template from the Quick Menu
publicstaticTransformNestedMenuTemplate()
{
if(NestedButtonReference==null)
{
NestedButtonReference=GetQuickMenuInstance().transform.Find("CameraMenu");
}
returnNestedButtonReference;
}
// Fetch the Quick Menu instance
publicstaticQuickMenuGetQuickMenuInstance()
{
if(quickmenuInstance==null)
{
quickmenuInstance=QuickMenu.prop_QuickMenu_0;
}
returnquickmenuInstance;
}
// Fetch the VRCUiManager instance
publicstaticVRCUiManagerGetVRCUiMInstance()
{
if(vrcuimInstance==null)
{
vrcuimInstance=VRCUiManager.prop_VRCUiManager_0;
}
returnvrcuimInstance;
}
// Cache the FieldInfo for getting the current page. Hope to god this works!
privatestaticFieldInfocurrentPageGetter;
privatestaticGameObjectshortcutMenu;
privatestaticGameObjectuserInteractMenu;
// Show a Quick Menu page via the Page Name. Hope to god this works!
publicstaticvoidShowQuickmenuPage(stringpagename)
{
QuickMenuquickmenu=GetQuickMenuInstance();
TransformpageTransform=quickmenu?.transform.Find(pagename);
if(pageTransform==null)
{
Console.WriteLine("[QMStuff] pageTransform is null !");
}
if(currentPageGetter==null)
{
GameObjectshortcutMenu=quickmenu.transform.Find("ShortcutMenu").gameObject;
if(!shortcutMenu.activeInHierarchy)
shortcutMenu=quickmenu.transform.Find("UserInteractMenu").gameObject;
FieldInfo[]fis=Il2CppType.Of<QuickMenu>().GetFields(BindingFlags.NonPublic|BindingFlags.Instance).Where((fi)=>fi.FieldType==Il2CppType.Of<GameObject>()).ToArray();
//MelonLoader.MelonModLogger.Log("[QMStuff] GameObject Fields in QuickMenu:");
intcount=0;
foreach(FieldInfofiinfis)
{
GameObjectvalue=fi.GetValue(quickmenu)?.TryCast<GameObject>();
if(value==shortcutMenu&&++count==2)
{
//MelonLoader.MelonModLogger.Log("[QMStuff] currentPage field: " + fi.Name);
currentPageGetter=fi;
break;
}
}
if(currentPageGetter==null)
{
Console.WriteLine("[QMStuff] Unable to find field currentPage in QuickMenu");
return;
}
}
currentPageGetter.GetValue(quickmenu)?.Cast<GameObject>().SetActive(false);
GameObjectinfoBar=GetQuickMenuInstance().transform.Find("QuickMenu_NewElements/_InfoBar").gameObject;
infoBar.SetActive(pagename=="ShortcutMenu");
QuickMenuContextualDisplayquickmenuContextualDisplay=GetQuickMenuInstance().field_Private_QuickMenuContextualDisplay_0;
quickmenuContextualDisplay.Method_Public_Void_EnumNPublicSealedvaUnNoToUs7vUsNoUnique_0(QuickMenuContextualDisplay.EnumNPublicSealedvaUnNoToUs7vUsNoUnique.NoSelection);
//quickmenuContextualDisplay.Method_Public_Nested0_0(QuickMenuContextualDisplay.Nested0.NoSelection);
pageTransform.gameObject.SetActive(true);
currentPageGetter.SetValue(quickmenu,pageTransform.gameObject);
if(shortcutMenu==null)
shortcutMenu=QuickMenu.prop_QuickMenu_0.transform.Find("ShortcutMenu")?.gameObject;
if(userInteractMenu==null)
userInteractMenu=QuickMenu.prop_QuickMenu_0.transform.Find("UserInteractMenu")?.gameObject;
if(pagename=="ShortcutMenu")
{
SetIndex(0);
}
elseif(pagename=="UserInteractMenu")
{
SetIndex(3);
}
else
{
SetIndex(-1);
shortcutMenu?.SetActive(false);
userInteractMenu?.SetActive(false);
}
}
// Set the current Quick Menu index
// VRChat Build 1101 - github.com/MintLily
publicstaticvoidSetIndex(intindex)
{
GetQuickMenuInstance().field_Private_EnumNPublicSealedvaUnShEmUsEmNoCaMo_nUnique_0=(QuickMenu.EnumNPublicSealedvaUnShEmUsEmNoCaMo_nUnique)index;
}
}
}