use of com.ldtteam.blockout.controls.TextField in project minecolonies by Minecolonies.
the class WindowPermissionsPage method addPlayerCLicked.
/**
* Action performed when add player button is clicked.
*/
private void addPlayerCLicked() {
final TextField input = findPaneOfTypeByID(INPUT_ADDPLAYER_NAME, TextField.class);
Network.getNetwork().sendToServer(new PermissionsMessage.AddPlayer(building.getColony(), input.getText()));
input.setText("");
}
use of com.ldtteam.blockout.controls.TextField in project minecolonies by Minecolonies.
the class WindowPermissionsPage method addRank.
/**
* Read the text input with the name of the rank to be added
* If the chosen name is valid, send a message to the server, hide the error label and empty the input
* else show the error label
*/
private void addRank() {
final Text label = findPaneOfTypeByID(TOWNHALL_ADD_RANK_ERROR, Text.class);
final TextField input = findPaneOfTypeByID(INPUT_ADDRANK_NAME, TextField.class);
if (isValidRankname(input.getText())) {
Network.getNetwork().sendToServer(new PermissionsMessage.AddRank(building.getColony(), input.getText()));
input.setText("");
label.hide();
} else {
label.show();
}
}
use of com.ldtteam.blockout.controls.TextField in project minecolonies by ldtteam.
the class WindowPermissionsPage method addRank.
/**
* Read the text input with the name of the rank to be added
* If the chosen name is valid, send a message to the server, hide the error label and empty the input
* else show the error label
*/
private void addRank() {
final Text label = findPaneOfTypeByID(TOWNHALL_ADD_RANK_ERROR, Text.class);
final TextField input = findPaneOfTypeByID(INPUT_ADDRANK_NAME, TextField.class);
if (isValidRankname(input.getText())) {
Network.getNetwork().sendToServer(new PermissionsMessage.AddRank(building.getColony(), input.getText()));
input.setText("");
label.hide();
} else {
label.show();
}
}
use of com.ldtteam.blockout.controls.TextField in project minecolonies by ldtteam.
the class WindowPermissionsPage method addPlayerCLicked.
/**
* Action performed when add player button is clicked.
*/
private void addPlayerCLicked() {
final TextField input = findPaneOfTypeByID(INPUT_ADDPLAYER_NAME, TextField.class);
Network.getNetwork().sendToServer(new PermissionsMessage.AddPlayer(building.getColony(), input.getText()));
input.setText("");
}
use of com.ldtteam.blockout.controls.TextField in project minecolonies by ldtteam.
the class WindowHutCrusherModule method saveCrushingMode.
/**
* Save the crushing mode.
*/
private void saveCrushingMode() {
final TextField crushingSettingsInput = findPaneOfTypeByID(QTY_INPUT, TextField.class);
try {
final int qty = Integer.parseInt(crushingSettingsInput.getText());
building.setCrusherMode(mode, qty);
} catch (final NumberFormatException ex) {
Log.getLogger().warn("Wrong input!");
}
}
Aggregations