From fdb62eaf20885c7ab0c9d58a25bd99cd4dfeffdf Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Thu, 27 May 2021 22:29:47 +0300 Subject: Make all WTextField instance fields private This lets me rewrite the implementation during the 4.x cycle. --- .../cottonmc/cotton/gui/widget/WTextField.java | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java index 70c0613..60ae5d4 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java @@ -34,18 +34,18 @@ public class WTextField extends WWidget { @Environment(EnvType.CLIENT) private TextRenderer font; - - protected String text = ""; - protected int maxLength = 16; - protected boolean editable = true; - - protected int enabledColor = 0xE0E0E0; - protected int uneditableColor = 0x707070; + + private String text = ""; + private int maxLength = 16; + private boolean editable = true; + + private int enabledColor = 0xE0E0E0; + private int uneditableColor = 0x707070; @Nullable - protected Text suggestion = null; - - protected int cursor = 0; + private Text suggestion = null; + + private int cursor = 0; /** * If not -1, select is the "anchor point" of a selection. That is, if you hit shift+left with * no existing selection, the selection will be anchored to where you were, but the cursor will @@ -53,15 +53,15 @@ public class WTextField extends WWidget { * eventually you'll overtake the anchor, drop the anchor at the same place and start expanding * the selection rightwards instead. */ - protected int select = -1; - - protected Consumer onChanged; - - protected Predicate textPredicate; + private int select = -1; + + private Consumer onChanged; + + private Predicate textPredicate; @Environment(EnvType.CLIENT) @Nullable - protected BackgroundPainter backgroundPainter; + private BackgroundPainter backgroundPainter; public WTextField() { } -- cgit