Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit dc2759c

Browse files
committed
1.7.2
unstrip fixes
1 parent 653b4a2 commit dc2759c

25 files changed

+305
-224
lines changed

src/CachedObjects/CacheObjectBase.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public void Draw(Rect window, float labelWidth = 215f)
379379

380380
if (MemInfo != null)
381381
{
382-
GUILayout.Label(RichTextName, new GUILayoutOption[] { GUILayout.Width(labelWidth) });
382+
GUIUnstrip.Label(RichTextName, new GUILayoutOption[] { GUILayout.Width(labelWidth) });
383383
}
384384
else
385385
{
@@ -408,15 +408,15 @@ public void Draw(Rect window, float labelWidth = 215f)
408408

409409
GUIUnstrip.BeginHorizontal();
410410

411-
GUILayout.Label(i.ToString(), new GUILayoutOption[] { GUILayout.Width(20) });
412-
m_argumentInput[i] = GUILayout.TextField(input, new GUILayoutOption[] { GUILayout.Width(150) });
413-
GUILayout.Label(label, null);
411+
GUIUnstrip.Label(i.ToString(), new GUILayoutOption[] { GUILayout.Width(20) });
412+
m_argumentInput[i] = GUIUnstrip.TextField(input, new GUILayoutOption[] { GUILayout.Width(150) });
413+
GUIUnstrip.Label(label);
414414

415415
GUIUnstrip.EndHorizontal();
416416
}
417417

