@@ -84,7 +84,7 @@ public void SetCell(HookCell cell, int index)
84
84
cell . CurrentDisplayedIndex = index ;
85
85
var hook = ( HookInstance ) this . currentHooks [ index ] ;
86
86
87
- cell . MethodNameLabel . text = HighlightMethod ( hook . TargetMethod ) ;
87
+ cell . MethodNameLabel . text = SignatureHighlighter . HighlightMethod ( hook . TargetMethod ) ;
88
88
89
89
cell . ToggleActiveButton . ButtonText . text = hook . Enabled ? "Enabled" : "Disabled" ;
90
90
RuntimeProvider . Instance . SetColorBlockAuto ( cell . ToggleActiveButton . Component ,
@@ -183,7 +183,7 @@ public void SetCell(AddHookCell cell, int index)
183
183
cell . CurrentDisplayedIndex = index ;
184
184
var method = this . filteredEligableMethods [ index ] ;
185
185
186
- cell . MethodNameLabel . text = HighlightMethod ( method ) ;
186
+ cell . MethodNameLabel . text = SignatureHighlighter . HighlightMethod ( method ) ;
187
187
188
188
var sig = method . FullDescription ( ) ;
189
189
if ( hookedSignatures . Contains ( sig ) )
@@ -225,50 +225,5 @@ public void EditorInputSave()
225
225
Panel . SetPage ( HookManagerPanel . Pages . CurrentHooks ) ;
226
226
}
227
227
}
228
-
229
- // ~~~~~~~~~~ Method syntax highlighting
230
-
231
- private static readonly Dictionary < string , string > highlightedMethods = new Dictionary < string , string > ( ) ;
232
-
233
- private string HighlightMethod ( MethodInfo method )
234
- {
235
- var sig = method . FullDescription ( ) ;
236
- if ( highlightedMethods . ContainsKey ( sig ) )
237
- return highlightedMethods [ sig ] ;
238
-
239
- var sb = new StringBuilder ( ) ;
240
-
241
- // declaring type
242
- sb . Append ( SignatureHighlighter . Parse ( method . DeclaringType , false ) ) ;
243
- sb . Append ( '.' ) ;
244
-
245
- // method name
246
- var color = ! method . IsStatic
247
- ? SignatureHighlighter . METHOD_INSTANCE
248
- : SignatureHighlighter . METHOD_STATIC ;
249
- sb . Append ( $ "<color={ color } >{ method . Name } </color>") ;
250
-
251
- // arguments
252
- sb . Append ( '(' ) ;
253
- var args = method . GetParameters ( ) ;
254
- if ( args != null && args . Any ( ) )
255
- {
256
- int i = 0 ;
257
- foreach ( var param in args )
258
- {
259
- sb . Append ( SignatureHighlighter . Parse ( param . ParameterType , false ) ) ;
260
- sb . Append ( ' ' ) ;
261
- sb . Append ( $ "<color={ SignatureHighlighter . LOCAL_ARG } >{ param . Name } </color>") ;
262
- i ++ ;
263
- if ( i < args . Length )
264
- sb . Append ( ", " ) ;
265
- }
266
- }
267
- sb . Append ( ')' ) ;
268
-
269
- var ret = sb . ToString ( ) ;
270
- highlightedMethods . Add ( sig , ret ) ;
271
- return ret ;
272
- }
273
228
}
274
229
}
0 commit comments