Skip to content

Commit 46aeb8e

Browse files
committed
Some Buttons -> Label
1 parent 0620510 commit 46aeb8e

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

KeyViewer/Core/Drawer.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,14 @@ public static bool DrawVectorConfig(VectorConfig vConfig) {
277277
}
278278
public static bool DrawVector2WithSlider(string label, ref Vector2 vec2, float lValue, float rValue) {
279279
bool result = false;
280-
Drawer.Button($"<b>{label}</b>");
280+
GUILayout.Label($"<b>{label}</b>");
281281
result |= DrawSingleWithSlider("X:", ref vec2.x, lValue, rValue, 300f);
282282
result |= DrawSingleWithSlider("Y:", ref vec2.y, lValue, rValue, 300f);
283283
return result;
284284
}
285285
public static bool DrawVector3WithSlider(string label, ref Vector3 vec3, float lValue, float rValue) {
286286
bool result = false;
287-
Drawer.Button($"<b>{label}</b>");
287+
GUILayout.Label($"<b>{label}</b>");
288288
result |= DrawSingleWithSlider("X:", ref vec3.x, lValue, rValue, 300f);
289289
result |= DrawSingleWithSlider("Y:", ref vec3.y, lValue, rValue, 300f);
290290
result |= DrawSingleWithSlider("Z:", ref vec3.z, lValue, rValue, 300f);
@@ -304,7 +304,7 @@ public static bool DrawPressReleaseBase<T>(string label, PressRelease<T> pr, Cus
304304
GUILayoutEx.ExpandableGUI((Action)(() => {
305305
begin(emptyOptions);
306306
{
307-
Drawer.Button(Main.Lang.Get("MISC_PRESSED", "Pressed"));
307+
GUILayout.Label(Main.Lang.Get("MISC_PRESSED", "Pressed"));
308308
changed |= drawer(ref pr.Pressed);
309309
}
310310
end();
@@ -322,7 +322,7 @@ public static bool DrawPressReleaseBase<T>(string label, PressRelease<T> pr, Cus
322322

323323
begin(emptyOptions);
324324
{
325-
Drawer.Button(Main.Lang.Get("MISC_RELEASED", "Released"));
325+
GUILayout.Label(Main.Lang.Get("MISC_RELEASED", "Released"));
326326
changed |= drawer(ref pr.Released);
327327
}
328328
end();
@@ -376,7 +376,7 @@ public static bool DrawStringArray(ref string[] array, Action<int> arrayResized
376376
for(int i = 0; i < array.Length; i++) {
377377
string cache = array[i];
378378
GUILayout.BeginHorizontal();
379-
Drawer.Button($"{i}: ");
379+
GUILayout.Label($"{i}: ");
380380
cache = GUILayout.TextField(cache);
381381
elementRightGUI?.Invoke(i);
382382
GUILayout.FlexibleSpace();
@@ -390,7 +390,7 @@ public static bool DrawStringArray(ref string[] array, Action<int> arrayResized
390390
}
391391
public static bool DrawArray(string label, ref object[] array) {
392392
bool result = false;
393-
Drawer.Button(label);
393+
GUILayout.Label(label);
394394
GUILayout.BeginVertical();
395395

396396
GUILayout.BeginHorizontal();
@@ -608,7 +608,7 @@ public static bool DrawObject(string label, ref object obj) {
608608
obj = str;
609609
break;
610610
default:
611-
Drawer.Button($"{label}{obj}");
611+
GUILayout.Label($"{label}{obj}");
612612
break;
613613
}
614614
return result;

KeyViewer/Core/GUILayoutEx.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static void ExpandableGUI(Action enGui, Action disGui, Action onEnable, A
5252
});
5353
if (!string.IsNullOrEmpty(desc))
5454
{
55-
Drawer.Button("-");
55+
GUILayout.Label("-");
5656
GUILayout.Label(
5757
desc,
5858
new GUIStyle(GUI.skin.label) { fontStyle = FontStyle.Bold });
@@ -349,12 +349,12 @@ public static float NamedSliderContent(
349349
{
350350
if (labelWidth == 0)
351351
{
352-
Drawer.Button(name);
352+
GUILayout.Label(name);
353353
GUILayout.Space(4f);
354354
}
355355
else
356356
{
357-
Drawer.Button(name, GUILayout.Width(labelWidth));
357+
GUILayout.Label(name, GUILayout.Width(labelWidth));
358358
}
359359
float newValue =
360360
GUILayout.HorizontalSlider(
@@ -365,7 +365,7 @@ public static float NamedSliderContent(
365365
}
366366
GUILayout.Space(8f);
367367
if (valueFormat != "{0}")
368-
Drawer.Button(string.Format(valueFormat, newValue));
368+
GUILayout.Label(string.Format(valueFormat, newValue));
369369
else newValue = StringConverter.ToFloat(GUILayout.TextField(newValue.ToString("F4")));
370370
GUILayout.FlexibleSpace();
371371
return newValue;
@@ -439,12 +439,12 @@ private static string NamedTextFieldContent(
439439
{
440440
if (labelWidth == 0)
441441
{
442-
Drawer.Button(name);
442+
GUILayout.Label(name);
443443
GUILayout.Space(4f);
444444
}
445445
else
446446
{
447-
Drawer.Button(name, GUILayout.Width(labelWidth));
447+
GUILayout.Label(name, GUILayout.Width(labelWidth));
448448
}
449449
string newValue = fieldWidth <= 0 ? GUILayout.TextField(value) : GUILayout.TextField(value, GUILayout.Width(fieldWidth));
450450
GUILayout.FlexibleSpace();
@@ -465,23 +465,23 @@ public static void LabelPair(string text1, string text2, float textWidth = 0)
465465
GUILayout.BeginHorizontal();
466466
if (textWidth == 0)
467467
{
468-
Drawer.Button(text1);
468+
GUILayout.Label(text1);
469469
GUILayout.Space(4f);
470470
}
471471
else
472472
{
473-
Drawer.Button(text1, GUILayout.Width(textWidth));
473+
GUILayout.Label(text1, GUILayout.Width(textWidth));
474474
}
475475
GUILayout.FlexibleSpace();
476476
GUILayout.Space(8f);
477477
if (textWidth == 0)
478478
{
479-
Drawer.Button(text2);
479+
GUILayout.Label(text2);
480480
GUILayout.Space(4f);
481481
}
482482
else
483483
{
484-
Drawer.Button(text2, GUILayout.Width(textWidth));
484+
GUILayout.Label(text2, GUILayout.Width(textWidth));
485485
}
486486
GUILayout.FlexibleSpace();
487487
GUILayout.Space(20f);

KeyViewer/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public static void OnUpdate(ModEntry modEntry, float deltaTime)
142142
public static void OnGUI(ModEntry modEntry)
143143
{
144144
if (Lang.GetLoading())
145-
Drawer.Button("Preparing...");
145+
GUILayout.Label("Preparing...");
146146
else GUI.Draw();
147147
}
148148
public static void OnSaveGUI(ModEntry modEntry)

KeyViewer/Views/MultipleRainConfigDrawer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ public override void Draw()
5656

5757
GUILayout.BeginHorizontal();
5858
{
59-
Drawer.Button(FormatText(string.Format(Main.Lang.Get("RAINCONFIG_DIRECTION", "Key {0} Rain Direction"), name), "Direction"));
59+
GUILayout.Label(FormatText(string.Format(Main.Lang.Get("RAINCONFIG_DIRECTION", "Key {0} Rain Direction"), name), "Direction"));
6060
changed |= Drawer.DrawEnum(FormatText(string.Format(Main.Lang.Get("RAINCONFIG_DIRECTION", "Key {0} Rain Direction"), name), "Direction"), ref model.Direction).IfTrue(() => Set("Direction"));
6161
}
6262
GUILayout.FlexibleSpace();
6363
GUILayout.EndHorizontal();
6464

6565
GUILayout.BeginHorizontal();
6666
{
67-
Drawer.Button(FormatText(string.Format(Main.Lang.Get("RAINCONFIG_IMAGE_DISPLAY_MODE", "Key {0} Rain Image Display Mode"), name), "ImageDisplayMode"));
67+
GUILayout.Label(FormatText(string.Format(Main.Lang.Get("RAINCONFIG_IMAGE_DISPLAY_MODE", "Key {0} Rain Image Display Mode"), name), "ImageDisplayMode"));
6868
changed |= Drawer.DrawEnum(FormatText(string.Format(Main.Lang.Get("RAINCONFIG_IMAGE_DISPLAY_MODE", "Key {0} Rain Image Display Mode"), name), "ImageDisplayMode"), ref model.ImageDisplayMode).IfTrue(() => Set("ImageDisplayMode"));
6969
}
7070
GUILayout.FlexibleSpace();

0 commit comments

Comments
 (0)