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:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user