ChatboxTextInput: Don't set built in update

update is desgined to be fully replaced by child classes, so it
should not access private state
This commit is contained in:
Max Weber
2018-12-01 16:14:44 -07:00
parent 90b00b234f
commit e287a34a57

View File

@@ -95,12 +95,13 @@ public class ChatboxTextInput extends ChatboxInput implements KeyListener, Mouse
@Getter @Getter
private int fontID = FontID.QUILL_8; private int fontID = FontID.QUILL_8;
@Getter
private boolean built = false;
// This is a lambda so I can have atomic updates for it's captures // This is a lambda so I can have atomic updates for it's captures
private ToIntFunction<MouseEvent> getCharOffset = null; private ToIntFunction<MouseEvent> getCharOffset = null;
private Predicate<MouseEvent> isInBounds = null; private Predicate<MouseEvent> isInBounds = null;
private boolean built = false;
@Inject @Inject
protected ChatboxTextInput(ChatboxPanelManager chatboxPanelManager, ClientThread clientThread) protected ChatboxTextInput(ChatboxPanelManager chatboxPanelManager, ClientThread clientThread)
{ {
@@ -209,7 +210,6 @@ public class ChatboxTextInput extends ChatboxInput implements KeyListener, Mouse
protected void update() protected void update()
{ {
this.built = true;
Widget container = chatboxPanelManager.getContainerWidget(); Widget container = chatboxPanelManager.getContainerWidget();
container.deleteAllChildren(); container.deleteAllChildren();
@@ -369,6 +369,7 @@ public class ChatboxTextInput extends ChatboxInput implements KeyListener, Mouse
@Override @Override
protected void open() protected void open()
{ {
this.built = true;
update(); update();
} }