use of mathax.client.systems.accounts.types.CrackedAccount in project Client by MatHax.
the class AddCrackedAccountScreen method initWidgets.
@Override
public void initWidgets() {
WTable t = add(theme.table()).widget();
// Name
t.add(theme.label("Name: "));
WTextBox name = t.add(theme.textBox("", (text, c) -> c != ' ')).minWidth(400).expandX().widget();
name.setFocused(true);
t.row();
// Add
add = t.add(theme.button("Add")).expandX().widget();
add.action = () -> {
if (!name.get().isEmpty() && (name.get().length() < 17) && name.get().matches("^[a-zA-Z0-9_]+$")) {
CrackedAccount account = new CrackedAccount(name.get());
if (!(Accounts.get().exists(account)))
AccountsScreen.addAccount(this, parent, account);
}
};
enterAction = add.action;
}
Aggregations