418418
GUIUnstrip.BeginHorizontal();
419-
if (GUILayout.Button(EVALUATE_LABEL, new GUILayoutOption[] { GUILayout.Width(70) }))
419+
if (GUIUnstrip.Button(EVALUATE_LABEL, new GUILayoutOption[] { GUILayout.Width(70) }))
420420
{
421421
if (cm != null)
422422
{
@@ -427,15 +427,15 @@ public void Draw(Rect window, float labelWidth = 215f)
427427
UpdateValue();
428428
}
429429
}
430-
if (GUILayout.Button("Cancel", new GUILayoutOption[] { GUILayout.Width(70) }))
430+
if (GUIUnstrip.Button("Cancel", new GUILayoutOption[] { GUILayout.Width(70) }))
431431
{
432432
m_isEvaluating = false;
433433
}
434434
GUIUnstrip.EndHorizontal();
435435
}
436436
else
437437
{
438-
if (GUILayout.Button($"Evaluate ({m_arguments.Length} params)", new GUILayoutOption[] { GUILayout.Width(150) }))
438+
if (GUIUnstrip.Button($"Evaluate ({m_arguments.Length} params)", new GUILayoutOption[] { GUILayout.Width(150) }))
439439
{
440440
m_isEvaluating = true;
441441
}
@@ -452,7 +452,7 @@ public void Draw(Rect window, float labelWidth = 215f)
452452
{
453453
//GUIUnstrip.BeginHorizontal();
454454

455-
if (GUILayout.Button(EVALUATE_LABEL, new GUILayoutOption[] { GUILayout.Width(70) }))
455+
if (GUIUnstrip.Button(EVALUATE_LABEL, new GUILayoutOption[] { GUILayout.Width(70) }))
456456
{
457457
cm.Evaluate();
458458
}
@@ -465,15 +465,15 @@ public void Draw(Rect window, float labelWidth = 215f)
465465

466466
if (!string.IsNullOrEmpty(ReflectionException))
467467
{
468-
GUILayout.Label("<color=red>Reflection failed!</color> (" + ReflectionException + ")", null);
468+
GUIUnstrip.Label("<color=red>Reflection failed!</color> (" + ReflectionException + ")");
469469
}
470470
else if ((HasParameters || this is CacheMethod) && !m_evaluated)
471471
{
472-
GUILayout.Label($"<color=grey><i>Not yet evaluated</i></color> (<color=#2df7b2>{ValueTypeName}</color>)", null);
472+
GUIUnstrip.Label($"<color=grey><i>Not yet evaluated</i></color> (<color=#2df7b2>{ValueTypeName}</color>)");
473473
}
474474
else if (Value == null && !(this is CacheMethod))
475475
{
476-
GUILayout.Label("<i>null (" + ValueTypeName + ")</i>", null);
476+
GUIUnstrip.Label("<i>null (" + ValueTypeName + ")</i>");
477477
}
478478
else
479479
{

src/CachedObjects/Object/CacheDictionary.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public override void DrawValue(Rect window, float width)
202202
{
203203
if (m_cachedKeys == null || m_cachedValues == null)
204204
{
205-
GUILayout.Label("Cached keys or values is null!", null);
205+
GUIUnstrip.Label("Cached keys or values is null!");
206206
return;
207207
}
208208

@@ -212,14 +212,14 @@ public override void DrawValue(Rect window, float width)
212212

213213
if (!IsExpanded)
214214
{
215-
if (GUILayout.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
215+
if (GUIUnstrip.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
216216
{
217217
IsExpanded = true;
218218
}
219219
}
220220
else
221221
{
222-
if (GUILayout.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
222+
if (GUIUnstrip.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
223223
{
224224
IsExpanded = false;
225225
}
@@ -229,7 +229,7 @@ public override void DrawValue(Rect window, float width)
229229

230230
GUI.skin.button.alignment = TextAnchor.MiddleLeft;
231231
string btnLabel = $"[{count}] <color=#2df7b2>Dictionary<{TypeOfKeys.FullName}, {TypeOfValues.FullName}></color>";
232-
if (GUILayout.Button(btnLabel, new GUILayoutOption[] { GUILayout.Width(negativeWhitespace) }))
232+
if (GUIUnstrip.Button(btnLabel, new GUILayoutOption[] { GUILayout.Width(negativeWhitespace) }))
233233
{
234234
WindowManager.InspectObject(Value, out bool _);
235235
}
@@ -251,11 +251,11 @@ public override void DrawValue(Rect window, float width)
251251
Pages.CurrentPageLabel();
252252

253253
// prev/next page buttons
254-
if (GUILayout.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(60) }))
254+
if (GUIUnstrip.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(60) }))
255255
{
256256
Pages.TurnPage(Turn.Left);
257257
}
258-
if (GUILayout.Button("Next >", new GUILayoutOption[] { GUILayout.Width(60) }))
258+
if (GUIUnstrip.Button("Next >", new GUILayoutOption[] { GUILayout.Width(60) }))
259259
{
260260
Pages.TurnPage(Turn.Right);
261261
}
@@ -280,17 +280,17 @@ public override void DrawValue(Rect window, float width)
280280

281281
if (key == null || val == null)
282282
{
283-
GUILayout.Label($"[{i}] <i><color=grey>(null)</color></i>", null);
283+
GUIUnstrip.Label($"[{i}] <i><color=grey>(null)</color></i>");
284284
}
285285
else
286286
{
287287
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
288-
GUILayout.Label($"[{i}]", new GUILayoutOption[] { GUILayout.Width(30) });
288+
GUIUnstrip.Label($"[{i}]", new GUILayoutOption[] { GUILayout.Width(30) });
289289

290-
GUILayout.Label("Key:", new GUILayoutOption[] { GUILayout.Width(40) });
290+
GUIUnstrip.Label("Key:", new GUILayoutOption[] { GUILayout.Width(40) });
291291
key.DrawValue(window, (window.width / 2) - 30f);
292292

293-
GUILayout.Label("Value:", new GUILayoutOption[] { GUILayout.Width(40) });
293+
GUIUnstrip.Label("Value:", new GUILayoutOption[] { GUILayout.Width(40) });
294294
val.DrawValue(window, (window.width / 2) - 30f);
295295
}
296296

src/CachedObjects/Object/CacheList.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public override void DrawValue(Rect window, float width)
264264
{
265265
if (m_cachedEntries == null)
266266
{
267-
GUILayout.Label("m_cachedEntries is null!", null);
267+
GUIUnstrip.Label("m_cachedEntries is null!");
268268
return;
269269
}
270270

@@ -274,14 +274,14 @@ public override void DrawValue(Rect window, float width)
274274

275275
if (!IsExpanded)
276276
{
277-
if (GUILayout.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
277+
if (GUIUnstrip.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
278278
{
279279
IsExpanded = true;
280280
}
281281
}
282282
else
283283
{
284-
if (GUILayout.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
284+
if (GUIUnstrip.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
285285
{
286286
IsExpanded = false;
287287
}
@@ -291,7 +291,7 @@ public override void DrawValue(Rect window, float width)
291291

292292
GUI.skin.button.alignment = TextAnchor.MiddleLeft;
293293
string btnLabel = $"[{count}] <color=#2df7b2>{EntryType.FullName}</color>";
294-
if (GUILayout.Button(btnLabel, new GUILayoutOption[] { GUILayout.MaxWidth(negativeWhitespace) }))
294+
if (GUIUnstrip.Button(btnLabel, new GUILayoutOption[] { GUILayout.MaxWidth(negativeWhitespace) }))
295295
{
296296
WindowManager.InspectObject(Value, out bool _);
297297
}
@@ -313,11 +313,11 @@ public override void DrawValue(Rect window, float width)
313313
Pages.CurrentPageLabel();
314314

315315
// prev/next page buttons
316-
if (GUILayout.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(60) }))
316+
if (GUIUnstrip.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(60) }))
317317
{
318318
Pages.TurnPage(Turn.Left);
319319
}
320-
if (GUILayout.Button("Next >", new GUILayoutOption[] { GUILayout.Width(60) }))
320+
if (GUIUnstrip.Button("Next >", new GUILayoutOption[] { GUILayout.Width(60) }))
321321
{
322322
Pages.TurnPage(Turn.Right);
323323
}
@@ -341,12 +341,12 @@ public override void DrawValue(Rect window, float width)
341341

342342
if (entry == null || entry.Value == null)
343343
{
344-
GUILayout.Label($"[{i}] <i><color=grey>(null)</color></i>", null);
344+
GUIUnstrip.Label($"[{i}] <i><color=grey>(null)</color></i>");
345345
}
346346
else
347347
{
348348
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
349-
GUILayout.Label($"[{i}]", new GUILayoutOption[] { GUILayout.Width(30) });
349+
GUIUnstrip.Label($"[{i}]", new GUILayoutOption[] { GUILayout.Width(30) });
350350

351351
entry.DrawValue(window, window.width - (whitespace + 85));
352352
}

src/CachedObjects/Other/CacheMethod.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ public override void DrawValue(Rect window, float width)
7878
}
7979
else
8080
{
81-
GUILayout.Label($"null (<color=#2df7b2>{ValueTypeName}</color>)", null);
81+
GUIUnstrip.Label($"null (<color=#2df7b2>{ValueTypeName}</color>)");
8282
}
8383
}
8484
else
8585
{
86-
GUILayout.Label($"<color=grey><i>Not yet evaluated</i></color> (<color=#2df7b2>{ValueTypeName}</color>)", null);
86+
GUIUnstrip.Label($"<color=grey><i>Not yet evaluated</i></color> (<color=#2df7b2>{ValueTypeName}</color>)");
8787
}
8888
}
8989
}

src/CachedObjects/Other/CacheOther.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public override void DrawValue(Rect window, float width)
5555
}
5656

5757
GUI.skin.button.alignment = TextAnchor.MiddleLeft;
58-
if (GUILayout.Button(label, new GUILayoutOption[] { GUILayout.Width(width - 15) }))
58+
if (GUIUnstrip.Button(label, new GUILayoutOption[] { GUILayout.Width(width - 15) }))
5959
{
6060
WindowManager.InspectObject(Value, out bool _);
6161
}

src/CachedObjects/Struct/CacheColor.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ public override void DrawValue(Rect window, float width)
3535
{
3636
if (!IsExpanded)
3737
{
38-
if (GUILayout.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
38+
if (GUIUnstrip.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
3939
{
4040
IsExpanded = true;
4141
}
4242
}
4343
else
4444
{
45-
if (GUILayout.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
45+
if (GUIUnstrip.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
4646
{
4747
IsExpanded = false;
4848
}
@@ -51,7 +51,7 @@ public override void DrawValue(Rect window, float width)
5151

5252
//var c = (Color)Value;
5353
//GUI.color = c;
54-
GUILayout.Label($"<color=#2df7b2>Color:</color> {((Color)Value).ToString()}", null);
54+
GUIUnstrip.Label($"<color=#2df7b2>Color:</color> {((Color)Value).ToString()}");
5555
//GUI.color = Color.white;
5656

5757
if (CanWrite && IsExpanded)
@@ -62,32 +62,32 @@ public override void DrawValue(Rect window, float width)
6262

6363
GUIUnstrip.BeginHorizontal();
6464
GUIUnstrip.Space(whitespace);
65-
GUILayout.Label("R:", new GUILayoutOption[] { GUILayout.Width(30) });
66-
r = GUILayout.TextField(r, new GUILayoutOption[] { GUILayout.Width(120) });
65+
GUIUnstrip.Label("R:", new GUILayoutOption[] { GUILayout.Width(30) });
66+
r = GUIUnstrip.TextField(r, new GUILayoutOption[] { GUILayout.Width(120) });
6767
GUIUnstrip.EndHorizontal();
6868

6969
GUIUnstrip.BeginHorizontal();
7070
GUIUnstrip.Space(whitespace);
71-
GUILayout.Label("G:", new GUILayoutOption[] { GUILayout.Width(30) });
72-
g = GUILayout.TextField(g, new GUILayoutOption[] { GUILayout.Width(120) });
71+
GUIUnstrip.Label("G:", new GUILayoutOption[] { GUILayout.Width(30) });
72+
g = GUIUnstrip.TextField(g, new GUILayoutOption[] { GUILayout.Width(120) });
7373
GUIUnstrip.EndHorizontal();
7474

7575
GUIUnstrip.BeginHorizontal();
7676
GUIUnstrip.Space(whitespace);
77-
GUILayout.Label("B:", new GUILayoutOption[] { GUILayout.Width(30) });
78-
b = GUILayout.TextField(b, new GUILayoutOption[] { GUILayout.Width(120) });
77+
GUIUnstrip.Label("B:", new GUILayoutOption[] { GUILayout.Width(30) });
78+
b = GUIUnstrip.TextField(b, new GUILayoutOption[] { GUILayout.Width(120) });
7979
GUIUnstrip.EndHorizontal();
8080

8181
GUIUnstrip.BeginHorizontal();
8282
GUIUnstrip.Space(whitespace);
83-
GUILayout.Label("A:", new GUILayoutOption[] { GUILayout.Width(30) });
84-
a = GUILayout.TextField(a, new GUILayoutOption[] { GUILayout.Width(120) });
83+
GUIUnstrip.Label("A:", new GUILayoutOption[] { GUILayout.Width(30) });
84+
a = GUIUnstrip.TextField(a, new GUILayoutOption[] { GUILayout.Width(120) });
8585
GUIUnstrip.EndHorizontal();
8686

8787
// draw set value button
8888
GUIUnstrip.BeginHorizontal();
8989
GUIUnstrip.Space(whitespace);
90-
if (GUILayout.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) }))
90+
if (GUIUnstrip.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) }))
9191
{
9292
SetValueFromInput();
9393
}

src/CachedObjects/Struct/CacheEnum.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ public override void DrawValue(Rect window, float width)
3939
{
4040
if (CanWrite)
4141
{
42-
if (GUILayout.Button("<", new GUILayoutOption[] { GUILayout.Width(25) }))
42+
if (GUIUnstrip.Button("<", new GUILayoutOption[] { GUILayout.Width(25) }))
4343
{
4444
SetEnum(ref Value, -1);
4545
SetValue();
4646
}
47-
if (GUILayout.Button(">", new GUILayoutOption[] { GUILayout.Width(25) }))
47+
if (GUIUnstrip.Button(">", new GUILayoutOption[] { GUILayout.Width(25) }))
4848
{
4949
SetEnum(ref Value, 1);
5050
SetValue();
5151
}
5252
}
5353

54-
GUILayout.Label(Value.ToString() + "<color=#2df7b2><i> (" + ValueType + ")</i></color>", null);
54+
GUIUnstrip.Label(Value.ToString() + "<color=#2df7b2><i> (" + ValueType + ")</i></color>");
5555
}
5656

5757
public void SetEnum(ref object value, int change)

src/CachedObjects/Struct/CachePrimitive.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,38 +55,38 @@ public override void DrawValue(Rect window, float width)
5555

5656
if (CanWrite)
5757
{
58-
b = GUILayout.Toggle(b, label, null);
58+
b = GUIUnstrip.Toggle(b, label);
5959
if (b != (bool)Value)
6060
{
6161
SetValueFromInput(b.ToString());
6262
}
6363
}
6464
else
6565
{
66-
GUILayout.Label(label, null);
66+
GUIUnstrip.Label(label);
6767
}
6868
}
6969
else
7070
{
7171
// using ValueType.Name instead of ValueTypeName, because we only want the short name.
72-
GUILayout.Label("<color=#2df7b2><i>" + ValueType.Name + "</i></color>", new GUILayoutOption[] { GUILayout.Width(50) });
72+
GUIUnstrip.Label("<color=#2df7b2><i>" + ValueType.Name + "</i></color>", new GUILayoutOption[] { GUILayout.Width(50) });
7373

7474
int dynSize = 25 + (m_valueToString.Length * 15);
7575
var maxwidth = window.width - 310f;
7676
if (CanWrite) maxwidth -= 60;
7777

7878
if (dynSize > maxwidth)
7979
{
80-
m_valueToString = GUILayout.TextArea(m_valueToString, new GUILayoutOption[] { GUILayout.MaxWidth(maxwidth) });
80+
m_valueToString = GUIUnstrip.TextArea(m_valueToString, new GUILayoutOption[] { GUILayout.MaxWidth(maxwidth) });
8181
}
8282
else
8383
{
84-
m_valueToString = GUILayout.TextField(m_valueToString, new GUILayoutOption[] { GUILayout.MaxWidth(dynSize) });
84+
m_valueToString = GUIUnstrip.TextField(m_valueToString, new GUILayoutOption[] { GUILayout.MaxWidth(dynSize) });
8585
}
8686

8787
if (CanWrite)
8888
{
89-
if (GUILayout.Button("<color=#00FF00>Apply</color>", new GUILayoutOption[] { GUILayout.Width(60) }))
89+
if (GUIUnstrip.Button("<color=#00FF00>Apply</color>", new GUILayoutOption[] { GUILayout.Width(60) }))
9090
{
9191
SetValueFromInput(m_valueToString);
9292
}

0 commit comments

Comments
 (0)