@@ -9,7 +9,7 @@ namespace ReMod.Core.VRChat
9
9
{
10
10
public static class QuickMenuExtensions
11
11
{
12
- public delegate void ShowConfirmDialogDelegate ( UIMenu uiMenu , string title , string body , Il2CppSystem . Action onYes , Il2CppSystem . Action onNo = null ) ;
12
+ public delegate void ShowConfirmDialogDelegate ( UIMenu uiMenu , string title , string body , Il2CppSystem . Action onYes , Il2CppSystem . Action onNo = null , string confirmText = "Yes" , string declineText = "No" ) ;
13
13
private static ShowConfirmDialogDelegate _showConfirmDialogDelegate ;
14
14
15
15
private static ShowConfirmDialogDelegate ShowConfirmDialogFn
@@ -21,7 +21,7 @@ private static ShowConfirmDialogDelegate ShowConfirmDialogFn
21
21
22
22
var showConfirmDialogFn = typeof ( UIMenu ) . GetMethods ( ) . FirstOrDefault ( m =>
23
23
{
24
- if ( ! m . Name . Contains ( "Public_Void_String_String_Action_Action_PDM_ " ) )
24
+ if ( ! m . Name . Contains ( "Public_Void_String_String_Action_Action_String_String_ " ) )
25
25
return false ;
26
26
27
27
return XrefUtils . CheckMethod ( m , "ConfirmDialog" ) ;
@@ -49,7 +49,7 @@ private static ShowConfirmDialogWithCancelDelegate ShowConfirmDialogWithCancelFn
49
49
50
50
var showConfirmDialogWithCancelFn = typeof ( UIMenu ) . GetMethods ( ) . FirstOrDefault ( m =>
51
51
{
52
- if ( ! m . Name . Contains ( "Method_Public_Void_String_String_String_String_String_Action_Action_Action " ) )
52
+ if ( ! m . Name . Contains ( "Method_Public_Void_String_String_String_String_String_Action_Action_Action_ " ) )
53
53
return false ;
54
54
55
55
return XrefUtils . CheckMethod ( m , "ConfirmDialog" ) ;
@@ -72,7 +72,7 @@ private static ShowAlertDialogDelegate ShowAlertDialogFn
72
72
73
73
var showAlertDialogFn = typeof ( UIMenu ) . GetMethods ( ) . FirstOrDefault ( m =>
74
74
{
75
- if ( ! m . Name . Contains ( "Method_Public_Void_String_String_Action_PDM " ) )
75
+ if ( ! m . Name . Contains ( "Method_Public_Void_String_String_Action_String_Boolean_PDM " ) )
76
76
return false ;
77
77
78
78
return XrefUtils . CheckMethod ( m , "ConfirmDialog" ) ;
@@ -82,10 +82,15 @@ private static ShowAlertDialogDelegate ShowAlertDialogFn
82
82
return _showAlertDialogDelegate ;
83
83
}
84
84
}
85
+
86
+ public static void ShowConfirmDialog ( this UIMenu uiMenu , string title , string body , Action onYes , Action onNo = null )
87
+ {
88
+ ShowConfirmDialog ( uiMenu , title , body , "Yes" , "No" , onYes , onNo ) ;
89
+ }
85
90
86
- public static void ShowConfirmDialog ( this UIMenu uiMenu , string title , string body , Action onYes , Action onNo = null )
91
+ public static void ShowConfirmDialog ( this UIMenu uiMenu , string title , string body , string confirmText , string declineText , Action onYes , Action onNo = null )
87
92
{
88
- ShowConfirmDialogFn . Invoke ( uiMenu , title , body , onYes , onNo ) ;
93
+ ShowConfirmDialogFn . Invoke ( uiMenu , title , body , onYes , onNo , confirmText , declineText ) ;
89
94
}
90
95
91
96
public static void ShowConfirmDialogWithCancel ( this UIMenu uiMenu , string title , string body , string yesLabel , string noLabel , string cancelLabel , Action onYes , Action onNo , Action onCancel )
@@ -94,6 +99,11 @@ public static void ShowConfirmDialogWithCancel(this UIMenu uiMenu, string title,
94
99
}
95
100
96
101
public static void ShowAlertDialog ( this UIMenu uiMenu , string title , string body , Action onClose = null )
102
+ {
103
+ ShowAlertDialog ( uiMenu , title , body , "Close" , onClose ) ;
104
+ }
105
+
106
+ public static void ShowAlertDialog ( this UIMenu uiMenu , string title , string body , string closeText , Action onClose = null )
97
107
{
98
108
ShowAlertDialogFn . Invoke ( uiMenu , title , body , onClose ) ;
99
109
}
0 commit comments