13
13
14
14
namespace Explorer
15
15
{
16
- // This is a copy+paste of UnityEngine source code, fixed for Il2Cpp.
17
- // Taken from dnSpy output using Unity 2018.4.20.
18
-
19
- // Subject to Unity's License and ToS.
20
- // https://unity3d.com/legal/terms-of-service
21
- // https://unity3d.com/legal/terms-of-service/software
22
-
23
16
public class GUIUnstrip
24
17
{
25
18
public static int s_ScrollControlId ;
@@ -41,9 +34,6 @@ private static GenericStack ScrollStack
41
34
42
35
// ======= public methods ======= //
43
36
44
- // Fix for GUILayoutUtility.GetLastRect().
45
- // Calls UnstripExtensions.GetLastUnstripped().
46
-
47
37
public static Rect GetLastRect ( )
48
38
{
49
39
EventType type = Event . current . type ;
@@ -59,8 +49,6 @@ public static Rect GetLastRect()
59
49
return last ;
60
50
}
61
51
62
- // Simple unstrips for HorizontalScrollbar and VerticalScrollbar, they just call the Scroller unstrip.
63
-
64
52
public static float HorizontalScrollbar ( Rect position , float value , float size , float leftValue , float rightValue , GUIStyle style )
65
53
{
66
54
return Scroller_Impl ( position , value , size , leftValue , rightValue , style ,
@@ -80,7 +68,6 @@ public static float VerticalScrollbar(Rect position, float value, float size, fl
80
68
}
81
69
82
70
// Fix for BeginScrollView.
83
- // Uses several manually unstripped methods.
84
71
85
72
public static Vector2 BeginScrollView ( Vector2 scroll , params GUILayoutOption [ ] options )
86
73
{
@@ -98,7 +85,7 @@ public static Vector2 BeginScrollView(Vector2 scroll, params GUILayoutOption[] o
98
85
}
99
86
}
100
87
101
- // Try manual unstripping implementation.
88
+ // Try manual implementation.
102
89
if ( ! ManualUnstripFailed )
103
90
{
104
91
try
@@ -107,7 +94,7 @@ public static Vector2 BeginScrollView(Vector2 scroll, params GUILayoutOption[] o
107
94
}
108
95
catch ( Exception e )
109
96
{
110
- MelonLogger . Log ( "Exception on GUIUnstrip.BeginScrollView_Impl : " + e . GetType ( ) + ", " + e . Message + "\r \n " + e . StackTrace ) ;
97
+ MelonLogger . Log ( "Exception on GUIUnstrip.BeginScrollView_ImplLayout : " + e . GetType ( ) + ", " + e . Message + "\r \n " + e . StackTrace ) ;
111
98
112
99
ManualUnstripFailed = true ;
113
100
return scroll ;
@@ -136,8 +123,6 @@ public static void EndScrollView(bool handleScrollWheel = true)
136
123
137
124
// ======= private methods ======= //
138
125
139
- // Actual unstrip of GUILayout.BeginScrollView()
140
-
141
126
private static Vector2 BeginScrollView_ImplLayout ( Vector2 scrollPosition , bool alwaysShowHorizontal , bool alwaysShowVertical ,
142
127
GUIStyle horizontalScrollbar , GUIStyle verticalScrollbar , GUIStyle background , params GUILayoutOption [ ] options )
143
128
{
@@ -171,8 +156,6 @@ private static Vector2 BeginScrollView_ImplLayout(Vector2 scrollPosition, bool a
171
156
) ;
172
157
}
173
158
174
- // Actual unstrip of GUI.BeginScrollView()
175
-
176
159
private static Vector2 BeginScrollView_Impl ( Rect position , Vector2 scrollPosition , Rect viewRect , bool alwaysShowHorizontal ,
177
160
bool alwaysShowVertical , GUIStyle horizontalScrollbar , GUIStyle verticalScrollbar , GUIStyle background )
178
161
{
@@ -296,8 +279,6 @@ private static Vector2 BeginScrollView_Impl(Rect position, Vector2 scrollPositio
296
279
return scrollPosition ;
297
280
}
298
281
299
- // Actual unstrip of GUI.EndScrollView()
300
-
301
282
private static void EndScrollView_Impl ( bool handleScrollWheel )
302
283
{
303
284
GUIUtility . CheckOnGUI ( ) ;
@@ -336,8 +317,6 @@ private static void EndScrollView_Impl(bool handleScrollWheel)
336
317
}
337
318
}
338
319
339
- // Actual unstrip of GUI.Scroller
340
-
341
320
private static float Scroller_Impl ( Rect position , float value , float size , float leftValue , float rightValue , GUIStyle slider , GUIStyle thumb , GUIStyle leftButton , GUIStyle rightButton , bool horiz )
342
321
{
343
322
GUIUtility . CheckOnGUI ( ) ;
@@ -384,8 +363,6 @@ private static float Scroller_Impl(Rect position, float value, float size, float
384
363
return value ;
385
364
}
386
365
387
- // Actual unstrip of GUI.Slider
388
-
389
366
public static float Slider ( Rect position , float value , float size , float start , float end , GUIStyle slider , GUIStyle thumb , bool horiz , int id )
390
367
{
391
368
if ( id == 0 )
@@ -396,8 +373,6 @@ public static float Slider(Rect position, float value, float size, float start,
396
373
return sliderHandler . Handle ( ) ;
397
374
}
398
375
399
- // Actual unstrip of GUI.ScrollerRepeatButton
400
-
401
376
private static bool ScrollerRepeatButton_Impl ( int scrollerID , Rect rect , GUIStyle style )
402
377
{
403
378
bool result = false ;
0 commit comments