use of io.xol.chunkstories.api.gui.FocusableGuiElement in project chunkstories by Hugobros3.
the class LoginPrompt method handleInput.
@Override
public boolean handleInput(Input input) {
if (input.equals("exit"))
autologin = false;
else if (input.equals("enter"))
connect();
else if (input.equals("tab")) {
int shift = gameWindow.getInputsManager().getInputByName("shift").isPressed() ? -1 : 1;
int i = this.elements.indexOf(this.focusedElement);
GuiElement elem = null;
while (elem == null || !(elem instanceof FocusableGuiElement)) {
i += shift;
if (i < 0)
i = this.elements.size();
if (i >= this.elements.size())
i = 0;
elem = this.elements.get(i);
}
if (elem != null)
this.focusedElement = (FocusableGuiElement) elem;
}
return super.handleInput(input);
}
Aggregations