public void setMayEdit(boolean mayEdit0) { if (mayEdit == mayEdit0) { return; } mayEdit = mayEdit0; avatarLabel.setEnabled(mayEdit); txtPlayerName.setEnabled(mayEdit); nameRandomiser.setEnabled(mayEdit); humanAiSwitch.setEnabled(mayEdit); updateVariantControlsVisibility(); // if panel has height already, ensure height updated to account for button visibility changes if (getHeight() > 0) { screen.getPlayersScroll().revalidate(); } }